3 # A first attempt at some automated support for making a perl release.
4 # Very basic but functional - if you're on a unix system.
6 # No matter how automated this gets, you'll always need to read
7 # and re-read pumpkin.pod checking for things to be done at various
8 # stages of the process.
10 # Tim Bunce, June 1997
12 use ExtUtils::Manifest qw(fullcheck);
15 $relroot = ".."; # XXX make an option
17 die "Must be in root of the perl source tree.\n"
18 unless -f "./MANIFEST" and -f "patchlevel.h";
20 open PATCHLEVEL,"<patchlevel.h" or die;
21 my @patchlevel_h = <PATCHLEVEL>;
23 my $patchlevel_h = join "", grep { /^#\s*define/ } @patchlevel_h;
25 $revision = $1 if $patchlevel_h =~ /PERL_REVISION\s+(\d+)/;
26 $patchlevel = $1 if $patchlevel_h =~ /PERL_VERSION\s+(\d+)/;
27 $subversion = $1 if $patchlevel_h =~ /PERL_SUBVERSION\s+(\d+)/;
28 die "Unable to parse patchlevel.h" unless $subversion >= 0;
29 $vers = sprintf("%d.%d.%d", $revision, $patchlevel, $subversion);
31 # fetch list of local patches
32 my (@local_patches, @lpatch_tags, $lpatch_tags);
33 @local_patches = grep { /^static.*local_patches/../^};/ } @patchlevel_h;
34 @local_patches = grep { !/^\s*,?NULL/ } @local_patches;
35 @lpatch_tags = map { /^\s*,"(\w+)/ } @local_patches;
36 $lpatch_tags = join "-", @lpatch_tags;
40 $reldir .= "-$lpatch_tags" if $lpatch_tags;
42 print "\nMaking a release for $perl in $relroot/$reldir\n\n";
44 print "Cross-checking the MANIFEST...\n";
45 ($missfile, $missentry) = fullcheck();
46 warn "Can't make a release with MANIFEST files missing.\n" if @$missfile;
47 warn "Can't make a release with files not listed in MANIFEST.\n" if @$missentry;
48 if ("@$missentry" =~ m/\.orig\b/) {
49 # Handy listing of find command and .orig files from patching work.
50 # I tend to run 'xargs rm' and copy and paste the file list.
51 my $cmd = "find . -name '*.orig' -print";
55 die "Aborted.\n" if @$missentry or @$missfile;
58 # VMS no longer has hardcoded version numbers descrip.mms
60 print "Creating $relroot/$reldir release directory...\n";
61 die "$relroot/$reldir release directory already exists\n" if -e "$relroot/$reldir";
62 die "$relroot/$reldir.tar.gz release file already exists\n" if -e "$relroot/$reldir.tar.gz";
63 mkdir("$relroot/$reldir", 0755) or die "mkdir $relroot/$reldir: $!\n";
67 print "Copying files to release directory...\n";
68 # ExtUtils::Manifest maniread does not preserve the order
69 $cmd = "awk '{print \$1}' MANIFEST | cpio -pdm $relroot/$reldir";
74 chdir "$relroot/$reldir" or die $!;
76 print "Setting file permissions...\n";
77 system("find . -type f -print | xargs chmod 0444");
78 system("find . -type d -print | xargs chmod 0755");
79 system("find t ext lib -name '*.t' -print | xargs chmod +x");
80 system("find t ext lib -name 'test.pl' -print | xargs chmod +x");
103 Cross/generate_config_sh
106 system("chmod +x @exe") == 0
128 ext/Devel/PPPort/module2.c
129 ext/Devel/PPPort/module3.c
145 system("chmod +w @writables") == 0
148 print "Adding CRs to DOSish files...\n";
149 # This list is also in curliff.pl.
162 win32/ce-helpers/compile-all.bat
163 win32/ce-helpers/compile.bat
164 win32/ce-helpers/registry.bat
168 system("perl -pi -e 's/\\015*\\012/\\015\\012/' @crlf") == 0
172 chdir ".." or die $!;
174 print "Creating and compressing the tar file...\n";
175 my $src = (-e $perl) ? $perl : 'perl'; # 'perl' in maint branch
176 $cmd = "tar cf - $reldir | gzip --best > $reldir.tar.gz";
178 or die "$cmd failed";
181 system("ls -ld $perl*");