net/dictd: @exec in pkg-plist doesn't work?

Dryice Liu dryice at
Thu Aug 12 01:32:23 PDT 2004


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/Makefile	Sat Jun  5 03:18:10 2004
+++	Thu Aug 12 09:02:44 2004
@@ -47,7 +47,7 @@
 .for i in example.conf example.dictrc example2.conf example3.conf
-	@${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/pkg-plist	Mon Jan 29 05:23:04 2001
+++	Thu Aug 12 16:06:47 2004
@@ -5,6 +5,8 @@
+ at unexec if cmp -s %D/etc/dictd.conf %D/etc/dictd.conf.sample; then rm -f %D/etc/dictd.conf; fi
+ at exec if [ ! -f %D/etc/dictd.conf ]; then cp %D/etc/dictd.conf.sample %D/etc/dictd.conf; fi
 @dirrm share/dictd


More information about the freebsd-ports mailing list