summaryrefslogtreecommitdiff
path: root/mk/scripts
diff options
context:
space:
mode:
authorspz <spz>2010-02-27 12:00:54 +0000
committerspz <spz>2010-02-27 12:00:54 +0000
commit8846b36149af7edd96025192bcde0340fa395a80 (patch)
treec4f935129c50146f6563cff4ffd84316aa2aa7b0 /mk/scripts
parentac8627bed1a3f09651b457bce22e41c023339a47 (diff)
downloadpkgsrc-8846b36149af7edd96025192bcde0340fa395a80.tar.gz
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
Diffstat (limited to 'mk/scripts')
-rwxr-xr-xmk/scripts/binpkg-cache10
1 files changed, 8 insertions, 2 deletions
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 **********"