[csw-devel] SF.net SVN: gar:[15459] csw/mgar/gar/v2

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Aug 29 10:53:02 CEST 2011


Revision: 15459
          http://gar.svn.sourceforge.net/gar/?rev=15459&view=rev
Author:   wahwah
Date:     2011-08-29 08:53:01 +0000 (Mon, 29 Aug 2011)
Log Message:
-----------
mGAR v2: Add an option to run pigz

Modified Paths:
--------------
    csw/mgar/gar/v2/bin/mkpackage
    csw/mgar/gar/v2/gar.conf.mk
    csw/mgar/gar/v2/gar.pkg.mk

Modified: csw/mgar/gar/v2/bin/mkpackage
===================================================================
--- csw/mgar/gar/v2/bin/mkpackage	2011-08-29 08:52:24 UTC (rev 15458)
+++ csw/mgar/gar/v2/bin/mkpackage	2011-08-29 08:53:01 UTC (rev 15459)
@@ -318,6 +318,7 @@
         'overwrite!'   => \$config{overwrite},
         'compress!'    => \$config{compress},
         'usebzip'      => \$config{usebzip},
+        'usepigz'      => \$config{usepigz},
         'quiet|q'      => \$config{quiet},
         'help'         => \$args{help},
         'manual'       => \$args{man},
@@ -397,6 +398,7 @@
     $config{transfer}  = 1 unless defined $config{transfer};
     $config{overwrite} = 0 unless defined $config{overwrite};
     $config{usebzip}   = 0 unless defined $config{usebzip};
+    $config{usepigz}   = 0 unless defined $config{usepigz};
 
     # Export variables to the spec
     $ENV{$_} = $config{$_} foreach qw/
@@ -911,7 +913,7 @@
         my $compress =
           $config{usebzip}
           ? 'bzip2 -9 -f %s'
-          : 'gzip -9 -f %s';
+          : ($config{usepigz} ? 'pigz -9 -f %s' : 'gzip -9 -f %s');
 
         vexec( sprintf( $compress, $tmppkg ), "Failed to compress $tmppkg" );
         $tmppkg .= $config{usebzip} ? ".bz2" : ".gz";
@@ -953,8 +955,8 @@
  mkpackage --spec <path> [--destdir <path>] [--workdir <path>]
         [--spooldir <path>] [--pkgroot <path>] [--tmpdir <path>]
         [--[no]transfer] [--[no]overwrite] [--[no]compress]
-        [--usebzip] [-v var=value...] [--dump <var>|-dumpall] [--quiet]
-        [--help] [--manual] [--version]
+        [--usebzip] [--usepigz] [-v var=value...] [--dump <var>|-dumpall]
+        [--quiet] [--help] [--manual] [--version]
 
 =head1 DESCRIPTION
 
@@ -1032,6 +1034,10 @@
 specified, mkpackage will compress bitstream packages using gzip.  Specifying
 --usebzip will use bzip2 instead, producing smaller archives in most cases.
 
+=head2 --usepigz
+
+Use pigz, a parallel implementation of gzip.
+
 =head2 -v var=value
 
 Build time variables.  Specify one or more variable replacements for pkgmk

Modified: csw/mgar/gar/v2/gar.conf.mk
===================================================================
--- csw/mgar/gar/v2/gar.conf.mk	2011-08-29 08:52:24 UTC (rev 15458)
+++ csw/mgar/gar/v2/gar.conf.mk	2011-08-29 08:53:01 UTC (rev 15459)
@@ -736,6 +736,9 @@
 # prepend the local file listing
 FILE_SITES = $(foreach DIR,$(FILEDIR) $(GARCHIVEPATH),file://$(DIR)/)
 
+# For example, --usepigz
+EXTRA_MKPACKAGE_OPTS ?=
+
 # Extra libraries
 EXTRA_LIBS = gar.pkg.mk gar.common.mk gar.svn.mk
 ccenv:

Modified: csw/mgar/gar/v2/gar.pkg.mk
===================================================================
--- csw/mgar/gar/v2/gar.pkg.mk	2011-08-29 08:52:24 UTC (rev 15458)
+++ csw/mgar/gar/v2/gar.pkg.mk	2011-08-29 08:53:01 UTC (rev 15459)
@@ -941,6 +941,7 @@
 						 --workdir  $(SPKG_WORKDIR) \
 						 --pkgbase  $(SPKG_PKGBASE) \
 						 --pkgroot  $(SPKG_PKGROOT) \
+						 $(EXTRA_MKPACKAGE_OPTS)  \
 						-v WORKDIR_FIRSTMOD=../build-$(firstword $(MODULATIONS)) \
 						 $(if $(_DIRPACKAGE),--notransfer --nocompress,--compress) \
 						 $(MKPACKAGE_ARGS) ) || exit 2

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list