1 |
r0bertz 08/03/02 05:34:07 |
2 |
|
3 |
Added: hb-introduction-new-devs.xml |
4 |
Log: |
5 |
added zh_cn hb-introduction-new-devs.xml |
6 |
|
7 |
Revision Changes Path |
8 |
1.1 xml/htdocs/proj/zh_cn/devrel/handbook/hb-introduction-new-devs.xml |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/zh_cn/devrel/handbook/hb-introduction-new-devs.xml?rev=1.1&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/zh_cn/devrel/handbook/hb-introduction-new-devs.xml?rev=1.1&content-type=text/plain |
12 |
|
13 |
Index: hb-introduction-new-devs.xml |
14 |
=================================================================== |
15 |
<?xml version='1.0' encoding='UTF-8'?> |
16 |
<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> |
17 |
|
18 |
|
19 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
20 |
<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> |
21 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/zh_cn/devrel/handbook/hb-introduction-new-devs.xml,v 1.1 2008/03/02 05:34:06 r0bertz Exp $ --> |
22 |
<!-- English CVS version: 1.10 --> |
23 |
<sections> |
24 |
<version>1.0.3</version> |
25 |
<date>2007-11-01</date> |
26 |
|
27 |
<section> |
28 |
<title>使用CVS</title> |
29 |
<subsection> |
30 |
<title>介绍</title> |
31 |
<body> |
32 |
|
33 |
<p> |
34 |
这不是一本讲解如何使用CVS的手册。如果你需要了解如何使用CVS,请查看CVS的info或者<uri>/doc/zh_cn/cvs-tutorial.xml</uri>。相反地,这本手册特别关注如何在Gentoo的ebuild树中使用CVS和Repoman。 |
35 |
</p> |
36 |
|
37 |
</body> |
38 |
</subsection> |
39 |
<subsection> |
40 |
<title>配置</title> |
41 |
<body> |
42 |
|
43 |
<p> |
44 |
一般来说,你会希望在<path>~/.cvsrc</path>中加入下面的几句话。 |
45 |
</p> |
46 |
|
47 |
<pre caption="~/.cvsrc"> |
48 |
cvs -q -z0 |
49 |
diff -u -B |
50 |
checkout -P |
51 |
update -d -P |
52 |
</pre> |
53 |
|
54 |
<p> |
55 |
为了确保digest的正确性,请将<c>cvs</c>加入到你的<c>FEATURES</c>设置中。 |
56 |
</p> |
57 |
|
58 |
<p> |
59 |
最后,很多使用CVS的人喜欢使用压缩选项(-z#)。我们要求那些不通过拨号连接的开发者使用选项-z0(考虑到我们CVS仓库的内容和我们CVS服务器的负载),在没有压缩的情况下,实际上你会感受到速度的<e>提升</e>。 |
60 |
</p> |
61 |
|
62 |
</body> |
63 |
</subsection> |
64 |
|
65 |
<subsection> |
66 |
<title>从CVS/SVN中checkout</title> |
67 |
<body> |
68 |
|
69 |
<p> |
70 |
在Gentoo的CVS仓库中有一些很有用的模块。Ebuild被存放在<path>gentoo-x86</path>模块中。<path>gentoo</path>包含了网站,文档,开发者目录,开发者图片等的XML文件。<path>gentoo-projects</path>包含了各种各样的项目,并替换了<path>gentoo-src</path>cvs模块。<path>gentoo-src</path>被保留,成为了历史。如果你仍然在使用它,请转移到一个不同的cvs模块。 |
71 |
</p> |
72 |
|
73 |
<pre caption="检出gentoo-x86"> |
74 |
# cvs -d username@××××××××××.org:/var/cvsroot co gentoo-x86 |
75 |
</pre> |
76 |
|
77 |
<p> |
78 |
在任何时候,在树中工作之前,总是记得要先更新,用来检查仓库中的内容是否有改变,以防止冲突的发生。如果你不希望等待整棵树的更新,你可以在任何一个子目录中进行更新,但不时地更新你的整棵树是个很好的主意。 |
79 |
</p> |
80 |
|
81 |
<pre caption="更新gentoo-x86"> |
82 |
# cd gentoo-x86 |
83 |
# cvs update |
84 |
</pre> |
85 |
|
86 |
<p> |
87 |
Gentoo也为那些偏爱SVN的人提供了subversion服务。许多核心项目,比如<path>portage</path>和<path>baselayout</path>现在也架设在这里。 |
88 |
</p> |
89 |
|
90 |
<pre caption="检出Portage"> |
91 |
# svn co svn+ssh://username@××××××××××.org/var/svnroot/portage |
92 |
</pre> |
93 |
|
94 |
</body> |
95 |
</subsection> |
96 |
|
97 |
<subsection> |
98 |
<title>更新Portage</title> |
99 |
<body> |
100 |
|
101 |
<p> |
102 |
如果你想使用CVS作为你主要的Portage树,那么你可以在<path>/etc/make.conf</path>中加入下面的几行,用你的名字替换其中的<c>you</c>。 |
103 |
</p> |
104 |
|
105 |
<pre caption="修改/etc/make.conf来配合CVS的使用"> |
106 |
SYNC="cvs://you@××××××××××.org:/var/cvsroot" |
107 |
CVSROOT=":ext:you@××××××××××.org:/var/cvsroot" |
108 |
</pre> |
109 |
|
110 |
<p> |
111 |
不管你是否希望使用CVS来作为你主要的Portage树,你应当确保<c>cvs</c>在文件<path>/etc/make.conf</path>的<c>FEATURES</c>选项中。这将保证在制作digest的时候,Portage会下载ebuild在<c>SRC_URI</c>中引用的所有文件。 |
112 |
</p> |
113 |
|
114 |
<note> |
115 |
由于cvs的检出的Portage树没有metadata cache,你的portage可能会变得很慢。 |
116 |
</note> |
117 |
|
118 |
<p> |
119 |
你可以在你的<c>FEATURES</c>中加入<c>digest</c>,让Portage自动创建新的digest,你也可以加入<c>autoaddcvs</c>,这样,<c>repoman</c>(用来commit到ebuild的一个工具)将会为你在CVS中自动加入缺少的digest。 |
120 |
</p> |
121 |
|
122 |
<p> |
123 |
在支持的架构上,你应该总是在你的<c>FEATURES</c>中加入<c>sandbox</c>来保证ebuild不会直接修改根文件系统。 |
124 |
</p> |
125 |
|
126 |
</body> |
127 |
</subsection> |
128 |
|
129 |
<subsection> |
130 |
<title>增加/删除包</title> |
131 |
<body> |
132 |
|
133 |
<p> |
134 |
假设你准备在app-misc中加入一个全新的包<c>foo</c>: |
135 |
</p> |
136 |
|
137 |
<pre caption="增加一个包"> |
138 |
<comment>(用你checkout出来的CVS树的位置来替换CVSROOT。)</comment> |
139 |
# cd $CVSROOT/app-misc |
140 |
<comment>(在CVS树中工作之前总是要先更新!)</comment> |
141 |
# cvs update |
142 |
# mkdir foo |
143 |
<comment>(这里,我们将foo包目录加入了CVS仓库。)</comment> |
144 |
# cvs add foo |
145 |
# cd foo |
146 |
<comment>(最好将你正在进行中的ebuild放置在CVS树之外的overlay中。)</comment> |
147 |
# cp /path/to/foo-1.0.ebuild ./ |
148 |
<comment>(不要忘记创建ChangeLog文件——查看echangelog的man帮助。)</comment> |
149 |
<comment>(当建立digest的时候,确保PORTDIR_OVERLAY设置成CVS目录。)</comment> |
150 |
# ebuild foo-1.0.ebuild digest |
151 |
# cvs add foo-1.0.ebuild ChangeLog files |
152 |
<comment>(FEATURES=autoaddcvs将会为你做这些……)</comment> |
153 |
# cvs add files/digest-foo-1.0 |
154 |
</pre> |
155 |
|
156 |
<p> |
157 |
记得加入包含维护者信息的metadata.xml文件。查看<uri link="?part=2&chap=4">Gentoo Metadata</uri>章节以获得更多的信息。 |
158 |
</p> |
159 |
|
160 |
<p> |
161 |
在这个时刻,你已经准备好commit了(查看下面的Commits章节)。但如果当foo-1.1发布的时候你想要删除foo-1.0,该怎么办呢? |
162 |
</p> |
163 |
|
164 |
<pre caption="删除旧版本"> |
165 |
# cd CVSROOT/app-misc/foo |
166 |
# cvs update |
167 |
# cvs remove -f foo-1.0.ebuild files/digest-foo-1.0 |
168 |
</pre> |
169 |
|
170 |
<p> |
171 |
现在你已经准备好可以commit了。(查看下面的Commits章节) |
172 |
</p> |
173 |
|
174 |
</body> |
175 |
</subsection> |
176 |
<subsection> |
177 |
<title>Commits</title> |
178 |
<body> |
179 |
|
180 |
<p> |
181 |
请一直使用<c>repoman commit</c>,而不是<c>cvs commit</c>。Repoman是一个质量保障(QA)工具,它会执行基本的检查并且建立Manifests。如果你对repoman输出的某些部分不清楚,请查看<c>man repoman</c>。另外,你可能会对不断地输入密码而感到厌倦;keychain(<uri>http://www.gentoo.org/proj/zh_cn/keychain.xml</uri>)可以帮助你。 |
182 |
</p> |
183 |
|
184 |
<pre caption="使用repoman"> |
185 |
<comment>(在运行repoman之前,请确保没有root用户所拥有的文件!)</comment> |
186 |
<comment>("scan"扫描当前的目录来查看QA事务。"full"选项更加完整。)</comment> |
187 |
# repoman scan |
188 |
<comment>("commit"先做scan,然后commit,同时更新digest。确认你已经 |
189 |
加入了冗长而有用的CVS ChangeLog信息……)</comment> |
190 |
# repoman commit |
191 |
</pre> |
192 |
|
193 |
</body> |
194 |
</subsection> |
195 |
<subsection> |
196 |
<title>提升CVS的速度</title> |
197 |
<body> |
198 |
|
199 |
<p> |
200 |
如果你到cvs服务器有很高的ping时间,你可能会希望使用ssh主从设置(你只需要连接到其他的ssh服务器一次,然后通过这个连接来执行后面的命令)。这样,你省下了握手的时间,可以整体提高3倍的checkout/commit速度。只需要将下面的代码加入到你的设置中即可。 |
201 |
</p> |
202 |
|
203 |
<pre caption="~/.ssh/config"> |
204 |
Host * |
205 |
ControlMaster auto |
206 |
ControlPath ~/.ssh/master-%r@%h:%p |
207 |
</pre> |
208 |
|
209 |
<p> |
210 |
在这样做了之后,你可以用这个命令启动一个后台的主连接 |
211 |
</p> |
212 |
|
213 |
<pre caption="在后台启动一个主连接"> |
214 |
<comment>你可以在ssh的man手册中找到下面参数的含义</comment> |
215 |
$ ssh -M -N -f ${USER}@cvs.gentoo.org |
216 |
</pre> |
217 |
|
218 |
</body> |
219 |
</subsection> |
220 |
</section> |
221 |
|
222 |
<section> |
223 |
<title>杂项</title> |
224 |
<subsection> |
225 |
<title>在镜像上放置文件</title> |
226 |
<body> |
227 |
|
228 |
<p> |
229 |
Gentoo镜像系统可自动获取Distfiles。你只需要监视你的distfiles是否有读取错误。请查看<uri link="/proj/en/infrastructure/mirrors/overview-distfile.xml">Distfiles概览</uri>以获得详细的指令。 |
230 |
</p> |
231 |
|
232 |
</body> |
233 |
</subsection> |
234 |
<subsection> |
235 |
<title>邮件和网页</title> |
236 |
<body> |
237 |
|
238 |
<p> |
239 |
我们的基础架构允许开发者管理他们自己的邮件。<uri>http://www.gentoo.org/proj/en/infrastructure/dev-email.xml</uri>包含了如何配置你的@gentoo.org邮件的指令。 |
240 |
</p> |
241 |
|
242 |
<p> |
243 |
开发者拥有发布网页的权力,http://dev.gentoo.org/~$YOURNAME。请查看<uri link="http://www.gentoo.org/proj/en/infrastructure/dev-webspace.xml">网页空间配置指南</uri>以获得更多详细的信息。 |
244 |
</p> |
245 |
|
246 |
</body> |
247 |
</subsection> |
248 |
<subsection> |
249 |
<title>Planet Gentoo"博客"</title> |
250 |
<body> |
251 |
|
252 |
<p> |
253 |
我们有一项服务,<uri link="http://planet.gentoo.org">Planet Gentoo</uri>。这项服务汇集由做贡献的开发者所写的文章。这项服务是可选的,但是我们鼓励你加入。这可以促进开发者之间的交流,而且用户也会觉得很有趣,值得一读。 |
254 |
</p> |
255 |
|
256 |
<p> |
257 |
为了能够在Planet Gentoo上发布内容,你需要有一个你自己的博客。许多网站提供这种免费的服务,或者你可以自己架设一个博客(如果你有这个资源的话)。作为另外一种选择,我们可以为你建立一个博客。 |
258 |
</p> |
259 |
|
260 |
<p> |
261 |
我们希望保持Planet Gentoo的内容是与Gentoo相关的,或者是Gentoo相关的开发和事件。 |
262 |
</p> |
263 |
|
264 |
<p> |
265 |
如果我们为你建立了博客,你的博客内容应当是主题相关的(关于Gentoo相关的文章)。你也需要了解,如果你失去了你的开发者状态,你将不能够在你的博客上编辑文章。 |
266 |
</p> |
267 |
|
268 |
<p> |
269 |
如果你在其他地方有一个博客,那么你需要提供一份XML的内容feed。如果你的博客是分类别的,我们需要一份关于"Gentoo"类别的XML feed,而不是其他部分。这也许不是一个问题,因为几乎所有的博客都提供像这样的标准feed服务。 |
270 |
</p> |
271 |
|
272 |
<p> |
273 |
尽管这是常识,但是请注意你所写的内容。你的观点可能会被不恰当地理解为这是Gentoo的观点。请注意不要破坏我们的形象。 |
274 |
</p> |
275 |
|
276 |
<p> |
277 |
如果你有兴趣对Planet Gentoo做贡献,请发邮件到<uri link="mailto:user-relations@g.o">user-relations@g.o</uri>。你可以请求一个建立在Gentoo空间上的博客,或者给出你现有博客的详细信息。我们会处理好这些细节,并让你的博客正确地运行起来。 |
278 |
</p> |
279 |
|
280 |
</body> |
281 |
</subsection> |
282 |
</section> |
283 |
</sections> |
284 |
|
285 |
|
286 |
|
287 |
-- |
288 |
gentoo-commits@l.g.o mailing list |