$|=1;
sub usage { die <<EOF; }
-usage: $0 [ -r rootdir ] [-s suffix ] [ -b ]
+usage: $0 [ -r rootdir ] [-s suffix ] [ -b ] [ -n ]
-r rootdir directory under which to create the build dir and tarball
defaults to '..'
-s suffix suffix to append to to the perl-x.y.z dir and tarball name
defaults to the concatenaion of the local_patches entry
in patchlevel.h (or blank, if none)
-b make a .bz2 file in addtion to a .gz file
+ -n do not make any tarballs, just the directory
EOF
my %opts;
-getopts('br:s:', \%opts) or usage;
+getopts('bnr:s:', \%opts) or usage;
@ARGV && usage;
$relroot = defined $opts{r} ? $opts{r} : "..";
chdir "$relroot/$reldir" or die $!;
-my $SEARCH_ROOTS = 't ext lib dist cpan';
-
print "Setting file permissions...\n";
system("find . -type f -print | xargs chmod 0444");
system("find . -type d -print | xargs chmod 0755");
-system("find $SEARCH_ROOTS -name '*.t' -print | xargs chmod +x");
-system("find $SEARCH_ROOTS -name 'test.pl' -print | xargs chmod +x");
-my @exe = qw(
- Configure
- configpm
- configure.gnu
- embed.pl
- installperl
- installman
- keywords.pl
- opcode.pl
- t/TEST
- *.SH
- vms/ext/filespec.t
- x2p/*.SH
- Porting/findrfuncs
- Porting/genlog
- Porting/makerel
- Porting/*.pl
- mpeix/nm
- mpeix/relink
- Cross/generate_config_sh
- Cross/warp
-);
+my @exe = map { my ($f) = split; glob($f) }
+ grep { $_ !~ /\A#/ && $_ !~ /\A\s*\z/ }
+ map { split "\n" }
+ do { local (@ARGV, $/) = 'Porting/exec-bit.txt'; <> };
+
system("chmod +x @exe") == 0
or die "system: $!";
chdir ".." or die $!;
+exit if $opts{n};
+
my $src = (-e $perl) ? $perl : 'perl'; # 'perl' in maint branch
print "Creating and compressing the tar.gz file...\n";