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