summaryrefslogtreecommitdiff
path: root/opcode.pl
diff options
context:
space:
mode:
authorMike Guy <mjtg@cam.ac.uk>2001-06-15 15:11:49 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-15 13:27:04 +0000
commit46f659cb44a97e36a1da9a3cb9c703c9d7ce538f (patch)
tree4d076d7ec7a50353b352cb4c9518609a5a8180ef /opcode.pl
parentcea00dc580b73966c5c98fc99732fe610def4247 (diff)
downloadperl-46f659cb44a97e36a1da9a3cb9c703c9d7ce538f.tar.gz
Re: [PATCH] opcode.pl is chmod'ing the original source tree
Message-Id: <E15AtO9-0006Nd-00@draco.cus.cam.ac.uk> p4raw-id: //depot/perl@10602
Diffstat (limited to 'opcode.pl')
-rwxr-xr-xopcode.pl17
1 files changed, 10 insertions, 7 deletions
diff --git a/opcode.pl b/opcode.pl
index ffdc93de5f..3c9ae929eb 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -1,8 +1,7 @@
#!/usr/bin/perl
-unlink "opcode.h", "opnames.h";
-open(OC, ">opcode.h") || die "Can't create opcode.h: $!\n";
-open(ON, ">opnames.h") || die "Can't create opnames.h: $!\n";
+open(OC, ">opcode.h.new") || die "Can't create opcode.h.new: $!\n";
+open(ON, ">opnames.h.new") || die "Can't create opnames.h.new: $!\n";
select OC;
# Read data.
@@ -255,10 +254,11 @@ if (keys %OP_IS_FILETEST) {
close OC or die "Error closing opcode.h: $!";
close ON or die "Error closing opnames.h: $!";
-unlink "pp_proto.h";
-unlink "pp.sym";
-open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!";
-open PPSYM, '>pp.sym' or die "Error creating pp.sym: $!";
+rename 'opcode.h.new', 'opcode.h' or die "renaming opcode.h: $!\n";
+rename 'opnames.h.new', 'opnames.h' or die "renaming opnames.h: $!\n";
+
+open PP, '>pp_proto.h.new' or die "Error creating pp_proto.h.new: $!";
+open PPSYM, '>pp.sym.new' or die "Error creating pp.sym.new: $!";
print PP <<"END";
/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
@@ -295,6 +295,9 @@ for (@ops) {
close PP or die "Error closing pp_proto.h: $!";
close PPSYM or die "Error closing pp.sym: $!";
+rename 'pp_proto.h.new', 'pp_proto.h' or die "rename pp_proto.h: $!\n";
+rename 'pp.sym.new', 'pp.sym' or die "rename pp.sym: $!\n";
+
###########################################################################
sub tab {
local($l, $t) = @_;