[RFC] bsd.port.mk: Record OPTIONS into /var/db/pkg on install

Bryan Drewery bdrewery at FreeBSD.org
Sat Aug 4 00:50:00 UTC 2012


Hi,

While developing on ports-mgmt/poudriere I've added support to
automatically rebuild packages if the selected options in /var/db/ports,
or make.conf change. This so far has worked well with pkgng as it
records the OPTIONS selected into the package already.

By suggestion of bapt, 'pretty-print-config' is used to compare the
packaged OPTIONS to the selected OPTIONS. This has worked great for pkgng.

Just today I added support [1] to poudriere for pkg_create(1) packages
by storing the 'pretty-print-config' into the
/var/db/pkg/PKGNAME/+CONTENTS as a comment:

@comment OPTIONS:`make pretty-print-config`

I'd like to add it to 'fake-pkg' so that the @comment is saved on every
port/package creation.

This may potentially benefit portmaster and portupgrade as well.

[1] http://fossil.etoilebsd.net/poudriere/ci/98426527c8?sbs=0

Comparison of the package +CONTENTS after patch:

diff -ur /tmp/zsh-5.0.0.orig/+CONTENTS /var/db/pkg/zsh-5.0.0/+CONTENTS
--- /tmp/zsh-5.0.0.orig/+CONTENTS       2012-08-04 02:31:51.000000000 +0200
+++ /var/db/pkg/zsh-5.0.0/+CONTENTS     2012-08-04 02:33:26.000000000 +0200
@@ -639,7 +639,7 @@
 share/zsh/5.0.0/functions/Completion/Solaris/_zones
 @comment MD5:858863d60ce982e149dbe3f2adb679c3
 share/zsh/5.0.0/functions/Completion/Unix.zwc
- at comment MD5:13a3ee08695e76219a326f722d7006c7
+ at comment MD5:8219096a131f65761e23864a62088298
 share/zsh/5.0.0/functions/Completion/Unix/_a2ps
 @comment MD5:e2d2d6b9f68fd43ce63040fc680ef9d6
 share/zsh/5.0.0/functions/Completion/Unix/_adb
@@ -2013,6 +2013,7 @@
 @dirrm share/zsh/5.0.0/scripts
 @dirrm share/zsh/5.0.0
 @unexec rmdir "%D/share/zsh" 2>/dev/null || true
+ at comment OPTIONS:-DEBUG +DOCS -GDBM +MAILDIR -MEM +MULTIBYTE -PCRE
+SECURE_FREE -STATIC
 @cwd
 @dirrm share/licenses/zsh-5.0.0
 @unexec rmdir %D/share/licenses 2>/dev/null || true

-- 
Regards,
Bryan Drewery
bdrewery at freenode/EFNet
-------------- next part --------------
--- /usr/ports/Mk/bsd.port.mk.orig	2012-08-04 02:22:29.000000000 +0200
+++ /usr/ports/Mk/bsd.port.mk	2012-08-04 02:32:20.000000000 +0200
@@ -5692,6 +5692,7 @@
 .endif
 .endif
 .endif
+	@cd ${.CURDIR} && { ${ECHO_CMD} -n "@comment OPTIONS:"; ${MAKE} pretty-print-config; } >> ${TMPPLIST}
 .endif
 
 ${TMPPLIST}:


More information about the freebsd-ports mailing list