This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Added -x option to makerel to produce .xz tarballs
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 29 Sep 2014 19:09:32 +0000 (20:09 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 29 Sep 2014 19:11:56 +0000 (20:11 +0100)
With the default of -6 produced much smaller tarball than
.gz (7z produced) and .bz2

  -rw-r--r--  1 bingos bingos 13601234 Sep 29 20:07 perl-5.21.5.tar.bz2
  -rw-r--r--  1 bingos bingos 15699515 Sep 29 20:07 perl-5.21.5.tar.gz
  -rw-r--r--  1 bingos bingos 10982580 Sep 29 20:08 perl-5.21.5.tar.xz

It's an option if we ever need it.

Porting/makerel

index e5d12c0..11e22fd 100755 (executable)
@@ -35,11 +35,12 @@ usage: $0 [ -r rootdir ] [-s suffix ] [ -b ] [ -n ]
                 defaults to the concatenation of the local_patches entry
                 in patchlevel.h (or blank, if none)
     -b           make a .bz2 file in addtion to a .gz file
+    -x           make a .xz file in addtion to a .gz file
     -n           do not make any tarballs, just the directory
 EOF
 
 my %opts;
-getopts('bnr:s:', \%opts) or usage;
+getopts('bxnr:s:', \%opts) or usage;
 @ARGV && usage;
 
 $relroot = defined $opts{r} ? $opts{r} : "..";
@@ -215,6 +216,12 @@ if ($opts{b}) {
     }
 }
 
+if ($opts{x}) {
+    print "Creating and compressing the tar.gz file with 7z...\n";
+    $cmd = "tar cf - $reldir | xz -z -c > $reldir.tar.xz";
+    system($cmd) == 0 or die "$cmd failed";
+}
+
 print "\n";
 
 system("ls -ld $perl*");