Subject: Re: Game score and config file handling
To: Todd Vierling <tv@pobox.com>
From: Simon Burge <simonb@telstra.com.au>
List: tech-pkg
Date: 12/03/1998 08:48:20
On Wed, 2 Dec 1998 12:14:13 -0500 (EST) Todd Vierling wrote:
> On Wed, 2 Dec 1998, Hubert Feyrer wrote:
>
> : Following up the recent discussion, i'd like to offer the following
> : solutions for handling game score files and config files. The idea on both
> : is to keep them on deleting, and generate them only if they aren't already
> : present, with a little trick for config files:
>
> This is already done in many pkgs. Simply put in pseudo-Make and
> pseudo-PLIST,
>
> pkg Makefile...
>
> =====
> do-install:
> ${INSTALL_DATA} ${WRKSRC}/mygame_score \
> ${PREFIX}/var/mygame_score.dist
> post-install:
> @if [ ! -f ${PREFIX}/var/mygame_score ]; then \
> ${CP} -p ${PREFIX}/var/mygame_score.dist \
> ${PREFIX}/var/mygame_score; \
> fi
> =====
>
> PLIST...
>
> =====
> var/mygame_score.dist
> @exec if [ ! -f %D/var/mygame_score ]; then cp -p %D/var/mygame_score.dist %D/var/mygame_score; fi
> =====
>
> The file is created if needed, but not deleted or messed with otherwise on
> delete or delete-and-reinstall.
${PREFIX}/var doesn't exist (at least on my systems here) - will the
+MTREE_DIRS stuff create this automagically? I'll experiment.
Also, should we create ${PREFIX}/share/games and ${PREFIX}/var/games to
stop the upper levels from becoming cluttered?
> Note that just because I proposed an implementation of Hubert's suggestion
> does not mean I volunteer to fix anything I haven't already fixed. 8-)
Thirded :-)
Simon.