Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jun 2011 16:44:01 -0400
From:      Bill Brinzer <brinzer@mfrac.com>
To:        freebsd-ruby@freebsd.org
Subject:   [PATCH] Fix portsdb -Uu when INDEXDIR != abs_ports_dir
Message-ID:  <20110624204401.GA49187@fire.mfrac.vpn>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110624204401.GA49187>