Bug 13068

Summary: Don't stamp out score files!
Product: Base System Reporter: Dom Mitchell <Dom.Mitchell>
Component: binAssignee: Mark Murray <markm>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   

Description Dom Mitchell 1999-08-11 13:00:01 UTC
The Makefiles in the src/games subtree will overwrite any existing score
files under the /var/games directory.  This patch stops them from doing
that.

Fix: Here's the patch.  Note that I wasn't sure what to do about the hack(6)
save and bones files.  I've commented them out here, but this should be
a point for discussion before committing.



This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.
**********************************************************************--iZacG9XfU9ObQO8Y0n42OhRNmUHqsj1CKqvfyobQ8uLrT8mK
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -urP /usr/src/games/battlestar/Makefile games/battlestar/Makefile
--- /usr/src/games/battlestar/Makefile	Thu Jul  2 17:57:02 1998
+++ games/battlestar/Makefile	Wed Aug 11 12:13:52 1999
@@ -11,7 +11,9 @@
 #CFLAGS+= -Wall -W
 
 beforeinstall:
+.if !exists(${DESTDIR}/var/games/battlestar.log)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
 	    ${DESTDIR}/var/games/battlestar.log
+.endif
 
 .include <bsd.prog.mk>
diff -urP /usr/src/games/canfield/canfield/Makefile games/canfield/canfield/Makefile
--- /usr/src/games/canfield/canfield/Makefile	Thu Jul  2 17:57:03 1998
+++ games/canfield/canfield/Makefile	Wed Aug 11 12:14:14 1999
@@ -8,8 +8,10 @@
 MLINKS=	canfield.6 cfscores.6
 
 beforeinstall:
+.if !exists(${DESTDIR}/var/games/cfscores)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
 	    ${DESTDIR}/var/games/cfscores
+.endif
 
 .include "../../Makefile.inc"
 .include <bsd.prog.mk>
diff -urP /usr/src/games/cribbage/Makefile games/cribbage/Makefile
--- /usr/src/games/cribbage/Makefile	Thu Jul  2 17:57:04 1998
+++ games/cribbage/Makefile	Wed Aug 11 12:16:54 1999
@@ -10,7 +10,9 @@
 beforeinstall:
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
 	  ${.CURDIR}/cribbage.n  ${DESTDIR}${SHAREDIR}/games/cribbage.instr
+.if exists(${DESTDIR}/var/games/criblog)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
 	    ${DESTDIR}/var/games/criblog
+.endif
 
 .include <bsd.prog.mk>
diff -urP /usr/src/games/hack/Makefile games/hack/Makefile
--- /usr/src/games/hack/Makefile	Thu Jun 24 00:00:33 1999
+++ games/hack/Makefile	Wed Aug 11 12:31:20 1999
@@ -31,14 +31,16 @@
 beforeinstall:
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} /dev/null \
 	    ${DESTDIR}/var/games/hackdir/perm
+.if !exists(${DESTDIR}/var/games/hackdir/record)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 460 /dev/null \
 	    ${DESTDIR}/var/games/hackdir/record
+.endif
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 440 ${.CURDIR}/rumors \
 	    ${DESTDIR}/var/games/hackdir/rumors
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
 	    ${.CURDIR}/help  ${.CURDIR}/hh ${.CURDIR}/data \
 	    ${DESTDIR}/var/games/hackdir
