aboutsummaryrefslogtreecommitdiff
blob: 26b770e3cc8a6e01476f510739899ee345495bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?xml version="1.0"?>
<guide self="ebuild-writing/functions/src_unpack/cvs-sources/">
<chapter>
<title>CVS Sources</title>

<body>
<p>
Rather than working with a source tarball, it is possible to use
upstream's CVS server directly. This can be useful when there is a
need to test unreleased snapshots on a regular basis.
</p>
</body>

<section>
<title>Disadvantages of CVS Sources</title>
<body>

<p>
Note that CVS ebuilds should <b>not</b> generally be added to the tree
(except under <c>package.mask</c>) for the following reasons:
</p>

<ul>
  <li>
  Upstream CVS servers tend to be far less reliable than our mirroring
  system.
  </li>
  <li>
  CVS ebuilds create a very heavy server load <d/> not only is CVS not
  mirrored, but allowing a CVS checkout is considerably more work for
  a server than simply serving up a file via HTTP or FTP.
  </li>
  <li>
  Many users who are behind strict firewalls cannot use CVS.
  </li>
</ul>

<p>
It is safer to make a snapshot instead. For example, vim snapshots are made using:
</p>

<pre>
$ cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/vim export -r HEAD vim
</pre>
</body>
</section>

<section>
<title>Disadvantages of CVS Live Sources</title>
<body>

<p>
CVS ebuilds which work against CVS <c>HEAD</c> rather than a specific
date or revision are even worse candidates for tree inclusion:
</p>

<ul>
  <li>
  You can never be sure whether upstream's CVS will actually
  build at any given point; which will most likely cause QA issues.
  </li>
  <li>
  It is extremely difficult to track down bugs when you cannot install
  the same version of a package as the reporter.
  </li>
  <li>
  Many upstream package maintainers tend to get upset if people aren't
  using a specific released version.
  </li>
</ul>

</body>
</section>

<section>
<title>Using CVS Sources</title>
<body>

<p>
To use a CVS source, <c>cvs.eclass</c> must be inherited, and then a
number of variables must be set. The following variables are often
useful:
</p>

<table>
  <tr>
    <th>Variable</th>
    <th>Purpose</th>
    <th>Example</th>
  </tr>
  <tr>
    <ti><c>ECVS_SERVER</c></ti>
    <ti>Server and path</ti>
    <ti><c>"cvs.sourceforge.net:/cvsroot/vim"</c></ti>
  </tr>
  <tr>
    <ti><c>ECVS_MODULE</c></ti>
    <ti>Module</ti>
    <ti><c>"vim"</c></ti>
  </tr>
  <tr>
    <ti><c>ECVS_BRANCH</c></ti>
    <ti>Branch</ti>
    <ti><c>"HEAD"</c></ti>
  </tr>
  <tr>
    <ti><c>ECVS_AUTH</c></ti>
    <ti>Auth method</ti>
    <ti><c>"ext"</c></ti>
  </tr>
  <tr>
    <ti><c>ECVS_USER</c></ti>
    <ti>Username</ti>
    <ti><c>"anoncvs"</c></ti>
  </tr>
  <tr>
    <ti><c>ECVS_PASSWORD</c></ti>
    <ti>Password</ti>
    <ti><c>""</c></ti>
  </tr>
  <tr>
    <ti><c>ECVS_TOPDIR</c></ti>
    <ti>Unpack location</ti>
    <ti><c>"${DISTDIR}/cvs-src/${ECVS_MODULE}"</c></ti>
  </tr>
</table>

<p>
See the eclass itself for the full range of options. To perform the
actual checkout, use the <c>cvs_src_unpack</c> function.
</p>

<p>
Here's a simple example, based upon the CVS options in vim.eclass:
</p>

<codesample lang="ebuild">
inherit cvs

SRC_URI=""

src_unpack() {
    ECVS_SERVER="cvs.sourceforge.net:/cvsroot/vim"
    ECVS_USER="anonymous"
    ECVS_PASS=""
    ECVS_AUTH="pserver"
    if [[ $(get_major_version ) -ge 7 ]] ; then
        ECVS_MODULE="vim7"
    else
        ECVS_MODULE="vim"
    fi
    ECVS_TOP_DIR="${DISTDIR}/cvs-src/${ECVS_MODULE}"
    cvs_src_unpack
}
</codesample>

<p>
Here's another approach, based upon the <c>emacs-cvs</c> ebuild, which
relies upon the default <c>src_unpack</c> provided in the eclass; this
approach is simpler but less flexible:
</p>

<codesample lang="ebuild">
inherit cvs

ECVS_AUTH="ext"
CVS_RSH="ssh"
ECVS_SERVER="savannah.gnu.org:/cvsroot/emacs"
ECVS_MODULE="emacs"
ECVS_BRANCH="emacs-unicode-2"
ECVS_USER="anoncvs"
ECVS_PASS=""
ECVS_CVS_OPTIONS="-dP"

# ...and so on. No src_unpack() is specified.
</codesample>

</body>
</section>

</chapter>
</guide>