bin/pack-debug                                |   14 ++++++++++----
 config_host.mk.in                             |    1 +
 configure.ac                                  |   10 ++++++++++
 instsetoo_native/CustomTarget_install.mk      |    1 +
 solenv/bin/modules/installer/download.pm      |    2 +-
 solenv/bin/modules/installer/epmfile.pm       |    4 ++--
 solenv/bin/modules/installer/globals.pm       |    2 ++
 solenv/bin/modules/installer/helppack.pm      |    2 +-
 solenv/bin/modules/installer/languagepack.pm  |    2 +-
 solenv/bin/modules/installer/parameter.pm     |    2 ++
 solenv/bin/modules/installer/simplepackage.pm |    2 +-
 solenv/bin/modules/installer/worker.pm        |    2 +-
 12 files changed, 33 insertions(+), 11 deletions(-)

New commits:
commit 5442eef243b13355d73785214f86214d8a73e6e4
Author:     Andras Timar <[email protected]>
AuthorDate: Sat Jan 22 20:35:00 2022 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Jan 22 20:35:00 2022 +0100

    [cp] use pigz (parallellized compression) instead of gzip, if we can
    
    Change-Id: I3f97702a6febd3ac0cbbd16a0932d74ea6659bf3

diff --git a/bin/pack-debug b/bin/pack-debug
index ff8defe4cb78..9a6f384035e3 100755
--- a/bin/pack-debug
+++ b/bin/pack-debug
@@ -13,6 +13,12 @@
 export BUILD_PATH=$PWD
 export BUILD_LOG=$BUILD_PATH/pack-debug.log
 
