Thursday, January 24, 2008

A live binutils ebuild

I have written a live binutils ebuild.
It is now in my loongson overlay.
I wrote it because binutils cvs already got loongson 2e and 2f support, but new version is not released yet.
The ebuild itself is quite simple, thanks to cvs.eclass and toolchain.eclass.
However, in order to make it really work, I have to modify cvs.eclass.
The reason is:
The checked out directory name of binutils is called "src". While cvs.eclass expects the checked out directory name is the same as the package name, i.e. "binutils". Unfortunately, "co -d binutils binutils" doesn't work. If I use "co -d binutils binutils", I can only checked out the "binutils" directory, while the actual binutils module contains more than that.

So, the most straight forward way to solve this would be to "mv src binutils" after checking it out, and this was exactly what I did.

I need a new variable name to hold "src". I call it ECVS_CO_DIR.

Some other things to pay attention to:
If the initial check out were interrupted, I have to remove the whole "src" directory and start over again. "update" command must not have -dP augument, otherwise directories not in binutils module will also be checked out. ECVS_LOCALNAME and ECVS_CO_DIR can't both be set in ebuild, since that does not make sense. By design ECVS_LOCALNAME is used when the server allow -d augument of co, while ECVS_CO_DIR is used when -d is not allowed.

So here is the patch:
http://xrl.us/ber83 (Link to www.gentoo-cn.org)

I will contact vapier soon, and see if this could be merged to cvs.eclass in tree.

Labels: , , ,

Saturday, January 05, 2008

Share /usr/portage via NFS

Recently I have tried sharing /usr/portage among several boxes via NFS after I've read http://www.gentoo.org/proj/en/portage/doc/faq.xml.
I followed portage's manpage, created /etc/portage/modules on nfs client
$ cat /etc/portage/modules
portdbapi.auxdbmodule = cache.metadata_overlay.database
And removed all cache files under /var/cache/edb/dep/usr/portage
So that I don't need to run emerge --metadata on nfs client after emerge --sync.

It is not over yet for eix users. If you have a $HOME/.eixrc and defines in it PORTDIR_CACHE_METHOD as something like "portage-2.1"/"cdb"/"sqlite"(check man eix), you may want to remove the ~/.eixrc file. Since those methods requires you to run emerge --metadata before update-eix, and thus defeat our purpose in the first place.