work around command line size limit
authorDr. Werner Fink <werner@suse.de>
Mon, 14 May 2012 11:30:08 +0000 (13:30 +0200)
committerLudwig Nussel <ludwig.nussel@suse.de>
Mon, 14 May 2012 12:08:20 +0000 (14:08 +0200)
mkbaselibs may fail on an excessive number of packages (bnc#761977)

build
mkbaselibs

diff --git a/build b/build
index b3ed485..685f3ed 100755 (executable)
--- a/build
+++ b/build
@@ -488,6 +488,7 @@ setmemorylimit()
 create_baselibs()
 {
     local pkgs=()
+    local line
 
     BASELIBS_CFG=
 
@@ -546,7 +547,10 @@ create_baselibs()
        fi
     fi
     echo "... creating baselibs$whichone"
-    chroot $BUILD_ROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG ${pkgs[*]#$BUILD_ROOT}" - $BUILD_USER || cleanup_and_exit 1
+    while read line
+    do
+       chroot $BUILD_ROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG $line" - $BUILD_USER || cleanup_and_exit 1
+    done < <(IFS=$'\n'; echo "${pkgs[*]#$BUILD_ROOT}" | xargs -n 1024)
     rm -rf $BUILD_ROOT/.mkbaselibs
 }
 
index e130f2f..1446ff0 100755 (executable)
@@ -1029,7 +1029,7 @@ sub handle_debs {
 
       # Tidy up the various control files.
       # the md5sums are regenerated by dpkg-deb when building
-      foreach my $c_file qw(conffiles postinst  postrm  preinst  prerm) {
+      foreach my $c_file ( qw(conffiles postins postrm preinst prerm) ) {
        unlink "${baseTarget}/DEBIAN/$c_file";
       }
       # Create them if needed