+if type -P pigz &>/dev/null; then
+    GZIP=pigz
+else
+    GZIP=gzip
+fi
+
 if [ $# -gt 0 ]
 then
  for i in "$@"
@@ -179,8 +185,8 @@ TARGET_RPM=$(ls *_download/*.tar.gz)
 TARGET_DEBUG=$(echo $TARGET_RPM | sed 's/.tar.gz$/-debug.tar.gz/')
 SOURCE_RPM=$(find *_rpm -type f | grep -v debug)
 SOURCE_DEBUG=$(find *_rpm -type f | grep -E '(debug|readme|README)')
-tar c $SOURCE_RPM | gzip >$TARGET_RPM
-tar c $SOURCE_DEBUG | gzip >$TARGET_DEBUG
+tar c $SOURCE_RPM | $GZIP >$TARGET_RPM
+tar c $SOURCE_DEBUG | $GZIP >$TARGET_DEBUG
 cd $BUILD_PATH
 rm -rf $topdir
 }
@@ -322,8 +328,8 @@ TARGET_DEB=$(ls *_download/*.tar.gz)
 TARGET_DEBUG=$(echo $TARGET_DEB | sed 's/.tar.gz$/-debug.tar.gz/')
 SOURCE_DEB=$(find *_deb -type f | grep -v debug)
 SOURCE_DEBUG=$(find *_deb -type f | grep -E '(debug|readme|README)')
-tar c $SOURCE_DEB | gzip >$TARGET_DEB
-tar c $SOURCE_DEBUG | gzip >$TARGET_DEBUG
+tar c $SOURCE_DEB | $GZIP >$TARGET_DEB
+tar c $SOURCE_DEBUG | $GZIP >$TARGET_DEBUG
 
 cd $BUILD_PATH
 rm -rf DEBS
commit 86c7688ec38ebf32a971d529c43779761b2dac78
Author:     Thorsten Behrens <[email protected]>
AuthorDate: Sat Jan 15 16:24:33 2022 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Sat Jan 22 20:24:56 2022 +0100

    Make installer compression tool configurable
    
    So we can use pigz or other parallelizable tools if available. Shaves
    off noticeable build time when packaging install sets.
    
    - figure out if pigz is available (fallback to gzip otherwise)
    - pass compression tool down into make_installer
    - and handle as one of many global options there
    
    Change-Id: Ia9d1ea27a9f990874238b6f0be3e1fd30a662ec6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128469
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/config_host.mk.in b/config_host.mk.in
index f0bf804474f7..d938ae941f88 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -88,6 +88,7 @@ export COMPILER_PLUGINS_CXXFLAGS=@COMPILER_PLUGINS_CXXFLAGS@
 export COMPILER_PLUGINS_CXX_LINKFLAGS=@COMPILER_PLUGINS_CXX_LINKFLAGS@
 export COMPILER_PLUGINS_DEBUG=@COMPILER_PLUGINS_DEBUG@
 export COMPILER_PLUGINS_TOOLING_ARGS=@COMPILER_PLUGINS_TOOLING_ARGS@
+export COMPRESSIONTOOL=@COMPRESSIONTOOL@
 export COM_IS_CLANG=@COM_IS_CLANG@
 export CPPUNIT_CFLAGS=$(gb_SPACE)@CPPUNIT_CFLAGS@
 export CPPUNIT_LIBS=$(gb_SPACE)@CPPUNIT_LIBS@
diff --git a/configure.ac b/configure.ac
index 35e6c39ed3fd..8dc18407cac4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2814,6 +2814,16 @@ if test -z "$BASH"; then
 fi
 AC_SUBST(BASH)
 
+# prefer parallel comression tools, if available
+AC_PATH_PROG(COMPRESSIONTOOL, pigz)
+if test -z "$COMPRESSIONTOOL"; then
+    AC_PATH_PROG(COMPRESSIONTOOL, gzip)
+    if test -z "$COMPRESSIONTOOL"; then
+        AC_MSG_ERROR([gzip not found in \$PATH])
+    fi
+fi
+AC_SUBST(COMPRESSIONTOOL)
+
 AC_MSG_CHECKING([for GNU or BSD tar])
 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
diff --git a/instsetoo_native/CustomTarget_install.mk 
b/instsetoo_native/CustomTarget_install.mk
index a83be274ff4b..0974240be1fb 100644
--- a/instsetoo_native/CustomTarget_install.mk
+++ b/instsetoo_native/CustomTarget_install.mk
@@ -87,6 +87,7 @@ $(foreach pkgformat,$(5),\
        -l $(subst $(WHITESPACE),$(COMMA),$(strip $(2))) \
        -p $(PRODUCTNAME_no_spaces)$(3) \
        -u $(instsetoo_OUT) \
+       -packer $(COMPRESSIONTOOL) \
        -buildid $(if $(filter deb0 
rpm0,$(pkgformat)$(LIBO_VERSION_PATCH)),1,$(LIBO_VERSION_PATCH)) \
        $(if $(filter WNT,$(OS)), \
                -msitemplate $(dir $@)msi_templates \
diff --git a/solenv/bin/modules/installer/download.pm 
b/solenv/bin/modules/installer/download.pm
index d74ee707900f..428a0a0315c2 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -520,7 +520,7 @@ sub create_tar_gz_file_from_directory
         unlink("$installdir/install");
     }
 
-    my $systemcall = "cd $changedir; $fakerootstring tar -cf - $packdir | gzip 
> $targzname";
+    my $systemcall = "cd $changedir; $fakerootstring tar -cf - $packdir | 
$installer::globals::packertool > $targzname";
 
     my $returnvalue = system($systemcall);
 
diff --git a/solenv/bin/modules/installer/epmfile.pm 
b/solenv/bin/modules/installer/epmfile.pm
index ed0066c65f2e..d699e46e03ed 100644
--- a/solenv/bin/modules/installer/epmfile.pm
+++ b/solenv/bin/modules/installer/epmfile.pm
@@ -1839,7 +1839,7 @@ sub create_packages_without_epm
 
     # Solaris: pkgmk -o -f solaris-2.8-sparc/SUNWso8m34.prototype -d 
solaris-2.8-sparc
     # Solaris: pkgtrans solaris-2.8-sparc SUNWso8m34.pkg SUNWso8m34
-    # Solaris: tar -cf - SUNWso8m34 | gzip > SUNWso8m34.tar.gz
+    # Solaris: tar -cf - SUNWso8m34 | $installer::globals::packertool > 
SUNWso8m34.tar.gz
 
     if ( $installer::globals::issolarispkgbuild )
     {
@@ -1983,7 +1983,7 @@ sub create_packages_without_epm
         #########################
 
         # my $targzname = $packagename . ".tar.gz";
-        # $systemcall = "cd $destinationdir; tar -cf - $packagename | gzip > 
$targzname";
+        # $systemcall = "cd $destinationdir; tar -cf - $packagename | 
$installer::globals::packertool > $targzname";
         # print "... $systemcall ...\n";
 
         # $returnvalue = system($systemcall);
diff --git a/solenv/bin/modules/installer/globals.pm 
b/solenv/bin/modules/installer/globals.pm
index e57627bb441b..1938942b0a82 100644
--- a/solenv/bin/modules/installer/globals.pm
+++ b/solenv/bin/modules/installer/globals.pm
@@ -129,6 +129,8 @@ BEGIN
 
     $strip = 0;
 
+    $packertool = "gzip";           # the default package compression tool for 
*NIX
+
     $logfilename = "logfile.log";   # the default logfile name for global 
errors
     @logfileinfo = ();
     @errorlogfileinfo = ();
diff --git a/solenv/bin/modules/installer/helppack.pm 
b/solenv/bin/modules/installer/helppack.pm
index 726157be2e27..456e91ecfdb0 100644
--- a/solenv/bin/modules/installer/helppack.pm
+++ b/solenv/bin/modules/installer/helppack.pm
@@ -130,7 +130,7 @@ sub create_tar_gz_file
 
     $packagename =~ s/\.rpm\s*$//;
     my $targzname = $packagename . ".tar.gz";
-    my $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > 
$targzname";
+    my $systemcall = "cd $installdir; tar -cf - $packagestring | 
$installer::globals::packertool > $targzname";
     installer::logger::print_message( "... $systemcall ...\n" );
 
     my $returnvalue = system($systemcall);
diff --git a/solenv/bin/modules/installer/languagepack.pm 
b/solenv/bin/modules/installer/languagepack.pm
index a39769144de6..14a870866128 100644
--- a/solenv/bin/modules/installer/languagepack.pm
+++ b/solenv/bin/modules/installer/languagepack.pm
@@ -128,7 +128,7 @@ sub create_tar_gz_file
 
     $packagename =~ s/\.rpm\s*$//;
     my $targzname = $packagename . ".tar.gz";
-    $systemcall = "cd $installdir; tar -cf - $packagestring | gzip > 
$targzname";
+    $systemcall = "cd $installdir; tar -cf - $packagestring | 
$installer::globals::packertool > $targzname";
     installer::logger::print_message( "... $systemcall ...\n" );
 
     my $returnvalue = system($systemcall);
diff --git a/solenv/bin/modules/installer/parameter.pm 
b/solenv/bin/modules/installer/parameter.pm
index 8c63a341d34d..8f259c3e9a32 100644
--- a/solenv/bin/modules/installer/parameter.pm
+++ b/solenv/bin/modules/installer/parameter.pm
@@ -56,6 +56,7 @@ The following parameter are needed:
 -languagepack : do create a languagepack, no product pack (optional)
 -helppack : do create a helppack, no product pack (optional)
 -strip: Stripping files (Unix only)
+-packer: Path and parameters for tarball packaging tool (default: gzip (Unix 
only))
 -log : Logging all available information (optional)
 
 Examples for Windows:
@@ -127,6 +128,7 @@ sub getparameter
         elsif ($param eq "-helppack") { $installer::globals::helppack = 1;}
         elsif ($param eq "-debian") { $installer::globals::debian = 1; }
         elsif ($param eq "-strip") { $installer::globals::strip = 1; }
+        elsif ($param eq "-packer") { $installer::globals::packertool = 
shift(@ARGV); }
         elsif ($param eq "-destdir")    # new parameter for simple installer
         {
             $installer::globals::rootpath ne "" && die "must set destdir 
before -i or -simple";
diff --git a/solenv/bin/modules/installer/simplepackage.pm 
b/solenv/bin/modules/installer/simplepackage.pm
index 7b5b20bc93e2..39de9d216500 100644
--- a/solenv/bin/modules/installer/simplepackage.pm
+++ b/solenv/bin/modules/installer/simplepackage.pm
@@ -474,7 +474,7 @@ sub create_package
             $fakerootstring = "fakeroot";
         }
 
-        $systemcall = "cd $tempdir; $fakerootstring tar -cf - . | gzip > 
$archive";
+        $systemcall = "cd $tempdir; $fakerootstring tar -cf - . | 
$installer::globals::packertool > $archive";
     }
 
     if ( $makesystemcall )
diff --git a/solenv/bin/modules/installer/worker.pm 
b/solenv/bin/modules/installer/worker.pm
index dcdfdce7d28e..1a86099a8de0 100644
--- a/solenv/bin/modules/installer/worker.pm
+++ b/solenv/bin/modules/installer/worker.pm
@@ -913,7 +913,7 @@ sub collectpackagemaps
     # Create a tar gz file with all package maps
     my $tarfilename = $subdirname . ".tar";
     my $targzname = $tarfilename . ".gz";
-    $systemcall = "cd $pkgmapdir; tar -cf - $subdirname | gzip > $targzname";
+    $systemcall = "cd $pkgmapdir; tar -cf - $subdirname | 
$installer::globals::packertool > $targzname";
     installer::systemactions::make_systemcall($systemcall);
     installer::systemactions::remove_complete_directory($pkgmapsubdir, 1);
 }

Reply via email to