summaryrefslogtreecommitdiff
path: root/Porting/makerel
diff options
context:
space:
mode:
authorLeon Brocard <acme@astray.com>2011-07-12 09:08:57 +0100
committerLeon Brocard <acme@astray.com>2011-07-12 09:08:57 +0100
commit0dcf3caac0d8a710d26d7cb042a4f5bd46af288d (patch)
treed35889e0d5ef10cc61201fc802761cf31fe7a15f /Porting/makerel
parent4000c4db548709df1a7c23190f040b9f654e0aad (diff)
downloadperl-0dcf3caac0d8a710d26d7cb042a4f5bd46af288d.tar.gz
Make Porting/makerel create smaller archives with 7z and advdef
It automatically will use these to create archives ~5% smaller, otherwise falls back to gzip and bzip2. Also, document in Porting/release_managers_guide.pod.
Diffstat (limited to 'Porting/makerel')
-rwxr-xr-xPorting/makerel37
1 files changed, 31 insertions, 6 deletions
diff --git a/Porting/makerel b/Porting/makerel
index 1e7ca7ce13..13bcf4a44e 100755
--- a/Porting/makerel
+++ b/Porting/makerel
@@ -171,14 +171,39 @@ exit if $opts{n};
my $src = (-e $perl) ? $perl : 'perl'; # 'perl' in maint branch
-print "Creating and compressing the tar.gz file...\n";
-$cmd = "tar cf - $reldir | gzip --best > $reldir.tar.gz";
-system($cmd) == 0 or die "$cmd failed";
+print "Checking if you have 7z...\n";
+my $output_7z = `7z 2>&1`;
+my $have_7z = defined $output_7z && $output_7z =~ /7-Zip/;
-if ($opts{b}) {
- print "Creating and compressing the tar.bz2 file...\n";
- $cmd = "tar cf - $reldir | bzip2 > $reldir.tar.bz2";
+print "Checking if you have advdef...\n";
+my $output_advdef = `advdef --version 2>&1`;
+my $have_advdef = defined $output_advdef && $output_advdef =~ /advancecomp/;
+
+if ($have_7z) {
+ print "Creating and compressing the tar.gz file with 7z...\n";
+ $cmd = "tar cf - $reldir | 7z a -tgzip -mx9 -bd -si $reldir.tar.gz";
system($cmd) == 0 or die "$cmd failed";
+} else {
+ print "Creating and compressing the tar.gz file...\n";
+ $cmd = "tar cf - $reldir | gzip --best > $reldir.tar.gz";
+ system($cmd) == 0 or die "$cmd failed";
+ if ($have_advdef) {
+ print "Recompressing the tar.gz file with advdef...\n";
+ $cmd = "advdef -z -4 $reldir.tar.gz";
+ system($cmd) == 0 or die "$cmd failed";
+ }
+}
+
+if ($opts{b}) {
+ if ($have_7z) {
+ print "Creating and compressing the tar.bz2 file with 7z...\n";
+ $cmd = "tar cf - $reldir | 7z a -tbzip2 -mx9 -bd -si $reldir.tar.bz2";
+ system($cmd) == 0 or die "$cmd failed";
+ } else {
+ print "Creating and compressing the tar.bz2 file...\n";
+ $cmd = "tar cf - $reldir | bzip2 > $reldir.tar.bz2";
+ system($cmd) == 0 or die "$cmd failed";
+ }
}
print "\n";