portmaster

James O'Gorman james at netinertia.co.uk
Thu Jun 8 21:57:03 UTC 2006


Alex Dupre wrote:
> James O'Gorman ha scritto:
>> Would it perhaps be possible for this to spam /etc/make.conf to add the
>> relevant entries, like the perl port does?
> 
> Possible yes, easy no. Adding rows on install is simple, removing them
> on deinstall less (perl set only a couple of variables). If you have a
> working patch I'll be glad ti commit it.

How's this? It's a technique I use in my Apache vhosts.conf maintainance
script.

James
-------------- next part --------------
diff -urN portsconf.orig/pkg-deinstall portsconf/pkg-deinstall
--- portsconf.orig/pkg-deinstall	Thu Jan  1 01:00:00 1970
+++ portsconf/pkg-deinstall	Thu Jun  8 20:22:13 2006
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+echo -n "Cleaning up /etc/make.conf..."
+sed -e "/# Begin portsconf configuration/,/# End portsconf configuration/ d" \
+	-i.bak /etc/make.conf
+echo " Done."
diff -urN portsconf.orig/pkg-install portsconf/pkg-install
--- portsconf.orig/pkg-install	Thu Jan  1 01:00:00 1970
+++ portsconf/pkg-install	Thu Jun  8 20:21:35 2006
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+echo -n "Spamming /etc/make.conf..."
+echo >> /etc/make.conf <<EOF
+# Begin portsconf configuration
+.if !empty(.CURDIR:M/usr/ports*)
+_PORTCONF!=%%PREFIX%%/sbin/portconf
+.for i in ${_PORTCONF:S/|/ /g}
+${i:S/%/ /g}
+.endfor
+.endif
+# End portsconf configuration
+EOF
+echo " Done."


More information about the freebsd-ports mailing list