[122659] trunk/dports/games/nethack/Portfile

mf2k at macports.org mf2k at macports.org
Fri Jul 25 13:30:23 PDT 2014


Revision: 122659
          https://trac.macports.org/changeset/122659
Author:   mf2k at macports.org
Date:     2014-07-25 13:30:23 -0700 (Fri, 25 Jul 2014)
Log Message:
-----------
nethack: Do not overwrite preference files. (#42611)

Modified Paths:
--------------
    trunk/dports/games/nethack/Portfile

Modified: trunk/dports/games/nethack/Portfile
===================================================================
--- trunk/dports/games/nethack/Portfile	2014-07-25 20:21:47 UTC (rev 122658)
+++ trunk/dports/games/nethack/Portfile	2014-07-25 20:30:23 UTC (rev 122659)
@@ -5,7 +5,7 @@
 
 name                nethack
 version             3.4.3
-revision            2
+revision            3
 categories          games
 maintainers         nomaintainer
 description         Classic dungeon adventure game.
@@ -51,8 +51,22 @@
 
 post-destroot {
     reinplace "s|${destroot}||" "${destroot}${prefix}/bin/nethack"
+
+    # Don't overwrite existing preference files
+    foreach f { logfile record } {
+        file rename ${destroot}${prefix}/share/nethackdir/${f} ${destroot}${prefix}/share/nethackdir/${f}.dist
+    }
 }
 
+post-activate {
+    # Make sure initial preference files exist
+    foreach f { logfile record } {
+        if {![file exists ${prefix}/share/nethackdir/${f}]} {
+            file copy ${prefix}/share/nethackdir/${f}.dist ${prefix}/share/nethackdir/${f}
+        }
+    }
+}
+
 variant x11 {
     patchfiles-append \
         x11/patch-include__config.h.diff \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140725/68b61650/attachment.html>


More information about the macports-changes mailing list