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>
This commit is contained in:
parent
cb9883b1e9
commit
a0165bb790
1 changed files with 15 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue