diff options
author | Jilles Tjoelker <jilles@FreeBSD.org> | 2011-10-04 22:28:06 +0000 |
---|---|---|
committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2011-10-04 22:28:06 +0000 |
commit | b77e3cbad16e0414fe448d1c50f9729b2b27919e (patch) | |
tree | a886d6eba88429014f7516d16264a7f1cfb92f89 /usr.sbin/portsnap | |
parent | df8d253fb40dac29d22bc4c329f3cce4554b84fb (diff) | |
download | src-b77e3cbad16e0414fe448d1c50f9729b2b27919e.tar.gz src-b77e3cbad16e0414fe448d1c50f9729b2b27919e.zip |
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
Notes
Notes:
svn path=/head/; revision=226028
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 60b20a0f8112..e715ce86984c 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 |