Date: Mon, 12 May 2014 00:27:51 +0000 (UTC) From: Dmitry Marakasov <amdmi3@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r353752 - in head/games/pachi: . files Message-ID: <201405120027.s4C0RpL7085962@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: amdmi3 Date: Mon May 12 00:27:51 2014 New Revision: 353752 URL: http://svnweb.freebsd.org/changeset/ports/353752 QAT: https://qat.redports.org/buildarchive/r353752/ Log: - Improve highscore file handling Added: head/games/pachi/files/ head/games/pachi/files/pkg-deinstall.in (contents, props changed) head/games/pachi/files/pkg-install.in - copied, changed from r340759, head/games/pachi/pkg-install Deleted: head/games/pachi/pkg-install Modified: head/games/pachi/Makefile Modified: head/games/pachi/Makefile ============================================================================== --- head/games/pachi/Makefile Mon May 12 00:14:24 2014 (r353751) +++ head/games/pachi/Makefile Mon May 12 00:27:51 2014 (r353752) @@ -3,7 +3,7 @@ PORTNAME= pachi PORTVERSION= 1.0 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= games MASTER_SITES= SF/dragontech/Pachi%20el%20marciano/Pachi%20el%20marciano%20${PORTVERSION} DISTNAME= pachi_source @@ -21,9 +21,12 @@ CPPFLAGS+= -I${LOCALBASE}/include WRKSRC= ${WRKDIR}/Pachi -SCOREDIR= /var/games/pachi +SCOREDIR= /var/games/${PORTNAME} SCOREFILE= ${SCOREDIR}/scores.dat +SUB_FILES= pkg-deinstall pkg-install +SUB_LIST= SCOREDIR="${SCOREDIR}" SCOREFILE="${SCOREFILE}" + PORTDATA= * DESKTOP_ENTRIES="Pachi el marciano" \ Added: head/games/pachi/files/pkg-deinstall.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/pachi/files/pkg-deinstall.in Mon May 12 00:27:51 2014 (r353752) @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ + +[ "$2" != "POST-DEINSTALL" ] && exit 0 + +# remove scorefile if it's empty +[ "`md5 -q '%%SCOREFILE%%'`" = 7ba69f4ec41007c035beb73aa29d6b32 ] && rm -f "%%SCOREFILE%%" 2>/dev/null +rmdir "%%SCOREDIR%%" 2>/dev/null + +if [ -e "%%SCOREDIR%%" ]; then + echo + echo "To completely remove the port, please remove the following" + echo "directory manually, if it's no longer needed:" + echo + echo " %%SCOREDIR%%" + echo +fi Copied and modified: head/games/pachi/files/pkg-install.in (from r340759, head/games/pachi/pkg-install) ============================================================================== --- head/games/pachi/pkg-install Thu Jan 23 00:15:38 2014 (r340759, copy source) +++ head/games/pachi/files/pkg-install.in Mon May 12 00:27:51 2014 (r353752) @@ -2,15 +2,12 @@ # # $FreeBSD$ -SCOREDIR="/var/games/pachi" -SCOREFILE="/var/games/pachi/scores.dat" +[ "$2" != "POST-INSTALL" ] && exit 0 +[ -e "%%SCOREFILE%%" ] && exit 0 -[ "$2" != "POST-INSTALL" -o -f "$SCOREFILE" ] && exit 0 +mkdir -p "%%SCOREDIR%%" -echo "Creating hiscore file..." -mkdir -p "$SCOREDIR" - -# Empty scorefile seem to contain 170 zero bytes -truncate -s 170 "$SCOREFILE" -chgrp -R games "$SCOREDIR" -chmod g+w "$SCOREFILE" +# Empty scorefile contains 170 zero bytes +dd if=/dev/zero of="%%SCOREFILE%%" bs=170 count=1 2>/dev/null +chgrp -R games "%%SCOREDIR%%" +chmod g+w "%%SCOREFILE%%"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405120027.s4C0RpL7085962>