a4433ba
commit 3ffc0373c4db9824a72a6356d04d862e51f42be0
a4433ba
Author: Panu Matilainen <pmatilai@redhat.com>
a4433ba
Date:   Tue Dec 8 15:58:51 2009 +0200
a4433ba
a4433ba
    Avoid noise from python bytecompile on non-python pkgs (RhBug:539635)
a4433ba
    - If a pattern doesn't match, we'd prefer an empty list instead of
a4433ba
      unexpanded garbage thank you... nullglob shell option is just what the
a4433ba
      doctor ordered but unfortunately its a bash-specific thing. Otoh there
a4433ba
      are number of other bash-specific scripts in rpm so probably not
a4433ba
      much of an issue...
a4433ba
    (cherry picked from commit d6bda5a1665d8d04526aea299781570ee7486b2e)
a4433ba
a4433ba
diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
a4433ba
index 1faa6db..9fac5a7 100644
a4433ba
--- a/scripts/brp-python-bytecompile
a4433ba
+++ b/scripts/brp-python-bytecompile
a4433ba
@@ -1,4 +1,4 @@
a4433ba
-#!/bin/sh
a4433ba
+#!/bin/bash
a4433ba
 
a4433ba
 # If using normal root, avoid changing anything.
a4433ba
 if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
a4433ba
@@ -32,6 +32,7 @@ fi
a4433ba
 # For example, below /usr/lib/python2.6/, we're targetting /usr/bin/python2.6
a4433ba
 # and below /usr/lib/python3.1/, we're targetting /usr/bin/python3.1
a4433ba
 
a4433ba
+shopt -s nullglob
a4433ba
 for python_libdir in $RPM_BUILD_ROOT/usr/lib*/python*/ ;
a4433ba
 do
a4433ba
 	python_binary=/usr/bin/$(basename $python_libdir)