[OpenBSD]

Анонимный CVS


Оглавление


Что такое анонимный CVS?

Анонимный CVS - метод обновления исходных тестов, относительно изменениний сделанных в репозитории OpenBSD. Кроме того, возможно отслеживать исправления ошибок, допущенных в релизе.

Основное отличие анонимного CVS от других методов обновления исходного текста, в том, что он работает напрямую с центральным репозиторием исходных текстов или его зеркалом, то есть, вы имеете полный набор CVS команд для обновления и объединения ваших изменений с другими изменениями, для создания diff'ов, просмотра истории изменений и других запросов.

В настоящее время проект OpenBSD имеет пять основных репозитория:

Что такое CVS?

CVS - это система контроля исходного кода, используеться для управления исходными текстами OpenBSD. CVS использует центральный репозиторий для хранения всего исходного текста и его изменений, в то же время позволяя разработчикам иметь локальную копию исходного кода со своими работающими изменениями. Разработчики имеющие "полный доступ" могут вносить изменения непосредственно в репозиторий исходных текстов OpenBSD, тогда как пользователи анонимного CVS имеют "доступ только для чтения" и могут только обновлять свои локальные копии исходных текстов и осуществлять другие запросы к репозиторию.

Основное достоинство CVS - способность выполнять разумное слияние изменений в центральном репозитории с изменениями, которые вы внесли в вашу локальную копию. Это значит что, если вы внесете изменения в какой-нибудь модуль и выполните обновление, ваши изменения не отбросятся, вместо этого CVS попытается объединить изменения из центрального репозитория с вашими изменениями в локальной копии.

Когда изменения не могут быть полностью объединены, CVS предоставляет сделать это вам, помечая конфликты в вашей локальной версии (сохраняя резервную копию) и продолжая обновлять другие исходные модули.

Подготовка к использованию анонимного CVS

Последняя версия CVS доступна на Cyclic. Версии ранее, чем 1.6 не рекомендуются, и могут не работать. CVS включён в состав OpenBSD.

На CD с OpenBSD находиться извлечённый модуль OpenBSD src (вы, возможно, замечали CVS/ директории), который можно использовать для продолжения обновления исходных текстов. Пользуясь этим деревом исходных текстов, обновление будет проходить значительно быстрее, нежели извлечение полного дерева исходных текстов. Есть два способа использовать этот CD:

У кого нет CD, могут использовать cvs(1) для получения дерева исходных текстов с сетевого репозитория. Подробно об этом говорится в следующей главе.

После этого, в /usr/src должны будут работать cvs(1) команды.

Использование CVS для получения и обновления исходных текстов

CVS was designed to be a simple way to retrieve and update your sources, therefore there isn't much involved at all in doing so. You must first decide whether you want to track current or a patch branch. The current tree has all of the up to the minute changes, whereas a patch branch contains a formal release plus the patches from the errata already applied. For a definition of current, see the Upgrade Mini-FAQ.

Once you have decided which tree to follow, you must choose which Anonymous CVS server you are going to use. A list of these servers is below. Do, however, notice that there are three ways to access these servers.

ssh
Secure Shell can be used to access the anonymous CVS servers. This is the recommended way of doing so, as it is encrypted. As of 2.6, OpenBSD has included OpenSSH in its standard distribution.
rsh
Remote Shell can be used on some of the servers for users who don't have access to ssh.
pserver
pserver is primarily useful for users who are behind firewalls that block the other two connections.

NOTE: For users wishing to use rsh, you must first set the CVS_RSH variable to rsh.

Once you have chosen which Anonymous CVS Server you will use, and which method you will use, you can start using cvs. For those of you who have CDs you can start with the CVS checkout that is on the CD by using the method above to get the sources onto your system. If you don't have a CD handy, use the method below to checkout the sources. This method puts the OpenBSD source tree into /usr/src.

	# cd /usr; cvs checkout -P src

