chiark / gitweb /
Mention ftp.upload.debian.org instead of ftp-master directly
[developers-reference.git] / pkgs.dbk
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3     "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4   <!ENTITY % commondata SYSTEM "common.ent" > %commondata;
5 ]>
6 <chapter id="pkgs">
7 <title>Managing Packages</title>
8 <para>
9 This chapter contains information related to creating, uploading, maintaining,
10 and porting packages.
11 </para>
12 <section id="newpackage">
13 <title>New packages</title>
14 <para>
15 If you want to create a new package for the Debian distribution, you should
16 first check the <ulink url="&url-wnpp;">Work-Needing and
17 Prospective Packages (WNPP)</ulink> list.  Checking the WNPP list ensures that
18 no one is already working on packaging that software, and that effort is not
19 duplicated.  Read the <ulink url="&url-wnpp;">WNPP web
20 pages</ulink> for more information.
21 </para>
22 <para>
23 Assuming no one else is already working on your prospective package, you must
24 then submit a bug report (<xref linkend="submit-bug"/> ) against the
25 pseudo-package <systemitem role="package">wnpp</systemitem> describing your
26 plan to create a new package, including, but not limiting yourself to, a
27 description of the package, the license of the prospective package, and the
28 current URL where it can be downloaded from.
29 </para>
30 <para>
31 You should set the subject of the bug to <literal>ITP: 
32 <replaceable>foo</replaceable> -- <replaceable>short
33 description</replaceable></literal>, substituting the name of the new
34 package for <replaceable>foo</replaceable>. 
35 The severity of the bug report must be set to <literal>wishlist</literal>.
36 Please send a copy to &email-debian-devel; by using the X-Debbugs-CC
37 header (don't use CC:, because that way the message's subject won't
38 indicate the bug number). If you are packaging so many new packages (>10)
39 that notifying the mailing list in seperate messages is too disruptive,
40 do send a summary after filing the bugs to the debian-devel list instead.
41 This will inform the other developers about upcoming packages and will
42 allow a review of your description and package name.
43 </para>
44 <para>
45 Please include a <literal>Closes:
46 bug#<replaceable>nnnnn</replaceable></literal> entry in the changelog of the
47 new package in order for the bug report to be automatically closed once the new
48 package is installed in the archive (see <xref linkend="upload-bugfix"/> ).
49 </para>
50 <para>
51 If you think your package needs some explanations for the administrators of the
52 NEW package queue, include them in your changelog, send to ftpmaster@debian.org
53 a reply to the email you receive as a maintainer after your upload, or reply to
54 the rejection email in case you are already re-uploading.
55 </para>
56 <para>
57 When closing security bugs include CVE numbers as well as the Closes: #nnnnn.
58 This is useful for the security team to track vulnerabilities.  If an upload is
59 made to fix the bug before the advisory ID is known, it is encouraged to modify
60 the historical changelog entry with the next upload.  Even in this case, please
61 include all available pointers to background information in the original
62 changelog entry.
63 </para>
64 <para>
65 There are a number of reasons why we ask maintainers to announce their
66 intentions:
67 </para>
68 <itemizedlist>
69 <listitem>
70 <para>
71 It helps the (potentially new) maintainer to tap into the experience of people
72 on the list, and lets them know if anyone else is working on it already.
73 </para>
74 </listitem>
75 <listitem>
76 <para>
77 It lets other people thinking about working on the package know that there
78 already is a volunteer, so efforts may be shared.
79 </para>
80 </listitem>
81 <listitem>
82 <para>
83 It lets the rest of the maintainers know more about the package than the one
84 line description and the usual changelog entry ``Initial release'' that gets
85 posted to &email-debian-devel-changes;.
86 </para>
87 </listitem>
88 <listitem>
89 <para>
90 It is helpful to the people who live off <literal>unstable</literal> (and form
91 our first line of testers).  We should encourage these people.
92 </para>
93 </listitem>
94 <listitem>
95 <para>
96 The announcements give maintainers and other interested parties a better feel
97 of what is going on, and what is new, in the project.
98 </para>
99 </listitem>
100 </itemizedlist>
101 <para>
102 Please see <ulink url="http://&ftp-master-host;/REJECT-FAQ.html"></ulink>
103 for common rejection reasons for a new package.
104 </para>
105 </section>
106
107 <section id="changelog-entries">
108 <title>Recording changes in the package</title>
109 <para>
110 Changes that you make to the package need to be recorded in the
111 <filename>debian/changelog</filename>.  These changes should provide a concise
112 description of what was changed, why (if it's in doubt), and note if any bugs
113 were closed.  They also record when the package was completed.  This file will
114 be installed in
115 <filename>/usr/share/doc/<replaceable>package</replaceable>/changelog.Debian.gz</filename>,
116 or
117 <filename>/usr/share/doc/<replaceable>package</replaceable>/changelog.gz</filename>
118 for native packages.
119 </para>
120 <para>
121 The <filename>debian/changelog</filename> file conforms to a certain structure,
122 with a number of different fields.  One field of note, the
123 <literal>distribution</literal>, is described in <xref
124 linkend="distribution"/> .  More information about the structure of this file
125 can be found in the Debian Policy section titled
126 <filename>debian/changelog</filename>.
127 </para>
128 <para>
129 Changelog entries can be used to automatically close Debian bugs when the
130 package is installed into the archive.  See <xref linkend="upload-bugfix"/> .
131 </para>
132 <para>
133 It is conventional that the changelog entry of a package that contains a new
134 upstream version of the software looks like this:
135 </para>
136 <screen>
137   * new upstream version
138 </screen>
139 <para>
140 There are tools to help you create entries and finalize the
141 <filename>changelog</filename> for release — see <xref linkend="devscripts"/>
142 and <xref linkend="dpkg-dev-el"/> .
143 </para>
144 <para>
145 See also <xref linkend="bpp-debian-changelog"/> .
146 </para>
147 </section>
148
149 <section id="sanitycheck">
150 <title>Testing the package</title>
151 <para>
152 Before you upload your package, you should do basic testing on it.  At a
153 minimum, you should try the following activities (you'll need to have an older
154 version of the same Debian package around):
155 </para>
156 <itemizedlist>
157 <listitem>
158 <para>
159 Install the package and make sure the software works, or upgrade the package
160 from an older version to your new version if a Debian package for it already
161 exists.
162 </para>
163 </listitem>
164 <listitem>
165 <para>
166 Run <command>lintian</command> over the package.  You can run
167 <command>lintian</command> as follows: <literal>lintian -v
168 <replaceable>package-version</replaceable>.changes</literal>.  This will check
169 the source package as well as the binary package.  If you don't understand the
170 output that <command>lintian</command> generates, try adding the
171 <literal>-i</literal> switch, which will cause <command>lintian</command> to
172 output a very verbose description of the problem.
173 </para>
174 <para>
175 Normally, a package should <emphasis>not</emphasis> be uploaded if it causes
176 lintian to emit errors (they will start with <literal>E</literal>).
177 </para>
178 <para>
179 For more information on <command>lintian</command>, see <xref
180 linkend="lintian"/> .
181 </para>
182 </listitem>
183 <listitem>
184 <para>
185 Optionally run <xref linkend="debdiff"/> to analyze changes from an older
186 version, if one exists.
187 </para>
188 </listitem>
189 <listitem>
190 <para>
191 Downgrade the package to the previous version (if one exists) — this tests
192 the <filename>postrm</filename> and <filename>prerm</filename> scripts.
193 </para>
194 </listitem>
195 <listitem>
196 <para>
197 Remove the package, then reinstall it.
198 </para>
199 </listitem>
200 <listitem>
201 <para>
202 Copy the source package in a different directory and try unpacking it and
203 rebuilding it.  This tests if the package relies on existing files outside of
204 it, or if it relies on permissions being preserved on the files shipped inside
205 the .diff.gz file.
206 </para>
207 </listitem>
208 </itemizedlist>
209 </section>
210
211 <section id="sourcelayout">
212 <title>Layout of the source package</title>
213 <para>
214 There are two types of Debian source packages:
215 </para>
216 <itemizedlist>
217 <listitem>
218 <para>
219 the so-called <literal>native</literal> packages, where there is no
220 distinction between the original sources and the patches applied for Debian
221 </para>
222 </listitem>
223 <listitem>
224 <para>
225 the (more common) packages where there's an original source tarball file
226 accompanied by another file that contains the patches applied for Debian
227 </para>
228 </listitem>
229 </itemizedlist>
230 <para>
231 For the native packages, the source package includes a Debian source control
232 file (<literal>.dsc</literal>) and the source tarball
233 (<literal>.tar.gz</literal>).  A source package of a non-native package
234 includes a Debian source control file, the original source tarball
235 (<literal>.orig.tar.gz</literal>) and the Debian patches
236 (<literal>.diff.gz</literal>).
237 </para>
238 <para>
239 Whether a package is native or not is determined when it is built by
240 <citerefentry> <refentrytitle>dpkg-buildpackage</refentrytitle>
241 <manvolnum>1</manvolnum> </citerefentry>.  The rest of this section relates
242 only to non-native packages.
243 </para>
244 <para>
245 The first time a version is uploaded which corresponds to a particular upstream
246 version, the original source tar file should be uploaded and included in the
247 <filename>.changes</filename> file.  Subsequently, this very same tar file
248 should be used to build the new diffs and <filename>.dsc</filename> files, and
249 will not need to be re-uploaded.
250 </para>
251 <para>
252 By default, <command>dpkg-genchanges</command> and
253 <command>dpkg-buildpackage</command> will include the original source tar file
254 if and only if the Debian revision part of the source version number is 0 or 1,
255 indicating a new upstream version.  This behavior may be modified by using
256 <literal>-sa</literal> to always include it or <literal>-sd</literal> to always
257 leave it out.
258 </para>
259 <para>
260 If no original source is included in the upload, the original source tar-file
261 used by <command>dpkg-source</command> when constructing the
262 <filename>.dsc</filename> file and diff to be uploaded
263 <emphasis>must</emphasis> be byte-for-byte identical with the one already in
264 the archive.
265 </para>
266 <para>
267 Please notice that, in non-native packages, permissions on files that are not
268 present in the .orig.tar.gz will not be preserved, as diff does not store file
269 permissions in the patch.
270 </para>
271 </section>
272
273 <section id="distribution">
274 <title>Picking a distribution</title>
275 <para>
276 Each upload needs to specify which distribution the package is intended for.
277 The package build process extracts this information from the first line of the
278 <filename>debian/changelog</filename> file and places it in the
279 <literal>Distribution</literal> field of the <literal>.changes</literal> file.
280 </para>
281 <para>
282 There are several possible values for this field: <literal>stable</literal>,
283 <literal>unstable</literal>, <literal>testing-proposed-updates</literal> and
284 <literal>experimental</literal>.  Normally, packages are uploaded into
285 <literal>unstable</literal>.
286 </para>
287 <para>
288 Actually, there are two other possible distributions: <literal>stable-security
289 </literal> and <literal>testing-security</literal>, but read 
290 <xref linkend="bug-security"/> for more information on those.
291 </para>
292 <para>
293 It is not possible to upload a package into several distributions at the same
294 time.
295 </para>
296 <section id="upload-stable">
297 <title>Special case: uploads to the <literal>stable</literal> and 
298 <literal>oldstable</literal> distributions</title>
299 <para>
300 Uploading to <literal>stable</literal> means that the package will transfered
301 to the <literal>proposed-updates-new</literal> queue for review by the stable
302 release managers, and if approved will be installed in
303 <filename>stable-proposed-updates</filename> directory of the Debian archive.
304 From there, it will be included in <literal>stable</literal> with the next
305 point release.
306 </para>
307 <para>
308 To ensure that your upload will be accepted, you should discuss the changes
309 with the stable release team before you upload. For that, send a mail to
310 the &email-debian-release; mailing list, including the patch you want to
311 apply to the package version currently in <literal>stable</literal>. Always
312 be verbose and detailed in your changelog entries for uploads to the
313 <literal>stable</literal> distribution.
314 </para>
315 <para>
316 Extra care should be taken when uploading to <literal>stable</literal>.
317 Basically, a package should only be uploaded to <literal>stable</literal> if
318 one of the following happens:
319 </para>
320 <itemizedlist>
321 <listitem>
322 <para>
323 a truly critical functionality problem
324 </para>
325 </listitem>
326 <listitem>
327 <para>
328 the package becomes uninstallable
329 </para>
330 </listitem>
331 <listitem>
332 <para>
333 a released architecture lacks the package
334 </para>
335 </listitem>
336 </itemizedlist>
337 <para>
338 In the past, uploads to <literal>stable</literal> were used to address
339 security problems as well.  However, this practice is deprecated, as uploads
340 used for Debian security advisories are automatically copied to the appropriate
341 <filename>proposed-updates</filename> archive when the advisory is released.
342 See <xref linkend="bug-security"/> for detailed information on handling
343 security problems. If the security teams deems the problem to be too
344 benign to be fixed through a <literal>DSA</literal>, the stable release
345 managers are usually willing to include your fix nonetheless in a regular
346 upload to <literal>stable</literal>.
347 </para>
348 <para>
349 Changing anything else in the package that isn't important is discouraged,
350 because even trivial fixes can cause bugs later on.
351 </para>
352 <para>
353 Packages uploaded to <literal>stable</literal> need to be compiled on systems
354 running <literal>stable</literal>, so that their dependencies are limited to
355 the libraries (and other packages) available in <literal>stable</literal>;
356 for example, a package uploaded to <literal>stable</literal> that depends on
357 a library package that only exists in <literal>unstable</literal> will be 
358 rejected.  Making changes to dependencies of other packages (by messing with
359 <literal>Provides</literal> or <literal>shlibs</literal> files), possibly 
360 making those other packages uninstallable, is strongly discouraged.
361 </para>
362 <para>
363 Uploads to the <literal>oldstable</literal> distributions are possible as
364 long as it hasn't been archived. The same rules as for <literal>stable
365 </literal> apply.
366 </para>
367 </section>
368
369 <section id="upload-t-p-u">
370 <title>Special case: uploads to <literal>testing/testing-proposed-updates</literal></title>
371 <para>
372 Please see the information in the <link linkend="t-p-u">testing
373 section</link> for details.
374 </para>
375 </section>
376
377 </section>
378
379 <section id="upload">
380 <title>Uploading a package</title>
381 <section id="upload-ftp-master">
382 <title>Uploading to <literal>ftp-master</literal></title>
383 <para>
384 To upload a package, you should upload the files (including the signed changes
385 and dsc-file) with anonymous ftp to <literal>&ftp-upload-host;</literal> in
386 the directory <ulink
387 url="ftp://&ftp-upload-host;&upload-queue;">&upload-queue;</ulink>.
388 To get the files processed there, they need to be signed with a key in the
389 Debian Developers keyring or the Debian Maintainers keyring
390 (see <ulink url="&url-wiki-dm;"></ulink>).
391 </para>
392 <para>
393 Please note that you should transfer the changes file last.  Otherwise, your
394 upload may be rejected because the archive maintenance software will parse the
395 changes file and see that not all files have been uploaded.
396 </para>
397 <para>
398 You may also find the Debian packages <xref linkend="dupload"/> or <xref
399 linkend="dput"/> useful when uploading packages.  These handy programs help
400 automate the process of uploading packages into Debian.
401 </para>
402 <para>
403 For removing packages, please see
404 <ulink url="ftp://&ftp-upload-host;&upload-queue;/README"/> and
405 the Debian package <xref linkend="dcut"/> .
406 </para>
407 </section>
408
409 <section id="delayed-incoming">
410 <title>Delayed uploads</title>
411
412 <para>
413 It is sometimes useful to upload a package immediately, but to want this
414 package to arrive in the archive only a few days later. For example,
415 when preparing a <link linkend="nmu">Non-maintainer Upload</link>,
416 you might want to give the maintainer a few days to react.
417 </para>
418
419 <para>
420 An upload to the delayed directory keeps the package in
421 <ulink url="http://ftp-master.debian.org/deferred.html">
422 the deferred uploads queue"</ulink>.
423 When the specified waiting time is over, the package is moved into
424 the regular incoming directory for processing.
425 This is done through automatic uploading to
426 <literal>&ftp-upload-host;</literal> in upload-directory
427 <literal>DELAYED/[012345678]-day</literal>. 0-day is uploaded
428 multiple times per day to <literal>&ftp-upload-host;</literal>.
429 </para>
430 <para>
431 With dput, you can use the <literal>--delayed <replaceable>DELAY</replaceable></literal>
432 parameter to put the package into one of the queues.
433 </para>
434 </section>
435
436 <section id="s5.6.4">
437 <title>Security uploads</title>
438 <para>
439 Do <emphasis role="strong">NOT</emphasis> upload a package to the security
440 upload queue (<literal>oldstable-security</literal>, <literal>stable-security
441 </literal>, etc.) without prior authorization from the security team.  If the
442 package does not exactly meet the team's requirements, it will cause many
443 problems and delays in dealing with the unwanted upload.  For details, please
444 see section <xref linkend="bug-security"/> .
445 </para>
446 </section>
447
448 <section id="s5.6.5">
449 <title>Other upload queues</title>
450 <para>
451 The scp queues on <literal>&ftp-master-host;</literal>, and <literal>
452 security.debian.org</literal> are mostly unusable due to the login restrictions
453 on those hosts.
454 </para>
455 <para>
456 The anonymous queues on ftp.uni-erlangen.de and ftp.uk.debian.org are currently
457 down.  Work is underway to resurrect them.
458 </para>
459 <para>
460 The queues on master.debian.org, samosa.debian.org, master.debian.or.jp, and
461 ftp.chiark.greenend.org.uk are down permanently, and will not be resurrected.
462 </para>
463 </section>
464
465 <section id="upload-notification">
466 <title>Notification that a new package has been installed</title>
467 <para>
468 The Debian archive maintainers are responsible for handling package uploads.
469 For the most part, uploads are automatically handled on a daily basis by the
470 archive maintenance tools, <command>katie</command>.  Specifically, updates to
471 existing packages to the <literal>unstable</literal> distribution are handled
472 automatically.  In other cases, notably new packages, placing the uploaded 
473 package into the distribution is handled manually.  When uploads are handled
474 manually, the change to the archive may take up to a month to occur.  Please
475 be patient.
476 </para>
477 <para>
478 In any case, you will receive an email notification indicating that the package
479 has been added to the archive, which also indicates which bugs will be closed
480 by the upload.  Please examine this notification carefully, checking if any
481 bugs you meant to close didn't get triggered.
482 </para>
483 <para>
484 The installation notification also includes information on what section the
485 package was inserted into.  If there is a disparity, you will receive a
486 separate email notifying you of that.  Read on below.
487 </para>
488 <para>
489 Note that if you upload via queues, the queue daemon software will also send
490 you a notification by email.
491 </para>
492 </section>
493
494 </section>
495
496 <section id="override-file">
497 <title>Specifying the package section, subsection and priority</title>
498 <para>
499 The <filename>debian/control</filename> file's <literal>Section</literal> and
500 <literal>Priority</literal> fields do not actually specify where the file will
501 be placed in the archive, nor its priority.  In order to retain the overall
502 integrity of the archive, it is the archive maintainers who have control over
503 these fields.  The values in the <filename>debian/control</filename> file are
504 actually just hints.
505 </para>
506 <para>
507 The archive maintainers keep track of the canonical sections and priorities for
508 packages in the <literal>override file</literal>.  If there is a disparity
509 between the <literal>override file</literal> and the package's fields as
510 indicated in <filename>debian/control</filename>, then you will receive an
511 email noting the divergence when the package is installed into the archive.
512 You can either correct your <filename>debian/control</filename> file for your
513 next upload, or else you may wish to make a change in the <literal>override
514 file</literal>.
515 </para>
516 <para>
517 To alter the actual section that a package is put in, you need to first make
518 sure that the <filename>debian/control</filename> file in your package is
519 accurate.  Next, submit a
520 bug against <systemitem role="package">ftp.debian.org</systemitem> requesting
521 that the section or priority for your package be changed from the old section
522 or priority to the new one. Use a Subject like
523 <literal>override: PACKAGE1:section/priority, [...],
524   PACKAGEX:section/priority</literal>, and include the justification for the
525 change in the body of the bug report.
526 </para>
527 <para>
528 For more information about <literal>override files</literal>, see
529 <citerefentry> <refentrytitle>dpkg-scanpackages</refentrytitle>
530 <manvolnum>1</manvolnum> </citerefentry> and <ulink
531 url="&url-bts-devel;#maintincorrect"></ulink>.
532 </para>
533 <para>
534 Note that the <literal>Section</literal> field describes both the section as
535 well as the subsection, which are described in <xref
536 linkend="archive-sections"/> .  If the section is main, it should be omitted.
537 The list of allowable subsections can be found in <ulink
538 url="&url-debian-policy;ch-archive.html#s-subsections"></ulink>.
539 </para>
540 </section>
541
542 <section id="bug-handling">
543 <title>Handling bugs</title>
544 <para>
545 Every developer has to be able to work with the Debian <ulink
546 url="&url-bts;">bug tracking system</ulink>.  This includes
547 knowing how to file bug reports properly (see <xref linkend="submit-bug"/> ),
548 how to update them and reorder them, and how to process and close them.
549 </para>
550 <para>
551 The bug tracking system's features are described in the <ulink
552 url="&url-bts-devel;">BTS documentation for
553 developers</ulink>.  This includes closing bugs, sending followup messages,
554 assigning severities and tags, marking bugs as forwarded, and other issues.
555 </para>
556 <para>
557 Operations such as reassigning bugs to other packages, merging separate bug
558 reports about the same issue, or reopening bugs when they are prematurely
559 closed, are handled using the so-called control mail server.  All of the
560 commands available on this server are described in the <ulink
561 url="&url-bts-control;">BTS control server
562 documentation</ulink>.
563 </para>
564 <section id="bug-monitoring">
565 <title>Monitoring bugs</title>
566 <para>
567 If you want to be a good maintainer, you should periodically check the <ulink
568 url="&url-bts;">Debian bug tracking system (BTS)</ulink> for
569 your packages.  The BTS contains all the open bugs against your packages.  You
570 can check them by browsing this page:
571 <literal>http://&bugs-host;/<replaceable>yourlogin</replaceable>@debian.org</literal>.
572 </para>
573 <para>
574 Maintainers interact with the BTS via email addresses at
575 <literal>&bugs-host;</literal>.  Documentation on available
576 commands can be found at <ulink url="&url-bts;"></ulink>, or,
577 if you have installed the <systemitem role="package">doc-debian</systemitem>
578 package, you can look at the local files &file-bts-docs;.
579 </para>
580 <para>
581 Some find it useful to get periodic reports on open bugs.  You can add a cron
582 job such as the following if you want to get a weekly email outlining all the
583 open bugs against your packages:
584 </para>
585 <screen>
586 # ask for weekly reports of bugs in my packages
587 &cron-bug-report;
588 </screen>
589 <para>
590 Replace <replaceable>address</replaceable> with your official Debian maintainer
591 address.
592 </para>
593 </section>
594
595 <section id="bug-answering">
596 <title>Responding to bugs</title>
597 <para>
598 When responding to bugs, make sure that any discussion you have about bugs is
599 sent both to the original submitter of the bug, and to the bug itself (e.g.,
600 <email>123@&bugs-host;</email>).  If you're writing a new mail and you
601 don't remember the submitter email address, you can use the
602 <email>123-submitter@&bugs-host;</email> email to contact the submitter
603 <emphasis>and</emphasis> to record your mail within the bug log (that means you
604 don't need to send a copy of the mail to <email>123@&bugs-host;</email>).
605 </para>
606 <para>
607 If you get a bug which mentions FTBFS, this means Fails to build from source.
608 Porters frequently use this acronym.
609 </para>
610 <para>
611 Once you've dealt with a bug report (e.g.  fixed it), mark it as
612 <literal>done</literal> (close it) by sending an explanation message to
613 <email>123-done@&bugs-host;</email>.  If you're fixing a bug by changing
614 and uploading the package, you can automate bug closing as described in <xref
615 linkend="upload-bugfix"/> .
616 </para>
617 <para>
618 You should <emphasis>never</emphasis> close bugs via the bug server
619 <literal>close</literal> command sent to &email-bts-control;.
620 If you do so, the original submitter will not receive any information about why
621 the bug was closed.
622 </para>
623 </section>
624
625 <section id="bug-housekeeping">
626 <title>Bug housekeeping</title>
627 <para>
628 As a package maintainer, you will often find bugs in other packages or have
629 bugs reported against your packages which are actually bugs in other packages.
630 The bug tracking system's features are described in the <ulink
631 url="&url-bts-devel;">BTS documentation for Debian
632 developers</ulink>.  Operations such as reassigning, merging, and tagging bug
633 reports are described in the <ulink
634 url="&url-bts-control;">BTS control server
635 documentation</ulink>.  This section contains some guidelines for managing your
636 own bugs, based on the collective Debian developer experience.
637 </para>
638 <para>
639 Filing bugs for problems that you find in other packages is one of the civic
640 obligations of maintainership, see <xref linkend="submit-bug"/> for details.
641 However, handling the bugs in your own packages is even more important.
642 </para>
643 <para>
644 Here's a list of steps that you may follow to handle a bug report:
645 </para>
646 <orderedlist numeration="arabic">
647 <listitem>
648 <para>
649 Decide whether the report corresponds to a real bug or not.  Sometimes users
650 are just calling a program in the wrong way because they haven't read the
651 documentation.  If you diagnose this, just close the bug with enough
652 information to let the user correct their problem (give pointers to the good
653 documentation and so on).  If the same report comes up again and again you may
654 ask yourself if the documentation is good enough or if the program shouldn't
655 detect its misuse in order to give an informative error message.  This is an
656 issue that may need to be brought up with the upstream author.
657 </para>
658 <para>
659 If the bug submitter disagrees with your decision to close the bug, they may
660 reopen it until you find an agreement on how to handle it.  If you don't find
661 any, you may want to tag the bug <literal>wontfix</literal> to let people know
662 that the bug exists but that it won't be corrected.  If this situation is
663 unacceptable, you (or the submitter) may want to require a decision of the
664 technical committee by reassigning the bug to <systemitem
665 role="package">tech-ctte</systemitem> (you may use the clone command of the BTS
666 if you wish to keep it reported against your package).  Before doing so, please
667 read the <ulink url="&url-tech-ctte;">recommended
668 procedure</ulink>.
669 </para>
670 </listitem>
671 <listitem>
672 <para>
673 If the bug is real but it's caused by another package, just reassign the bug to
674 the right package.  If you don't know which package it should be reassigned to,
675 you should ask for help on <link linkend="irc-channels">IRC</link> or
676 on &email-debian-devel;.  Please inform the maintainer(s) of the package
677 you reassign the bug to, for example by Cc:ing the message that does the
678 reassign to <email>packagename@packages.debian.org</email> and explaining
679 your reasons in that mail. Please note that a simple reassignment is
680 <emphasis>not</emphasis> e-mailed to the maintainers of the package
681 being reassigned to, so they won't know about it until they look at
682 a bug overview for their packages.
683 </para>
684 <para>
685 If the bug affects the operation of your package, please consider
686 cloning the bug and reassigning the clone to the package that really
687 causes the behavior. Otherwise, the bug will not be shown in your
688 package's bug list, possibly causing users to report the same bug over
689 and over again. You should block "your" bug with the reassigned, cloned
690 bug to document the relationship.
691 </para>
692 </listitem>
693 <listitem>
694 <para>
695 Sometimes you also have to adjust the severity of the bug so that it matches
696 our definition of the severity.  That's because people tend to inflate the
697 severity of bugs to make sure their bugs are fixed quickly.  Some bugs may even
698 be dropped to wishlist severity when the requested change is just cosmetic.
699 </para>
700 </listitem>
701 <listitem>
702 <para>
703 If the bug is real but the same problem has already been reported by someone
704 else, then the two relevant bug reports should be merged into one using the
705 merge command of the BTS.  In this way, when the bug is fixed, all of the
706 submitters will be informed of this.  (Note, however, that emails sent to one
707 bug report's submitter won't automatically be sent to the other report's
708 submitter.) For more details on the technicalities of the merge command and its
709 relative, the unmerge command, see the BTS control server documentation.
710 </para>
711 </listitem>
712 <listitem>
713 <para>
714 The bug submitter may have forgotten to provide some information, in which case
715 you have to ask them for the required information.  You may use the
716 <literal>moreinfo</literal> tag to mark the bug as such.  Moreover if you can't
717 reproduce the bug, you tag it <literal>unreproducible</literal>.  Anyone who
718 can reproduce the bug is then invited to provide more information on how to
719 reproduce it.  After a few months, if this information has not been sent by
720 someone, the bug may be closed.
721 </para>
722 </listitem>
723 <listitem>
724 <para>
725 If the bug is related to the packaging, you just fix it.  If you are not able
726 to fix it yourself, then tag the bug as <literal>help</literal>.  You can also
727 ask for help on &email-debian-devel; or
728 &email-debian-qa;.  If it's an upstream problem, you have to
729 forward it to the upstream author.  Forwarding a bug is not enough, you have to
730 check at each release if the bug has been fixed or not.  If it has, you just
731 close it, otherwise you have to remind the author about it.  If you have the
732 required skills you can prepare a patch that fixes the bug and send it to the
733 author at the same time.  Make sure to send the patch to the BTS and to tag the
734 bug as <literal>patch</literal>.
735 </para>
736 </listitem>
737 <listitem>
738 <para>
739 If you have fixed a bug in your local copy, or if a fix has been committed to
740 the CVS repository, you may tag the bug as <literal>pending</literal> to let
741 people know that the bug is corrected and that it will be closed with the next
742 upload (add the <literal>closes:</literal> in the
743 <filename>changelog</filename>).  This is particularly useful if you are
744 several developers working on the same package.
745 </para>
746 </listitem>
747 <listitem>
748 <para>
749 Once a corrected package is available in the archive, the bug should be
750 closed indicating the version in which it was fixed. This can be done
751 automatically, read <xref linkend="upload-bugfix"/>.
752 </para>
753 </listitem>
754 </orderedlist>
755 </section>
756
757 <section id="upload-bugfix">
758 <title>When bugs are closed by new uploads</title>
759 <para>
760 As bugs and problems are fixed in your packages, it is your responsibility as
761 the package maintainer to close these bugs.  However, you should not close a
762 bug until the package which fixes the bug has been accepted into the Debian
763 archive.  Therefore, once you get notification that your updated package has
764 been installed into the archive, you can and should close the bug in the BTS.
765 Also, the bug should be closed with the correct version.
766 </para>
767 <para>
768 However, it's possible to avoid having to manually close bugs after the upload
769 — just list the fixed bugs in your <filename>debian/changelog</filename>
770 file, following a certain syntax, and the archive maintenance software will
771 close the bugs for you.  For example:
772 </para>
773 <screen>
774 acme-cannon (3.1415) unstable; urgency=low
775
776   * Frobbed with options (closes: Bug#98339)
777   * Added safety to prevent operator dismemberment, closes: bug#98765,
778     bug#98713, #98714.
779   * Added man page. Closes: #98725.
780 </screen>
781 <para>
782 Technically speaking, the following Perl regular expression describes how bug
783 closing changelogs are identified:
784 </para>
785 <screen>
786   /closes:\s*(?:bug)?\#\s*\d+(?:,\s*(?:bug)?\#\s*\d+)*/ig
787 </screen>
788 <para>
789 We prefer the <literal>closes: #<replaceable>XXX</replaceable></literal>
790 syntax, as it is the most concise entry and the easiest to integrate with the
791 text of the <filename>changelog</filename>.  Unless specified different by the
792 <replaceable>-v</replaceable>-switch to <command>dpkg-buildpackage</command>,
793 only the bugs closed in the most recent changelog entry are closed (basically,
794 exactly the bugs mentioned in the changelog-part in the
795 <filename>.changes</filename> file are closed).
796 </para>
797 <para>
798 Historically, uploads identified as <link linkend="nmu">Non-maintainer
799 upload (NMU)</link> were tagged <literal>fixed</literal> instead of being
800 closed, but that practice was ceased with the advent of version-tracking.  The
801 same applied to the tag <literal>fixed-in-experimental</literal>.
802 </para>
803 <para>
804 If you happen to mistype a bug number or forget a bug in the changelog entries,
805 don't hesitate to undo any damage the error caused.  To reopen wrongly closed
806 bugs, send a <literal>reopen <replaceable>XXX</replaceable></literal> command
807 to the bug tracking system's control address,
808 &email-bts-control;.  To close any remaining bugs that were
809 fixed by your upload, email the <filename>.changes</filename> file to
810 <email>XXX-done@&bugs-host;</email>, where <replaceable>XXX</replaceable>
811 is the bug number, and put Version: YYY and an empty line as the first two
812 lines of the body of the email, where <replaceable>YYY</replaceable> is the
813 first version where the bug has been fixed.
814 </para>
815 <para>
816 Bear in mind that it is not obligatory to close bugs using the changelog as
817 described above.  If you simply want to close bugs that don't have anything to
818 do with an upload you made, do it by emailing an explanation to
819 <email>XXX-done@&bugs-host;</email>.  Do <emphasis
820 role="strong">not</emphasis> close bugs in the changelog entry of a version if
821 the changes in that version of the package don't have any bearing on the bug.
822 </para>
823 <para>
824 For general information on how to write your changelog entries, see <xref
825 linkend="bpp-debian-changelog"/> .
826 </para>
827 </section>
828
829 <section id="bug-security">
830 <title>Handling security-related bugs</title>
831 <para>
832 Due to their sensitive nature, security-related bugs must be handled carefully.
833 The Debian Security Team exists to coordinate this activity, keeping track of
834 outstanding security problems, helping maintainers with security problems or
835 fixing them themselves, sending security advisories, and maintaining
836 <literal>security.debian.org</literal>.
837 </para>
838 <para>
839 When you become aware of a security-related bug in a Debian package, whether or
840 not you are the maintainer, collect pertinent information about the problem,
841 and promptly contact the security team at
842 &email-security-team; as soon as possible.  <emphasis
843 role="strong">DO NOT UPLOAD</emphasis> any packages for <literal>stable</literal>
844 without contacting the team.  Useful information includes, for example:
845 </para>
846 <itemizedlist>
847 <listitem>
848 <para>
849 Which versions of the package are known to be affected by the bug.  Check each
850 version that is present in a supported Debian release, as well as 
851 <literal>testing</literal> and <literal>unstable</literal>.
852 </para>
853 </listitem>
854 <listitem>
855 <para>
856 The nature of the fix, if any is available (patches are especially helpful)
857 </para>
858 </listitem>
859 <listitem>
860 <para>
861 Any fixed packages that you have prepared yourself (send only the
862 <literal>.diff.gz</literal> and <literal>.dsc</literal> files and read <xref
863 linkend="bug-security-building"/> first)
864 </para>
865 </listitem>
866 <listitem>
867 <para>
868 Any assistance you can provide to help with testing (exploits, regression
869 testing, etc.)
870 </para>
871 </listitem>
872 <listitem>
873 <para>
874 Any information needed for the advisory (see <xref
875 linkend="bug-security-advisories"/> )
876 </para>
877 </listitem>
878 </itemizedlist>
879 <para>As the maintainer of the package, you have the responsibility to
880 maintain it, even in the stable release. You are in the best position
881 to evaluate patches and test updated packages, so please see the sections
882 below on how to prepare packages for the Security Team to handle.</para>
883
884 <section id="bug-security-tracker">
885 <title>The Security Tracker</title>
886 <para>
887 The security team maintains a central database, the
888 <ulink url="http://security-tracker.debian.net/">Debian Security Tracker</ulink>.
889 This contains all public information that is known about security issues:
890 which packages and versions are affected or fixed, and thus whether stable,
891 testing and/or unstable are vulnerable. Information that is still confidential
892 is not added to the tracker.
893 </para>
894 <para>
895 You can search it for a specific issue, but also on package name. Look
896 for your package to see which issues are still open. If you can, please provide
897 more information about those issues, or help to address them in your package.
898 Instructions are on the tracker web pages.
899 </para>
900 </section>
901
902 <section id="bug-security-confidentiality">
903 <title>Confidentiality</title>
904 <para>
905 Unlike most other activities within Debian, information about security issues
906 must sometimes be kept private for a time.  This allows software distributors
907 to coordinate their disclosure in order to minimize their users' exposure.
908 Whether this is the case depends on the nature of the problem and corresponding
909 fix, and whether it is already a matter of public knowledge.
910 </para>
911 <para>
912 There are several ways developers can learn of a security problem:
913 </para>
914 <itemizedlist>
915 <listitem>
916 <para>
917 they notice it on a public forum (mailing list, web site, etc.)
918 </para>
919 </listitem>
920 <listitem>
921 <para>
922 someone files a bug report
923 </para>
924 </listitem>
925 <listitem>
926 <para>
927 someone informs them via private email
928 </para>
929 </listitem>
930 </itemizedlist>
931 <para>
932 In the first two cases, the information is public and it is important to have a
933 fix as soon as possible.  In the last case, however, it might not be public
934 information.  In that case there are a few possible options for dealing with
935 the problem:
936 </para>
937 <itemizedlist>
938 <listitem>
939 <para>
940 If the security exposure is minor, there is sometimes no need to keep the
941 problem a secret and a fix should be made and released.
942 </para>
943 </listitem>
944 <listitem>
945 <para>
946 If the problem is severe, it is preferable to share the information with other
947 vendors and coordinate a release.  The security team keeps in contact with the
948 various organizations and individuals and can take care of that.
949 </para>
950 </listitem>
951 </itemizedlist>
952 <para>
953 In all cases if the person who reports the problem asks that it not be
954 disclosed, such requests should be honored, with the obvious exception of
955 informing the security team in order that a fix may be produced for a stable
956 release of Debian.  When sending confidential information to the security team,
957 be sure to mention this fact.
958 </para>
959 <para>
960 Please note that if secrecy is needed you may not upload a fix to 
961 <literal>unstable</literal> (or
962 anywhere else, such as a public CVS repository).  It is not sufficient to
963 obfuscate the details of the change, as the code itself is public, and can (and
964 will) be examined by the general public.
965 </para>
966 <para>
967 There are two reasons for releasing information even though secrecy is
968 requested: the problem has been known for a while, or the problem or exploit
969 has become public.
970 </para>
971 <para>
972 The Security Team has a PGP-key to enable encrypted communication about
973 sensitive issues. See the <ulink url="http://www.debian.org/security/faq.en.html#contact">Security Team FAQ</ulink> for details.
974 </para>
975 </section>
976
977 <section id="bug-security-advisories">
978 <title>Security Advisories</title>
979 <para>
980 Security advisories are only issued for the current, released stable
981 distribution, and <emphasis>not</emphasis> for <literal>testing</literal>
982 or <literal>unstable</literal>.  When released, advisories are sent to the
983 &email-debian-security-announce; mailing list and posted on
984 <ulink url="&url-debian-security-advisories;">the security web
985 page</ulink>.  Security advisories are written and posted by the security team.
986 However they certainly do not mind if a maintainer can supply some of the
987 information for them, or write part of the text.  Information that should be in
988 an advisory includes:
989 </para>
990 <itemizedlist>
991 <listitem>
992 <para>
993 A description of the problem and its scope, including:
994 </para>
995 <itemizedlist>
996 <listitem>
997 <para>
998 The type of problem (privilege escalation, denial of service, etc.)
999 </para>
1000 </listitem>
1001 <listitem>
1002 <para>
1003 What privileges may be gained, and by whom (if any)
1004 </para>
1005 </listitem>
1006 <listitem>
1007 <para>
1008 How it can be exploited
1009 </para>
1010 </listitem>
1011 <listitem>
1012 <para>
1013 Whether it is remotely or locally exploitable
1014 </para>
1015 </listitem>
1016 <listitem>
1017 <para>
1018 How the problem was fixed
1019 </para>
1020 </listitem>
1021 </itemizedlist>
1022 <para>
1023 This information allows users to assess the threat to their systems.
1024 </para>
1025 </listitem>
1026 <listitem>
1027 <para>
1028 Version numbers of affected packages
1029 </para>
1030 </listitem>
1031 <listitem>
1032 <para>
1033 Version numbers of fixed packages
1034 </para>
1035 </listitem>
1036 <listitem>
1037 <para>
1038 Information on where to obtain the updated packages (usually from the Debian
1039 security archive)
1040 </para>
1041 </listitem>
1042 <listitem>
1043 <para>
1044 References to upstream advisories, <ulink
1045 url="http://cve.mitre.org">CVE</ulink> identifiers, and any other information
1046 useful in cross-referencing the vulnerability
1047 </para>
1048 </listitem>
1049 </itemizedlist>
1050 </section>
1051
1052 <section id="bug-security-building">
1053 <title>Preparing packages to address security issues</title>
1054 <para>
1055 One way that you can assist the security team in their duties is to provide
1056 them with fixed packages suitable for a security advisory for the stable Debian
1057 release.
1058 </para>
1059 <para>
1060 When an update is made to the stable release, care must be taken to avoid
1061 changing system behavior or introducing new bugs.  In order to do this, make as
1062 few changes as possible to fix the bug.  Users and administrators rely on the
1063 exact behavior of a release once it is made, so any change that is made might
1064 break someone's system.  This is especially true of libraries: make sure you
1065 never change the API or ABI, no matter how small the change.
1066 </para>
1067 <para>
1068 This means that moving to a new upstream version is not a good solution.
1069 Instead, the relevant changes should be back-ported to the version present in
1070 the current stable Debian release.  Generally, upstream maintainers are willing
1071 to help if needed.  If not, the Debian security team may be able to help.
1072 </para>
1073 <para>
1074 In some cases, it is not possible to back-port a security fix, for example when
1075 large amounts of source code need to be modified or rewritten.  If this
1076 happens, it may be necessary to move to a new upstream version.  However, this
1077 is only done in extreme situations, and you must always coordinate that with
1078 the security team beforehand.
1079 </para>
1080 <para>
1081 Related to this is another important guideline: always test your changes.  If
1082 you have an exploit available, try it and see if it indeed succeeds on the
1083 unpatched package and fails on the fixed package.  Test other, normal actions
1084 as well, as sometimes a security fix can break seemingly unrelated features in
1085 subtle ways.
1086 </para>
1087 <para>
1088 Do <emphasis role="strong">NOT</emphasis> include any changes in your package
1089 which are not directly related to fixing the vulnerability.  These will only
1090 need to be reverted, and this wastes time.  If there are other bugs in your
1091 package that you would like to fix, make an upload to proposed-updates in the
1092 usual way, after the security advisory is issued.  The security update
1093 mechanism is not a means for introducing changes to your package which would
1094 otherwise be rejected from the stable release, so please do not attempt to do
1095 this.
1096 </para>
1097 <para>
1098 Review and test your changes as much as possible.  Check the differences from
1099 the previous version repeatedly (<command>interdiff</command> from the
1100 <systemitem role="package">patchutils</systemitem> package and
1101 <command>debdiff</command> from <systemitem
1102 role="package">devscripts</systemitem> are useful tools for this, see <xref
1103 linkend="debdiff"/> ).
1104 </para>
1105 <para>
1106 Be sure to verify the following items:
1107 </para>
1108 <itemizedlist>
1109 <listitem>
1110 <para>
1111 <emphasis role="strong">Target the right distribution</emphasis>
1112 in your <filename>debian/changelog</filename>.
1113 For <literal>stable</literal> this is <literal>stable-security</literal> and
1114 for testing this is <literal>testing-security</literal>, and for the previous
1115 stable release, this is <literal>oldstable-security</literal>.  Do not target
1116 <replaceable>distribution</replaceable><literal>-proposed-updates</literal> or
1117 <literal>stable</literal>!
1118 </para>
1119 </listitem>
1120 <listitem>
1121 <para>
1122 The upload should have <emphasis role="strong">urgency=high</emphasis>.
1123 </para>
1124 </listitem>
1125 <listitem>
1126 <para>
1127 Make descriptive, meaningful changelog entries.  Others will rely on them to
1128 determine whether a particular bug was fixed.  Add <literal>closes:</literal>
1129 statements for any <emphasis role="strong">Debian bugs</emphasis> filed.
1130 Always include an external reference, preferably a <emphasis role="strong">CVE
1131 identifier</emphasis>, so that it can be cross-referenced. However, if a CVE
1132 identifier has not yet been assigned, do not wait for it but continue the
1133 process. The identifier can be cross-referenced later.
1134 </para>
1135 </listitem>
1136 <listitem>
1137 <para>
1138 Make sure the <emphasis role="strong">version number</emphasis> is proper. 
1139 It must be greater than the current package, but less than package versions in
1140 later distributions.  If in doubt, test it with <literal>dpkg
1141 --compare-versions</literal>.  Be careful not to re-use a version number that
1142 you have already used for a previous upload, or one that conflicts with a
1143 binNMU. The convention is to append
1144 <literal>+</literal><replaceable>codename</replaceable><literal>1</literal>, e.g.
1145 <literal>1:2.4.3-4+etch1</literal>, of course increasing 1 for any subsequent
1146 uploads.
1147 </para>
1148 </listitem>
1149 <listitem>
1150 <para>
1151 Unless the upstream source has been uploaded to <literal>security.debian.org
1152 </literal> before (by a previous security update), build the upload <emphasis
1153 role="strong">with full upstream source</emphasis> (<literal>dpkg-buildpackage
1154 -sa</literal>).  If there has been a previous upload to
1155 <literal>security.debian.org</literal> with the same upstream version, you may
1156 upload without upstream source (<literal> dpkg-buildpackage -sd</literal>).
1157 </para>
1158 </listitem>
1159 <listitem>
1160 <para>
1161 Be sure to use the <emphasis role="strong">exact same
1162 <filename>*.orig.tar.gz</filename></emphasis> as used in the
1163 normal archive, otherwise it is not possible to move the security fix into the
1164 main archives later.
1165 </para>
1166 </listitem>
1167 <listitem>
1168 <para>
1169 Build the package on a <emphasis role="strong">clean system</emphasis> which only
1170 has packages installed from the distribution you are building for. If you do not
1171 have such a system yourself, you can use a debian.org machine (see
1172 <xref linkend="server-machines"/> ) or setup a chroot (see
1173 <xref linkend="pbuilder"/> and <xref linkend="debootstrap"/> ).
1174 </para>
1175 </listitem>
1176 </itemizedlist>
1177 </section>
1178
1179 <section id="bug-security-upload">
1180 <title>Uploading the fixed package</title>
1181 <para>
1182 Do <emphasis role="strong">NOT</emphasis> upload a package to the security
1183 upload queue (<literal>oldstable-security</literal>, <literal>stable-security
1184 </literal>, etc.) without prior authorization from the security team.  If the
1185 package does not exactly meet the team's requirements, it will cause many 
1186 problems and delays in dealing with the unwanted upload.
1187 </para>
1188 <para>
1189 Do <emphasis role="strong">NOT</emphasis> upload your fix to <literal>
1190 proposed-updates</literal> without coordinating with the security team.  
1191 Packages from <literal>security.debian.org</literal> will be copied into
1192 the <literal>proposed-updates</literal> directory automatically.  If a package
1193 with the same or a higher version number is already installed into the archive,
1194 the security update will be rejected by the archive system.  That way, the
1195 stable distribution will end up without a security update for this package
1196 instead.
1197 </para>
1198 <para>
1199 Once you have created and tested the new package and it has been approved by
1200 the security team, it needs to be uploaded so that it can be installed in the
1201 archives.  For security uploads, the place to upload to is
1202 <literal>ftp://security-master.debian.org/pub/SecurityUploadQueue/</literal> .
1203 </para>
1204 <para>
1205 Once an upload to the security queue has been accepted, the package will
1206 automatically be built for all architectures and stored for verification by
1207 the security team.
1208 </para>
1209 <para>
1210 Uploads which are waiting for acceptance or verification are only accessible by
1211 the security team.  This is necessary since there might be fixes for security
1212 problems that cannot be disclosed yet.
1213 </para>
1214 <para>
1215 If a member of the security team accepts a package, it will be installed on
1216 <literal>security.debian.org</literal> as well as proposed for the proper
1217 <replaceable>distribution</replaceable><literal>-proposed-updates</literal>
1218 on <literal>&ftp-master-host;</literal>.
1219 </para>
1220 </section>
1221
1222 </section>
1223
1224 </section>
1225
1226 <section id="archive-manip">
1227 <title>Moving, removing, renaming, adopting, and orphaning packages</title>
1228 <para>
1229 Some archive manipulation operations are not automated in the Debian upload
1230 process.  These procedures should be manually followed by maintainers.  This
1231 chapter gives guidelines on what to do in these cases.
1232 </para>
1233 <section id="moving-pkgs">
1234 <title>Moving packages</title>
1235 <para>
1236 Sometimes a package will change its section.  For instance, a package from the
1237 `non-free' section might be GPL'd in a later version, in which case the package
1238 should be moved to `main' or `contrib'.<footnote><para> See the <ulink
1239 url="&url-debian-policy;">Debian Policy Manual</ulink> for
1240 guidelines on what section a package belongs in.  </para> </footnote>
1241 </para>
1242 <para>
1243 If you need to change the section for one of your packages, change the package
1244 control information to place the package in the desired section, and re-upload
1245 the package (see the <ulink
1246 url="&url-debian-policy;">Debian Policy Manual</ulink> for
1247 details).  You must ensure that you include the
1248 <filename>.orig.tar.gz</filename> in your upload (even if you are not uploading
1249 a new upstream version), or it will not appear in the new section together with
1250 the rest of the package.  If your new section is valid, it will be moved
1251 automatically.  If it does not, then contact the ftpmasters in order to
1252 understand what happened.
1253 </para>
1254 <para>
1255 If, on the other hand, you need to change the <literal>subsection</literal>
1256 of one of your packages (e.g., ``devel'', ``admin''), the procedure is slightly
1257 different.  Correct the subsection as found in the control file of the package,
1258 and re-upload that.  Also, you'll need to get the override file updated, as
1259 described in <xref linkend="override-file"/> .
1260 </para>
1261 </section>
1262
1263 <section id="removing-pkgs">
1264 <title>Removing packages</title>
1265 <para>
1266 If for some reason you want to completely remove a package (say, if it is an
1267 old compatibility library which is no longer required), you need to file a bug
1268 against <literal>ftp.debian.org</literal> asking that the package be removed;
1269 as all bugs, this bug should normally have normal severity.
1270 The bug title should be in the form <literal>RM: <replaceable>package
1271 </replaceable> <replaceable>[architecture list]</replaceable> -- 
1272 <replaceable>reason</replaceable></literal>, where <replaceable>package</replaceable>
1273 is the package to be removed and <replaceable>reason</replaceable> is a
1274 short summary of the reason for the removal request. 
1275 <replaceable>[architecture list]</replaceable> is optional and only needed
1276 if the removal request only applies to some architectures, not all. Note
1277 that the <command>reportbug</command> will create a title conforming
1278 to these rules when you use it to report a bug against the <literal>
1279 ftp.debian.org</literal> pseudo-package.
1280 </para>
1281
1282 <para>
1283 If you want to remove a package you maintain, you should note this in
1284 the bug title by prepending <literal>ROM</literal> (Request Of Maintainer).
1285 There are several other standard acronyms used in the reasoning for a package
1286 removal, see <ulink url="http://&ftp-master-host;/removals.html"></ulink>
1287 for a complete list. That page also provides a convenient overview of
1288 pending removal requests.
1289 </para>
1290
1291 <para>
1292 Note that removals can only be done for the <literal>unstable
1293 </literal>, <literal>experimental</literal> and <literal>stable
1294 </literal> distribution.  Packages are not removed from 
1295 <literal>testing</literal> directly.  Rather, they will be removed
1296 automatically after the package has been removed from
1297 <literal>unstable</literal> and no package in <literal>testing
1298 </literal> depends on it.
1299 </para>
1300 <para>
1301 There is one exception when an explicit removal request is not necessary: If a
1302 (source or binary) package is an orphan, it will be removed semi-automatically.
1303 For a binary-package, this means if there is no longer any source package
1304 producing this binary package; if the binary package is just no longer produced
1305 on some architectures, a removal request is still necessary.  For a
1306 source-package, this means that all binary packages it refers to have been
1307 taken over by another source package.
1308 </para>
1309 <para>
1310 In your removal request, you have to detail the reasons justifying the request.
1311 This is to avoid unwanted removals and to keep a trace of why a package has
1312 been removed.  For example, you can provide the name of the package that
1313 supersedes the one to be removed.
1314 </para>
1315 <para>
1316 Usually you only ask for the removal of a package maintained by yourself.  If
1317 you want to remove another package, you have to get the approval of its
1318 maintainer. Should the package be orphaned and thus have no maintainer,
1319 you should first discuss the removal request on &email-debian-qa;. If
1320 there is a consensus that the package should be removed, you should
1321 reassign and retitle the <literal>O:</literal> bug filed against the
1322 <literal>wnpp</literal> package instead of filing a new bug as
1323 removal request.
1324 </para>
1325 <para>
1326 Further information relating to these and other package removal related topics
1327 may be found at <ulink url="http://wiki.debian.org/ftpmaster_Removals"></ulink>
1328 and <ulink url="&url-debian-qa;howto-remove.html"></ulink>.
1329 </para>
1330 <para>
1331 If in doubt concerning whether a package is disposable, email
1332 &email-debian-devel; asking for opinions.  Also of interest is
1333 the <command>apt-cache</command> program from the <systemitem
1334 role="package">apt</systemitem> package.  When invoked as <literal>apt-cache
1335 showpkg <replaceable>package</replaceable></literal>, the program will show
1336 details for <replaceable>package</replaceable>, including reverse depends.
1337 Other useful programs include <literal>apt-cache rdepends</literal>,
1338 <command>apt-rdepends</command>, <command>build-rdeps</command> (in the
1339 <systemitem role="package">devscripts</systemitem> package) and
1340 <command>grep-dctrl</command>.  Removal of
1341 orphaned packages is discussed on &email-debian-qa;.
1342 </para>
1343 <para>
1344 Once the package has been removed, the package's bugs should be handled.  They
1345 should either be reassigned to another package in the case where the actual
1346 code has evolved into another package (e.g.  <literal>libfoo12</literal> was
1347 removed because <literal>libfoo13</literal> supersedes it) or closed if the
1348 software is simply no longer part of Debian.
1349 When closing the bugs,
1350 to avoid marking the bugs as fixed in versions of the packages
1351 in previous Debian releases, they should be marked as fixed
1352 in the version <literal>&lt;most-recent-version-ever-in-Debian&gt;+rm</literal>.
1353 </para>
1354 <section id="s5.9.2.1">
1355 <title>Removing packages from <filename>Incoming</filename></title>
1356 <para>
1357 In the past, it was possible to remove packages from
1358 <filename>incoming</filename>.  However, with the introduction of the new
1359 incoming system, this is no longer possible.  Instead, you have to upload a new
1360 revision of your package with a higher version than the package you want to
1361 replace.  Both versions will be installed in the archive but only the higher
1362 version will actually be available in <literal>unstable</literal> since the
1363 previous version will immediately be replaced by the higher.  However, if you
1364 do proper testing of your packages, the need to replace a package should not
1365 occur too often anyway.
1366 </para>
1367 </section>
1368
1369 </section>
1370
1371 <section id="s5.9.3">
1372 <title>Replacing or renaming packages</title>
1373 <para>
1374 When the upstream maintainers for one of your packages chose to
1375 rename their software (or you made a mistake naming your package),
1376 you should follow a two-step process to rename it. In the first
1377 step, change the <filename>debian/control</filename> file to
1378 reflect the new name and to replace, provide and conflict with the
1379 obsolete package name (see the <ulink url="&url-debian-policy;">
1380 Debian Policy Manual</ulink> for details).  Please note that you
1381 should only add a <literal>Provides</literal> relation if all
1382 packages depending on the obsolete package name continue to work
1383 after the renaming. Once you've uploaded the package and the package
1384 has moved into the archive, file a bug against <literal>
1385 ftp.debian.org</literal> asking to remove the package with the
1386 obsolete name (see <xref linkend="removing-pkgs"/>).  Do not forget
1387 to properly reassign the package's bugs at the same time.
1388 </para>
1389 <para>
1390 At other times, you may make a mistake in constructing your package and wish to
1391 replace it.  The only way to do this is to increase the version number and
1392 upload a new version.  The old version will be expired in the usual manner.
1393 Note that this applies to each part of your package, including the sources: if
1394 you wish to replace the upstream source tarball of your package, you will need
1395 to upload it with a different version.  An easy possibility is to replace
1396 <filename>foo_1.00.orig.tar.gz</filename> with
1397 <filename>foo_1.00+0.orig.tar.gz</filename>.  This restriction gives each file
1398 on the ftp site a unique name, which helps to ensure consistency across the
1399 mirror network.
1400 </para>
1401 </section>
1402
1403 <section id="orphaning">
1404 <title>Orphaning a package</title>
1405 <para>
1406 If you can no longer maintain a package, you need to inform others, and see
1407 that the package is marked as orphaned.  You should set the package maintainer
1408 to <literal>Debian QA Group &orphan-address;</literal> and
1409 submit a bug report against the pseudo package <systemitem
1410 role="package">wnpp</systemitem>.  The bug report should be titled <literal>O:
1411 <replaceable>package</replaceable> -- <replaceable>short
1412 description</replaceable></literal> indicating that the package is now
1413 orphaned.  The severity of the bug should be set to
1414 <literal>normal</literal>; if the package has a priority of standard or
1415 higher, it should be set to important.  If you feel it's necessary, send a copy
1416 to &email-debian-devel; by putting the address in the
1417 X-Debbugs-CC: header of the message (no, don't use CC:, because that way the
1418 message's subject won't indicate the bug number).
1419 </para>
1420 <para>
1421 If you just intend to give the package away, but you can keep maintainership
1422 for the moment, then you should instead submit a bug against <systemitem
1423 role="package">wnpp</systemitem> and title it <literal>RFA:
1424 <replaceable>package</replaceable> -- <replaceable>short
1425 description</replaceable></literal>.  <literal>RFA</literal> stands for
1426 <literal>Request For Adoption</literal>.
1427 </para>
1428 <para>
1429 More information is on the <ulink url="&url-wnpp;">WNPP
1430 web pages</ulink>.
1431 </para>
1432 </section>
1433
1434 <section id="adopting">
1435 <title>Adopting a package</title>
1436 <para>
1437 A list of packages in need of a new maintainer is available in the <ulink
1438 url="&url-wnpp;">Work-Needing and Prospective Packages
1439 list (WNPP)</ulink>.  If you wish to take over maintenance of any of the
1440 packages listed in the WNPP, please take a look at the aforementioned page for
1441 information and procedures.
1442 </para>
1443 <para>
1444 It is not OK to simply take over a package that you feel is neglected — that
1445 would be package hijacking.  You can, of course, contact the current maintainer
1446 and ask them if you may take over the package.  If you have reason to believe a
1447 maintainer has gone AWOL (absent without leave), see <xref linkend="mia-qa"/> .
1448 </para>
1449 <para>
1450 Generally, you may not take over the package without the assent of the current
1451 maintainer.  Even if they ignore you, that is still not grounds to take over a
1452 package.  Complaints about maintainers should be brought up on the developers'
1453 mailing list.  If the discussion doesn't end with a positive conclusion, and
1454 the issue is of a technical nature, consider bringing it to the attention of
1455 the technical committee (see the <ulink
1456 url="&url-tech-ctte;">technical committee web page</ulink> for
1457 more information).
1458 </para>
1459 <para>
1460 If you take over an old package, you probably want to be listed as the
1461 package's official maintainer in the bug system.  This will happen
1462 automatically once you upload a new version with an updated
1463 <literal>Maintainer:</literal> field, although it can take a few hours after
1464 the upload is done.  If you do not expect to upload a new version for a while,
1465 you can use <xref linkend="pkg-tracking-system"/> to get the bug reports.
1466 However, make sure that the old maintainer has no problem with the fact that
1467 they will continue to receive the bugs during that time.
1468 </para>
1469 </section>
1470
1471 </section>
1472
1473 <section id="porting">
1474 <title>Porting and being ported</title>
1475 <para>
1476 Debian supports an ever-increasing number of architectures.  Even if you are
1477 not a porter, and you don't use any architecture but one, it is part of your
1478 duty as a maintainer to be aware of issues of portability.  Therefore, even if
1479 you are not a porter, you should read most of this chapter.
1480 </para>
1481 <para>
1482 Porting is the act of building Debian packages for architectures that are
1483 different from the original architecture of the package maintainer's binary
1484 package.  It is a unique and essential activity.  In fact, porters do most of
1485 the actual compiling of Debian packages.  For instance, when a maintainer
1486 uploads a (portable) source packages with binaries for the <literal>i386
1487 </literal> architecture, it will be built for each of the other architectures,
1488 amounting to &number-of-arches; more builds.
1489 </para>
1490 <section id="kind-to-porters">
1491 <title>Being kind to porters</title>
1492 <para>
1493 Porters have a difficult and unique task, since they are required to deal with
1494 a large volume of packages.  Ideally, every source package should build right
1495 out of the box.  Unfortunately, this is often not the case.  This section
1496 contains a checklist of ``gotchas'' often committed by Debian maintainers —
1497 common problems which often stymie porters, and make their jobs unnecessarily
1498 difficult.
1499 </para>
1500 <para>
1501 The first and most important thing is to respond quickly to bug or issues
1502 raised by porters.  Please treat porters with courtesy, as if they were in fact
1503 co-maintainers of your package (which, in a way, they are).  Please be tolerant
1504 of succinct or even unclear bug reports; do your best to hunt down whatever the
1505 problem is.
1506 </para>
1507 <para>
1508 By far, most of the problems encountered by porters are caused by
1509 <emphasis>packaging bugs</emphasis> in the source packages.  Here is a
1510 checklist of things you should check or be aware of.
1511 </para>
1512 <orderedlist numeration="arabic">
1513 <listitem>
1514 <para>
1515 Make sure that your <literal>Build-Depends</literal> and
1516 <literal>Build-Depends-Indep</literal> settings in
1517 <filename>debian/control</filename> are set properly.  The best way to validate
1518 this is to use the <systemitem role="package">debootstrap</systemitem> package
1519 to create an <literal>unstable</literal> chroot environment (see <xref
1520 linkend="debootstrap"/> ).
1521 Within that chrooted environment, install the <systemitem
1522 role="package">build-essential</systemitem> package and any package
1523 dependencies mentioned in <literal>Build-Depends</literal> and/or
1524 <literal>Build-Depends-Indep</literal>.  Finally, try building your package
1525 within that chrooted environment.  These steps can be automated by the use of
1526 the <command>pbuilder</command> program which is provided by the package of the
1527 same name (see <xref linkend="pbuilder"/> ).
1528 </para>
1529 <para>
1530 If you can't set up a proper chroot, <command>dpkg-depcheck</command> may be of
1531 assistance (see <xref linkend="dpkg-depcheck"/> ).
1532 </para>
1533 <para>
1534 See the <ulink url="&url-debian-policy;">Debian Policy
1535 Manual</ulink> for instructions on setting build dependencies.
1536 </para>
1537 </listitem>
1538 <listitem>
1539 <para>
1540 Don't set architecture to a value other than <literal>all</literal> or 
1541 <literal>any</literal> unless you really mean it.  In too many cases,
1542 maintainers don't follow the instructions in the <ulink 
1543 url="&url-debian-policy;">Debian Policy Manual</ulink>.  Setting your
1544 architecture to only one architecture (such as <literal>i386</literal>
1545 or <literal>amd64</literal>) is usually incorrect.
1546 </para>
1547 </listitem>
1548 <listitem>
1549 <para>
1550 Make sure your source package is correct.  Do <literal>dpkg-source -x
1551 <replaceable>package</replaceable>.dsc</literal> to make sure your source
1552 package unpacks properly.  Then, in there, try building your package from
1553 scratch with <command>dpkg-buildpackage</command>.
1554 </para>
1555 </listitem>
1556 <listitem>
1557 <para>
1558 Make sure you don't ship your source package with the
1559 <filename>debian/files</filename> or <filename>debian/substvars</filename>
1560 files.  They should be removed by the <literal>clean</literal> target of
1561 <filename>debian/rules</filename>.
1562 </para>
1563 </listitem>
1564 <listitem>
1565 <para>
1566 Make sure you don't rely on locally installed or hacked configurations or
1567 programs.  For instance, you should never be calling programs in
1568 <filename>/usr/local/bin</filename> or the like.  Try not to rely on programs
1569 being setup in a special way.  Try building your package on another machine,
1570 even if it's the same architecture.
1571 </para>
1572 </listitem>
1573 <listitem>
1574 <para>
1575 Don't depend on the package you're building being installed already (a sub-case
1576 of the above issue). There are, of course, exceptions to this rule, but be
1577 aware that any case like this needs manual bootstrapping and cannot be done
1578 by automated package builders.
1579 </para>
1580 </listitem>
1581 <listitem>
1582 <para>
1583 Don't rely on the compiler being a certain version, if possible.  If not, then
1584 make sure your build dependencies reflect the restrictions, although you are
1585 probably asking for trouble, since different architectures sometimes
1586 standardize on different compilers.
1587 </para>
1588 </listitem>
1589 <listitem>
1590 <para>
1591 Make sure your debian/rules contains separate <literal>binary-arch</literal>
1592 and <literal>binary-indep</literal> targets, as the Debian Policy Manual 
1593 requires.  Make sure that both targets work independently, that is, that you
1594 can call the target without having called the other before.  To test this,
1595 try to run <command>dpkg-buildpackage -B</command>.
1596 </para>
1597 </listitem>
1598 </orderedlist>
1599 </section>
1600
1601 <section id="porter-guidelines">
1602 <title>Guidelines for porter uploads</title>
1603 <para>
1604 If the package builds out of the box for the architecture to be ported to, you
1605 are in luck and your job is easy.  This section applies to that case; it
1606 describes how to build and upload your binary package so that it is properly
1607 installed into the archive.  If you do have to patch the package in order to
1608 get it to compile for the other architecture, you are actually doing a source
1609 NMU, so consult <xref linkend="nmu-guidelines"/> instead.
1610 </para>
1611 <para>
1612 For a porter upload, no changes are being made to the source.  You do not need
1613 to touch any of the files in the source package.  This includes
1614 <filename>debian/changelog</filename>.
1615 </para>
1616 <para>
1617 The way to invoke <command>dpkg-buildpackage</command> is as
1618 <literal>dpkg-buildpackage -B
1619 -m<replaceable>porter-email</replaceable></literal>.  Of course, set
1620 <replaceable>porter-email</replaceable> to your email address.  This will do a
1621 binary-only build of only the architecture-dependent portions of the package,
1622 using the <literal>binary-arch</literal> target in <filename>debian/rules
1623 </filename>.
1624 </para>
1625 <para>
1626 If you are working on a Debian machine for your porting efforts and you need to
1627 sign your upload locally for its acceptance in the archive, you can run
1628 <command>debsign</command> on your <filename>.changes</filename> file to have
1629 it signed conveniently, or use the remote signing mode of
1630 <command>dpkg-sig</command>.
1631 </para>
1632 <section id="binary-only-nmu">
1633 <title>Recompilation or binary-only NMU</title>
1634 <para>
1635 Sometimes the initial porter upload is problematic because the environment in
1636 which the package was built was not good enough (outdated or obsolete library,
1637 bad compiler, ...).  Then you may just need to recompile it in an updated
1638 environment.  However, you have to bump the version number in this case, so
1639 that the old bad package can be replaced in the Debian archive
1640 (<command>dak</command> refuses to install new packages if they don't have a
1641 version number greater than the currently available one).
1642 </para>
1643 <para>
1644 You have to make sure that your binary-only NMU doesn't render the package
1645 uninstallable.  This could happen when a source package generates
1646 arch-dependent and arch-independent packages that have inter-dependencies
1647 generated using dpkg's substitution variable <literal>$(Source-Version)
1648 </literal>.
1649 </para>
1650 <para>
1651 Despite the required modification of the changelog, these are called
1652 binary-only NMUs — there is no need in this case to trigger all other
1653 architectures to consider themselves out of date or requiring recompilation.
1654 </para>
1655 <para>
1656 Such recompilations require special ``magic'' version numbering, so that the
1657 archive maintenance tools recognize that, even though there is a new Debian
1658 version, there is no corresponding source update.  If you get this wrong, the
1659 archive maintainers will reject your upload (due to lack of corresponding
1660 source code).
1661 </para>
1662 <para>
1663 The ``magic'' for a recompilation-only NMU is triggered by using a suffix
1664 appended to the package version number, following the form <literal>
1665 b<replaceable>number</replaceable></literal>.
1666 For instance, if the latest version you are recompiling against was version
1667 <literal>2.9-3</literal>, your binary-only NMU should carry a version of 
1668 <literal>2.9-3+b1</literal>.  If the latest version was <literal>3.4+b1
1669 </literal> (i.e, a native package with a previous recompilation NMU), your
1670 binary-only NMU should have a version number of <literal>3.4+b2</literal>.
1671 <footnote><para> In the past, such NMUs used the third-level number on the 
1672 Debian part of the revision to denote their recompilation-only status;
1673 however, this syntax was ambiguous with native packages and did not allow
1674 proper ordering of recompile-only NMUs, source NMUs, and security NMUs on
1675 the same package, and has therefore been abandoned in favor of this new syntax.
1676 </para> </footnote>
1677 </para>
1678 <para>
1679 Similar to initial porter uploads, the correct way of invoking
1680 <command>dpkg-buildpackage</command> is <literal>dpkg-buildpackage -B</literal>
1681 to only build the architecture-dependent parts of the package.
1682 </para>
1683 </section>
1684
1685 <section id="source-nmu-when-porter">
1686 <title>When to do a source NMU if you are a porter</title>
1687 <para>
1688 Porters doing a source NMU generally follow the guidelines found in <xref
1689 linkend="nmu"/> , just like non-porters.  However, it is expected that the wait
1690 cycle for a porter's source NMU is smaller than for a non-porter, since porters
1691 have to cope with a large quantity of packages.  Again, the situation varies
1692 depending on the distribution they are uploading to.  It also varies whether
1693 the architecture is a candidate for inclusion into the next stable release; the
1694 release managers decide and announce which architectures are candidates.
1695 </para>
1696 <para>
1697 If you are a porter doing an NMU for <literal>unstable</literal>, the above 
1698 guidelines for porting should be followed, with two variations.  Firstly, the
1699 acceptable waiting period — the time between when the bug is submitted to
1700 the BTS and when it is OK to do an NMU — is seven days for porters working
1701 on the <literal>unstable</literal> distribution.  This period can be shortened
1702 if the problem is critical and imposes hardship on the porting effort, at the
1703 discretion of the porter group.  (Remember, none of this is Policy, just
1704 mutually agreed upon guidelines.) For uploads to <literal>stable</literal> or
1705 <literal>testing </literal>, please coordinate with the appropriate release
1706 team first.
1707 </para>
1708 <para>
1709 Secondly, porters doing source NMUs should make sure that the bug they submit
1710 to the BTS should be of severity <literal>serious</literal> or greater.  This
1711 ensures that a single source package can be used to compile every supported 
1712 Debian architecture by release time.  It is very important that we have one
1713 version of the binary and source package for all architectures in order to
1714 comply with many licenses.
1715 </para>
1716 <para>
1717 Porters should try to avoid patches which simply kludge around bugs in the
1718 current version of the compile environment, kernel, or libc.  Sometimes such
1719 kludges can't be helped.  If you have to kludge around compiler bugs and the
1720 like, make sure you <literal>#ifdef</literal> your work properly; also,
1721 document your kludge so that people know to remove it once the external
1722 problems have been fixed.
1723 </para>
1724 <para>
1725 Porters may also have an unofficial location where they can put the results of
1726 their work during the waiting period.  This helps others running the port have
1727 the benefit of the porter's work, even during the waiting period.  Of course,
1728 such locations have no official blessing or status, so buyer beware.
1729 </para>
1730 </section>
1731
1732 </section>
1733
1734 <section id="porter-automation">
1735 <title>Porting infrastructure and automation</title>
1736 <para>
1737 There is infrastructure and several tools to help automate package porting.
1738 This section contains a brief overview of this automation and porting to these
1739 tools; see the package documentation or references for full information.
1740 </para>
1741 <section id="s5.10.3.1">
1742 <title>Mailing lists and web pages</title>
1743 <para>
1744 Web pages containing the status of each port can be found at <ulink
1745 url="&url-debian-ports;"></ulink>.
1746 </para>
1747 <para>
1748 Each port of Debian has a mailing list.  The list of porting mailing lists can
1749 be found at <ulink url="&url-debian-port-lists;"></ulink>.  These
1750 lists are used to coordinate porters, and to connect the users of a given port
1751 with the porters.
1752 </para>
1753 </section>
1754
1755 <section id="s5.10.3.2">
1756 <title>Porter tools</title>
1757 <para>
1758 Descriptions of several porting tools can be found in <xref
1759 linkend="tools-porting"/> .
1760 </para>
1761 </section>
1762
1763 <section id="wanna-build">
1764 <title><systemitem role="package">wanna-build</systemitem></title>
1765 <para>
1766 The <systemitem role="package">wanna-build</systemitem> system is used as a
1767 distributed, client-server build distribution system.  It is usually used in
1768 conjunction with build daemons running the <systemitem role="package">buildd
1769 </systemitem> program. <literal>Build daemons</literal> are ``slave'' hosts
1770 which contact the central <systemitem role="package"> wanna-build</systemitem>
1771 system to receive a list of packages that need to be built.
1772 </para>
1773 <para>
1774 <systemitem role="package">wanna-build</systemitem> is not yet available as a
1775 package; however, all Debian porting efforts are using it for automated
1776 package building.  The tool used to do the actual package builds, <systemitem
1777 role="package">sbuild</systemitem> is available as a package, see its 
1778 description in <xref linkend="sbuild"/> .  Please note that the packaged
1779 version is not the same as the one used on build daemons, but it is close
1780 enough to reproduce problems. 
1781 </para>
1782 <para>
1783 Most of the data produced by <systemitem role="package">wanna-build
1784 </systemitem> which is generally useful to porters is available on the
1785 web at <ulink url="&url-buildd;"></ulink>.  This data includes nightly
1786 updated statistics, queueing information and logs for build attempts.
1787 </para>
1788 <para>
1789 We are quite proud of this system, since it has so many possible uses.
1790 Independent development groups can use the system for different sub-flavors of
1791 Debian, which may or may not really be of general interest (for instance, a
1792 flavor of Debian built with <command>gcc</command> bounds checking).  It will
1793 also enable Debian to recompile entire distributions quickly.
1794 </para>
1795 <para>
1796 The wanna-build team, in charge of the buildds,
1797 can be reached at <literal>debian-wb-team@lists.debian.org</literal>.
1798 To determine who (wanna-build team, release team) and how (mail, BTS)
1799 to contact, refer to <ulink url="&url-wb-team;"></ulink>.
1800 </para>
1801
1802 <para>
1803 When requesting binNMUs or give-backs (retries after a failed build),
1804 please use the format described at <ulink url="&url-release-wb;"/>.
1805 </para>
1806
1807 </section>
1808
1809 </section>
1810
1811 <section id="packages-arch-specific">
1812 <title>When your package is <emphasis>not</emphasis> portable</title>
1813 <para>
1814 Some packages still have issues with building and/or working on some of the
1815 architectures supported by Debian, and cannot be ported at all, or not within a
1816 reasonable amount of time.  An example is a package that is SVGA-specific (only
1817 available for <literal>i386</literal> and <literal>amd64</literal>), or uses
1818 other hardware-specific features not supported on all architectures.
1819 </para>
1820 <para>
1821 In order to prevent broken packages from being uploaded to the archive, and
1822 wasting buildd time, you need to do a few things:
1823 </para>
1824 <itemizedlist>
1825 <listitem>
1826 <para>
1827 First, make sure your package <emphasis>does</emphasis> fail to build on
1828 architectures that it cannot support.  There are a few ways to achieve this.
1829 The preferred way is to have a small testsuite during build time that will test
1830 the functionality, and fail if it doesn't work.  This is a good idea anyway, as
1831 this will prevent (some) broken uploads on all architectures, and also will
1832 allow the package to build as soon as the required functionality is available.
1833 </para>
1834 <para>
1835 Additionally, if you believe the list of supported architectures is pretty
1836 constant, you should change <literal>any</literal> to a list of supported
1837 architectures in <filename>debian/control</filename>.  This way, the build will
1838 fail also, and indicate this to a human reader without actually trying.
1839 </para>
1840 </listitem>
1841 <listitem>
1842 <para>
1843 In order to prevent autobuilders from needlessly trying to build your package,
1844 it must be included in <filename>packages-arch-specific</filename>, a list used
1845 by the <command>wanna-build</command> script.  The current version is available
1846 as <ulink
1847 url="&url-cvsweb;srcdep/Packages-arch-specific?cvsroot=dak"></ulink>;
1848 please see the top of the file for whom to contact for changes.
1849 </para>
1850 </listitem>
1851 </itemizedlist>
1852 <para>
1853 Please note that it is insufficient to only add your package to
1854 Packages-arch-specific without making it fail to build on unsupported
1855 architectures: A porter or any other person trying to build your package might
1856 accidently upload it without noticing it doesn't work.  If in the past some
1857 binary packages were uploaded on unsupported architectures, request their
1858 removal by filing a bug against <systemitem
1859 role="package">ftp.debian.org</systemitem>
1860 </para>
1861 </section>
1862
1863 </section>
1864
1865 <section id="nmu">
1866 <title>Non-Maintainer Uploads (NMUs)</title>
1867 <para>
1868 Every package has one or more maintainers. Normally, these are the people who
1869 work on and upload new versions of the package. In some situations, it is
1870 useful that other developers can upload a new version as well, for example if
1871 they want to fix a bug in a package they don't maintain, when the maintainer
1872 needs help to respond to issues.  Such uploads are called
1873 <emphasis>Non-Maintainer Uploads (NMU)</emphasis>.
1874 </para>
1875
1876 <section id="nmu-guidelines">
1877 <title>When and how to do an NMU</title>
1878
1879 <para>
1880 Before doing an NMU, consider the following questions:
1881 </para>
1882 <itemizedlist>
1883 <listitem>
1884 <para>
1885 Does your NMU really fix bugs? Fixing cosmetic issues or changing the
1886 packaging style in NMUs is discouraged.
1887 </para>
1888 </listitem>
1889 <listitem>
1890 <para>
1891 Did you give enough time to the maintainer? When was the bug reported to the
1892 BTS? Being busy for a week or two isn't unusual.  Is the bug so severe that it
1893 needs to be fixed right now, or can it wait a few more days?
1894 </para>
1895 </listitem>
1896 <listitem>
1897 <para>
1898 How confident are you about your changes? Please remember the Hippocratic Oath:
1899 "Above all, do no harm." It is better to leave a package with an open grave bug
1900 than applying a non-functional patch, or one that hides the bug instead of
1901 resolving it. If you are not 100% sure of what you did, it might be a good idea
1902 to seek advice from others. Remember that if you break something in your NMU,
1903 many people will be very unhappy about it.
1904 </para>
1905 </listitem>
1906 <listitem>
1907 <para>
1908 Have you clearly expressed your intention to NMU, at least in the BTS?
1909 It is also a good idea to try to contact the
1910 maintainer by other means (private email, IRC).
1911 </para>
1912 </listitem>
1913 <listitem>
1914 <para>
1915 If the maintainer is usually active and responsive, have you tried to contact
1916 him? In general it should be considered preferable that a maintainer takes care
1917 of an issue himself and that he is given the chance to review and correct your
1918 patch, because he can be expected to be more aware of potential issues which an
1919 NMUer might miss. It is often a better use of everyone's time if the maintainer
1920 is given an opportunity to upload a fix on their own.
1921 </para>
1922 </listitem>
1923 </itemizedlist>
1924 <para>
1925 When doing an NMU, you must first make sure that your intention to NMU is
1926 clear.  Then, you must send a patch with the differences between the
1927 current package and your proposed NMU to the BTS. The
1928 <literal>nmudiff</literal> script in the <literal>devscripts</literal> package
1929 might be helpful.
1930 </para>
1931 <para>
1932 While preparing the patch, you should better be aware of any package-specific
1933 practices that the maintainer might be using. Taking them into account reduces
1934 the burden of getting your changes integrated back in the normal package
1935 workflow and thus increases the possibilities that that will happen. A good
1936 place where to look for for possible package-specific practices is
1937 <ulink url="&url-debian-policy;ch-source.html#s-readmesource"><literal>debian/README.source</literal></ulink>.
1938 </para>
1939 <para>
1940 Unless you have an excellent reason not to do so, you must then give some time
1941 to the maintainer to react (for example, by uploading to the
1942 <literal>DELAYED</literal> queue).  Here are some recommended values to use for delays:
1943 </para>
1944 <itemizedlist>
1945 <listitem>
1946 <para>
1947 Upload fixing only release-critical bugs older than 7 days: 2 days
1948 </para>
1949 </listitem>
1950 <listitem>
1951 <para>
1952 Upload fixing only release-critical and important bugs: 5 days
1953 </para>
1954 </listitem>
1955 <listitem>
1956 <para>
1957 Other NMUs: 10 days
1958 </para>
1959 </listitem>
1960 </itemizedlist>
1961
1962 <para>
1963 Those delays are only examples. In some cases, such as uploads fixing security
1964 issues, or fixes for trivial bugs that blocking a transition, it is desirable
1965 that the fixed package reaches <literal>unstable</literal> sooner.
1966 </para>
1967
1968 <para>
1969 Sometimes, release managers decide to allow NMUs with shorter delays for a
1970 subset of bugs (e.g release-critical bugs older than 7 days). Also, some
1971 maintainers list themselves in the <ulink url="&url-low-threshold-nmu;">Low
1972 Threshold NMU list</ulink>, and accept that NMUs are uploaded without delay. But
1973 even in those cases, it's still a good idea to give the maintainer a few days
1974 to react before you upload, especially if the patch wasn't available in the BTS
1975 before, or if you know that the maintainer is generally active.
1976 </para>
1977
1978 <para>
1979 After you upload an NMU, you are responsible for the possible problems that you
1980 might have introduced. You must keep an eye on the package (subscribing to the
1981 package on the PTS is a good way to achieve this).
1982 </para>
1983
1984 <para>
1985 This is not a license to perform NMUs thoughtlessly.  If you NMU when it is
1986 clear that the maintainers are active and would have acknowledged a patch in a
1987 timely manner, or if you ignore the recommendations of this document, your
1988 upload might be a cause of conflict with the maintainer.
1989 You should always be prepared to
1990 defend the wisdom of any NMU you perform on its own merits.
1991 </para>
1992 </section>
1993
1994 <section id="nmu-changelog">
1995 <title>NMUs and debian/changelog</title>
1996 <para>
1997 Just like any other (source) upload, NMUs must add an entry to
1998 <literal>debian/changelog</literal>, telling what has changed with this
1999 upload.  The first line of this entry must explicitely mention that this upload is an NMU, e.g.:
2000 </para>
2001 <screen>
2002   * Non-maintainer upload.
2003 </screen>
2004
2005 <para>
2006 The way to version NMUs differs for native and non-native packages.
2007 </para>
2008 <para>
2009 If the package is a native package (without a debian revision in the version number), 
2010 the version must be the version of the last maintainer upload, plus
2011 <literal>+nmu<replaceable>X</replaceable></literal>, where
2012 <replaceable>X</replaceable> is a counter starting at <literal>1</literal>.
2013 If
2014 the last upload was also an NMU, the counter should be increased.  For example,
2015 if the current version is <literal>1.5</literal>, then an NMU would get
2016 version <literal>1.5+nmu1</literal>.
2017 </para>
2018 <para>
2019 If the package is a not a native package, you should add a minor version number
2020 to the debian revision part of the version number (the portion after the last
2021 hyphen). This extra number must start at 1.  For example,
2022 if the current version is <literal>1.5-2</literal>, then an NMU would get
2023 version <literal>1.5-2.1</literal>. If a new upstream version
2024 is packaged in the NMU, the debian revision is set to <literal>0</literal>, for
2025 example <literal>1.6-0.1</literal>.
2026 </para>
2027 <para>
2028 In both cases, if the last upload was also an NMU, the counter should
2029 be increased. For example, if the current version is
2030 <literal>1.5+nmu3</literal> (a native package which has already been
2031 NMUed), the NMU would get version <literal>1.5+nmu4</literal>.  .
2032 </para>
2033 <para>
2034 A special versioning scheme is needed to avoid disrupting the maintainer's
2035 work, since using an integer for the Debian revision will potentially
2036 conflict with a maintainer upload already in preparation at the time of an
2037 NMU, or even one sitting in the ftp NEW queue.
2038 It also has the
2039 benefit of making it visually clear that a package in the archive was not made
2040 by the official maintainer.
2041 </para>
2042
2043 <para>
2044 If you upload a package to testing or stable, you sometimes need to "fork" the
2045 version number tree. This is the case for security uploads, for example.  For
2046 this, a version of the form
2047 <literal>+deb<replaceable>XY</replaceable>u<replaceable>Z</replaceable></literal>
2048 should be used, where <replaceable>X</replaceable> and
2049 <replaceable>Y</replaceable> are the major and minor release numbers, and
2050 <replaceable>Z</replaceable> is a counter starting at <literal>1</literal>.
2051 When the release number is not yet known (often the case for
2052 <literal>testing</literal>, at the beginning of release cycles), the lowest
2053 release number higher than the last stable release number must be used.  For
2054 example, while Etch (Debian 4.0) is stable, a security NMU to stable for a
2055 package at version <literal>1.5-3</literal> would have version
2056 <literal>1.5-3+deb40u1</literal>, whereas a security NMU to Lenny would get
2057 version <literal>1.5-3+deb50u1</literal>. After the release of Lenny, security
2058 uploads to the <literal>testing</literal> distribution will be versioned
2059 <literal>+deb51uZ</literal>, until it is known whether that release will be
2060 Debian 5.1 or Debian 6.0 (if that becomes the case, uploads will be versioned
2061 as <literal>+deb60uZ</literal>.
2062 </para>
2063 </section>
2064
2065 <section id="nmu-delayed">
2066 <title>Using the <literal>DELAYED/</literal> queue</title>
2067
2068 <para>
2069 Having to wait for a response after you request permission to NMU is
2070 inefficient, because it costs the NMUer a context switch to come back to the
2071 issue.
2072 The <literal>DELAYED</literal> queue (see <xref linkend="delayed-incoming"/>)
2073 allows the developer doing the NMU to perform all the necessary tasks at the
2074 same time. For instance, instead of telling the maintainer that you will
2075 upload the updated
2076 package in 7 days, you should upload the package to
2077 <literal>DELAYED/7</literal> and tell the maintainer that he has 7 days to
2078 react.  During this time, the maintainer can ask you to delay the upload some
2079 more, or cancel your upload.
2080 </para>
2081
2082 <para>
2083 The <literal>DELAYED</literal> queue should not be used to put additional
2084 pressure on the maintainer. In particular, it's important that you are
2085 available to cancel or delay the upload before the delay expires since the
2086 maintainer cannot cancel the upload himself.
2087 </para>
2088
2089 <para>
2090 If you make an NMU to <literal>DELAYED</literal> and the maintainer updates
2091 his package before the delay expires, your upload will be rejected because a
2092 newer version is already available in the archive.
2093 Ideally, the maintainer will take care to include your proposed changes (or
2094 at least a solution for the problems they address) in that upload.
2095 </para>
2096
2097 </section>
2098
2099 <section id="nmu-maintainer">
2100 <title>NMUs from the maintainer's point of view</title>
2101
2102 <para>
2103 When someone NMUs your package, this means they want to help you to keep it in
2104 good shape.  This gives users fixed packages faster.  You
2105 can consider asking the NMUer to become a co-maintainer of the package.
2106 Receiving an NMU on a package is not a bad
2107 thing; it just means that the package is interesting enough for other people to
2108 work on it.
2109 </para>
2110
2111 <para>
2112 To acknowledge an NMU, include its changes and changelog entry in your next
2113 maintainer upload.  If you do not acknowledge the NMU by including the
2114 NMU changelog entry in your changelog, the bugs will remain closed in the
2115 BTS but will be listed as affecting your maintainer version of the package.
2116 </para>
2117
2118 </section>
2119
2120 <section id="nmu-binnmu">
2121 <title>Source NMUs vs Binary-only NMUs (binNMUs)</title>
2122
2123 <para>
2124 The full name of an NMU is <emphasis>source NMU</emphasis>.  There is also
2125 another type, namely the <emphasis>binary-only NMU</emphasis>, or
2126 <emphasis>binNMU</emphasis>.  A binNMU is also a package upload by someone
2127 other than the package's maintainer.  However, it is a binary-only upload.
2128 </para>
2129
2130 <para>
2131 When a library (or other dependency) is updated, the packages using it may need
2132 to be rebuilt.  Since no changes to the source are needed, the same source
2133 package is used.
2134 </para>
2135
2136 <para>
2137 BinNMUs are usually triggered on the buildds by wanna-build.
2138 An entry is added to debian/changelog,
2139 explaining why the upload was needed and increasing the version number as
2140 described in <xref linkend="binary-only-nmu"/>.
2141 This entry should not be included in the next upload.
2142 </para>
2143
2144 <para>
2145 Buildds upload packages for their architecture to the archive as binary-only
2146 uploads.  Strictly speaking, these are binNMUs.  However, they are not normally
2147 called NMU, and they don't add an entry to debian/changelog.
2148 </para>
2149
2150 </section>
2151
2152 <section id="nmu-qa-upload">
2153 <title>NMUs vs QA uploads</title>
2154
2155 <para>
2156 NMUs are uploads of packages by somebody else than their assigned maintainer.
2157 There is
2158 another type of upload where the uploaded package is not yours: QA uploads. QA
2159 uploads are uploads of orphaned packages.
2160 </para>
2161
2162 <para>
2163 QA uploads are very much like normal maintainer uploads: they may fix anything,
2164 even minor issues; the version numbering is normal, and there is no need to use
2165 a delayed upload.  The difference is that you are not listed as the Maintainer
2166 or Uploader for the package.  Also, the changelog entry of a QA upload has a
2167 special first line:
2168 </para>
2169
2170 <screen>
2171  * QA upload.
2172 </screen>
2173
2174 <para>
2175 If you want to do an NMU, and it seems that the maintainer is not active, it is
2176 wise to check if the package is orphaned
2177 (this information is displayed on the package's Package Tracking System page).
2178 When doing the first QA upload to an
2179 orphaned package, the maintainer should be set to <literal>Debian QA Group
2180 &lt;packages@qa.debian.org&gt;</literal>.  Orphaned packages which did
2181 not yet have a QA upload still have their old maintainer set.  There is a list
2182 of them at <ulink url="&url-orphaned-not-qa;"/>.
2183 </para>
2184
2185 <para>
2186 Instead of doing a QA upload, you can also consider adopting the package by
2187 making yourself the maintainer.  You don't need permission from anybody to
2188 adopt an orphaned package, you can just set yourself as maintainer and upload
2189 the new version (see <xref linkend="adopting"/>).
2190 </para>
2191
2192 </section>
2193
2194 </section>
2195
2196 <section id="collaborative-maint">
2197 <title>Collaborative maintenance</title>
2198 <para>
2199 Collaborative maintenance is a term describing the sharing of Debian package
2200 maintenance duties by several people.  This collaboration is almost always a
2201 good idea, since it generally results in higher quality and faster bug fix
2202 turnaround times.  It is strongly recommended that packages with a priority of
2203 <literal>Standard</literal> or which are part of the base set have
2204 co-maintainers.
2205 </para>
2206 <para>
2207 Generally there is a primary maintainer and one or more co-maintainers.  The
2208 primary maintainer is the person whose name is listed in the
2209 <literal>Maintainer</literal> field of the <filename>debian/control</filename>
2210 file.  Co-maintainers are all the other maintainers,
2211 usually listed in the <literal>Uploaders</literal> field of the
2212 <filename>debian/control</filename> file.
2213 </para>
2214 <para>
2215 In its most basic form, the process of adding a new co-maintainer is quite
2216 easy:
2217 </para>
2218 <itemizedlist>
2219 <listitem>
2220 <para>
2221 Setup the co-maintainer with access to the sources you build the package from.
2222 Generally this implies you are using a network-capable version control system,
2223 such as <command>CVS</command> or <command>Subversion</command>.  Alioth (see
2224 <xref linkend="alioth"/> ) provides such tools, amongst others.
2225 </para>
2226 </listitem>
2227 <listitem>
2228 <para>
2229 Add the co-maintainer's correct maintainer name and address to the
2230 <literal>Uploaders</literal> field in the first paragraph of the
2231 <filename>debian/control</filename> file.
2232 </para>
2233 <screen>
2234 Uploaders: John Buzz &lt;jbuzz@debian.org&gt;, Adam Rex &lt;arex@debian.org&gt;
2235 </screen>
2236 </listitem>
2237 <listitem>
2238 <para>
2239 Using the PTS (<xref linkend="pkg-tracking-system"/> ), the co-maintainers
2240 should subscribe themselves to the appropriate source package.
2241 </para>
2242 </listitem>
2243 </itemizedlist>
2244 <para>
2245 Another form of collaborative maintenance is team maintenance, which is
2246 recommended if you maintain several packages with the same group of developers.
2247 In that case, the Maintainer and Uploaders field of each package must be
2248 managed with care.  It is recommended to choose between one of the two
2249 following schemes:
2250 </para>
2251 <orderedlist numeration="arabic">
2252 <listitem>
2253 <para>
2254 Put the team member mainly responsible for the package in the Maintainer field.
2255 In the Uploaders, put the mailing list address, and the team members who care
2256 for the package.
2257 </para>
2258 </listitem>
2259 <listitem>
2260 <para>
2261 Put the mailing list address in the Maintainer field.  In the Uploaders field,
2262 put the team members who care for the package.  In this case, you must make
2263 sure the mailing list accept bug reports without any human interaction (like
2264 moderation for non-subscribers).
2265 </para>
2266 </listitem>
2267 </orderedlist>
2268 <para>
2269 In any case, it is a bad idea to automatically put all team members in the
2270 Uploaders field.  It clutters the Developer's Package Overview listing (see
2271 <xref linkend="ddpo"/> ) with packages one doesn't really care for, and creates
2272 a false sense of good maintenance.
2273 </para>
2274 </section>
2275
2276 <section id="testing">
2277 <title>The testing distribution</title>
2278 <section id="testing-basics">
2279 <title>Basics</title>
2280 <para>
2281 Packages are usually installed into the <literal>testing</literal> distribution
2282 after they have undergone some degree of <literal>testing</literal> in
2283 <literal>unstable</literal>.
2284 </para>
2285 <para>
2286 They must be in sync on all architectures and mustn't have dependencies that
2287 make them uninstallable; they also have to have generally no known
2288 release-critical bugs at the time they're installed into <literal>testing
2289 </literal>.  This way, <literal>testing</literal> should always be close to
2290 being a release candidate.  Please see below for details.
2291 </para>
2292 </section>
2293
2294 <section id="testing-unstable">
2295 <title>Updates from unstable</title>
2296 <para>
2297 The scripts that update the <literal>testing</literal> distribution are run
2298 twice each day, right after the installation of the updated packages; these
2299 scripts are called <literal>britney</literal>.  They generate the
2300 <filename>Packages</filename> files for the <literal>testing</literal>
2301 distribution, but they do so in an intelligent manner; they try to avoid any
2302 inconsistency and to use only non-buggy packages.
2303 </para>
2304 <para>
2305 The inclusion of a package from <literal>unstable</literal> is conditional on
2306 the following:
2307 </para>
2308 <itemizedlist>
2309 <listitem>
2310 <para>
2311 The package must have been available in <literal>unstable</literal> for 2, 5
2312 or 10 days, depending on the urgency (high, medium or low).  Please note that
2313 the urgency is sticky, meaning that the highest urgency uploaded since the
2314 previous <literal>testing</literal> transition is taken into account.  Those
2315 delays may be doubled during a freeze, or <literal>testing</literal> 
2316 transitions may be switched off altogether;
2317 </para>
2318 </listitem>
2319 <listitem>
2320 <para>
2321 It must not have new release-critical bugs (RC bugs affecting the version
2322 available in <literal>unstable</literal>, but not affecting the version in 
2323 <literal>testing</literal>);
2324 </para>
2325 </listitem>
2326 <listitem>
2327 <para>
2328 It must be available on all architectures on which it has previously been built
2329 in <literal>unstable</literal>.  <xref linkend="dak-ls"/> may be of interest
2330 to check that information;
2331 </para>
2332 </listitem>
2333 <listitem>
2334 <para>
2335 It must not break any dependency of a package which is already available in
2336 <literal>testing</literal>;
2337 </para>
2338 </listitem>
2339 <listitem>
2340 <para>
2341 The packages on which it depends must either be available in
2342 <literal>testing</literal> or they must be accepted into
2343 <literal>testing</literal> at the same time (and they will be if they fulfill
2344 all the necessary criteria);
2345 </para>
2346 </listitem>
2347 </itemizedlist>
2348 <para>
2349 To find out whether a package is progressing into <literal>testing</literal>
2350 or not, see the <literal>testing</literal> script output on the <ulink
2351 url="&url-testing-maint;">web page of the testing
2352 distribution</ulink>, or use the program <command>grep-excuses</command> which
2353 is in the <systemitem role="package">devscripts</systemitem> package.  This
2354 utility can easily be used in a <citerefentry>
2355 <refentrytitle>crontab</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>
2356 to keep yourself informed of the progression of your packages into
2357 <literal>testing</literal>.
2358 </para>
2359 <para>
2360 The <filename>update_excuses</filename> file does not always give the precise
2361 reason why the package is refused; you may have to find it on your own by
2362 looking for what would break with the inclusion of the package.  The <ulink
2363 url="&url-testing-maint;">testing web page</ulink> gives some
2364 more information about the usual problems which may be causing such troubles.
2365 </para>
2366 <para>
2367 Sometimes, some packages never enter <literal>testing</literal> because the
2368 set of inter-relationship is too complicated and cannot be sorted out by the
2369 scripts.  See below for details.
2370 </para>
2371 <para>
2372 Some further dependency analysis is shown on <ulink
2373 url="http://release.debian.org/migration/"></ulink> — but be warned, this page also
2374 shows build dependencies which are not considered by britney.
2375 </para>
2376 <section id="outdated">
2377 <title>out-of-date</title>
2378 <para>
2379 <!-- FIXME: better rename this file than document rampant professionalism? -->
2380 For the <literal>testing</literal> migration script, outdated means: There are
2381 different versions in <literal>unstable</literal> for the release architectures
2382 (except for the architectures in fuckedarches; fuckedarches is a list of
2383 architectures that don't keep up (in <filename>update_out.py</filename>), but
2384 currently, it's empty).  outdated has nothing whatsoever to do with the 
2385 architectures this package has in <literal>testing</literal>.
2386 </para>
2387 <para>
2388 Consider this example:
2389 </para>
2390 <informaltable pgwide="1">
2391 <tgroup cols="3">
2392 <thead>
2393 <row>
2394 <entry></entry>
2395 <entry>alpha</entry>
2396 <entry>arm</entry>
2397 </row>
2398 </thead>
2399 <tbody>
2400 <row>
2401 <entry>testing</entry>
2402 <entry>1</entry>
2403 <entry>-</entry>
2404 </row>
2405 <row>
2406 <entry>unstable</entry>
2407 <entry>1</entry>
2408 <entry>2</entry>
2409 </row>
2410 </tbody>
2411 </tgroup>
2412 </informaltable>
2413 <para>
2414 The package is out of date on alpha in <literal>unstable</literal>, and will
2415 not go to <literal>testing</literal>. Removing the package would not help at all, the
2416 package is still out of date on <literal>alpha</literal>, and will not 
2417 propagate to testing.
2418 </para>
2419 <para>
2420 However, if ftp-master removes a package in <literal>unstable</literal> (here
2421 on <literal>arm</literal>):
2422 </para>
2423 <informaltable pgwide="1">
2424 <tgroup cols="4">
2425 <thead>
2426 <row>
2427 <entry></entry>
2428 <entry>alpha</entry>
2429 <entry>arm</entry>
2430 <entry>hurd-i386</entry>
2431 </row>
2432 </thead>
2433 <tbody>
2434 <row>
2435 <entry>testing</entry>
2436 <entry>1</entry>
2437 <entry>1</entry>
2438 <entry>-</entry>
2439 </row>
2440 <row>
2441 <entry>unstable</entry>
2442 <entry>2</entry>
2443 <entry>-</entry>
2444 <entry>1</entry>
2445 </row>
2446 </tbody>
2447 </tgroup>
2448 </informaltable>
2449 <para>
2450 In this case, the package is up to date on all release architectures in
2451 <literal>unstable</literal> (and the extra <literal>hurd-i386</literal> 
2452 doesn't matter, as it's not a release architecture).
2453 </para>
2454 <para>
2455 Sometimes, the question is raised if it is possible to allow packages in that
2456 are not yet built on all architectures: No.  Just plainly no.  (Except if you
2457 maintain glibc or so.)
2458 </para>
2459 </section>
2460
2461 <section id="removals">
2462 <title>Removals from testing</title>
2463 <para>
2464 Sometimes, a package is removed to allow another package in: This happens only
2465 to allow <emphasis>another</emphasis> package to go in if it's ready in every
2466 other sense.  Suppose e.g.  that <literal>a</literal> cannot be installed
2467 with the new version of <literal>b</literal>; then <literal>a</literal> may
2468 be removed to allow <literal>b</literal> in.
2469 </para>
2470 <para>
2471 Of course, there is another reason to remove a package from <literal>testing
2472 </literal>: It's just too buggy (and having a single RC-bug is enough to be
2473 in this state).
2474 </para>
2475 <para>
2476 Furthermore, if a package has been removed from <literal>unstable</literal>,
2477 and no package in <literal>testing</literal> depends on it any more, then it
2478 will automatically be removed.
2479 </para>
2480 </section>
2481
2482 <section id="circular">
2483 <title>circular dependencies</title>
2484 <para>
2485 A situation which is not handled very well by britney is if package
2486 <literal>a</literal> depends on the new version of package
2487 <literal>b</literal>, and vice versa.
2488 </para>
2489 <para>
2490 An example of this is:
2491 </para>
2492 <informaltable pgwide="1">
2493 <tgroup cols="3">
2494 <thead>
2495 <row>
2496 <entry></entry>
2497 <entry>testing</entry>
2498 <entry>unstable</entry>
2499 </row>
2500 </thead>
2501 <tbody>
2502 <row>
2503 <entry>a</entry>
2504 <entry>1; depends: b=1</entry>
2505 <entry>2; depends: b=2</entry>
2506 </row>
2507 <row>
2508 <entry>b</entry>
2509 <entry>1; depends: a=1</entry>
2510 <entry>2; depends: a=2</entry>
2511 </row>
2512 </tbody>
2513 </tgroup>
2514 </informaltable>
2515 <para>
2516 Neither package <literal>a</literal> nor package <literal>b</literal> is
2517 considered for update.
2518 </para>
2519 <para>
2520 Currently, this requires some manual hinting from the release team.  Please
2521 contact them by sending mail to &email-debian-release; if this
2522 happens to one of your packages.
2523 </para>
2524 </section>
2525
2526 <section id="s5.13.2.4">
2527 <title>influence of package in testing</title>
2528 <para>
2529 Generally, there is nothing that the status of a package in <literal>testing
2530 </literal> means for transition of the next version from <literal>unstable
2531 </literal> to <literal>testing</literal>, with two exceptions:
2532 If the RC-bugginess of the package goes down, it may go in even if it is still
2533 RC-buggy.  The second exception is if the version of the package in <literal>
2534 testing</literal> is out of sync on the different arches: Then any arch might
2535 just upgrade to the version of the source package; however, this can happen
2536 only if the package was previously forced through, the arch is in fuckedarches,
2537 or there was no binary package of that arch present in <literal>unstable
2538 </literal> at all during the <literal>testing</literal> migration.
2539 </para>
2540 <para>
2541 In summary this means: The only influence that a package being in <literal>
2542 testing</literal> has on a new version of the same package is that the new
2543 version might go in easier.
2544 </para>
2545 </section>
2546
2547 <section id="details">
2548 <title>details</title>
2549 <para>
2550 If you are interested in details, this is how britney works:
2551 </para>
2552 <para>
2553 The packages are looked at to determine whether they are valid candidates.
2554 This gives the update excuses.  The most common reasons why a package is not
2555 considered are too young, RC-bugginess, and out of date on some arches.  For
2556 this part of britney, the release managers have hammers of various sizes to
2557 force britney to consider a package.  (Also, the base freeze is coded in that
2558 part of britney.) (There is a similar thing for binary-only updates, but this
2559 is not described here.  If you're interested in that, please peruse the code.)
2560 </para>
2561 <para>
2562 Now, the more complex part happens: Britney tries to update <literal>testing
2563 </literal> with the valid candidates. For that, britney tries to add each
2564 valid candidate to the testing distribution. If the number of uninstallable
2565 packages in <literal>testing</literal> doesn't increase, the package is
2566 accepted. From that point on, the accepted package is considered to be part
2567 of <literal>testing</literal>, such that all subsequent installability
2568 tests include this package.  Hints from the release team are processed
2569 before or after this main run, depending on the exact type.
2570 </para>
2571 <para>
2572 If you want to see more details, you can look it up on
2573 <filename>merkel:/org/&ftp-debian-org;/testing/update_out/</filename> (or
2574 in <filename>merkel:~aba/testing/update_out</filename> to see a setup with
2575 a smaller packages file).  Via web, it's at <ulink
2576 url="http://&ftp-master-host;/testing/update_out_code/"></ulink>
2577 </para>
2578 <para>
2579 The hints are available via <ulink
2580 url="http://&ftp-master-host;/testing/hints/"></ulink>.
2581 </para>
2582 </section>
2583
2584 </section>
2585
2586 <section id="t-p-u">
2587 <title>Direct updates to testing</title>
2588 <para>
2589 The <literal>testing</literal> distribution is fed with packages from 
2590 <literal>unstable</literal> according to the rules explained above.  However,
2591 in some cases, it is necessary to upload packages built only for <literal>
2592 testing</literal>.  For that, you may want to upload to <literal>
2593 testing-proposed-updates</literal>.
2594 </para>
2595 <para>
2596 Keep in mind that packages uploaded there are not automatically processed, they
2597 have to go through the hands of the release manager.  So you'd better have a
2598 good reason to upload there.  In order to know what a good reason is in the
2599 release managers' eyes, you should read the instructions that they regularly
2600 give on &email-debian-devel-announce;.
2601 </para>
2602 <para>
2603 You should not upload to <literal>testing-proposed-updates</literal> when you
2604 can update your packages through <literal>unstable</literal>.  If you can't
2605 (for example because you have a newer development version in <literal>unstable
2606 </literal>), you may use this facility, but it is recommended that you ask for
2607 authorization from the release manager first.  Even if a package is frozen,
2608 updates through <literal>unstable</literal> are possible, if the upload via
2609 <literal>unstable</literal> does not pull in any new dependencies.
2610 </para>
2611 <para>
2612 Version numbers are usually selected by adding the codename of the 
2613 <literal>testing</literal> distribution and a running number, like 
2614 <literal>1.2sarge1</literal> for the first upload through
2615 <literal>testing-proposed-updates</literal> of package version 
2616 <literal>1.2</literal>.
2617 </para>
2618 <para>
2619 Please make sure you didn't miss any of these items in your upload:
2620 </para>
2621 <itemizedlist>
2622 <listitem>
2623 <para>
2624 Make sure that your package really needs to go through
2625 <literal>testing-proposed-updates</literal>, and can't go through <literal>
2626 unstable</literal>;
2627 </para>
2628 </listitem>
2629 <listitem>
2630 <para>
2631 Make sure that you included only the minimal amount of changes;
2632 </para>
2633 </listitem>
2634 <listitem>
2635 <para>
2636 Make sure that you included an appropriate explanation in the changelog;
2637 </para>
2638 </listitem>
2639 <listitem>
2640 <para>
2641 Make sure that you've written <literal>testing</literal> or
2642 <literal>testing-proposed-updates</literal> into your target distribution;
2643 </para>
2644 </listitem>
2645 <listitem>
2646 <para>
2647 Make sure that you've built and tested your package in
2648 <literal>testing</literal>, not in <literal>unstable</literal>;
2649 </para>
2650 </listitem>
2651 <listitem>
2652 <para>
2653 Make sure that your version number is higher than the version in
2654 <literal>testing</literal> and <literal>testing-proposed-updates</literal>,
2655 and lower than in <literal>unstable</literal>;
2656 </para>
2657 </listitem>
2658 <listitem>
2659 <para>
2660 After uploading and successful build on all platforms, contact the release team
2661 at &email-debian-release; and ask them to approve your upload.
2662 </para>
2663 </listitem>
2664 </itemizedlist>
2665 </section>
2666
2667 <section id="faq">
2668 <title>Frequently asked questions</title>
2669 <section id="rc">
2670 <title>What are release-critical bugs, and how do they get counted?</title>
2671 <para>
2672 All bugs of some higher severities are by default considered release-critical;
2673 currently, these are <literal>critical</literal>, <literal>grave</literal> and
2674 <literal>serious</literal> bugs.
2675 </para>
2676 <para>
2677 Such bugs are presumed to have an impact on the chances that the package will
2678 be released with the <literal>stable</literal> release of Debian: in general,
2679 if a package has open release-critical bugs filed on it, it won't get into 
2680 <literal>testing</literal>, and consequently won't be released in <literal>
2681 stable</literal>.
2682 </para>
2683 <para>
2684 The <literal>unstable</literal> bug count are all release-critical bugs which
2685 are marked to apply to <replaceable>package</replaceable>/<replaceable>version
2686 </replaceable> combinations that are available in unstable for a release
2687 architecture. The <literal>testing</literal> bug count is defined analogously.
2688 </para>
2689 </section>
2690
2691 <section id="s5.13.4.2">
2692 <title>How could installing a package into <literal>testing</literal> possibly
2693 break other packages?</title>
2694 <para>
2695 The structure of the distribution archives is such that they can only contain
2696 one version of a package; a package is defined by its name.  So when the source
2697 package <literal>acmefoo</literal> is installed into <literal>testing</literal>,
2698 along with its binary packages <literal>acme-foo-bin</literal>, <literal>
2699 acme-bar-bin</literal>, <literal>libacme-foo1</literal> and <literal>
2700 libacme-foo-dev</literal>, the old version is removed.
2701 </para>
2702 <para>
2703 However, the old version may have provided a binary package with an old soname
2704 of a library, such as <literal>libacme-foo0</literal>.  Removing the old 
2705 <literal>acmefoo</literal> will remove <literal>libacme-foo0</literal>, which
2706 will break any packages which depend on it.
2707 </para>
2708 <para>
2709 Evidently, this mainly affects packages which provide changing sets of binary
2710 packages in different versions (in turn, mainly libraries).  However, it will
2711 also affect packages upon which versioned dependencies have been declared of
2712 the ==, &lt;=, or &lt;&lt; varieties.
2713 </para>
2714 <para>
2715 When the set of binary packages provided by a source package change in this
2716 way, all the packages that depended on the old binaries will have to be updated
2717 to depend on the new binaries instead.  Because installing such a source
2718 package into <literal>testing</literal> breaks all the packages that depended on
2719 it in <literal>testing</literal>,
2720 some care has to be taken now: all the depending packages must be updated and
2721 ready to be installed themselves so that they won't be broken, and, once
2722 everything is ready, manual intervention by the release manager or an assistant
2723 is normally required.
2724 </para>
2725 <para>
2726 If you are having problems with complicated groups of packages like this,
2727 contact &email-debian-devel; or &email-debian-release; for help.
2728 </para>
2729 </section>
2730
2731 </section>
2732
2733 </section>
2734
2735 </chapter>
2736