[PATCH] Fix portsdb -Uu when INDEXDIR != abs_ports_dir
Bill Brinzer
brinzer at mfrac.com
Fri Jun 24 21:03:45 UTC 2011
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
More information about the freebsd-ruby
mailing list