[ << ] [ < ] [ 手册主页 ] [ > ] [ >> ]
4.a. Using CVS
Introduction
This guide is not intended to be a manual on using CVS; for that, take a look at the CVS info page or http://www.gentoo.org/doc/en/cvs-tutorial.xml. Instead, this guide focuses specifically on using CVS and Repoman in Gentoo's ebuild tree.
Configuration
Typically, you'll want something along these lines in your ~/.cvsrc:
代码 1: ~/.cvsrc |
cvs -q -z0 diff -u -B checkout -P update -d -P |
In order to make sure digests are correct, please put cvs in your FEATURES setting.
Finally, many people using CVS like to use compression (-z#). We ask that developers who are not on dialup connections please use -z0 - with the contents of our CVS repository and the load on our CVS server, you actually experience a speed increase without compression.
Checking out
There are a few useful modules in Gentoo's CVS repository. Ebuilds are kept in the gentoo-x86 module. gentoo-src contains various projects - some useful, some inactive. gentoo contains the XML for the website, documentation, developer directories, developer pictures, and so on.
代码 2: Checking out gentoo-x86 |
# cvs -d username@cvs.gentoo.org:/var/cvsroot co gentoo-x86 |
Before working in the tree at any time, it's always a good idea to do an update to check for changes and prevent conflicts. You can update in any subdirectory of the tree if you don't want to want for a tree-wide update, but from time to time it's a good idea to update your entire tree:
代码 3: Updating in gentoo-x86 |
# cd gentoo-x86 # cvs update |
Updating Portage
If you want to use CVS as your primary Portage tree, you can add the following lines to /etc/make.conf, replacing you with your username:
代码 4: Changing /etc/make.conf for use with CVS |
SYNC="cvs://you@cvs.gentoo.org:/var/cvsroot" CVSROOT=":ext:you@cvs.gentoo.org:/var/cvsroot" |
Whether you wish to use a CVS checkout as your primary Portage tree or not, you should ensure that cvs is in your FEATURES in /etc/make.conf. This makes sure Portage downloads all the files an ebuild references in its SRC_URI when making a digest.
You can add digest to your FEATURES, letting Portage automatically create new digests. You can also add autoaddcvs so repoman, the tool which you will use to commit in ebuilds, would automatically add missing digests for you into CVS.
On supported architectures, you should also have sandbox in your FEATURES to ensure ebuilds do not modify the root filesystem directly.
Adding/Removing
Say you're ready to add a brand new package, foo, in app-misc:
代码 .5 |
(Replace CVSROOT with the location of your checked-out CVS tree.) # cd $CVSROOT/app-misc (Always update before working in part of the CVS tree!) # cvs update # mkdir foo (Here, we add the package directory foo to the CVS repository.) # cvs add foo # cd foo (It's better to keep in-progress ebuilds in an overlay outside of your CVS tree.) # cp /path/to/foo-1.0.ebuild ./ [Don't forget to create a ChangeLog - see the man page for echangelog.] (Make sure PORTDIR_OVERLAY is set to the CVS directory when creating digests.) # ebuild foo-1.0.ebuild digest # cvs add foo-1.0.ebuild ChangeLog files (FEATURES=autoaddcvs will do this for you...) # cvs add files/digest-foo-1.0 |
Remember to also add a metadata.xml file with maintainer information. See the Gentoo Metadata section for more information.
At this point, you're ready to commit (see the section on Commits below). But what if you want to remove foo-1.0 when foo-1.1 is out?
代码 .6 |
# cd CVSROOT/app-misc/foo
# cvs update
# rm foo-1.0.ebuild files/digest-foo-1.0 (Files should be deleted first...)
# cvs remove foo-1.0.ebuild files/digest-foo-1.0
|
And now you're ready to commit (see the section on Commits below).
Commits
Always use repoman commit rather than cvs commit. Repoman is a quality assurance (QA) tool that performs basic checks and creates Manifests. If any part of repoman's output is unclear, please see man repoman. Additionally, you may tire of entering your key passphrase repeatedly; keychain (http://www.gentoo.org/proj/en/keychain.xml) can help you.
代码 .7 |
[Make sure there are no root-owned files present prior to running repoman!] ("scan" scans the current directory for QA issues. "full" is more complete.) # repoman scan ("commit" does a scan, then commits, while also updating digests. Make sure you add a verbose and useful CVS ChangeLog message...) # repoman commit |
4.b. Miscellaneous
Putting files on mirrors
The procedure for dropping a new file in distfiles on Gentoo mirrors is very simple: copy it to /space/distfiles-local on dev.gentoo.org.
Our infrastructure allows developers to manage their own mail. http://www.gentoo.org/proj/en/infrastructure/dev-email.xml contains instructions on configuring your gentoo.org mail.
[ << ] [ < ] [ 手册主页 ] [ > ] [ >> ]