summaryrefslogtreecommitdiff
path: root/mk/scripts
diff options
context:
space:
mode:
authordmcmahill <dmcmahill>2005-05-19 03:58:40 +0000
committerdmcmahill <dmcmahill>2005-05-19 03:58:40 +0000
commit83c3a8966c2813ee014bcf73e1c027aabd6cfafb (patch)
tree07cefed56805608c016ae30524c401f0d82f7d89 /mk/scripts
parente1a1ea0bc81060c561ff8b8b0e6dad857f20216e (diff)
downloadpkgsrc-83c3a8966c2813ee014bcf73e1c027aabd6cfafb.tar.gz
- if the mv of the temporary cache file to the real one fails, usually
due to a directory permissions error, then error out. - when the master cache has just been newly created, don't also report that the master cache is up to date. Both were suggested by Christian Hattemer.
Diffstat (limited to 'mk/scripts')
-rwxr-xr-xmk/scripts/binpkg-cache22
1 files changed, 18 insertions, 4 deletions
diff --git a/mk/scripts/binpkg-cache b/mk/scripts/binpkg-cache
index 79ed68eb0db..a8a4587f82d 100755
--- a/mk/scripts/binpkg-cache
+++ b/mk/scripts/binpkg-cache
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: binpkg-cache,v 1.1 2005/05/17 21:46:59 dmcmahill Exp $
+# $NetBSD: binpkg-cache,v 1.2 2005/05/19 03:58:40 dmcmahill Exp $
#
# Script for generating a cache file with information about
# all binary packages contained in a directory.
@@ -191,6 +191,11 @@ process_binpkg_dir(){
echo "pkgcache_end ${fn}" >> ${tmpd}/${cachefile}
done
mv ${tmpd}/${cachefile} ${d}/${cachefile}
+ if test $? -ne 0 ; then
+ echo "move of ${tmpd}/${cachefile} to ${d}/${cachefile} failed!"
+ echo "Perhaps you do not have write permissions to ${d}?"
+ clean_and_exit1
+ fi
fi
@@ -206,13 +211,22 @@ process_cache_files(){
fi
if test ! -f ${PACKAGES}/${cachefile} ; then
echo "${tab}Creating master cache file ${PACKAGES}/${cachefile}"
- cp ${tmpd}/${cachefile} ${PACKAGES}/${cachefile}
- fi
- if ${CMP} -s ${tmpd}/${cachefile} ${PACKAGES}/${cachefile} ; then
+ mv ${tmpd}/${cachefile} ${PACKAGES}/${cachefile}
+ if test $? -ne 0 ; then
+ echo "move of ${tmpd}/${cachefile} to ${PACKAGES}/${cachefile} failed!"
+ echo "Perhaps you do not have write permissions to ${PACKAGES}?"
+ clean_and_exit1
+ fi
+ elif ${CMP} -s ${tmpd}/${cachefile} ${PACKAGES}/${cachefile} ; then
echo "${tab}Master cache file ${PACKAGES}/${cachefile} is up to date"
else
echo "${tab}Updating master cache file ${PACKAGES}/${cachefile}"
mv ${tmpd}/${cachefile} ${PACKAGES}/${cachefile}
+ if test $? -ne 0 ; then
+ echo "move of ${tmpd}/${cachefile} to ${PACKAGES}/${cachefile} failed!"
+ echo "Perhaps you do not have write permissions to ${PACKAGES}?"
+ clean_and_exit1
+ fi
fi
}