[PATCH] Use a directory in build tree for pylint data.

David Shea dshea at redhat.com
Fri Nov 22 15:50:38 UTC 2013


Initialize the directory in runpylint.sh to prevent a race condition
with multiple pylint instances trying to create the directory.
---
 .gitignore                | 1 +
 tests/Makefile.am         | 3 +++
 tests/pylint/runpylint.sh | 5 +++++
 3 files changed, 9 insertions(+)

diff --git a/.gitignore b/.gitignore
index b3852e7..913da4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -75,6 +75,7 @@ tests/*/*.log
 tests/*/*.trs
 tests/*.log
 tests/*.trs
+tests/pylint/.pylint.d
 tests/test-suite.log
 updates.img
 utils/dd/dd_extract
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dc59daf..a1dc04a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -52,3 +52,6 @@ TESTS = nosetests.sh \
 	gettext/gettext_warnings.sh \
 	storage/run_storage_tests.py \
 	accelerators/run_check_accelerators.sh
+
+clean-local:
+	-rm -rf pylint/.pylint.d
diff --git a/tests/pylint/runpylint.sh b/tests/pylint/runpylint.sh
index e3c8a67..3d3de1d 100755
--- a/tests/pylint/runpylint.sh
+++ b/tests/pylint/runpylint.sh
@@ -25,10 +25,15 @@ if [ -z "$top_srcdir" ]; then
 fi
 
 srcdir="${top_srcdir}/tests/pylint"
+builddir="${top_builddir}/tests/pylint"
 
 # Need to add the pylint module directory to PYTHONPATH as well.
 export PYTHONPATH="${PYTHONPATH}:${srcdir}"
 
+# Save analysis data in the pylint directory
+export PYLINTHOME="${builddir}/.pylint.d"
+[ -d "$PYLINTHOME" ] || mkdir "$PYLINTHOME"
+
 export FALSE_POSITIVES="${srcdir}"/pylint-false-positives
 
 # W0212 - Access to a protected member %s of a client class
-- 
1.8.3.1



More information about the anaconda-patches mailing list