Date: Thu, 12 Aug 2004 16:32:21 +0800 From: Dryice Liu <dryice@hotpop.com> To: freebsd-ports@freebsd.org Cc: dd@freebsd.org Subject: net/dictd: @exec in pkg-plist doesn't work? Message-ID: <86657og3je.fsf@dryice.3322.org>
next in thread | raw e-mail | index | archive | help
Hi, I'm using net/dictd and I found if I deinstall - install it, or portupgrade it, it will overwrite my /usr/local/etc/dictd.conf with a default one. I'm trying to fix this but failed (see my patch below) Basically I'm install the default one as etc/dictd.conf.sample, and use @exec/@unexec to make or copy a etc/dictd.conf. However, only the @unexec works as expected. The @exec clause doesn't work, it didn't copy a etc/dictd.conf with clean installation. Could anyone help me to find out why? I see this is used in many other ports like ftp/lftp and net/GeoIp. Thanks! BTW, is there any tool to help debug this kind of problem? My patch: ====================================================================== diff -ruN dictd/Makefile dictd.new/Makefile --- dictd/Makefile Sat Jun 5 03:18:10 2004 +++ dictd.new/Makefile Thu Aug 12 09:02:44 2004 @@ -47,7 +47,7 @@ .for i in example.conf example.dictrc example.site example2.conf example3.conf ${INSTALL_DATA} ${WRKSRC}/$i ${DATADIR} .endfor - @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.conf > ${PREFIX}/etc/${PORTNAME}.conf + @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.conf > ${PREFIX}/etc/${PORTNAME}.conf.sample @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.sh > ${PREFIX}/etc/rc.d/${PORTNAME}.sh @${CHMOD} +x ${PREFIX}/etc/rc.d/${PORTNAME}.sh @${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${PKGMESSAGE} diff -ruN dictd/pkg-plist dictd.new/pkg-plist --- dictd/pkg-plist Mon Jan 29 05:23:04 2001 +++ dictd.new/pkg-plist Thu Aug 12 16:06:47 2004 @@ -5,6 +5,8 @@ share/dictd/example.site share/dictd/example2.conf share/dictd/example3.conf -etc/dictd.conf +@unexec if cmp -s %D/etc/dictd.conf %D/etc/dictd.conf.sample; then rm -f %D/etc/dictd.conf; fi +etc/dictd.conf.sample +@exec if [ ! -f %D/etc/dictd.conf ]; then cp %D/etc/dictd.conf.sample %D/etc/dictd.conf; fi etc/rc.d/dictd.sh @dirrm share/dictd ====================================================================== -- Cheers, Dryice http://dryice.3322.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86657og3je.fsf>