svn commit: r226028 - head/usr.sbin/portsnap/portsnap

Jilles Tjoelker jilles at FreeBSD.org
Tue Oct 4 22:28:07 UTC 2011


Author: jilles
Date: Tue Oct  4 22:28:06 2011
New Revision: 226028
URL: http://svn.freebsd.org/changeset/base/226028

Log:
  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

Modified:
  head/usr.sbin/portsnap/portsnap/portsnap.sh

Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh
==============================================================================
--- head/usr.sbin/portsnap/portsnap/portsnap.sh	Tue Oct  4 22:23:00 2011	(r226027)
+++ head/usr.sbin/portsnap/portsnap/portsnap.sh	Tue Oct  4 22:28:06 2011	(r226028)
@@ -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-head mailing list