Subject: Re: creating pkg_summary after each bulk build
To: Dieter Baron <dillo@danbala.tuwien.ac.at>
From: Hubert Feyrer <hubert@feyrer.de>
List: tech-pkg
Date: 03/21/2007 01:03:28
On Sat, 17 Mar 2007, Dieter Baron wrote:
> : 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.


  - Hubert

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	21 Mar 2007 00:01:18 -0000
@@ -128,6 +128,21 @@
  	done

  	#
+	# Create pkg_summary file
+	#
+	if [ "${MKSUMMARY-}" = "yes" -o "${MKSUMMARY-}" = "YES" ]; then
+		echo "upload> Creating summary file..."
+		if [ `pkg_info -V` -lt 20060424 ]
+		then
+			echo "upload> 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..."
Index: build.conf-example
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bulk/build.conf-example,v
retrieving revision 1.37
diff -u -r1.37 build.conf-example
--- build.conf-example	6 Mar 2007 10:57:11 -0000	1.37
+++ build.conf-example	21 Mar 2007 00:01:18 -0000
@@ -91,7 +91,7 @@
  MKSUMS=yes

  # Whether or not to create the summary file.
-MKSUMMARY=no
+MKSUMMARY=yes

  # If you want to PGP sign the checksum files, set and correct.
  #SIGN_AS=username@NetBSD.org
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	21 Mar 2007 00:01:18 -0000
@@ -291,13 +291,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