ports/162397: [patch] Mk/bsd.port.mk: add new target add-plist-buildinfo for package build details

Jason Helfman jhelfman at experts-exchange.com
Wed Nov 9 06:30:11 UTC 2011


>Number:         162397
>Category:       ports
>Synopsis:       [patch] Mk/bsd.port.mk: add new target add-plist-buildinfo for package build details
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 09 06:30:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jason Helfman
>Release:        FreeBSD 8.2-RELEASE i386
>Organization:
Experts Exchange, LLC.
>Environment:
System: FreeBSD dormouse.experts-exchange.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64


	
>Description:
In working more and more with FreeBSD, ports, packages and the Operating System,
itself, I am finding the more background I have the better. One item I have
always found to be curious is no details of any sort for a given built package
are bound to a package that are distributed by FreeBSD. I think this would be
a great addition to consider.

I would think this would be very helpful, and thought that it could be great
for the pointyhat buildcluster in respect to either resolving issues, or at
the very least have details recorded in the package of it's build origin.

The included patch is configurable, however a prePortBuild hook would be
required, at the minimum, to get the correct information into the build cycle,
unless it is supplied another way.

Below is an example of my hook, and the resulting package information from the
package I had built. In addition, there are links to the package, and log of the
build.
>How-To-Repeat:
* tinderbox prePortBuild hook:

#!/bin/sh
host=`uname -n`
date=`date`

echo "BUILDHOST=$host" >> ${CHROOT}/etc/make.conf
echo "BUILDDATE=$date" >> ${CHROOT}/etc/make.conf
echo "BUILD=$BUILD" >> ${CHROOT}/etc/make.conf
echo "JAIL=$JAIL" >> ${CHROOT}/etc/make.conf
echo "PORTSTREE=$PORTSTREE" >> ${CHROOT}/etc/make.conf

* pkg_info -f xjobs-20110730.tbz
Information for xjobs-20110730.tbz:

Packing list:
	Comment: PKG_FORMAT_REVISION:1.1
	Package name: xjobs-20110730
	Package origin: sysutils/xjobs
	CWD to /usr/local
File: bin/xjobs
	Comment: MD5:149c40759e9cf35d71691f5412d5057e
File: man/man1/xjobs.1.gz
	Comment: MD5:aefe511b9eab2187add56e82ccd08b1b
	UNEXEC 'rm -f %D/man/cat1/xjobs.1.gz %D/man/cat1/xjobs.1 %D/man/cat1/xjobs.1.gz %D/man/cat1/xjobs.1.gz.gz %D/man/cat1/xjobs.1.gz.bz2'
	Comment: Build details:  walrus.experts-exchange.com|8.2|8.2-dev|current-dev|Tue Nov  8 21:23:41 PST 2011

* The resulting +CONTENTS file from the installed package:
[jhelfman at dormouse /var/db/pkg]$ cd xjobs-20110730/
[jhelfman at dormouse /var/db/pkg/xjobs-20110730]$ cat ./+CONTENTS 
@comment PKG_FORMAT_REVISION:1.1
@name xjobs-20110730
@comment ORIGIN:sysutils/xjobs
@cwd /usr/local
bin/xjobs
@comment MD5:149c40759e9cf35d71691f5412d5057e
man/man1/xjobs.1.gz
@comment MD5:aefe511b9eab2187add56e82ccd08b1b
@unexec rm -f %D/man/cat1/xjobs.1.gz %D/man/cat1/xjobs.1 %D/man/cat1/xjobs.1.gz %D/man/cat1/xjobs.1.gz.gz %D/man/cat1/xjobs.1.gz.bz2
@comment Build details:  walrus.experts-exchange.com|8.2|8.2-dev|current-dev|Tue Nov  8 21:23:41 PST 2011

* Tinderbox package: http://jgh.devio.us/files/logs/xjobs-20110730.tbz
* Tinderbox log: http://jgh.devio.us/files/logs/xjobs-20110730.log

>Fix:

Index: ports/Mk/bsd.port.mk
===================================================================
RCS file: /home/jhelfman/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.698
diff -u -r1.698 bsd.port.mk
--- ports/Mk/bsd.port.mk	7 Nov 2011 12:44:42 -0000	1.698
+++ ports/Mk/bsd.port.mk	9 Nov 2011 05:31:26 -0000
@@ -4294,10 +4294,10 @@
 _INSTALL_SUSEQ= check-umask install-mtree pre-su-install \
 				pre-su-install-script create-users-groups do-install \
 				install-desktop-entries install-license install-rc-script \
-				post-install post-install-script add-plist-info \
-				add-plist-docs add-plist-examples add-plist-data \
-				add-plist-post fix-plist-sequence compress-man \
-				install-ldconfig-file fake-pkg security-check
+				post-install post-install-script add-plist-buildinfo \
+				add-plist-info add-plist-docs add-plist-examples \
+				add-plist-data add-plist-post fix-plist-sequence \
+				compress-man install-ldconfig-file fake-pkg security-check
 _PACKAGE_DEP=	install
 _PACKAGE_SEQ=	package-message pre-package pre-package-script \
 				do-package post-package-script
@@ -5761,6 +5761,13 @@
 .endif
 .endif
 
+.if defined(PACKAGE_BUILDING)
+.if !target(add-plist-buildinfo)
+add-plist-buildinfo:
+	@${ECHO_CMD} "@comment Build details:  ${BUILDHOST}|${JAIL}|${BUILD}|${PORTSTREE}|${BUILDDATE}" >> ${TMPPLIST}
+.endif
+.endif
+
 .if !target(add-plist-info)
 add-plist-info:
 # Process GNU INFO files at package install/deinstall time
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list