svn commit: r332560 - head/astro/ephem

Mark Felder feld at FreeBSD.org
Mon Nov 4 14:02:04 UTC 2013


On Sun, Nov 3, 2013, at 12:31, Tijl Coosemans wrote:
> 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
>

Yes, I was planning something like that but didn't have time to fully
test it. I also would prefer the maintainer's feedback as I don't use
this software. However, the fact that we still have to do this is quite
inefficient not to mention inconsistent throughout the tree. I'm hoping
someone can add functionality to the ports tree that handles
installation of example/sample configs and automatically removes them
during deinstall if they haven't been modified.
 
> Also, I think you can remove the USE_GCC=any if you add -Wno-return-type
> to CFLAGS.

I will test building with that added to CFLAGS and ask the maintainer to
confirm that the software works correctly. And thank you very much for
the suggestion -- I'm not a programmer by trade and learning what errors
could be solved by which CFLAGS is an ongoing process. I'll take note of
this and put it in my toolbox. :-)


More information about the svn-ports-all mailing list