From owner-svn-src-head@FreeBSD.ORG Wed Oct 24 12:49:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C5297B3; Wed, 24 Oct 2012 12:49:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6966E8FC0C; Wed, 24 Oct 2012 12:49:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9OCn4DX016487; Wed, 24 Oct 2012 12:49:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OCn4ng016485; Wed, 24 Oct 2012 12:49:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201210241249.q9OCn4ng016485@svn.freebsd.org> From: Eitan Adler Date: Wed, 24 Oct 2012 12:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241999 - head/usr.sbin/portsnap/portsnap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 12:49:04 -0000 Author: eadler Date: Wed Oct 24 12:49:03 2012 New Revision: 241999 URL: http://svn.freebsd.org/changeset/base/241999 Log: Avoid changing IFS in a global context as this can sometimes cause errors later on. PR: bin/172715 Submitted by: Matthew D.Fuller (older version) Submitted by: dteske Approved 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 Wed Oct 24 10:44:07 2012 (r241998) +++ head/usr.sbin/portsnap/portsnap/portsnap.sh Wed Oct 24 12:49:03 2012 (r241999) @@ -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 }