From 8846b36149af7edd96025192bcde0340fa395a80 Mon Sep 17 00:00:00 2001 From: spz Date: Sat, 27 Feb 2010 12:00:54 +0000 Subject: delete the summary and cache files in case the dir is writeable, but the file isn't (as suggested by bouyer@) fix typo in output message --- mk/scripts/binpkg-cache | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'mk/scripts') diff --git a/mk/scripts/binpkg-cache b/mk/scripts/binpkg-cache index cfdb37f3a92..3388d74e745 100755 --- a/mk/scripts/binpkg-cache +++ b/mk/scripts/binpkg-cache @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: binpkg-cache,v 1.17 2007/10/13 17:46:12 rillig Exp $ +# $NetBSD: binpkg-cache,v 1.18 2010/02/27 12:00:54 spz Exp $ # # Script for generating a cache file with information about # all binary packages contained in a directory. @@ -206,7 +206,7 @@ process_binpkg_dir(){ need_update=yes fi if test "${build_summary}" = "yes" -a ${d}/${summaryfile}.gz -ot ${d}/${cachefile} ; then - echo "${tab}Summary file ${d}/${summaryfile}.gz is out of date and will be regnerated." + echo "${tab}Summary file ${d}/${summaryfile}.gz is out of date and will be regenerated." need_update=yes fi @@ -238,6 +238,9 @@ process_binpkg_dir(){ fi echo "pkgcache_end ${fn}" >> ${tmpd}/${cachefile} done + if test -f ${d}/${cachefile} ; then + rm -f ${d}/${cachefile} + fi mv -f ${tmpd}/${cachefile} ${d}/${cachefile} if test $? -ne 0 ; then echo "********** WARNING **********" @@ -249,6 +252,9 @@ process_binpkg_dir(){ fi if test "${build_summary}" = "yes" ; then + if test -f ${d}/${summaryfile}.gz ; then + rm -f ${d}/${summaryfile}.gz + fi cat ${tmpd}/${summaryfile} | ${GZIP_CMD} > ${d}/${summaryfile}.gz if test $? -ne 0 ; then echo "********** WARNING **********" -- cgit v1.2.3