chantra / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
78383f
commit 198363e1b703107eba929d70dce2e1d762388bef
78383f
Author: Panu Matilainen <pmatilai@redhat.com>
78383f
Date:   Fri Sep 6 10:41:45 2013 +0300
78383f
78383f
    Byte-compile versioned python libdirs in non-root prefix too (RhBug:868332)
78383f
    
78383f
    - Previously brp-python-bytecompile assumed versioned python stdlib
78383f
      always starts at / but if a software stack relies on "non-system"
78383f
      python installed to a different prefix, those directories did
78383f
      not get bytecompiled at all. Look for versioned python libdirs
78383f
      all over the buildroot in the first loop to allow multiple
78383f
      parallel versions to be handled (notably python 2 vs 3), everything
78383f
      else still falls back to "default" python.
78383f
    
78383f
    (cherry picked from commit e83d5c0bdd0e5d400a7bf76e08ce45f5305cf18d)
78383f
78383f
diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
78383f
index af6378e..f227305 100644
78383f
--- a/scripts/brp-python-bytecompile
78383f
+++ b/scripts/brp-python-bytecompile
78383f
@@ -34,7 +34,7 @@ fi
78383f
 # and below /usr/lib/python3.1/, we're targeting /usr/bin/python3.1
78383f
 
78383f
 shopt -s nullglob
78383f
-for python_libdir in "$RPM_BUILD_ROOT"/usr/lib{,64}/python[0-9].[0-9]/ ;
78383f
+for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E "/usr/lib(64)?/python[0-9]\.[0-9]$"`;
78383f
 do
78383f
 	python_binary=/usr/bin/$(basename $python_libdir)
78383f
 	real_libdir=${python_libdir/$RPM_BUILD_ROOT/}