The above will checkout the current source tree. Many of you will only want the patch branch sources. To checkout a patch branch, you must specify a tag along with your command. Example:

	# cd /usr; cvs checkout -P -rOPENBSD_3_4 src

Or OPENBSD_3_3 for 3.3, etc.

The OPENBSD_3_4 tag contains the release sources and errata already applied.

Анонимные CVS сервера

Существует два способа доступа к дереву исходных текстов:

Полный доступ:
Разработчики, которые должны вносить изменения в дерево исходных текстов, должны иметь аккоунт на серверах проекта OpenBSD. Получение этого доступа - естественный результат работы над исходными текстами OpenBSD совместно с другими разработчиками. Если кто-то сделал хорошую работу и показал, что может работать в команде, он получит такой доступ.
Доступ только для чтения:
Любой желающий может обратиться к анонимным CVS репозиториям с доступом только для чтения. Такие репозитории часто зеркалируються с основного репозитория проекта OpenBSD. Для того, чтобы ими воспользоваться, установите переменную окружения CVSROOT на одно из значений в приведенном ниже списке серверов.

Список анонимных CVS серверов.

Если ваш сервер перечислен с неточной или неполной информацией, пожалуйста, свяжитесь с beck@openbsd.org. Для нахождения близлежащего к вам сервера, используйте traceroute(8). При возникновении проблем с сервером свяжитесь с обслуживающим его персоналом (maintainters).

Getting crypto sources through cvs(1)

IMPORTANT NOTE: There are a few issues relating to cryptographic software that everyone should be aware of:

Example usages for cvs(1)

NOTICE: If you want to update a branch (such as a patch branch) to current, you would add the -A flag to cvs, but this flag is of little use otherwise. Some older versions of the OpenBSD documentation recommended use of this flag in many examples. We no longer recommend this flag unless absolutely necessary.

A sample use of an anoncvs server would be:

% setenv CVSROOT anoncvs@anoncvs.ca.openbsd.org:/cvs
% cd /tmp
% cvs get src/sys/arch/sparc
    [copies the files from the repository to your machine]
% cvs log src/sys/arch/sparc/sparc/locore.s
    [shows the commit log for the chosen file]
% cvs diff -bc -r1.1 -r1.5 src/sys/arch/sparc/sparc/locore.s
    [shows the changes between revisions 1.1 and rev 1.5]

In order to use a cvs ``pserver'' (a direct TCP connection instead of using ssh or rsh) you must login once:

