From 46f659cb44a97e36a1da9a3cb9c703c9d7ce538f Mon Sep 17 00:00:00 2001 From: Mike Guy Date: Fri, 15 Jun 2001 15:11:49 +0100 Subject: [PATCH] Re: [PATCH] opcode.pl is chmod'ing the original source tree Message-Id: p4raw-id: //depot/perl@10602 --- opcode.pl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/opcode.pl b/opcode.pl index ffdc93d..3c9ae92 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) = @_; -- 2.7.4