diff --git a/DEVEL/gitinfo.pl b/DEVEL/gitinfo.pl index b62428975..d62f1a588 100644 --- a/DEVEL/gitinfo.pl +++ b/DEVEL/gitinfo.pl @@ -20,6 +20,13 @@ BEGIN { $gitdir = `git rev-parse --git-dir`; chomp $gitdir; push(@INC, $gitdir.$PDS."hooks"); + + # special case for this script only: allow + # it to run from DEVEL or $TOP + if (-f "hooksdir/NHgithook.pm" || -f "DEVEL/hooksdir/NHgithook.pm"){ + push(@INC, "DEVEL/hooksdir"); + } + chdir("..") if (-f "hooksdir/NHgithook.pm"); } use NHgithook; diff --git a/DEVEL/hooksdir/.NHgithook.pm.swp b/DEVEL/hooksdir/.NHgithook.pm.swp deleted file mode 100644 index 19e7ec873..000000000 Binary files a/DEVEL/hooksdir/.NHgithook.pm.swp and /dev/null differ diff --git a/DEVEL/hooksdir/NHgithook.pm b/DEVEL/hooksdir/NHgithook.pm index 1bb92cf7e..0d586cfb7 100644 --- a/DEVEL/hooksdir/NHgithook.pm +++ b/DEVEL/hooksdir/NHgithook.pm @@ -1,7 +1,7 @@ # # NHgithook.pm # NetHack Git Hook Module -# $NHDT-Date$ +# $NHDT-Date: 1519164205 2018/02/20 22:03:25 $ package NHgithook; use Cwd; @@ -72,6 +72,7 @@ sub nhversioning { $git_sha =~ s/\s+//g; my $git_branch = `git rev-parse --abbrev-ref HEAD`; $git_branch =~ s/\s+//g; + die "git rev-parse failed" unless(length $git_sha and length $git_branch); if (open my $fh, '<', 'dat/gitinfo.txt') { while(my $line = <$fh>) { @@ -82,11 +83,15 @@ sub nhversioning { } } close $fh; + } else { + print "WARNING: Can't find dat directory\n" unless(-d "dat"); } if (open my $fh, '>', 'dat/gitinfo.txt') { print $fh 'githash='.$git_sha."\n"; print $fh 'gitbranch='.$git_branch."\n"; print "An updated dat/gitinfo.txt was written, githash=".$git_sha."\n"; + } else { + print "WARNING: Unable to open dat/gitinfo.txt: $!\n"; } } diff --git a/src/allmain.c b/src/allmain.c index 789c5d48f..eab1fce3d 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 allmain.c $NHDT-Date: 1513130016 2017/12/13 01:53:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.81 $ */ +/* NetHack 3.6 allmain.c $NHDT-Date: 1518193644 2018/02/09 16:27:24 $ $NHDT-Branch: githash $:$NHDT-Revision: 1.86 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -763,7 +763,8 @@ enum earlyarg e_arg; { int i, idx; boolean match = FALSE; - char *userea = (char *)0, *dashdash = ""; + char *userea = (char *)0; + const char *dashdash = ""; for (idx = 0; idx < SIZE(earlyopts); idx++) { if (earlyopts[idx].e == e_arg) diff --git a/src/version.c b/src/version.c index 514665663..30e4ce75f 100644 --- a/src/version.c +++ b/src/version.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 version.c $NHDT-Date: 1517140532 2018/01/28 11:55:32 $ $NHDT-Branch: nhmall-githash3 $:$NHDT-Revision: 1.50 $ */ +/* NetHack 3.6 version.c $NHDT-Date: 1519155525 2018/02/20 19:38:45 $ $NHDT-Branch: githash $:$NHDT-Revision: 1.47 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -46,7 +46,9 @@ char *buf; #endif if (details) { +#if defined(RUNTIME_PORT_ID) || defined(NETHACK_GIT_SHA) || defined(NETHACK_GIT_BRANCH) int c = 0; +#endif #if defined(RUNTIME_PORT_ID) char tmpbuf[BUFSZ]; char *tmp = (char *)0; diff --git a/sys/unix/hints/macosx.sh b/sys/unix/hints/macosx.sh index 93e28ca51..c6cf10c31 100755 --- a/sys/unix/hints/macosx.sh +++ b/sys/unix/hints/macosx.sh @@ -1,5 +1,5 @@ #!/bin/sh -# NetHack 3.6 macosx.sh $NHDT-Date: 1518800856 2018/02/16 17:07:36 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.19 $ +# NetHack 3.6 macosx.sh $NHDT-Date: 1517231957 2018/01/29 13:19:17 $ $NHDT-Branch: githash $:$NHDT-Revision: 1.20 $ # Copyright (c) Kenneth Lorber, Kensington, Maryland, 2007. # NetHack may be freely redistributed. See license for details. #