Search:  
Gentoo Wiki

Skipping_fetch_for_CVS_packages

Contents

Introduction

Portage includes a number of packages which get their source directly from a CVS repository, rather than by downloading a tarball. Occaisionally you may have the need to re-compile these packages without fetching the latest source (because you have no internet access for example).

This tip will show you how to emerge a CVS sourced package without fetching the source.

All the examples below user the rt2x00-9999 package as an example.

Downloading the package

Using another Gentoo installation

If you have another Gentoo machine connected to the net, you can use that and simply emerge the package, then abort the command by pressing CTRL+C (at the same time) when you see the line that reads >>> Source unpacked.: ACCEPT_KEYWORDS="~x86" emerge =rt2x00-9999

WARNING: Do not press CTRL+C after the line >>> Merging net-wireless/rt2x00-9999 to / appears. Let the package finish installing, then uninstall it: emerge -C =rt2x00-9999

It's safe to use ACCEPT_KEYWORDS on the command line here because we're only fetching the package source, not installing the package. You should never use ACCEPT_KEYWORDS on the command line when you're installing a package.

Now you can copy /usr/portage/distfiles/cvs-src/rt2x00-9999/ to the machine you need to install on.


Using CVS directly

You can download a CVS client from: http://ximbiot.com/cvs/wiki/index.php?title=Main_Page#CVS_Downloads

This method is going to involve looking at the ebuild (the package file format Gentoo uses) directly. First you need to know what category your package is in. You can easily find this out by running eix rt2x00 if you have the eix utility from the eix package installed. If not, you can run emerge -p rt2x00 - in the case of the rt2x00 package, it's in the net-wireless category.

Now open the package file, /usr/portage/net-wireless/rt2x00/rt2x00-9999.ebuild, in a text editor. You now need to find the three lines similar to the ones below.

File: /usr/portage/net-wireless/rt2x00/rt2x00-9999.ebuild
ECVS_SERVER="rt2400.cvs.sourceforge.net:/cvsroot/rt2400"
ECVS_MODULE="source/rt2x00"
ECVS_LOCALNAME="${P}"

ECVS_SERVER is the address of the CVS server; ECVS_MODULE is the name of the CVS module on the server. ECVS_LOCALNAME is the directory in /usr/portage/distfiles/cvs-src where the source is created - this is usually the same as the package name and version (${P}) or just the package name (${PN}).

The following commands were copied from the commands that portage runs to download the CVS source itself, so you shouldn't have any problems here.

Now you need to connect and login to the CVS server as an anonymous user. To do this, we're going to run the following command, substituting ${ECVS_SERVER} with the value from the package file: cvs -q -f -z3 -d ":pserver:anonymous:@${ECVS_SERVER}" login

For the rt2x00 package this becomes: cvs -q -f -z3 -d ":pserver:anonymous:@rt2400.cvs.sourceforge.net:/cvsroot/rt2400" login

Now we want to actually fetch the source, the command for this, again replacing with the values from the package file is: cvs -q -f -z3 -d ":pserver:anonymous@${ECVS_SERVER}" checkout -d ${ECVS_LOCALNAME} ${ECVS_MODULE}

For the rt2x00 package, this becomes: cvs -q -f -z3 -d ":pserver:anonymous@rt2400.cvs.sourceforge.net:/cvsroot/rt2400" checkout -d rt2x00-9999 source/rt2x00

That's it. As a final step you may want to put the source into a tarball to make it easier to transport: tar jcvf rt2x00-9999.tbz2 rt2x00-9999

Once the tarball is on the target machine, extract it to /usr/portage/distfiles/cvs-src/: tar jxvf rt2x00-9999.tbz2 -C /usr/portage/distfiles/cvs-src/

Emerging the package

You need to set the environment variable ECVS_OFFLINE_${P}=1 while emerging the package, where ${P} is the package name, so in the case of rt2x00, you set ECVS_OFFLINE_rt2x00=1

The entire command for the rt2x00 package is: ECVS_OFFLINE_rt2x00=1 emerge =rt2x00-9999

NOTE: Remember, you MUST NOT use ACCEPT_KEYWORDS on the commandline when installing a package. Use /etc/portage/package.keywords instead. If you don't know how to use this file, see the Gentoo Handbook

Retrieved from "http://www.gentoo-wiki.info/Skipping_fetch_for_CVS_packages"

Last modified: Wed, 26 Dec 2007 15:07:00 +0000 Hits: 4,385