This file is indexed.

/usr/share/doc/maint-guide/html/checkit.en.html is in maint-guide 1.2.32.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Chapter 7. Checking the package for errors</title>
    <link rel="stylesheet" type="text/css" href="maint-guide.css"/>
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="home" href="index.en.html" title="Debian New Maintainers' Guide"/>
    <link rel="up" href="index.en.html" title="Debian New Maintainers' Guide"/>
    <link rel="prev" href="build.en.html" title="Chapter 6. Building the package"/>
    <link rel="next" href="update.en.html" title="Chapter 8. Updating the package"/>
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Chapter 7. Checking the package for errors</th>
        </tr>
        <tr>
          <td align="left"><a accesskey="p" href="build.en.html"><img src="images/prev.gif" alt="Prev"/></a> </td>
          <th width="60%" align="center"> </th>
          <td align="right"> <a accesskey="n" href="update.en.html"><img src="images/next.gif" alt="Next"/></a></td>
        </tr>
      </table>
      <hr/>
    </div>
    <div class="chapter">
      <div class="titlepage">
        <div>
          <div>
            <h1 class="title"><a id="checkit"/>Chapter 7. Checking the package for errors</h1>
          </div>
        </div>
      </div>
      <div class="toc">
        <p>
          <strong>Table of Contents</strong>
        </p>
        <dl class="toc">
          <dt>
            <span class="section">
              <a href="checkit.en.html#inadvent">7.1. Suspicious changes</a>
            </span>
          </dt>
          <dt>
            <span class="section">
              <a href="checkit.en.html#pinstall">7.2. Verifying a package's installation</a>
            </span>
          </dt>
          <dt>
            <span class="section">
              <a href="checkit.en.html#pmaintscripts">7.3. Verifying a package's maintainer scripts</a>
            </span>
          </dt>
          <dt>
            <span class="section">
              <a href="checkit.en.html#lintians">7.4. Using <code class="systemitem">lintian</code></a>
            </span>
          </dt>
          <dt>
            <span class="section">
              <a href="checkit.en.html#debc">7.5. The <span class="command"><strong>debc</strong></span> command</a>
            </span>
          </dt>
          <dt>
            <span class="section">
              <a href="checkit.en.html#debdiff">7.6. The <span class="command"><strong>debdiff</strong></span> command</a>
            </span>
          </dt>
          <dt>
            <span class="section">
              <a href="checkit.en.html#interdiff">7.7. The <span class="command"><strong>interdiff</strong></span> command</a>
            </span>
          </dt>
          <dt>
            <span class="section">
              <a href="checkit.en.html#mc">7.8. The <span class="command"><strong>mc</strong></span> command</a>
            </span>
          </dt>
        </dl>
      </div>
      <p>
There are some techniques you should know for checking a package for errors
before uploading it to the public archives.
</p>
      <p>
It's also a good idea to carry out testing on a machine other than your own.  You must watch
closely for any warnings or errors for all the tests described here.
</p>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="inadvent"/>7.1. Suspicious changes</h2>
            </div>
          </div>
        </div>
        <p>
If you find a new autogenerated patch file such as
<code class="filename">debian-changes-*</code> in the
<code class="filename">debian/patches</code> directory after building your non-native
Debian package in <code class="literal">3.0 (quilt)</code> format, chances are you
changed some files by accident or the build script modified the upstream
source.  If it is your mistake, fix it.  If it is caused by the build script,
fix the root cause with <span class="command"><strong>dh-autoreconf</strong></span> as in 
<a class="xref" href="dreq.en.html#customrules" title="4.4.3. Customization of rules file">Section 4.4.3, “Customization of <code class="filename">rules</code> file”</a> or work around it with
<code class="filename">source/options</code> as in <a class="xref" href="dother.en.html#sourceopt" title="5.25. source/options">Section 5.25, “<code class="filename">source/options</code></a>.
</p>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="pinstall"/>7.2. Verifying a package's installation</h2>
            </div>
          </div>
        </div>
        <p>
You must test your package for whether it installs without problem.  The <span class="citerefentry"><span class="refentrytitle">debi</span>(1)</span>
command helps you to test installing all the generated binary packages.
</p>
        <pre class="screen">
$ sudo debi gentoo_0.9.12-1_i386.changes
</pre>
        <p>
To prevent installation problem on different systems, you must make
sure that there are no filenames conflicting with other existing packages,
using the
<code class="filename">Contents-<em class="replaceable"><code>i386</code></em></code> file downloaded
from the Debian archive.
The <span class="command"><strong>apt-file</strong></span> command may be handy for this task.  If there
are collisions, please take action to avoid this real problem, whether by
renaming the file, moving a common file to a separate package that
multiple packages can depend on, using the alternatives mechanism (see
<span class="citerefentry"><span class="refentrytitle">update-alternatives</span>(1)</span>) in coordination with the
maintainers of other affected packages, or declaring a
<code class="literal">Conflicts</code> relationship in the
<code class="filename">debian/control</code> file.
</p>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="pmaintscripts"/>7.3. Verifying a package's maintainer scripts</h2>
            </div>
          </div>
        </div>
        <p>
