This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Bump $File::Copy::VERSION
[perl5.git] / regen.pl
index 1c830a2..8788668 100644 (file)
--- a/regen.pl
+++ b/regen.pl
@@ -1,45 +1,32 @@
 #!/usr/bin/perl -w
-use strict;
-use vars qw($Is_W32 $Is_OS2 $Is_Cygwin $Is_NetWare $Needs_Write);
-use Config; # Remember, this is running using an existing perl
-
-# Common functions needed by the regen scripts
-
-$Is_W32 = $^O eq 'MSWin32';
-$Is_OS2 = $^O eq 'os2';
-$Is_Cygwin = $^O eq 'cygwin';
-$Is_NetWare = $Config{osname} eq 'NetWare';
-if ($Is_NetWare) {
-  $Is_W32 = 0;
-}
+#
+# regen.pl - a wrapper that runs all *.pl scripts to autogenerate files
 
-$Needs_Write = $Is_OS2 || $Is_W32 || $Is_Cygwin || $Is_NetWare;
+require 5.004; # keep this compatible, an old perl is all we may have before
+                # we build the new one
 
-sub safer_unlink {
-  my @names = @_;
-  my $cnt = 0;
+# The idea is to move the regen_headers target out of the Makefile so that
+# it is possible to rebuild the headers before the Makefile is available.
+# (and the Makefile is unavailable until after Configure is run, and we may
+# wish to make a clean source tree but with current headers without running
+# anything else.
 
-  my $name;
-  foreach $name (@names) {
-    next unless -e $name;
-    chmod 0777, $name if $Needs_Write;
-    ( CORE::unlink($name) and ++$cnt
-      or warn "Couldn't unlink $name: $!\n" );
-  }
-  return $cnt;
-}
-
-sub safer_rename_silent {
-  my ($from, $to) = @_;
+use strict;
 
-  # Some dosish systems can't rename over an existing file:
-  safer_unlink $to;
-  chmod 0600, $from if $Needs_Write;
-  rename $from, $to;
+my $tap = $ARGV[0] && $ARGV[0] eq '--tap' ? '# ' : '';
+foreach my $pl (map {chomp; "regen/$_"} <DATA>) {
+  my @command =  ($^X, $pl, @ARGV);
+  print "$tap@command\n";
+  system @command
+    and die "@command failed: $?" 
 }
 
-sub safer_rename {
-  my ($from, $to) = @_;
-  safer_rename_silent($from, $to) or die "renaming $from to $to: $!";
-}
-1;
+__END__
+mg_vtable.pl
+opcode.pl
+overload.pl
+reentr.pl
+regcomp.pl
+warnings.pl
+embed.pl
+feature.pl