-	rm -f ${DESTDIR}/var/games/hackdir/bones* \
-	    ${DESTDIR}/var/games/hackdir/save/*
+#	rm -f ${DESTDIR}/var/games/hackdir/bones* \
+#	    ${DESTDIR}/var/games/hackdir/save/*
 
 .include <bsd.prog.mk>
diff -urP /usr/src/games/larn/Makefile games/larn/Makefile
--- /usr/src/games/larn/Makefile	Thu Jul  2 17:57:17 1998
+++ games/larn/Makefile	Wed Aug 11 12:45:30 1999
@@ -65,9 +65,13 @@
 	(cd ${.CURDIR}/datfiles; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} \
 	    -m ${NOBINMODE} larnmaze larnopts larn.help \
 	    ${DESTDIR}${SHAREDIR}/games/larn)
+.if !exists(${DESTDIR}/var/games/larn/lscore12.0)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 660 /dev/null \
 	    ${DESTDIR}/var/games/larn/lscore12.0
+.endif
+.if !exists(${DESTDIR}/var/games/larn/llog12.0)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 660 /dev/null \
 	    ${DESTDIR}/var/games/larn/llog12.0
+.endif
 
 .include <bsd.prog.mk>
diff -urP /usr/src/games/phantasia/Makefile games/phantasia/Makefile
--- /usr/src/games/phantasia/Makefile	Thu Dec  3 10:44:27 1998
+++ games/phantasia/Makefile	Wed Aug 11 12:39:55 1999
@@ -24,8 +24,12 @@
 	${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC:M*.o} -lm
 
 beforeinstall:
+.for file in ${DATAFILES}
+.if !exists($file)
 	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 660 \
-	    ${DATAFILES} ${DESTDIR}/var/games/phantasia
+	    ${file} ${DESTDIR}/var/games/phantasia
+.endif
+.endfor
 
 # Make Phantasia map.  Change the map commands reflect your installation.
 # PLOTDEVICE is used for plotting the map.  Change as appropriate.
diff -urP /usr/src/games/robots/Makefile games/robots/Makefile
--- /usr/src/games/robots/Makefile	Thu Jul  2 17:57:23 1998
+++ games/robots/Makefile	Wed Aug 11 12:41:58 1999
@@ -10,7 +10,9 @@
 HIDEGAME=hidegame
 
 beforeinstall:
+.if !exists(${DESTDIR}/var/games/robots_roll)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
 	    ${DESTDIR}/var/games/robots_roll
+.endif
 
 .include <bsd.prog.mk>
diff -urP /usr/src/games/rogue/Makefile games/rogue/Makefile
--- /usr/src/games/rogue/Makefile	Thu Jul  2 17:57:23 1998
+++ games/rogue/Makefile	Wed Aug 11 12:42:16 1999
@@ -11,7 +11,9 @@
 MAN6=	rogue.6
 
 beforeinstall:
+.if !exists(${DESTDIR}/var/games/rogue.scores)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
 	    ${DESTDIR}/var/games/rogue.scores
+.endif
 
 .include <bsd.prog.mk>
diff -urP /usr/src/games/sail/Makefile games/sail/Makefile
--- /usr/src/games/sail/Makefile	Thu Jul  2 17:57:24 1998
+++ games/sail/Makefile	Wed Aug 11 12:42:37 1999
@@ -10,7 +10,9 @@
 HIDEGAME=hidegame
 
 beforeinstall:
+.if !exists(${DESTDIR}/var/games/saillog)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
 	    ${DESTDIR}/var/games/saillog
+.endif
 
 .include <bsd.prog.mk>
diff -urP /usr/src/games/snake/snake/Makefile games/snake/snake/Makefile
--- /usr/src/games/snake/snake/Makefile	Thu Jul  2 17:57:27 1998
+++ games/snake/snake/Makefile	Wed Aug 11 12:44:13 1999
@@ -9,10 +9,14 @@
 MLINKS=	snake.6 snscore.6
 
 beforeinstall:
+.if !exists(${DESTDIR}/var/games/snakerawscores)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
 	    ${DESTDIR}/var/games/snakerawscores
+.endif
+.if !exists(${DESTDIR}/var/games/snake.log)
 	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
 	    ${DESTDIR}/var/games/snake.log
+.endif
 
 .include "../../Makefile.inc"
 .include <bsd.prog.mk>
-- 
**********************************************************************
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they   
are addressed. If you have received this email in error please notify 
the system manager.
How-To-Repeat: 
Run rogue.  Do really well.

Make world.

Run rogue -s.  Cry.
Comment 1 Steve Price freebsd_committer freebsd_triage 1999-09-07 04:17:08 UTC
Responsible Changed
From-To: freebsd-bugs->billf

This is related to bin/12727. 
Comment 2 bill fumerola freebsd_committer freebsd_triage 2004-03-20 15:54:51 UTC
Responsible Changed
From-To: billf->markm

src/games is no longer maintained within the freebsd src/ tree. 

moving over to markm, who removed it, to see if these changes are applicable still.
Comment 3 Mark Murray freebsd_committer freebsd_triage 2004-03-20 17:10:22 UTC
State Changed
From-To: open->closed

Doesn't apply to current, and RELENG_4* is at end-of-life 
slowdown, so this is no longer appropriate for a direct 
commit there.