Exclude bin and sbin directories from python bytecompile (rhbz#182498)
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 5 Feb 2009 10:20:20 +0000 (12:20 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 5 Feb 2009 10:20:20 +0000 (12:20 +0200)
scripts/brp-python-bytecompile

index 77be2d5..5aae31a 100644 (file)
@@ -20,7 +20,7 @@ if [ -z "$depth" -o "$depth" -le "1" ]; then
 fi
 
 # Generate normal (.pyc) byte-compiled files.
-$python    -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1)' > /dev/null
+$python    -c 'import compileall, re; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1, re.compile(r"'"/bin/|/sbin/"'"))' > /dev/null
 
 # Generate optimized (.pyo) byte-compiled files.
-$python -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1)' > /dev/null
+$python -O -c 'import compileall, re; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"$depth"', "/", 1, re.compile(r"'"/bin/|/sbin/"'"))' > /dev/null