From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 15 16:30:02 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23297DEA for ; Mon, 15 Oct 2012 16:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id EBE878FC1B for ; Mon, 15 Oct 2012 16:30:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9FGU1N1037067 for ; Mon, 15 Oct 2012 16:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9FGU106037066; Mon, 15 Oct 2012 16:30:01 GMT (envelope-from gnats) Resent-Date: Mon, 15 Oct 2012 16:30:01 GMT Resent-Message-Id: <201210151630.q9FGU106037066@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Matthew D.Fuller" Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DE87AC1 for ; Mon, 15 Oct 2012 16:25:50 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from thyme.infocus-llc.com (server.infocus-llc.com [206.156.254.44]) by mx1.freebsd.org (Postfix) with ESMTP id E6E448FC0C for ; Mon, 15 Oct 2012 16:25:49 +0000 (UTC) Received: from draco.over-yonder.net (c-174-50-4-38.hsd1.ms.comcast.net [174.50.4.38]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by thyme.infocus-llc.com (Postfix) with ESMTPSA id E65E437B4AC for ; Mon, 15 Oct 2012 11:20:28 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3XgPyN12HfzWh5; Mon, 15 Oct 2012 11:20:28 -0500 (CDT) Message-Id: <3XgPyN12HfzWh5@draco.over-yonder.net> Date: Mon, 15 Oct 2012 11:20:28 -0500 (CDT) From: "Matthew D.Fuller" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/172715: [PATCH] Fix portsnap's INDEX building X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "Matthew D.Fuller" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 16:30:02 -0000 >Number: 172715 >Category: bin >Synopsis: [PATCH] Fix portsnap's INDEX building >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 15 16:30:01 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Matthew D. Fuller >Release: FreeBSD 9.0-STABLE amd64 >Organization: >Environment: System: FreeBSD draco.over-yonder.net 9.0-STABLE FreeBSD 9.0-STABLE #0 r237357: Thu Jun 21 01:21:37 CDT 2012 root@draco.over-yonder.net:/usr/obj/usr/src/sys/DRACO amd64 >Description: In r227483, portsnap.sh was changed to use $IFS in several places rather than calling out to cut(1) to split things up by '|'. However, in several places, this was done around a block by "IFS='|'" prior and "IFS=" after, which has the result of leaving IFS set to the empty string after the fact. This causes an error when extract_indices() is called after some of the fetch functions (as will happen when you run a `portsnap fetch update`) that looks like: Building new INDEX files... DESCRIBE.7 INDEX-8 not provided by portsnap server; INDEX-7 not being generated. To properly return to default behavior, IFS needs to be unset, not set to empty. Changes tested via 'extract' and 'fetch update'. >How-To-Repeat: >Fix: Index: portsnap.sh =================================================================== --- portsnap.sh (revision 241541) +++ portsnap.sh (working copy) @@ -587,7 +587,7 @@ # 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 @@ echo "${X}|${Y}" done echo "" 1>${QUIETREDIR} - IFS= } # Print user-friendly progress statistics @@ -725,7 +724,7 @@ fi rm -f diff OLD NEW ${X}-${Y}.gz ptmp done < patchlist 2>${QUIETREDIR} - IFS= + unset IFS echo "done." # Update metadata without patches @@ -810,7 +809,7 @@ fi rm -f diff OLD NEW ${X}-${Y} done < patchlist 2>${QUIETREDIR} - IFS= + unset IFS echo "done." # Update ports without patches @@ -948,6 +947,8 @@ return 0; fi + unset IFS + extract_metadata extract_indices } >Release-Note: >Audit-Trail: >Unformatted: