ports/75018: [maintainer update]: net-mgmt/rotorouter was missing a file from its plist...

Paul Chvostek paul+fbsd at it.ca
Tue Dec 14 13:15:30 PST 2004


On Tue, Dec 14, 2004 at 05:15:06AM +0300, Sergey Matveychuk wrote:
> 
> I don't think it's a good idea to remove conf file this way.
> 
> Use something like this instead:
> @unexec if cmp -s %D/etc/rotorouter.conf %D/etc/rotorouter.conf-example; 
> then rm -f %D/etc/rotorouter.conf; fi

Agreed, that's more consistent with what other ports are doing.  I've
attached a replacement diff against the original port.

But ...

While this is indeed consistent with how other ports work, it brings up
a philosophical question.  Should port behaviour upon uninstall be
controlled by the port, or by the ports system itself?

By simply including the conf file in the +CONTENTS, without this
@unexec, a `pkg_delete` will remove the package but leave an altered
conf file, while `make deinstall` will remove the conf file as well.
Both will display a warning about the MD5 not matching, and neither will
return an error, whatever happens.

Could this be improved?  I think so.  (I'm CCing ports@ for discussion.)

So ... we have a "convention" amongst other ports of comparing config
files against their "-dist" or "-example" counterparts.  Should this
behaviour be made standard?  Perhaps a variable in the Makefile (i.e.
SAVEFILES or DO_NOT_DELETE) that contains a list of prefix-less files
that should kept rather than deleted if their MD5 is wrong?

For basic implementation of this, we wouldn't need to change the pkg_*
tools; the existence of the file in the variable could cause bsd.port.mk
to generate exactly the @unexec you've recommended above.  Unless of
course we wanted some kind of override option that would let us say "ya,
delete the bugger, I don't care."

Is there any merit to any of this, or should folks installing ports just
be able to clean up after themselves?

p

-- 
  Paul Chvostek                                             <paul at it.ca>
  Operations / Abuse / Whatever
  it.canada, hosting and development                   http://www.it.ca/

-------------- next part --------------
diff -ruN /usr/ports/net-mgmt/rotorouter/pkg-plist rotorouter/pkg-plist
--- /usr/ports/net-mgmt/rotorouter/pkg-plist	Mon Jun 14 13:56:41 2004
+++ rotorouter/pkg-plist	Tue Dec 14 16:11:03 2004
@@ -1,3 +1,4 @@
 sbin/rotorouter
 etc/rc.d/rotorouter.sh
 etc/rotorouter.conf-example
+ at unexec if cmp -s %D/etc/rotorouter.conf %D/etc/rotorouter.conf-example; then rm -f %D/etc/rotorouter.conf; fi


More information about the freebsd-ports mailing list