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

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.
@@ -43,12 +43,15 @@ us an email if that's more appropriate).
------------------------------------------------------------------------------
4. git configuration
NOTE: These instructions assume you are on the default branch ("master");
this _is_ where you want to be for setting things up. This may or may
not be the branch you want to use for your changes; see the appropriate
NOTE: These instructions assume you are on the default branch; this _is_
where you want to be for setting things up. This may or may not be
the branch you want to use for your changes; see the appropriate
project private documentation for more information (if you are working
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:
(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.)

View File

@@ -1,6 +1,6 @@
#!/usr/bin/perl
# 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.
@@ -245,6 +245,7 @@ my $count = s/\$$PREFIX-(([A-Za-z][A-Za-z0-9_]*)(: ([^\x24]+))?)\$/&handlevar($2
# XXX had o modifier, why?
return unless($count>0);
return if($opt{n});
my $mode = 0777 & (stat($file))[2];
my $ofile = $file . ".nht";
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";
# 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";
}

2
sys/unix/hints/macosx.sh Normal file → Executable file
View File

@@ -1,5 +1,5 @@
#!/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.
# NetHack may be freely redistributed. See license for details.
#