]> granicus.if.org Git - nethack/commitdiff
do away with symbols.template in windows
authornhmall <nhmall@nethack.org>
Sat, 29 Jan 2022 18:04:20 +0000 (13:04 -0500)
committernhmall <nhmall@nethack.org>
Sat, 29 Jan 2022 19:04:20 +0000 (14:04 -0500)
If the one provided in the zip/distribution is newer, replace
the one used by the game after renaming the current one to
symbols.save.

If the one used by the game is newer, do nothing with it.

sys/windows/Makefile.mingw32
sys/windows/Makefile.msc
sys/windows/windmain.c

index 548ae868d3535536bc582e44d84e5b7019cec678..8a63605fd7c8f9b12b3565e406d2d30e3ae12cb4 100644 (file)
@@ -772,7 +772,7 @@ CLEAN_FILE += $(NHTARGET) $(NHOBJS) $(NHRES)
 all: install
 
 TO_INSTALL = $(GAMEDIR)/NetHack.exe $(RTARGETS) \
-            $(addprefix $(GAMEDIR)/, $(addsuffix .template, sysconf symbols .nethackrc) \
+            $(addprefix $(GAMEDIR)/, $(addsuffix .template, sysconf .nethackrc) \
             Guidebook.txt NetHack.txt license opthelp record)
 
 ifeq "$(USE_LUADLL)" "Y"
@@ -798,7 +798,7 @@ ifneq "$(USE_DLB)" "Y"
 endif
        @echo NetHack is up to date.
 
-$(GAMEDIR)/symbols.template: $(DAT)/symbols
+$(GAMEDIR)/symbols: $(DAT)/symbols
        cp $< $@
 
 $(GAMEDIR)/NetHack.txt: $(DOC)/nethack.txt
index 5577b687a079acc3d052d7670abd073dd7fa5e7c..bad64503d57fa411dc4327542bb0908bc6c545d2 100644 (file)
@@ -971,7 +971,7 @@ $(O)install.tag:    $(DAT)\data     $(DAT)\rumors   $(DAT)\oracles \
        if exist $(DAT)\ttyoptions copy $(DAT)\ttyoptions $(GAMEDIR)
 ! ENDIF
        if exist $(MSWSYS)\sysconf.template copy $(MSWSYS)\sysconf.template $(GAMEDIR)
-       if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR)\symbols.template
+       if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR)\symbols
        if exist $(DOC)\guidebook.txt copy $(DOC)\guidebook.txt $(GAMEDIR)\Guidebook.txt
        if exist $(DOC)\nethack.txt copy $(DOC)\nethack.txt $(GAMEDIR)\NetHack.txt
        @if exist $(GAMEDIR)\NetHack.PDB echo NOTE: You may want to remove $(GAMEDIR:\=/)/NetHack.PDB to conserve space
index 78a1c48e05803932e2c5a719690789885477a78d..c6075ce799cbd8f9934d4908eefae034c422abf9 100644 (file)
@@ -355,15 +355,16 @@ void copy_sysconf_content()
     update_file(g.fqn_prefix[SYSCONFPREFIX], SYSCF_TEMPLATE,
         g.fqn_prefix[DATAPREFIX], SYSCF_TEMPLATE, FALSE);
 
-    update_file(g.fqn_prefix[SYSCONFPREFIX], SYMBOLS_TEMPLATE,
-        g.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE, FALSE);
+//    update_file(g.fqn_prefix[SYSCONFPREFIX], SYMBOLS_TEMPLATE,
+//        g.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE, FALSE);
 
     /* If the required early game file does not exist, copy it */
     copy_file(g.fqn_prefix[SYSCONFPREFIX], SYSCF_FILE,
         g.fqn_prefix[DATAPREFIX], SYSCF_TEMPLATE);
 
     update_file(g.fqn_prefix[SYSCONFPREFIX], SYMBOLS,
-        g.fqn_prefix[DATAPREFIX], SYMBOLS_TEMPLATE, TRUE);
+        g.fqn_prefix[DATAPREFIX], SYMBOLS, TRUE);
+
 }
 
 void copy_config_content()
@@ -1239,14 +1240,16 @@ file_newer(const char* a_path, const char* b_path)
 {
     struct stat a_sb;
     struct stat b_sb;
+    double timediff;
 
     if (stat(a_path, &a_sb))
         return FALSE;
 
     if (stat(b_path, &b_sb))
         return TRUE;
+    timediff = difftime(a_sb.st_mtime, b_sb.st_mtime);
 
-    if(difftime(a_sb.st_mtime, b_sb.st_mtime) < 0)
+    if(timediff > 0)
         return TRUE;
     return FALSE;
 }