diff options
author | jilles <jilles@FreeBSD.org> | 2011-10-04 22:28:06 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-10-04 22:28:06 +0000 |
commit | 56aec0668314696fdcc68977b39589825c74efd3 (patch) | |
tree | a886d6eba88429014f7516d16264a7f1cfb92f89 /usr.sbin/portsnap | |
parent | 943e8837f549e88b65ea32d48427753e05e6a31a (diff) | |
download | FreeBSD-src-56aec0668314696fdcc68977b39589825c74efd3.zip FreeBSD-src-56aec0668314696fdcc68977b39589825c74efd3.tar.gz |
portsnap: Detect error immediately if we can't fetch the snapshot metadata.
Also add some quotes around command substitution where useful and possible.
Reviewed by: cperciva
MFC after: 1 week
Diffstat (limited to 'usr.sbin/portsnap')
-rw-r--r-- | usr.sbin/portsnap/portsnap/portsnap.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh index 60b20a0..e715ce8 100644 --- a/usr.sbin/portsnap/portsnap/portsnap.sh +++ b/usr.sbin/portsnap/portsnap/portsnap.sh @@ -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 |