Commit | Line | Data |
---|---|---|
23b3bd7f | 1 | #!/usr/bin/perl -w |
08aa1457 | 2 | |
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. | |
08aa1457 | 5 | # |
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. | |
9 | # | |
10 | # Tim Bunce, June 1997 | |
11 | ||
12 | use ExtUtils::Manifest qw(fullcheck); | |
13 | ||
14 | $|=1; | |
15 | $relroot = ".."; # XXX make an option | |
16 | ||
17 | die "Must be in root of the perl source tree.\n" | |
18 | unless -f "./MANIFEST" and -f "patchlevel.h"; | |
19 | ||
3ffabb8c GS |
20 | open PATCHLEVEL,"<patchlevel.h" or die; |
21 | my @patchlevel_h = <PATCHLEVEL>; | |
22 | close PATCHLEVEL; | |
d4257220 | 23 | my $patchlevel_h = join "", grep { /^#\s*define/ } @patchlevel_h; |
08aa1457 | 24 | print $patchlevel_h; |
93136620 | 25 | $revision = $1 if $patchlevel_h =~ /PERL_REVISION\s+(\d+)/; |
d4257220 GS |
26 | $patchlevel = $1 if $patchlevel_h =~ /PERL_VERSION\s+(\d+)/; |
27 | $subversion = $1 if $patchlevel_h =~ /PERL_SUBVERSION\s+(\d+)/; | |
55d729e4 | 28 | die "Unable to parse patchlevel.h" unless $subversion >= 0; |
93136620 GS |
29 | $vers = sprintf("%d.%d.%d", $revision, $patchlevel, $subversion); |
30 | $vms_vers = sprintf("%d_%d_%d", $revision, $patchlevel, $subversion); | |
08aa1457 | 31 | |
3ffabb8c GS |
32 | # fetch list of local patches |
33 | my (@local_patches, @lpatch_tags, $lpatch_tags); | |
34 | @local_patches = grep { /^static.*local_patches/../^};/ } @patchlevel_h; | |
35 | @local_patches = grep { !/^\s*,?NULL/ } @local_patches; | |
36 | @lpatch_tags = map { /^\s*,"(\w+)/ } @local_patches; | |
37 | $lpatch_tags = join "-", @lpatch_tags; | |
38 | ||
2a7df08c | 39 | $perl = "perl-$vers"; |
f27ffc4a | 40 | $reldir = "$perl"; |
3ffabb8c | 41 | $reldir .= "-$lpatch_tags" if $lpatch_tags; |
08aa1457 | 42 | |
f27ffc4a | 43 | print "\nMaking a release for $perl in $relroot/$reldir\n\n"; |
08aa1457 | 44 | |
08aa1457 | 45 | print "Cross-checking the MANIFEST...\n"; |
46 | ($missfile, $missentry) = fullcheck(); | |
3e3baf6d TB |
47 | warn "Can't make a release with MANIFEST files missing.\n" if @$missfile; |
48 | warn "Can't make a release with files not listed in MANIFEST.\n" if @$missentry; | |
90248788 TB |
49 | if ("@$missentry" =~ m/\.orig\b/) { |
50 | # Handy listing of find command and .orig files from patching work. | |
51 | # I tend to run 'xargs rm' and copy and paste the file list. | |
52 | my $cmd = "find . -name '*.orig' -print"; | |
53 | print "$cmd\n"; | |
54 | system($cmd); | |
55 | } | |
3e3baf6d | 56 | die "Aborted.\n" if @$missentry or @$missfile; |
08aa1457 | 57 | print "\n"; |
58 | ||
b59922b7 GS |
59 | # VMS no longer has hardcoded version numbers descrip.mms |
60 | #print "Updating VMS version specific files with $vms_vers...\n"; | |
61 | #system("perl -pi -e 's/^\QPERL_VERSION = \E\d\_\d+(\s*\#)/PERL_VERSION = $vms_vers$1/' vms/descrip.mms"); | |
55d729e4 GS |
62 | |
63 | ||
48e117bb GS |
64 | |
65 | print "Creating $relroot/$reldir release directory...\n"; | |
66 | die "$relroot/$reldir release directory already exists\n" if -e "$relroot/$reldir"; | |
67 | die "$relroot/$reldir.tar.gz release file already exists\n" if -e "$relroot/$reldir.tar.gz"; | |
68 | mkdir("$relroot/$reldir", 0755) or die "mkdir $relroot/$reldir: $!\n"; | |
69 | print "\n"; | |
70 | ||
71 | ||
72 | print "Copying files to release directory...\n"; | |
73 | # ExtUtils::Manifest maniread does not preserve the order | |
74 | $cmd = "awk '{print \$1}' MANIFEST | cpio -pdm $relroot/$reldir"; | |
86cd7d77 JH |
75 | system($cmd) == 0 |
76 | or die "$cmd failed"; | |
48e117bb GS |
77 | print "\n"; |
78 | ||
6e24577b | 79 | chdir "$relroot/$reldir" or die $!; |
48e117bb | 80 | |
08aa1457 | 81 | print "Setting file permissions...\n"; |
bf955a65 GS |
82 | system("find . -type f -print | xargs chmod 0444"); |
83 | system("find . -type d -print | xargs chmod 0755"); | |
e619572c JH |
84 | system("find t ext lib -name '*.t' -print | xargs chmod +x"); |
85 | system("find t ext lib -name 'test.pl' -print | xargs chmod +x"); | |
48e117bb | 86 | my @exe = qw( |
08aa1457 | 87 | Configure |
88 | configpm | |
b907dc6d | 89 | configure.gnu |
08aa1457 | 90 | embed.pl |
91 | installperl | |
92 | installman | |
93 | keywords.pl | |
08aa1457 | 94 | opcode.pl |
95 | perly.fixer | |
96 | t/TEST | |
08aa1457 | 97 | *.SH |
98 | vms/ext/Stdio/test.pl | |
99 | vms/ext/filespec.t | |
08aa1457 | 100 | x2p/*.SH |
bb304ec8 JH |
101 | Porting/findrfuncs |
102 | Porting/genlog | |
08aa1457 | 103 | Porting/makerel |
a619eb9e | 104 | Porting/p4genpatch |
bb304ec8 JH |
105 | Porting/patchls |
106 | Porting/*.pl | |
e619572c JH |
107 | mpeix/nm |
108 | mpeix/relink | |
26e23ede JH |
109 | Cross/generate_config_sh |
110 | Cross/warp | |
08aa1457 | 111 | ); |
86cd7d77 JH |
112 | system("chmod +x @exe") == 0 |
113 | or die "system: $!"; | |
6e24577b | 114 | |
f7f713ed | 115 | my @writables = qw( |
f3513db0 JH |
116 | NetWare/config_H.wc |
117 | NetWare/Makefile | |
ac634a9a JH |
118 | keywords.h |
119 | opcode.h | |
120 | opnames.h | |
121 | pp_proto.h | |
122 | pp.sym | |
123 | proto.h | |
f7f713ed GS |
124 | embed.h |
125 | embedvar.h | |
f7f713ed | 126 | global.sym |
ac634a9a JH |
127 | pod/perlintern.pod |
128 | pod/perlapi.pod | |
ac634a9a JH |
129 | perlapi.h |
130 | perlapi.c | |
131 | ext/ByteLoader/byterun.h | |
132 | ext/ByteLoader/byterun.c | |
133 | ext/B/B/Asmdata.pm | |
799d3a59 JH |
134 | ext/Devel/PPPort/PPPort.xs |
135 | ext/Devel/PPPort/module2.c | |
136 | ext/Devel/PPPort/module3.c | |
f7f713ed | 137 | regnodes.h |
0ebdc6d5 | 138 | warnings.h |
ac634a9a JH |
139 | lib/warnings.pm |
140 | vms/perly_c.vms | |
141 | vms/perly_h.vms | |
142 | win32/Makefile | |
143 | win32/makefile.mk | |
144 | win32/config_H.bc | |
f29c64d6 | 145 | win32/config_H.gc |
f7f713ed | 146 | win32/config_H.vc |
f3513db0 JH |
147 | wince/config_H.ce |
148 | wince/Makefile.ce | |
f7f713ed | 149 | ); |
86cd7d77 JH |
150 | system("chmod +w @writables") == 0 |
151 | or die "system: $!"; | |
f7f713ed | 152 | |
6e24577b | 153 | print "Adding CRs to DOSish files...\n"; |
27da23d5 | 154 | # This list is also in curliff.pl. |
48e117bb GS |
155 | my @crlf = qw( |
156 | djgpp/configure.bat | |
f3513db0 | 157 | README.ce |
48e117bb | 158 | README.dos |
27da23d5 | 159 | README.symbian |
48e117bb | 160 | README.win32 |
27da23d5 JH |
161 | symbian/config.pl |
162 | symbian/makesis.pl | |
163 | symbian/README | |
164 | symbian/xsbuild.pl | |
48e117bb GS |
165 | win32/Makefile |
166 | win32/makefile.mk | |
f3513db0 | 167 | wince/Makefile.ce |
3e786a10 | 168 | wince/compile-all.bat |
dd01ab47 JH |
169 | wince/README.perlce |
170 | wince/registry.bat | |
48e117bb | 171 | ); |
86cd7d77 JH |
172 | system("perl -pi -e 's/\\015*\\012/\\015\\012/' @crlf") == 0 |
173 | or die "system: $!"; | |
08aa1457 | 174 | print "\n"; |
175 | ||
6e24577b GS |
176 | chdir ".." or die $!; |
177 | ||
08aa1457 | 178 | print "Creating and compressing the tar file...\n"; |
f27ffc4a | 179 | my $src = (-e $perl) ? $perl : 'perl'; # 'perl' in maint branch |
3ffabb8c | 180 | $cmd = "tar cf - $reldir | gzip --best > $reldir.tar.gz"; |
86cd7d77 JH |
181 | system($cmd) == 0 |
182 | or die "$cmd failed"; | |
08aa1457 | 183 | print "\n"; |
184 | ||
185 | system("ls -ld $perl*"); |