From owner-freebsd-ruby@FreeBSD.ORG Fri Jun 24 21:03:45 2011 Return-Path: Delivered-To: freebsd-ruby@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 511D91065677 for ; Fri, 24 Jun 2011 21:03:45 +0000 (UTC) (envelope-from brinzer@mfrac.com) Received: from email.mfrac.com (email.mfrac.com [74.1.169.10]) by mx1.freebsd.org (Postfix) with ESMTP id 0964B8FC1C for ; Fri, 24 Jun 2011 21:03:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by email.mfrac.com (Postfix) with ESMTP id 6BB9A1CC7A; Fri, 24 Jun 2011 16:44:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mfrac.com; h= user-agent:content-disposition:content-type:content-type :mime-version:message-id:subject:subject:from:from:date:date :received:received; s=alpha; t=1308948241; bh=igdo9pyTo/FCyOU+Wi 7nuC4OfWZ+iBqBkwqaXCR+GNo=; b=sKkA42WfLamQGaJESlZ804XlYb7yFzfh2V grwzxsKVztLhHYRN4sNxynGOGEiK44yd0zz6SJNwYDFRR8G/RMyd0owApbHV3U7F MjTFjWmsKEQsmw/H/FszCAEdHQrNxg X-Virus-Scanned: amavisd-new at mfrac.com Received: from email.mfrac.com ([127.0.0.1]) by localhost (email.mfrac.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id drI0ao21efGn; Fri, 24 Jun 2011 16:44:01 -0400 (EDT) Received: by email.mfrac.com (Postfix, from userid 1002) id A00771CC6C; Fri, 24 Jun 2011 16:44:01 -0400 (EDT) Date: Fri, 24 Jun 2011 16:44:01 -0400 From: Bill Brinzer To: freebsd-ruby@freebsd.org Message-ID: <20110624204401.GA49187@fire.mfrac.vpn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [PATCH] Fix portsdb -Uu when INDEXDIR != abs_ports_dir X-BeenThere: freebsd-ruby@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Ruby discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 21:03:45 -0000 Hi, My apologies if this is the wrong list for this post. First some background information: I am sharing /usr/ports and a couple of different collections of locally built packages (various permutations of FreeBSD 7.x, 8.x, i386, and amd64) across NFS. Packages are going into /usr/packages/OS_MAJOR (e.g., /usr/packages/7), with a corresponding INDEX-OS_MAJOR (INDEX-7, INDEX-8, etc. file) also under /usr/packages/OS_MAJOR. I am maintaining everything with ports-mgmt/portupgrade. I have all kinds of variables (PORTS_INDEX, PORTS_DBDIR, INDEXDIR, DISTDIR, WRKDIRPREFIX, etc.) set in my pkgtools.conf and /etc/make.conf. Everything is running smoothly... ...except for portsdb -Uu. (portsdb -Fu works fine but I have locally maintained ports that I want to include in the INDEX.) Example: > $ portsdb -Uu > Updating the ports index ... Generating INDEX.tmp - please wait. > (snip) > Done. > mv: INDEX.tmp: No such file or directory > failed to generate INDEX! > portsdb: index generation error I traced this down to portsdb.rb where the code appears to be assuming that "make INDEXFILE=INDEX.tmp index" generates INDEX.tmp in the abs_ports_dir. The following 1-line patch fixes portsdb -Uu for me: --- portsdb.rb.orig 2011-06-24 14:27:08.000000000 -0400 +++ portsdb.rb 2011-06-24 14:27:37.000000000 -0400 @@ -404,7 +404,7 @@ if fetch system "cd #{abs_ports_dir} && make fetchindex && cp $(make -V INDEXDIR)/$(make -V INDEXFILE) #{tmp}" else - system "cd #{abs_ports_dir} && make INDEXFILE=INDEX.tmp index && mv INDEX.tmp #{tmp}" + system "cd #{abs_ports_dir} && make INDEXFILE=INDEX.tmp index && mv $(make -V INDEXDIR)/INDEX.tmp #{tmp}" end if File.zero?(tmp) Shall I file a PR for this? Thanks for your attention, Bill Brinzer