Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Nov 2013 19:31:39 +0100
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        Mark Felder <feld@FreeBSD.org>
Cc:        svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, ports-committers@freebsd.org
Subject:   Re: svn commit: r332560 - head/astro/ephem
Message-ID:  <20131103193139.5e44b9b8@kalimero.tijl.coosemans.org>
In-Reply-To: <201311022337.rA2NbENO095280@svn.freebsd.org>
References:  <201311022337.rA2NbENO095280@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2 Nov 2013 23:37:14 +0000 (UTC) Mark Felder wrote:
> Author: feld
> Date: Sat Nov  2 23:37:13 2013
> New Revision: 332560
> URL: http://svnweb.freebsd.org/changeset/ports/332560
> 
> Log:
>   Reverting STAGE support. Just realized the way the .db and .cfg files
>   are being installed needs to be reworked for STAGE or we will always
>   overwrite them, breaking POLA
>   
>   Approved by:	swills (mentor, implicit), my guilty conscience
> 
> Modified:
>   head/astro/ephem/Makefile
> 
> Modified: head/astro/ephem/Makefile
> ==============================================================================
> --- head/astro/ephem/Makefile	Sat Nov  2 23:29:18 2013	(r332559)
> +++ head/astro/ephem/Makefile	Sat Nov  2 23:37:13 2013	(r332560)
> @@ -21,11 +21,11 @@ USE_GCC=	any
>  
>  do-install:
>  	-cd ${WRKSRC}; \
> -	${INSTALL_PROGRAM} ephem ${STAGEDIR}${PREFIX}/bin; \
> -	${MKDIR} ${STAGEDIR}${PREFIX}/share/ephem; \
> -	${INSTALL_DATA} Man.txt ${STAGEDIR}${PREFIX}/share/ephem/; \
> -	[ ! -f ${STAGEDIR}${PREFIX}/share/ephem/ephem.db ] && ${INSTALL_DATA} ephem.db ${STAGEDIR}${PREFIX}/share/ephem/; \
> -	[ ! -f ${STAGEDIR}${PREFIX}/share/ephem/ephem.cfg ] && ${INSTALL_DATA} ephem.cfg ${STAGEDIR}${PREFIX}/share/ephem/
> +	${INSTALL_PROGRAM} ephem ${PREFIX}/bin; \
> +	${MKDIR} ${PREFIX}/share/ephem; \
> +	${INSTALL_DATA} Man.txt ${PREFIX}/share/ephem/; \
> +	[ ! -f ${PREFIX}/share/ephem/ephem.db ] && ${INSTALL_DATA} ephem.db ${PREFIX}/share/ephem/; \
> +	[ ! -f ${PREFIX}/share/ephem/ephem.cfg ] && ${INSTALL_DATA} ephem.cfg ${PREFIX}/share/ephem/
>  
>  post-install:
>  	@${ECHO_MSG} Don\'t forget to edit ${PREFIX}/share/ephem/ephem.cfg!

Hmm, this post-install message suggests modifying an installed file
which means when the package is deleted the file stays because of a
checksum failure and that's why you need the existence test in
do-install.

The correct way to deal with this situation is to install those files
as *.sample and then put the following in pkg-plist for each file:

@unexec if cmp -s %D/%%DATADIR%%/ephem.cfg %D/%%DATADIR%%/ephem.cfg.sample; then rm -f %D/%%DATADIR%%/ephem.cfg; fi
%%DATADIR%%/ephem.cfg.sample
@exec if [ ! -f %B/ephem.cfg ]; then cp -p %D/%F %B/ephem.cfg; fi

Also, I think you can remove the USE_GCC=any if you add -Wno-return-type
to CFLAGS.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131103193139.5e44b9b8>