From 8df013cd6fc08441dc9c0f5b087311df7d131e11 Mon Sep 17 00:00:00 2001 From: spz Date: Fri, 12 Mar 2010 20:19:15 +0000 Subject: update pkg_summary.bz2 files if existing (and the pkg_summary.gz gets updated) --- mk/scripts/binpkg-cache | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'mk') diff --git a/mk/scripts/binpkg-cache b/mk/scripts/binpkg-cache index 3388d74e745..5fab4008066 100755 --- a/mk/scripts/binpkg-cache +++ b/mk/scripts/binpkg-cache @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: binpkg-cache,v 1.18 2010/02/27 12:00:54 spz Exp $ +# $NetBSD: binpkg-cache,v 1.19 2010/03/12 20:19:15 spz Exp $ # # Script for generating a cache file with information about # all binary packages contained in a directory. @@ -48,6 +48,7 @@ CMP=${CMP:-cmp} FIND=${FIND:-find} GREP=${GREP:-grep} GZIP_CMD=${GZIP_CMD:-gzip} +BZIP2=${BZIP2:-bzip2} PKG_INFO=${PKG_INFO:-pkg_info} PKG_SUFX=${PKG_SUFX:-.tgz} SED=${SED:-sed} @@ -263,6 +264,17 @@ process_binpkg_dir(){ echo "********** WARNING **********" return fi + # if it's there, update it, otherwise don't bother + if test -f ${d}/${summaryfile}.bz2 ; then + cat ${tmpd}/${summaryfile} | ${BZIP2} > ${d}/${summaryfile}.bz2 + if test $? -ne 0 ; then + echo "********** WARNING **********" + echo "${BZIP2} of ${tmpd}/${summaryfile} to ${d}/${summaryfile}.bz2 failed!" + echo "Perhaps you do not have write permissions to ${d}?" + echo "********** WARNING **********" + return + fi + fi fi fi -- cgit v1.2.3