svn commit: r226312 - stable/9/usr.sbin/portsnap/portsnap
Jilles Tjoelker
jilles at FreeBSD.org
Wed Oct 12 17:57:58 UTC 2011
Author: jilles
Date: Wed Oct 12 17:57:57 2011
New Revision: 226312
URL: http://svn.freebsd.org/changeset/base/226312
Log:
MFC r226028: portsnap: Detect error immediately if we can't fetch the
snapshot metadata.
Also add some quotes around command substitution where useful and possible.
Approved by: re (kib)
Modified:
stable/9/usr.sbin/portsnap/portsnap/portsnap.sh
Directory Properties:
stable/9/usr.sbin/portsnap/ (props changed)
Modified: stable/9/usr.sbin/portsnap/portsnap/portsnap.sh
==============================================================================
--- stable/9/usr.sbin/portsnap/portsnap/portsnap.sh Wed Oct 12 17:47:15 2011 (r226311)
+++ stable/9/usr.sbin/portsnap/portsnap/portsnap.sh Wed Oct 12 17:57:57 2011 (r226312)
@@ -536,9 +536,9 @@ fetch_metadata() {
rm -f ${SNAPSHOTHASH} tINDEX.new
echo ${NDEBUG} "Fetching snapshot metadata... "
- fetch ${QUIETFLAG} http://${SERVERNAME}/t/${SNAPSHOTHASH}
+ fetch ${QUIETFLAG} http://${SERVERNAME}/t/${SNAPSHOTHASH} \
2>${QUIETREDIR} || return
- if [ `${SHA256} -q ${SNAPSHOTHASH}` != ${SNAPSHOTHASH} ]; then
+ if [ "`${SHA256} -q ${SNAPSHOTHASH}`" != ${SNAPSHOTHASH} ]; then
echo "snapshot metadata corrupt."
return 1
fi
@@ -606,7 +606,7 @@ fetch_index_sanity() {
# Verify a list of files
fetch_snapshot_verify() {
while read F; do
- if [ `gunzip -c snap/${F} | ${SHA256} -q` != ${F} ]; then
+ if [ "`gunzip -c snap/${F} | ${SHA256} -q`" != ${F} ]; then
echo "snapshot corrupt."
return 1
fi
More information about the svn-src-stable-9
mailing list