1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-30 05:40:06 +00:00
freebsd-ports/games/atomix/pkg-deinstall
John Marino 87f8b2e2dd games/atomix: Fix deinstallation issue involving scores file
The scheme used to leave a non-zero length scores file alone during
deinstallation no longer works under stage.  The scheme used a
post-install script to add the scores directory and initial file, but
then tried to remove it using the pkg-plist.

Apparently these need to be matched, which means either the post-install
script is matched with a post-deinstall script, or the creation of the
scores file be done in the pkg-list with @exec.  As the logic is slightly
complex, it was easier to solve with a pkg-deinstall script.

There were two unnecessary @dirrmtry lines as well which have been
removed.  Bump portrevision for multiple reasons.

Reported by:	swills (jenkins)
2014-07-08 17:26:36 +00:00

13 lines
282 B
Bash

#!/bin/sh
if [ "$2" = "POST-DEINSTALL" ]; then
GAMES=${PKG_PREFIX}/share/games
SCORES=${GAMES}/atomix.scores
if [ -f ${SCORES} ]; then
if [ ! -s ${SCORES} ]; then
rm -f ${SCORES}
rmdir ${GAMES} > /dev/null 2>&1 || :
fi
fi
fi