This construction doesn't work
Gabor Kovesdan
gabor at FreeBSD.org
Mon Jun 28 23:13:50 UTC 2010
Em 2010.06.29. 0:24, Paul Schmehl escreveu:
> I'm working on a port update for one of the ports that I maintain, and
> I've run into a problem that I can't seem to solve.
>
> I use this construction to ensure that the port doesn't overwrite the
> conf file, if one exists:
>
> .for f in barnyard2.conf
> ${INSTALL_DATA} ${WRKSRC}/etc/${f} ${PREFIX}/etc/${f}-sample
> [ -f ${PREFIX}/etc/${f} ] || \
> ${INSTALL_DATA} ${WRKSRC}/etc/${f} ${PREFIX}/etc/${f}
> .endfor
>
> But it gets overwritten anyway. What am I doing wrong? I thought
> this worked before, but I can't be sure. Testing proves that it does
> not work now. I tried to changing to an if [ ! -f construction, but
> that didn't do a thing.
>
I think it should work, I used to write the same in audio/shoutcast. Are
you testing by installing from port or from package? It should work for
ports but for packages, you need some more magic in pkg-plist. You can
also refer to audio/shoutcast how it is done there. Maybe is it what you
missed?
Regards,
Gabor
More information about the freebsd-ports
mailing list