7 <firstname>Marc
</firstname>
8 <surname>Fournier
</surname>
11 <firstname>Tom
</firstname>
12 <surname>Lane
</surname>
15 <firstname>Thomas
</firstname>
16 <surname>Lockhart
</surname>
19 <firstname>David
</firstname>
20 <surname>Fetter
</surname>
23 <date>1999-
05-
20</date>
26 <title>The
<productname>CVS
</productname> Repository
</title>
29 The
<productname>PostgreSQL
</productname> source code is stored and managed using the
30 <productname>CVS
</productname> version control system.
34 At least three methods, anonymous CVS,
<productname>rsync
</productname>,
35 and
<productname>CVSup
</productname>,
36 are available to pull the
<productname>CVS
</productname> code tree from the
37 <productname>PostgreSQL
</productname> server to your local machine.
39 url=
"http://wiki.postgresql.org/index.php/Working_with_CVS"></ulink>,
40 has additional details on working with CVS.
44 <title>Getting The Source Via Anonymous
<productname>CVS
</productname></title>
47 If you would like to keep up with the current sources on a regular
48 basis, you can fetch them from our
<productname>CVS
</productname> server
49 and then use
<productname>CVS
</productname> to
50 retrieve updates from time to time.
54 <title>Anonymous CVS
</title>
58 You will need a local copy of
<productname>CVS
</productname>
59 (Concurrent Version Control System), which you can get from
60 <ulink url=
"http://www.nongnu.org/cvs/"></ulink> (the official
61 site with the latest version) or any GNU software archive site
62 (often somewhat outdated). Many systems have a recent version of
63 <application>cvs
</application> installed by default.
69 Do an initial login to the
<productname>CVS
</productname> server:
72 cvs -d :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot login
75 You will be prompted for a password; you can enter anything except
80 You should only need to do this once, since the password will be
81 saved in
<filename>.cvspass
</filename> in your home directory.
87 Fetch the
<productname>PostgreSQL
</productname> sources:
89 cvs -z3 -d :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot co -P pgsql
92 This installs the
<productname>PostgreSQL
</productname> sources into a
93 subdirectory
<filename>pgsql
</filename>
94 of the directory you are currently in.
98 If you have a fast link to the Internet, you might not need
99 <option>-z3
</option>, which instructs
100 <productname>CVS
</productname> to use
<command>gzip
</command> compression for transferred data. But
101 on a modem-speed link, it's a very substantial win.
107 This initial checkout is a little slower than simply downloading
108 a
<filename>tar.gz
</filename> file; expect it to take
40 minutes or so if you
109 have a
28.8K modem. The advantage of
110 <productname>CVS
</productname>
111 doesn't show up until you want to update the file set later on.
117 Whenever you want to update to the latest
<productname>CVS
</productname> sources,
118 <command>cd
</command> into
119 the
<filename>pgsql
</filename> subdirectory, and issue:
124 This will fetch only the changes since the last time you updated.
125 You can update in just a couple of minutes, typically, even over
132 You can save yourself some typing by making a file
<filename>.cvsrc
</filename>
133 in your home directory that contains:
140 This supplies the
<option>-z3
</option> option to all
<command>cvs<
/> commands, and the
141 <option>-d
</option> and
<option>-P
</option> options to
<command>cvs update<
/>. Then you just have
147 to update your files.
153 <productname>CVS
</productname> can do a lot of other things, such
154 as fetching prior revisions of the
155 <productname>PostgreSQL
</productname> sources rather than the
156 latest development version. For more info consult the manual that
157 comes with
<productname>CVS
</productname>, or see the online
158 documentation at
<ulink url=
"http://www.nongnu.org/cvs/"></ulink>.
161 <productname>CVS
</productname> has deficiencies. For example,
162 generating diffs that add or remove files requires write access to the
163 CVS repository. To work around that deficiency, use
164 <productname>cvsutils
</productname>, which is packaged in several
165 operating systems, and is available in source form at
<ulink
166 url=
"http://www.red-bean.com/cvsutils/"></ulink>.
170 Note that building
<productname>PostgreSQL
</productname> from a CVS
171 pull requires reasonably up-to-date versions of
<application>bison<
/>
172 and
<application>flex<
/>, which are not needed to build from a distribution
173 tarball because the files made with them are pre-built in a tarball.
174 You will need Perl as well.
175 Otherwise the tool requirements are the same as building from source.
179 <sect1 id=
"cvs-tree">
180 <title><productname>CVS
</productname> Tree Organization
</title>
184 <title>Author
</title>
186 Written by Marc G. Fournier (
<email>scrappy@hub.org
</email>) on
1998-
11-
05
192 The command
<command>cvs checkout
</command> has a flag,
<option>-r
</option>,
193 that lets you check out a
194 certain revision of a module. This flag makes it easy to, for example,
196 sources that make up release
6_4 of the module `tc' at any time in the
200 cvs checkout -r REL6_4 tc
203 This is useful, for instance, if someone claims that there is a bug in
204 that release, but you cannot find the bug in the current working copy.
208 You can also check out a module as it was at any given date using the
209 <option>-D
</option> option.
215 When you tag more than one file with the same tag you can think
216 about the tag as
<quote>a curve drawn through a matrix of file name vs.
217 revision number
</quote>. Say we have
5 files with the following revisions:
220 file1 file2 file3 file4 file5
222 1.1 1.1 1.1 1.1 /--
1.1*
<-*- TAG
224 1.3 \-
1.3*-
1.3 /
1.3
230 then the tag
<literal>TAG
</literal> will reference
231 file1-
1.2, file2-
1.3, etc.
235 For creating a release branch, other than a
236 <literal>-b<
/> option added to the command, it's the same thing.
</para>
241 So, to create the
6.4 release
249 which will create the tag and the branch for the RELEASE tree.
253 For those with
<productname>CVS
</productname> access, it's simple to
254 create directories for different versions.
255 First, create two subdirectories, RELEASE and CURRENT, so that you don't
256 mix up the two. Then do:
260 cvs checkout -P -r REL6_4 pgsql
262 cvs checkout -P pgsql
265 which results in two directory trees,
<filename>RELEASE/pgsql
</filename> and
266 <filename>CURRENT/pgsql
</filename>. From that point on,
267 <productname>CVS
</productname>
268 will keep track of which repository branch is in which directory tree, and will
269 allow independent updates of either tree.
273 If you are
<emphasis>only
</emphasis> working on the
<literal>CURRENT
</literal>
274 source tree, you just do
275 everything as before we started tagging release branches.
279 After you've done the initial checkout on a branch:
282 cvs checkout -r REL6_4
285 anything you do within that directory structure is restricted to that
286 branch. If you apply a patch to that directory structure and do a:
292 while inside of it, the patch is applied to the branch and
293 <emphasis>only
</emphasis> the branch.
298 <title>Getting The Source Via
<productname>rsync
</productname></title>
301 An alternative to using anonymous CVS for retrieving the
302 <productname>PostgreSQL
</productname> source tree is
303 <productname>rsync
</productname>, an incremental file transfer tool.
304 A major advantage to using
<productname>rsync
</productname> is that it
305 can reliably replicate the
<emphasis>entire
</emphasis> CVS repository
306 on your local system, allowing fast local access to
<command>cvs<
/>
307 operations such as
<option>log
</option> and
<option>diff
</option>.
308 Other advantages include fast synchronization to the
309 <productname>PostgreSQL
</productname> server due to an efficient
310 streaming transfer protocol which only sends the changes since the last
315 You can download the CVS repository using this command:
317 rsync -avzH --delete anoncvs.postgresql.org::pgsql-cvs cvsroot/
319 For full instructions, see the
"rsync" section in the
320 <ulink url=
"http://pgfoundry.org/docman/view.php/1000040/4/PGBuildFarm-HOWTO.txt">
321 pgbuildfarm instructions
</ulink>.
326 <title>Getting The Source Via
<productname>CVSup
</productname></title>
329 Another alternative to using anonymous CVS for retrieving
330 the
<productname>PostgreSQL
</productname> source tree
331 is
<productname>CVSup
</productname>.
332 <productname>CVSup
</productname> was developed by
333 John Polstra (
<email>jdp@polstra.com
</email>) to
334 distribute CVS repositories and other file trees for the
335 <ulink url=
"http://www.freebsd.org">FreeBSD project
</ulink>.
339 <title>Preparing A
<productname>CVSup
</productname> Client System
</title>
342 Two directory areas are required for
<productname>CVSup
</productname>
343 to do its job: a local
<productname>CVS
</productname> repository
344 (or simply a directory area if you are fetching a snapshot rather
345 than a repository; see below)
346 and a local
<productname>CVSup
</productname> bookkeeping
347 area. These can coexist in the same directory tree.
351 Decide where you want to keep your local copy of the
352 <productname>CVS
</productname> repository. On one of our systems we
353 recently set up a repository in
<filename>/home/cvs/
</filename>,
354 but had formerly kept it under a
355 <productname>PostgreSQL
</productname> development tree in
356 <filename>/opt/postgres/cvs/
</filename>. If you intend to keep your
357 repository in
<filename>/home/cvs/
</filename>, then put:
360 setenv CVSROOT /home/cvs
363 in your
<filename>.cshrc
</filename> file, or a similar line in
364 your
<filename>.bashrc
</filename> or
365 <filename>.profile
</filename> file, depending on your shell.
369 The
<application>cvs
</application> repository area must be initialized.
370 Once
<envar>CVSROOT
</envar> is set, then this can be done with a
377 after which you should see at least a directory named
378 <filename>CVSROOT
</filename> when listing the
379 <envar>CVSROOT
</envar> directory:
389 <title>Running a
<productname>CVSup
</productname> Client
</title>
393 <application>cvsup
</application> is in your path; on most systems
394 you can do this by typing:
401 <application>cvsup
</application> using:
404 cvsup -L
2 <replaceable class=
"parameter">postgres.cvsup
</replaceable>
407 where
<option>-L
2</option> enables some status messages so you
408 can monitor the progress of the update,
409 and
<replaceable class=
"parameter">postgres.cvsup
</replaceable> is
410 the path and name you have given to your
411 <productname>CVSup
</productname> configuration file.
415 Here is a
<productname>CVSup
</productname> configuration file
416 modified for a specific installation, and which maintains a full
417 local
<productname>CVS
</productname> repository:
420 # This file represents the standard CVSup distribution file
421 # for the
<productname>PostgreSQL<
/> ORDBMS project
422 # Modified by lockhart@fourpalms.org
1997-
08-
28
423 # - Point to my local snapshot source tree
424 # - Pull the full CVS repository, not just the latest snapshot
426 # Defaults that apply to all the collections
427 *default host=cvsup.postgresql.org
430 *default delete use-rel-suffix
431 # enable the following line to get the latest snapshot
433 # enable the following line to get whatever was specified above or by default
434 # at the date specified below
435 #*default date=
97.08.29.00.00.00
437 # base directory where CVSup will store its 'bookmarks' file(s)
438 # will create subdirectory sup/
439 #*default base=/opt/postgres # /usr/local/pgsql
440 *default base=/home/cvs
442 # prefix directory where CVSup will store the actual distribution(s)
443 *default prefix=/home/cvs
445 # complete distribution, including all below
448 # individual distributions vs 'the whole thing'
456 If you specify
<option>repository<
/> instead of
<option>pgsql<
/>
457 in the above setup, you will get a complete copy of the entire
458 repository at cvsup.postgresql.org, including its
459 <filename>CVSROOT
</filename> directory. If you do that, you will
460 probably want to exclude those files in that directory that you
461 want to modify locally, using a refuse file. For example, for the
462 above setup you might put this in
463 <filename>/home/cvs/sup/repository/refuse<
/>:
469 See the
<productname>CVSup<
/> manual pages for how to use refuse files.
473 The following is a suggested
<productname>CVSup
</productname> configuration file from
474 the
<productname>PostgreSQL<
/>
475 <ulink url=
"ftp://ftp.postgresql.org/pub/CVSup/README.cvsup">
477 which will fetch the current snapshot only:
480 # This file represents the standard CVSup distribution file
481 # for the
<productname>PostgreSQL<
/> ORDBMS project
483 # Defaults that apply to all the collections
484 *default host=cvsup.postgresql.org
487 *default delete use-rel-suffix
490 # base directory where CVSup will store its 'bookmarks' file(s)
491 *default base=
<replaceable class=
"parameter">/usr/local/pgsql
</replaceable>
493 # prefix directory where CVSup will store the actual distribution(s)
494 *default prefix=
<replaceable class=
"parameter">/usr/local/pgsql
</replaceable>
496 # complete distribution, including all below
499 # individual distributions vs 'the whole thing'