Date: Sat, 29 Jul 2006 14:11:04 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 102722 for review Message-ID: <200607291411.k6TEB4mC002030@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=102722 Change 102722 by gabor@gabor_spitfire on 2006/07/29 14:10:55 Use brackets {} around variables when referencing to them as suggested by sh(1). Affected files ... .. //depot/projects/soc2006/gabor_ports/Tools/scripts/do-fetch.sh#12 edit Differences ... ==== //depot/projects/soc2006/gabor_ports/Tools/scripts/do-fetch.sh#12 (text+ko) ==== @@ -177,34 +177,34 @@ done for _file in ${DISTFILES}; do - file= `${ECHO_CMD} $_file | ${SED} -E -e 's/:[^:]+$//'` + file= `${ECHO_CMD} ${_file} | ${SED} -E -e 's/:[^:]+$//'` select= `${ECHO_CMD} ${_file#${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` force_fetch= false - filebasename= `${BASENAME} $file` + filebasename= `${BASENAME} ${file}` for afile in ${FORCE_FETCH}; do - afile=`${BASENAME} $afile` - if [ "x$afile" = "x$filebasename" ]; then + afile=`${BASENAME} ${afile}` + if [ "x${afile}" = "x${filebasename}" ]; then force_fetch= true fi done - if [ ! -f $file -a ! -f $filebasename -o "$force_fetch" = "true" ]; then + if [ ! -f ${file} -a ! -f ${filebasename} -o "${force_fetch}" = "true" ]; then DIR= ${DIST_SUBDIR} - pattern= "${DIR:+$DIR/}`${ECHO_CMD} $file | ${SED} -e 's/\./\\\\./g'`" - if [ -L $file -o -L $filebasename ]; then - ${ECHO_MSG} "=> ${_DISTDIR}/$file is a broken symlink." + pattern= "${DIR:+$DIR/}`${ECHO_CMD} ${file} | ${SED} -e 's/\./\\\\./g'`" + if [ -L ${file} -o -L ${filebasename} ]; then + ${ECHO_MSG} "=> ${_DISTDIR}/${file} is a broken symlink." ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?" ${ECHO_MSG} "=> Please correct this problem and try again." exit 1 fi if [ -f ${MD5_FILE} -a "x${NO_CHECKSUM}" = "x" ]; then if ! ${GREP} -q "^MD5 ($pattern)" ${MD5_FILE}; then - ${ECHO_MSG} "=> ${DIR:+$DIR/}$file is not in ${MD5_FILE}." + ${ECHO_MSG} "=> ${DIR:+$DIR/}${file} is not in ${MD5_FILE}." ${ECHO_MSG} "=> Either ${MD5_FILE} is out of date, or" - ${ECHO_MSG} "=> ${DIR:+$DIR/}$file is spelled incorrectly." + ${ECHO_MSG} "=> ${DIR:+$DIR/}${file} is spelled incorrectly." exit 1 fi fi - ${ECHO_MSG} "=> $file doesn't seem to exist in ${_DISTDIR}." + ${ECHO_MSG} "=> ${file} doesn't seem to exist in ${_DISTDIR}." if [ ! -w ${DISTDIR} ]; then ${ECHO_MSG} "=> ${DISTDIR} is not writable by you; cannot fetch." exit 1 @@ -225,7 +225,7 @@ for site in `eval $SORTED_MASTER_SITES_CMD_TMP ${_RANDOMIZE_SITES}`; do ${ECHO_MSG} "=> Attempting to fetch from ${site}." DIR= ${DIST_SUBDIR} - CKSIZE= `${GREP} "^SIZE (${DIR:+$DIR/}$file)" ${MD5_FILE} | ${AWK} '{print $4}'` + CKSIZE= `${GREP} "^SIZE (${DIR:+$DIR/}${file})" ${MD5_FILE} | ${AWK} '{print $4}'` case ${file} in */*) ${MKDIR} ${file%/*}; \ @@ -359,19 +359,19 @@ cd ${_DISTDIR} for _file in ${PATCHFILES}; do - file= `${ECHO_CMD} $_file | ${SED} -E -e 's/:[^:]+$$//'` + file= `${ECHO_CMD} ${_file} | ${SED} -E -e 's/:[^:]+$$//'` select= `${ECHO_CMD} ${_file#${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` force_fetch= false - filebasename= `${BASENAME} $file` + filebasename= `${BASENAME} ${file}` for afile in ${FORCE_FETCH}; do - afile= `${BASENAME} $afile` - if [ "x$afile" = "x$filebasename" ]; then - force_fetch =true + afile= `${BASENAME} ${afile}` + if [ "x${afile}" = "x${filebasename}" ]; then + force_fetch= true fi done - if [ ! -f $file -a ! -f $filebasename -o "$force_fetch" = "true" ]; then - if [ -L $file -o -L `${BASENAME} $file` ]; then - ${ECHO_MSG} "=> ${_DISTDIR}/$file is a broken symlink." + if [ ! -f ${file} -a ! -f ${filebasename} -o "${force_fetch}" = "true" ]; then + if [ -L ${file} -o -L `${BASENAME} ${file}` ]; then + ${ECHO_MSG} "=> ${_DISTDIR}/${file} is a broken symlink." ${ECHO_MSG} "=> Perhaps a filesystem (most likely a CD) isn't mounted?" ${ECHO_MSG} "=> Please correct this problem and try again." exit 1 @@ -379,7 +379,7 @@ ${ECHO_MSG} "=> $file doesn't seem to exist in ${_DISTDIR}." if [ ! -z "${select}" ] ; then __PATCH_SITES_TMP= - for group in $select; do + for group in ${select}; do if [ ! -z $${_PATCH_SITES_${group}} ] ; then eval ___PATCH_SITES_TMP= "$${_PATCH_SITES_${group}}" __PATCH_SITES_TMP= "${__PATCH_SITES_TMP} ${___PATCH_SITES_TMP}" @@ -393,8 +393,8 @@ for site in `eval $SORTED_PATCH_SITES_CMD_TMP`; do ${ECHO_MSG} "=> Attempting to fetch from ${site}." DIR= ${DIST_SUBDIR} - pattern= "${DIR:+$DIR/}`${ECHO_CMD} $file | ${SED} -e 's/\./\\\\./g'`" - CKSIZE= `${GREP} "^SIZE ($pattern)" ${MD5_FILE} | ${AWK} '{print $4}'` + pattern= "${DIR:+$DIR/}`${ECHO_CMD} ${file} | ${SED} -e 's/\./\\\\./g'`" + CKSIZE= `${GREP} "^SIZE (${pattern})" ${MD5_FILE} | ${AWK} '{print $4}'` case ${file} in */*) ${MKDIR} ${file%/*}; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607291411.k6TEB4mC002030>