diff options
author | eadler <eadler@FreeBSD.org> | 2012-10-24 12:49:03 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2012-10-24 12:49:03 +0000 |
commit | ece1c03fda91811c054ca411badfb27091d4ebf9 (patch) | |
tree | bdcc5adcb326164da522fe01f091b9525a86fab6 /usr.sbin/portsnap | |
parent | 4148eda911072de3dfcf59cb053a4b803f89c743 (diff) | |
download | FreeBSD-src-ece1c03fda91811c054ca411badfb27091d4ebf9.zip FreeBSD-src-ece1c03fda91811c054ca411badfb27091d4ebf9.tar.gz |
Avoid changing IFS in a global context as this can sometimes cause
errors later on.
PR: bin/172715
Submitted by: Matthew D.Fuller <fullermd@over-yonder.net> (older
version)
Submitted by: dteske
Approved by: cperciva
MFC after: 1 week
Diffstat (limited to 'usr.sbin/portsnap')
-rw-r--r-- | usr.sbin/portsnap/portsnap/portsnap.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh index 8071820..ed9c28d 100644 --- a/usr.sbin/portsnap/portsnap/portsnap.sh +++ b/usr.sbin/portsnap/portsnap/portsnap.sh @@ -587,7 +587,7 @@ fetch_metadata_sanity() { # Take a list of ${oldhash}|${newhash} and output a list of needed patches fetch_make_patchlist() { - IFS='|' + local IFS='|' echo "" 1>${QUIETREDIR} grep -vE "^([0-9a-f]{64})\|\1$" | while read X Y; do @@ -596,7 +596,6 @@ fetch_make_patchlist() { echo "${X}|${Y}" done echo "" 1>${QUIETREDIR} - IFS= } # Print user-friendly progress statistics @@ -711,7 +710,7 @@ fetch_update() { # Attempt to apply metadata patches echo -n "Applying metadata patches... " - IFS='|' + local oldifs="$IFS" IFS='|' while read X Y; do if [ ! -f "${X}-${Y}.gz" ]; then continue; fi gunzip -c < ${X}-${Y}.gz > diff @@ -725,7 +724,7 @@ fetch_update() { fi rm -f diff OLD NEW ${X}-${Y}.gz ptmp done < patchlist 2>${QUIETREDIR} - IFS= + IFS="$oldifs" echo "done." # Update metadata without patches @@ -792,7 +791,7 @@ fetch_update() { # Attempt to apply ports patches PATCHCNT=`wc -l patchlist` echo "Applying patches... " - IFS='|' + local oldifs="$IFS" IFS='|' I=0 while read X Y; do I=$(($I + 1)) @@ -810,7 +809,7 @@ fetch_update() { fi rm -f diff OLD NEW ${X}-${Y} done < patchlist 2>${QUIETREDIR} - IFS= + IFS="$oldifs" echo "done." # Update ports without patches @@ -912,7 +911,7 @@ extract_metadata() { # Do the actual work involved in "extract" extract_run() { - local IFS='|' + local oldifs="$IFS" IFS='|' mkdir -p ${PORTSDIR} || return 1 if ! @@ -948,6 +947,8 @@ extract_run() { return 0; fi + IFS="$oldifs" + extract_metadata extract_indices } |