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