% setenv CVSROOT :pserver:anoncvs@anoncvs.ca.openbsd.org:/cvs
% cvs login
(Logging in to anoncvs@anoncvs1.ca.openbsd.org)
CVS password: anoncvs
    [This writes a line to ~/.cvspass (filename over-ridden by CVS_PASSFILE).]
    [An example line from my ~/.cvspass after typing 'blah' for the above    ]
    [password is:                                                            ]
    [:pserver:anoncvs@anoncvs5.usa.openbsd.org:/cvs Au'yc                    ]
    [After logging in ONCE every other use of the above CVSROOT will work.   ]
% cvs get ksrc-i386 ksrc-common
    [Allows you to retrieve ONLY that necessary to rebuild an i386 kernel.   ]

Here is how someone using anoncvs regularly would update his source tree:

To use ports, it is similar to src:

In the above example, -q is optional, only intended to minimize cvs's output. For those who like to see screenfulls of output, it can be omitted.

or to make a diff of a locally patched module (here cd.c) to include with a bug report:

	# cd /usr
	# cvs diff -u src/sys/scsi/cd.c > /tmp/patch

The cvs(1) man page (included with the CVS sources) has much more information about how CVS can be used.

X11 Source tree

Anoncvs mirrors also carry the OpenBSD X11 (XFree86) source tree. You can adapt the recipe above to update your XFree86 source tree from the third CD. You can copy or download the XFree86 3 source tree with the X11 cvs module, although the current module containing XFree86 4 is XF4. There are two ways to get the XF4 sources to /usr/XF4:

After this, /usr/XF4 will be ready to be used by cvs. You can for example update it to -current source (assuming you've already set the CVSROOT environment variable):
        # cd /usr/XF4
        # cvs -q update -Pd

Warning: When using cvs you should take care that your current directory is either the root of the tree you are referencing or in a separate place such as /tmp. Some commands such as "get" can create an arbitrary sub-tree in the current directory, and a subsequent update will recursively flesh out this sub-tree.

The anoncvs service gives fledgling developers a chance to learn CVS operation and get thoroughly involved in the development process before getting "commit" access -- as a result of showing useful skills and high quality results they will naturally later be given developer access. As well, people providing patches can create their "diff"s relative to the CVS tree, which will ease integration.

Use rsh(1) or ssh(1)?

By default, the CVS client uses ssh ("secure shell": OpenSSH) to talk to the CVS server.

Many of the CVS sites no longer support rsh for security reasons. Local problems like firewalls or imperfect protocol emulators such as slirp may also hinder rsh usage. However, if rsh is desired, one must set the CVS_RSH environment variable to point to rsh (typically /usr/bin/rsh).

If local policy prevents outgoing connections to ssh's default port of 22, port 2022 may be used in its place. Note, however, that not all anoncvs servers accept ssh connections on this port. Furthermore, most anoncvs servers no longer accept the none cipher, as it is disabled in recent versions of ssh for security reasons. Also, do not be tempted to turn on compression: CVS already compresses.

One could specify something like the following in the $HOME/.ssh/config configuration file to avoid the pitfalls and restrictions mentioned above:

	Host anoncvs.ca.openbsd.org
	    Compression no
	    Port 2022

CVS is a little noisy starting up; to quiet it a bit you may want to do this:

	% setenv CVS_CLIENT_PORT -1

Mirroring the CVS repository via sup(1)

Users wishing to mirror the OpenBSD CVS tree itself may now do so from anoncvs.usa.openbsd.org or anoncvs1.usa.openbsd.org (these are different machines). Note that this is the cvs tree, not a checked out source tree. It is only useful if you want to be able to do fast cvs operations (diff, annotate, etc) or if you have multiple source trees and you only want to transfer new data once (you can then checkout a tree from your local cvs mirror).

A sample supfile would be:

	cvs host=anoncvs.usa.openbsd.org hostbase=/ base=/home delete

which would mirror the cvs tree into /home/cvs with the sup data files ending up in /home/sup. The full OpenBSD cvs tree is currently about 2.2GB in size.

Setting up an anoncvs mirror

If you wish to setup a new anoncvs mirror site and make it available to the general public, please contact the anoncvs maintainer. Anoncvs mirrors require about 2.2GB of disk, and use up to 32MB of swap per anoncvs user (assuming the user does a large operation; while smaller operations use fewer resources, anoncvs still makes much more of an impact than ftp or sup). Such anoncvs machines should have excellent network connectivity for the area they are expected to serve. A document which describes the setup of anoncvs servers is available.

Final notes

After upgrading your source tree, you should read the comments at the top of /usr/src/Makefile before attempting a build. Also, you should build a new kernel before doing a make build if possible. In some cases it may be necessary to rebuild and install the config utility before you can build the kernel. If config GENERIC fails this is probably the case.

It is important to note that upgrading from a release to the current tree by rebuilding the sources can be rather difficult due to dependencies that are often not obvious. Therefore, it is suggested that you first install the latest snapshot before attempting a tree build from source.


OpenBSD www@openbsd.org
Originally [OpenBSD: anoncvs.html,v 1.200 ]
$RuOBSD: anoncvs.html,v 1.13 2004/02/28 08:38:39 dfa Exp $
$Translation: anoncvs.html,v 1.28 2004/02/28 19:30:42 dfa Exp $
$OpenBSD: anoncvs.html,v 1.22 2004/02/29 08:50:22 jufi Exp $