All maintainer scripts (that is,
<code class="filename">preinst</code>, <code class="filename">prerm</code>,
<code class="filename">postinst</code>, and <code class="filename">postrm</code> files) are
hard to write correctly unless they are auto-generated by the
<code class="systemitem">debhelper</code> programs.  So do not use them if you are
a novice maintainer (see <a class="xref" href="dother.en.html#maintscripts" title="5.19. {pre,post}{inst,rm}">Section 5.19, “<code class="filename">{pre,post}{inst,rm}</code></a>).
</p>
        <p>
If the package makes use of these non-trivial maintainer scripts, be sure to test not only for install but also for remove,
purge, and upgrade processes.  Many maintainer script bugs show up
when packages are removed or purged.  Use the <span class="command"><strong>dpkg</strong></span> command
as follows to test them.
</p>
        <pre class="screen">
$ sudo dpkg -r gentoo
$ sudo dpkg -P gentoo
$ sudo dpkg -i gentoo_<em class="replaceable"><code>version</code></em>-<em class="replaceable"><code>revision</code></em>_<em class="replaceable"><code>i386</code></em>.deb
</pre>
        <p>
This should be done with sequences such as the following.
</p>
        <div class="itemizedlist">
          <ul class="itemizedlist">
            <li class="listitem">
              <p>
install the previous version (if needed).
</p>
            </li>
            <li class="listitem">
              <p>
upgrade it from the previous version.
</p>
            </li>
            <li class="listitem">
              <p>
downgrade it back to the previous version (optional).
</p>
            </li>
            <li class="listitem">
              <p>
purge it.
</p>
            </li>
            <li class="listitem">
              <p>
install the new package.
</p>
            </li>
            <li class="listitem">
              <p>
remove it.
</p>
            </li>
            <li class="listitem">
              <p>
install it again.
</p>
            </li>
            <li class="listitem">
              <p>
purge it.
</p>
            </li>
          </ul>
        </div>
        <p>
If this is your first package, you should create dummy packages with different
versions to test your package in advance to prevent future problems.
</p>
        <p>
Bear in mind that if your package has previously been released in Debian,
people will often be upgrading to your package from the version that was in the
last Debian release.  Remember to test upgrades from that version too.
</p>
        <p>
Although downgrading is not officially supported, supporting it is a
friendly gesture.
</p>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="lintians"/>7.4. Using <code class="systemitem">lintian</code></h2>
            </div>
          </div>
        </div>
        <p>
Run <span class="citerefentry"><span class="refentrytitle">lintian</span>(1)</span> on your <code class="filename">.changes</code>
file.  The <span class="command"><strong>lintian</strong></span> command runs many test scripts to check
for many common packaging errors.  <a href="#ftn.idp31156764" class="footnote" id="idp31156764"><sup class="footnote">[77]</sup></a>
</p>
        <pre class="screen">
$ lintian -i -I --show-overrides gentoo_0.9.12-1_i386.changes
</pre>
        <p>
Of course, replace the filename with the name of the
<code class="filename">.changes</code> file generated for your package.  The output of
the <span class="command"><strong>lintian</strong></span> command uses the following flags.
</p>
        <div class="itemizedlist">
          <ul class="itemizedlist">
            <li class="listitem">
              <p>
<code class="literal">E:</code> for error; a sure policy violation or packaging error.
</p>
            </li>
            <li class="listitem">
              <p>
<code class="literal">W:</code> for warning; a possible policy violation or packaging
error.
</p>
            </li>
            <li class="listitem">
              <p>
<code class="literal">I:</code> for info; information on certain aspects of packaging.
</p>
            </li>
            <li class="listitem">
              <p>
<code class="literal">N:</code> for note; a detailed message to help your debugging.
</p>
            </li>
            <li class="listitem">
              <p>
<code class="literal">O:</code> for overridden; a message overridden by the
<code class="filename">lintian-overrides</code> files but displayed by the
<code class="literal">--show-overrides</code> option.
</p>
            </li>
          </ul>
        </div>
        <p>
When you see warnings, tune the package to avoid them or verify that the warnings are
spurious.  If spurious, set up <code class="filename">lintian-overrides</code> files as
described in <a class="xref" href="dother.en.html#lintian" title="5.14. {package.,source/}lintian-overrides">Section 5.14, “<code class="filename">{<em class="replaceable"><code>package</code></em>.,source/}lintian-overrides</code></a>.
</p>
        <p>
