infrastructure fixes:

- fix bug in git hooks that loses file permissions when doing variable expansion
- fix execute permissions on sys/unix/hints/macosx.sh
- explicitly call out perl as required for hooks in Developer.txt
This commit is contained in:
keni
2018-02-16 12:07:37 -05:00
parent 2c21399a7e
commit 12530cb155
3 changed files with 12 additions and 6 deletions
+7 -4
View File
@@ -4,7 +4,7 @@
|___/\___|\_/\___|_\___/ .__/\___|_| |___/\___|\_/\___|_\___/ .__/\___|_|
|_| |_|
$NHDT-Date: 1447180052 2015/11/10 18:27:32 $ $NHDT-Date: 1518800857 2018/02/16 17:07:37 $
Welcome to the NetHack Infrastructure Developer's Guide. Welcome to the NetHack Infrastructure Developer's Guide.
@@ -43,12 +43,15 @@ us an email if that's more appropriate).
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
4. git configuration 4. git configuration
NOTE: These instructions assume you are on the default branch ("master"); NOTE: These instructions assume you are on the default branch; this _is_
this _is_ where you want to be for setting things up. This may or may where you want to be for setting things up. This may or may not be
not be the branch you want to use for your changes; see the appropriate the branch you want to use for your changes; see the appropriate
project private documentation for more information (if you are working project private documentation for more information (if you are working
alone we suggest using branch names starting with "LOCAL-"). alone we suggest using branch names starting with "LOCAL-").
NOTE: The following instructions require perl. If you do not have perl on
your system, please install it before proceeding.
A. If you have never set up git on this machine before: A. If you have never set up git on this machine before:
(This assumes you will only be using git for NetHack. If you are going to (This assumes you will only be using git for NetHack. If you are going to
use it for other projects as well, think before you type.) use it for other projects as well, think before you type.)
+4 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
# nhsub # nhsub
# $NHDT-Date: 1427408239 2015/03/26 22:17:19 $ # $NHDT-Date: 1518800857 2018/02/16 17:07:37 $
# Note: was originally called nhdate; the rename is not reflected in the code. # Note: was originally called nhdate; the rename is not reflected in the code.
@@ -245,6 +245,7 @@ my $count = s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2
# XXX had o modifier, why? # XXX had o modifier, why?
return unless($count>0); return unless($count>0);
return if($opt{n}); return if($opt{n});
my $mode = 0777 & (stat($file))[2];
my $ofile = $file . ".nht"; my $ofile = $file . ".nht";
open(TOUT, ">", $ofile) or die "Can't open $ofile"; open(TOUT, ">", $ofile) or die "Can't open $ofile";
@@ -263,6 +264,8 @@ my $count = s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2
} }
close TOUT or die "Can't close $ofile"; close TOUT or die "Can't close $ofile";
# Do the right thing for *nix and hope for the best elsewhere:
chmod($mode, $ofile)==1 or warn "Can't set filemode on $ofile";
rename $ofile, $file or die "Can't rename $ofile to $file"; rename $ofile, $file or die "Can't rename $ofile to $file";
} }
Regular → Executable
+1 -1
View File
@@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# NetHack 3.6 macosx.sh $NHDT-Date: 1515549543 2018/01/10 01:59:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.18 $ # NetHack 3.6 macosx.sh $NHDT-Date: 1518800856 2018/02/16 17:07:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.19 $
# Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007.
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
# #