X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=opcode.pl;h=40536717334d659735c9a55f7dfa2e8eac337fd6;hb=67597c89125e7e144f9ba60f5b1fe23b951286d8;hp=f897bb9688a8bcd1824af904858cfaaa9fddb5f7;hpb=2de3dbccea8bcb1d17328cd596713c4aa8443082;p=p5sagit%2Fp5-mst-13.2.git diff --git a/opcode.pl b/opcode.pl index f897bb9..4053671 100755 --- a/opcode.pl +++ b/opcode.pl @@ -1,9 +1,7 @@ #!/usr/bin/perl -chmod 0666, "opcode.h", "opnames.h"; -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. @@ -256,10 +254,14 @@ 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: $!"; +chmod 0600, 'opcode.h'; # required by dosish filesystems +chmod 0600, 'opnames.h'; # required by dosish filesystems + +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 !!!!!!! @@ -296,6 +298,12 @@ 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 + +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) = @_; @@ -436,7 +444,7 @@ bless bless ck_fun s@ S S? backtick quoted execution (``, qx) ck_open t% # glob defaults its first arg to $_ glob glob ck_glob t@ S? -readline ck_null t% +readline ck_null t% F? rcatline append I/O operator ck_null t% # Bindable operators.