Note that you can build the package with <span class="command"><strong>dpkg-buildpackage</strong></span>
and run <span class="command"><strong>lintian</strong></span> on it in one command, if you use <span class="citerefentry"><span class="refentrytitle">debuild</span>(1)</span>
or <span class="citerefentry"><span class="refentrytitle">pdebuild</span>(1)</span>.
</p>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="debc"/>7.5. The <span class="command"><strong>debc</strong></span> command</h2>
            </div>
          </div>
        </div>
        <p>
You can list files in the binary Debian package with the <span class="citerefentry"><span class="refentrytitle">debc</span>(1)</span>
command.
</p>
        <pre class="screen">
$ debc <em class="replaceable"><code>package</code></em>.changes
</pre>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="debdiff"/>7.6. The <span class="command"><strong>debdiff</strong></span> command</h2>
            </div>
          </div>
        </div>
        <p>
You can compare file contents in two source Debian packages with the
<span class="citerefentry"><span class="refentrytitle">debdiff</span>(1)</span> command.
</p>
        <pre class="screen">
$ debdiff <em class="replaceable"><code>old-package</code></em>.dsc <em class="replaceable"><code>new-package</code></em>.dsc
</pre>
        <p>
You can also compare file lists in two sets of binary Debian packages with the
<span class="citerefentry"><span class="refentrytitle">debdiff</span>(1)</span> command.
</p>
        <pre class="screen">
$ debdiff <em class="replaceable"><code>old-package</code></em>.changes <em class="replaceable"><code>new-package</code></em>.changes
</pre>
        <p>
These are useful to identify what has been changed in the source packages
and to check for inadvertent changes made when updating binary
packages, such as unintentionally misplacing or removing files.
</p>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="interdiff"/>7.7. The <span class="command"><strong>interdiff</strong></span> command</h2>
            </div>
          </div>
        </div>
        <p>
You can compare two <code class="filename">diff.gz</code> files with the <span class="citerefentry"><span class="refentrytitle">interdiff</span>(1)</span> command.  This is useful for verifying that no inadvertent
changes were made to the source by the maintainer when updating packages in the
old <code class="literal">1.0</code> source format.
</p>
        <pre class="screen">
$ interdiff -z <em class="replaceable"><code>old-package</code></em>.diff.gz <em class="replaceable"><code>new-package</code></em>.diff.gz
</pre>
        <p>
The new <code class="literal">3.0</code> source format stores changes in multiple patch
files as described in <a class="xref" href="dother.en.html#patches" title="5.26. patches/*">Section 5.26, “<code class="filename">patches/*</code></a>.  You can trace changes of each
<code class="filename">debian/patches/*</code> file using <span class="command"><strong>interdiff</strong></span>, too.
</p>
      </div>
      <div class="section">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title"><a id="mc"/>7.8. The <span class="command"><strong>mc</strong></span> command</h2>
            </div>
          </div>
        </div>
        <p>
Many of these file inspection operations can be made into an intuitive process
by using a file manager like <span class="citerefentry"><span class="refentrytitle">mc</span>(1)</span> which will let you browse not only the
contents of <code class="filename">*.deb</code> package files but also
<code class="filename">*.udeb</code>, <code class="filename">*.debian.tar.gz</code>,
<code class="filename">*.diff.gz</code>, and <code class="filename">*.orig.tar.gz</code> files.
</p>
        <p>
Be on the lookout for extra unneeded files or zero length files, both in the
binary and source package.  Often cruft doesn't get cleaned up properly; adjust
your <code class="filename">rules</code> file to compensate for this.
</p>
      </div>
      <div class="footnotes">
        <br/>
        <hr/>
        <div id="ftn.idp31156764" class="footnote">
          <p><a href="#idp31156764" class="para"><sup class="para">[77] </sup></a> You do not need to provide
the <span class="command"><strong>lintian</strong></span> option <code class="literal">-i -I --show-overrides</code>
if you customized <code class="filename">/etc/devscripts.conf</code> or
<code class="filename">~/.devscripts</code> as described in <a class="xref" href="build.en.html#debuild" title="6.3. debuild command">Section 6.3, “<span class="command"><strong>debuild</strong></span> command”</a>.
</p>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <hr/>
      <table width="100%" summary="Navigation footer">
        <tr>
          <td align="left"><a accesskey="p" href="build.en.html"><img src="images/prev.gif" alt="Prev"/></a> </td>
          <td align="center"> </td>
          <td align="right"> <a accesskey="n" href="update.en.html"><img src="images/next.gif" alt="Next"/></a></td>
        </tr>
        <tr>
          <td align="left" valign="top">Chapter 6. Building the package </td>
          <td align="center">
            <a accesskey="h" href="index.en.html">
              <img src="images/home.gif" alt="Home"/>
            </a>
          </td>
          <td align="right" valign="top"> Chapter 8. Updating the package</td>
        </tr>
      </table>
    </div>
  </body>
</html>