From owner-svn-ports-all@FreeBSD.ORG Mon May 12 00:27:52 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56052E89; Mon, 12 May 2014 00:27:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 379A423E1; Mon, 12 May 2014 00:27:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4C0RqEf085967; Mon, 12 May 2014 00:27:52 GMT (envelope-from amdmi3@svn.freebsd.org) Received: (from amdmi3@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4C0RpL7085962; Mon, 12 May 2014 00:27:51 GMT (envelope-from amdmi3@svn.freebsd.org) Message-Id: <201405120027.s4C0RpL7085962@svn.freebsd.org> From: Dmitry Marakasov Date: Mon, 12 May 2014 00:27:51 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r353752 - in head/games/pachi: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 00:27:52 -0000 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%%"