summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/lo-pack-sources16
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/lo-pack-sources b/bin/lo-pack-sources
index 289a595b06e0..a34a4c95ab6a 100755
--- a/bin/lo-pack-sources
+++ b/bin/lo-pack-sources
@@ -285,19 +285,33 @@ sub generate_module_tarball($$$$$$$$)
my ($source_dir, $release_version, $module, $md5, $bzip2, $xz, $lo_topdir_name, $module_tarball_name) = @_;
my $PARALLELISM = $ENV{'PARALLELISM'};
my $CPUS_XZ = 0;
+ my $CPUS_BZ2 = "";
+ my $bzip_arguments;
# Set CPUS_ to the number of CPUs that should be used. If PARALLELISM
# is set then this is used otherwise autodetect is used.
if (defined $PARALLELISM) {
if ($PARALLELISM > 0) {
$CPUS_XZ = $PARALLELISM;
+ $CPUS_BZ2 = "-p$PARALLELISM";
} else {
$CPUS_XZ = 1;
+ $CPUS_BZ2 = "-p1";
}
}
+ if (defined $bzip2) {
+ my $exit_code = system("pbzip2 --version >/dev/null 2>&1");
+ if ($exit_code == 0) {
+ $bzip_arguments = "pbzip2 -z -b20 $CPUS_BZ2";
+ } else {
+ $bzip_arguments = "bzip2 -z --best";
+ print("Consider installing pbzip2, using bzip2 now.\n");
+ }
+ }
+
my $temp_dir = prepare_module_sources($source_dir, $release_version, $module, $lo_topdir_name);
- pack_module_sources($temp_dir, $md5, "$module_tarball_name.tar.bz2", "bzip2 -z --best > ") if (defined $bzip2);
+ pack_module_sources($temp_dir, $md5, "$module_tarball_name.tar.bz2", "$bzip_arguments > ") if (defined $bzip2);
pack_module_sources($temp_dir, $md5, "$module_tarball_name.tar.xz", "xz -z -T$CPUS_XZ -e > ") if (defined $xz);
remove_tempdir($temp_dir);
}