Subject: Re: creating pkg_summary after each bulk build
To: Hubert Feyrer <hubert@feyrer.de>
From: Dieter Baron <dillo@danbala.tuwien.ac.at>
List: tech-pkg
Date: 03/25/2007 14:43:27
--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hi,

> >: The patche below is intended to change this. I cannot test it though.
> >: Any comments? Commit? Objections?
> >
> > Looks good, I'll test it on my next bulk build.
> 
> The patch below is updated to include the version check to make sure 
> pkg_info is new enough to have -X.
> 
> Please let me know if your bulk build produced a proper pkg_summary file.
> I'll wait until your OK before I commit the patch.

  A fixed version of your patch is attached (you used variables not
defined in build).

					yours,
					dillo

--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="summary.diff"

Index: build
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bulk/build,v
retrieving revision 1.101
diff -u -r1.101 build
--- build	7 Mar 2007 23:32:49 -0000	1.101
+++ build	25 Mar 2007 12:40:34 -0000
@@ -128,6 +128,21 @@
 	done
 
 	#
+	# Create pkg_summary file
+	#
+	if [ "${MKSUMMARY-}" = "yes" -o "${MKSUMMARY-}" = "YES" ]; then
+		echo "build> Creating summary file..."
+		if [ `pkg_info -V` -lt 20060424 ]
+		then
+			echo "build> your pkg_info is too old, skipping."
+		else
+			(cd "${PACKAGES}/All" \
+				&& ls -t | grep '\.t[gb]z$' | while read n; do pkg_info -X "$n"; done) \
+			| ${GZIP_CMD} > "${PACKAGES}"/All/pkg_summary.gz
+		fi
+	fi
+
+	#
 	# Generate the post-build report.
 	#
 	echo "build> Generating the bulk build report..."
@@ -257,9 +272,9 @@
 		SUPPORTSFILE BULK_BUILD_ID_FILE BUILDLOG BROKENFILE
 		BROKENWRKLOG
 		AWK GREP MAIL_CMD MKDIR PERL5 SED
-		PKG_DELETE PKG_INFO PKGBASE"
+		PKG_DELETE PKG_INFO PKGBASE PACKAGES GZIP_CMD"
 
-	values=`cd "$pkglint_dir" && $BMAKE show-vars VARNAMES="$vars" USE_TOOLS="awk grep mail mkdir perl sed"`
+	values=`cd "$pkglint_dir" && $BMAKE show-vars VARNAMES="$vars" USE_TOOLS="awk grep mail mkdir perl sed gzip"`
 
 	for v in $vars; do
 		eval "read $v" || die "Could not read value for $v"
Index: upload
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bulk/upload,v
retrieving revision 1.37
diff -u -r1.37 upload
--- upload	15 Dec 2006 13:15:06 -0000	1.37
+++ upload	25 Mar 2007 12:40:34 -0000
@@ -197,7 +197,6 @@
 pkgsrcdir=`cd pkgtools/pkglint ; ${BMAKE} show-var VARNAME=_PKGSRCDIR`
 packages=`cd pkgtools/pkglint ; ${BMAKE} show-var VARNAME=PACKAGES`
 distdir=`cd pkgtools/pkglint ; ${BMAKE} show-var VARNAME=DISTDIR`
-gzip_cmd=`cd pkgtools/pkglint; ${BMAKE} show-var VARNAME=GZIP_CMD USE_TOOLS=gzip`
 pkg_info=`cd pkgtools/pkglint && ${BMAKE} show-var VARNAME=PKG_INFO`
 
 # Pull in some pkgs needed
@@ -291,13 +290,6 @@
 	fi
 fi
 
-if [ "${MKSUMMARY-}" = "yes" -o "${MKSUMMARY-}" = "YES" ]; then
-	echo "upload> Creating summary file..."
-	(cd "${packages}/All" \
-		&& ls -t | grep '\.t[gb]z$' | while read n; do pkg_info -X "$n"; done) \
-		| ${gzip_cmd} > "${packages}"/All/pkg_summary.gz
-fi
-
 cat <<EOF > "$upload_general"
 #! /bin/sh
 set -e

--k+w/mQv8wyuph6w0--