summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>2023-02-10 22:18:05 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-02-11 22:45:27 +0000
commita0165bb7900f6d03a49076d755568ac33ee8e9c9 (patch)
tree9fd726082bd14871075ab642097472c04a179980 /bin
parentcb9883b1e9fb620f280e950de2bb50f9ec3a4c5e (diff)
lo-pack-sources: Add support for pbzip2.
Use pbzip for compression if possible. Otherwise fallback to bzip2. Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Change-Id: I9091c5dfe25ee00854b6938464af23b56cdcb31c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146814 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'bin')
-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);
}