This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Porting/sync-with-cpan: another preflight check
[perl5.git] / Porting / makerel
index e5d12c0..53ecdc2 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} : "..";
@@ -47,7 +48,7 @@ $relroot = defined $opts{r} ? $opts{r} : "..";
 die "Must be in root of the perl source tree.\n"
        unless -f "./MANIFEST" and -f "patchlevel.h";
 
-open PATCHLEVEL,"<patchlevel.h" or die;
+open PATCHLEVEL, '<', 'patchlevel.h' or die;
 my @patchlevel_h = <PATCHLEVEL>;
 close PATCHLEVEL;
 my $patchlevel_h = join "", grep { /^#\s*define/ } @patchlevel_h;
@@ -140,19 +141,21 @@ my @writables = qw(
     proto.h
     embed.h
     embedvar.h
-    overload.c
+    overload.inc
     overload.h
     mg_vtable.h
     perlapi.h
     perlapi.c
     cpan/Devel-PPPort/module2.c
     cpan/Devel-PPPort/module3.c
+    cpan/autodie/t/touch_me
     reentr.c
     reentr.h
     regcharclass.h
     regnodes.h
     warnings.h
     lib/warnings.pm
+    win32/GNUmakefile
     win32/Makefile
     win32/Makefile.ce
     win32/makefile.mk
@@ -215,6 +218,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*");