summaryrefslogtreecommitdiff
path: root/opcode.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2002-10-29 23:00:05 +0000
committerhv <hv@crypt.org>2002-11-19 12:07:25 +0000
commit36bb303b6ac55df9c2780b48d374c505374dc378 (patch)
tree6aa3bf528c2bb5e5d77e72a8f5137a045663734e /opcode.pl
parent0dae17bd7971d11b90a07b6fc03ec78ab38e4db4 (diff)
downloadperl-36bb303b6ac55df9c2780b48d374c505374dc378.tar.gz
regen_headers outside Makefile (was Re: [PATCH] embed.pl doc)
Message-ID: <20021029230003.GF287@Bagpuss.unfortu.net> p4raw-id: //depot/perl@18160
Diffstat (limited to 'opcode.pl')
-rwxr-xr-xopcode.pl32
1 files changed, 14 insertions, 18 deletions
diff --git a/opcode.pl b/opcode.pl
index 03e7dc7138..d055f585a2 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -1,4 +1,8 @@
#!/usr/bin/perl
+BEGIN {
+ # Get function prototypes
+ require 'regen.pl';
+}
$opcode_new = 'opcode.h-new';
$opname_new = 'opnames.h-new';
@@ -278,15 +282,11 @@ if (keys %OP_IS_FILETEST) {
close OC or die "Error closing opcode.h: $!";
close ON or die "Error closing opnames.h: $!";
-chmod 0600, 'opcode.h'; # required by dosish filesystems
-chmod 0600, 'opnames.h'; # required by dosish filesystems
-
-# Some dosish systems can't rename over an existing file:
-unlink "$_-old" for qw(opcode.h opnames.h);
-rename $_, "$_-old" for qw(opcode.h opnames.h);
-
-rename $opcode_new, 'opcode.h' or die "renaming opcode.h: $!\n";
-rename $opname_new, 'opnames.h' or die "renaming opnames.h: $!\n";
+foreach ('opcode.h', 'opnames.h') {
+ safer_rename_silent $_, "$_-old";
+}
+safer_rename $opcode_new, 'opcode.h';
+safer_rename $opname_new, 'opnames.h';
$pp_proto_new = 'pp_proto.h-new';
$pp_sym_new = 'pp.sym-new';
@@ -330,15 +330,11 @@ for (@ops) {
close PP or die "Error closing pp_proto.h: $!";
close PPSYM or die "Error closing pp.sym: $!";
-chmod 0600, 'pp_proto.h'; # required by dosish filesystems
-chmod 0600, 'pp.sym'; # required by dosish filesystems
-
-# Some dosish systems can't rename over an existing file:
-unlink "$_-old" for qw(pp_proto.h pp.sym);
-rename $_, "$_-old" for qw(pp_proto.h pp.sym);
-
-rename $pp_proto_new, 'pp_proto.h' or die "rename pp_proto.h: $!\n";
-rename $pp_sym_new, 'pp.sym' or die "rename pp.sym: $!\n";
+foreach ('pp_proto.h', 'pp.sym') {
+ safer_rename_silent $_, "$_-old";
+}
+safer_rename $pp_proto_new, 'pp_proto.h';
+safer_rename $pp_sym_new, 'pp.sym';
###########################################################################
sub tab {