Added some code to peer into a data structure in Maemian/Schedule.pm. Also added the
[maemian] / nokia-lintian / man / lintian.1
1 .\" Copyright (C) 1998 Richard Braakman and Christian Schwarz
2 .\"
3 .\" This manual page is free software.  It is distributed under the
4 .\" terms of the GNU General Public License as published by the Free
5 .\" Software Foundation; either version 2 of the License, or (at your
6 .\" option) any later version.
7 .\"
8 .\" This manual page is distributed in the hope that it will be useful,
9 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
10 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 .\" GNU General Public License for more details.
12 .\"
13 .\" You should have received a copy of the GNU General Public License
14 .\" along with this manual page; if not, write to the Free Software
15 .\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
16 .\" USA
17 .\"
18 .TH LINTIAN 1 "June 21, 2008" "Debian GNU/Linux"
19 .if n .ad l
20 .nh
21
22 .SH NAME
23 lintian \- Debian package checker
24
25 .SH SYNOPSIS
26 .B lintian
27 .RI [ action ]
28 .RI [ options ] 
29 .RI [ packages ]
30 \&...
31
32 .SH DESCRIPTION
33 .PP
34 Lintian dissects Debian packages and reports bugs and policy
35 violations.  It contains automated checks for many aspects of Debian
36 policy as well as some checks for common errors.
37 .sp
38 It uses an archive directory, called \fIlaboratory\fR, in which it
39 stores information about the packages it examines.  It can keep this
40 information between multiple invocations in order to avoid repeating
41 expensive data-collection operations.
42 .sp
43 There are three ways to specify binary, udeb or source packages for Lintian
44 to process: by file name (the .deb file for a binary package or the .dsc
45 file for a source package), by package name, or by naming a
46 .I .changes
47 file.  
48 If you list packages by package name, you'll have to
49 define the 
50 .B LINTIAN_DIST
51 variable in the configuration file (see below).  Lintian will then
52 search for any binary or source packages in this directory for
53 packages with the given name. (You can use the
54 .BR \-b " (" \-\-binary "), " \-\-udeb
55 and
56 .BR \-s " (" \-\-source )
57 options if you only want to process binary, udeb or source packages.)
58
59 If you specify a
60 .I .changes
61 file, Lintian will process all packages listed in that file.
62 This is convenient when checking a new package before uploading it.
63
64 .SH OPTIONS
65
66 .PP
67 Actions of the
68 .B lintian
69 command: (Only one action can be specified per invocation)
70
71 .TP
72 .BR \-S ", " \-\-setup\-lab
73 Set up or update the laboratory.
74
75 .TP
76 .BR \-R ", " \-\-remove\-lab
77 Remove the laboratory directory.
78
79 .TP
80 .BR \-c ", " \-\-check
81 Run all checks over the specified packages.
82 This is the default action.
83
84 .TP
85 .BR \-C " chk1,chk2,..., " \-\-check\-part " chk1,chk2,..."
86 Run only the specified checks.  You can either specify the
87 name of the check script or the abbreviation.
88 For details, see the CHECKS section below.
89
90 .TP
91 .BR \-X " chk1,chk2,..., " \-\-dont\-check\-part " chk1,chk2,..."
92 Run all but the the specified checks.  You can either specify
93 the name of the check script or the abbreviation.
94 For details, see the CHECKS section below.
95
96 .TP
97 .BR \-u ", " \-\-unpack
98 Unpack the specified packages up to the current unpack level.
99 The default unpack level is 1 for this option.  See the UNPACK
100 LEVELS section below.
101
102 .TP
103 .BR \-r ", " \-\-remove
104 Clean up the lintian directory of the specified packages up to
105 the current unpack level.  The default unpack level is 0 for
106 this option.
107
108 .PP
109 General options:
110
111 .TP
112 .BR \-h ", " \-\-help
113 Display usage information and exit.
114
115 .TP
116 .BR \-V ", " \-\-version
117 Display lintian version number and exit.
118
119 .TP
120 .BR \-\-print\-version
121 Print unadorned version number and exit.
122
123 .TP
124 .BR \-v ", " \-\-verbose
125 Display verbose messages.
126
127 .TP
128 .BR \-d ", " \-\-debug
129 Display debugging messages. (Implies
130 .BR \-v ).
131
132 .TP
133 .BR \-q ", " \-\-quiet
134 Suppress all informational messages.  Currently, the only message this
135 suppresses is the message at the end of the run giving the total count of
136 overrides.
137
138 .PP
139
140 Behaviour options for
141 .BR lintian .
142
143 .TP
144 .BR \-i ", " \-\-info
145 Print explanatory information about discovered policy violations in
146 addition to the lintian error tags. To print a long tag description
147 without running lintian, see
148 .BR lintian\-info (1).
149
150 .TP
151 .BR \-I ", " \-\-display\-info
152 Display informational ("I:") tags as well.  They are normally suppressed.
153
154 .TP
155 .BR \-E ", " \-\-display\-experimental
156 Display experimental ("X:") tags as well.  They are normally suppressed.
157
158 .TP
159 .BR \-l " n, " \-\-unpack\-level " n"
160 Set unpack level to
161 .IR n .
162 See the UNPACK LEVELS section, below.
163
164 .TP
165 .BR \-o ", " \-\-no\-override
166 Don't use the overrides file.
167
168 .TP
169 .BR \-\-show\-overrides
170 Output tags that have been overriden.
171
172 .TP
173 .BR \-\-color " (never|always|auto|html)"
174 Whether to colorize tags in lintian output based on their severity.  The
175 default is "never", which never uses color.  "always" will always use
176 color, "auto" will use color only if the output is going to a terminal,
177 and "html" will use HTML <span> tags with a color style attribute (instead
178 of ANSI color escape sequences).
179
180 .TP
181 .BR \-U " info1,info2,..., " \-\-unpack\-info " info1,info2,..."
182 Collect information info1, info2, etc. even if these are not
183 required by the checks.
184
185 .TP
186 .BR \-m ", " \-\-md5sums ", " \-\-checksums
187 Check checksums when processing a .changes file.  Normally, Lintian only
188 checks the checksums for .dsc files when processing a .changes file.
189
190 .TP
191 .BR \-\-allow\-root
192 Override
193 .BR lintian 's
194 warning when it is run with superuser privileges.
195
196 .TP
197 .BR \-\-fail\-on\-warnings
198 By default,
199 .B lintian
200 exits with 0 status if only warnings were found.  If this flag is given,
201 exit with a status of 1 if either warnings or errors are found.
202
203 .TP
204 .BR \-\-keep\-lab
205 By default, temporary labs will be removed after lintian is finished.
206 Specifying this options will leave the lab behind, which might be
207 useful for debugging purposes.  You can find out where the temporary
208 lab is located by running lintian with the
209 .B \-\-verbose
210 option.  Implies
211 .B \-\-unpack\-level=2
212 unless another unpack level is specified directly.
213
214 .PP
215
216 Configuration options:
217
218 .TP
219 .BR \-\-cfg " configfile"
220 Read the configuration from
221 .IR configfile
222 rather than the default locations.  This option overrides the
223 .B LINTIAN_CFG
224 environment variable.
225
226 .TP
227 .BR \-\-lab " labdir"
228 Use
229 .IR labdir
230 as the permanent laboratory.  This is where Lintian keeps information about
231 the packages it checks.  This option overrides the
232 .B LINTIAN_LAB
233 environment variable and the configuration file entry of the same
234 name.
235
236 .TP
237 .BR \-\-archivedir " archivedir"
238 Location of Debian archive to scan for packages.  (See the FILES section
239 for complete information on how the path is constructed.)  Use this if you
240 want Lintian to check the whole Debian archive instead of just single
241 packages. This option overrides the
242 .B LINTIAN_ARCHIVEDIR
243 environment variable and the configuration file entry of the same
244 name.
245
246 .TP
247 .BR \-\-dist " distdir"
248 Scan for packages in the
249 .IR distdir
250 directory.  (See the FILES section for complete information on how the
251 path is constructed.)  Use this if you want Lintian to check the whole
252 Debian archive instead of just single packages.  This option overrides the
253 .B LINTIAN_DIST
254 environment variable and the configuration file entry of the same
255 name.
256
257 .TP
258 .BR \-\-section " release"
259 When scanning for packages in the distdir, select only packages from
260 section
261 .IR section
262 (e.g. main). This option overrides the
263 .B LINTIAN_SECTION
264 environment variable and the configuration file entry of the same name.
265
266 .TP
267 .BR \-\-arch " arch"
268 When scanning for packages in the distdir, select only packages for
269 architecture
270 .IR arch .
271 This option overrides the
272 .B LINTIAN_ARCH
273 environment variable and the configuration file entry of the same name.
274
275 .TP
276 .BR \-\-root " rootdir"
277 Look for
278 .BR lintian 's
279 support files (such as check scripts and collection scripts) in
280 .IR rootdir .
281 This overrides the
282 .B LINTIAN_ROOT
283 environment variable.  The default location is
284 .IR /usr/share/lintian .
285
286 .PP
287
288 Package selection options:
289
290 .TP
291 .BR \-a ", " \-\-all
292 Check all packages in the distribution. (This requires that the
293 LINTIAN_DIST variable is defined in the configuration file.)
294
295 .TP
296 .BR \-b ", " \-\-binary
297 The following packages listed on the command line are binary packages.
298
299 .TP
300 .BR \-s ", " \-\-source
301 The following packages listed on the command line are source packages.
302
303 .TP
304 .BR \-\-udeb
305 The following packages listed on the command line are udeb packages.
306
307 .TP
308 .BR \-p ", " \-\-packages\-file " X"
309 Process all packages which are listed in file
310 .BR X .
311 Each package has to be listed in a single line using the following format:
312 .sp
313 .B type package version file
314 .sp
315 where 
316 .B type
317 is either `b' or `s' (binary or source package),
318 .B package
319 is the package name,
320 .B version
321 is the package's version, and
322 .B file
323 is the package file name (absolute path specification).
324
325 .SH "UNPACK LEVELS"
326 .TP
327 .B "0 (none)"
328 The package does not exist in the \fIlaboratory\fR at all.
329
330 .TP
331 .B "1 (basic)"
332 A directory for this package exists in the \fIlaboratory\fR
333 and basic information is extracted.  This does not take
334 much space.
335
336 For binary and udeb packages,
337 the
338 .I control
339 and
340 .I fields
341 directories and the
342 .I index
343 file are unpacked, and symbolic links are made to the
344 .B .deb
345 file and to the lintian directory for the source package.
346
347 For source packages, the
348 .I binary
349 and
350 .I fields
351 directories are unpacked, and symbolic links are made to the
352 source package files.
353
354 .TP
355 .B "2 (contents)"
356 The actual package contents are unpacked as well.
357
358 .PP
359 Lintian will unpack packages as far as is necessary to do its checks,
360 but it will leave the package in whatever unpack level was specified
361 when it is done.
362
363 The default unpack level can be overwritten by setting the
364 .B LINTIAN_UNPACK_LEVEL
365 variable in the configuration file.
366
367 .SH CHECKS
368 .TP
369 .B binaries (bin)
370 Search for bugs in binaries and object files.
371
372 .TP
373 .B changelog\-file (chg)
374 Check changelog files in a binary package.
375
376 .TP
377 .B conffiles (cnf)
378 Check if the
379 .I conffiles
380 control file of a binary package is correct.
381
382 .TP
383 .B control\-file (dctl)
384 This script checks debian/control files in source packages.
385
386 .TP
387 .B control\-files (ctl)
388 Check for unknown control files in the binary package.
389
390 .TP
391 .B copyright\-file (cpy)
392 Check if a binary package conforms to policy with respect to
393 the copyright file.  Each binary package must either have a 
394 .RI /usr/share/doc/ package /copyright
395 file or must have a symlink
396 .RI /usr/share/doc/ package \-> foo ,
397 where
398 .I foo
399 comes from the same source package, and this package declares a 
400 "Depends" relation on
401 .IR foo .
402
403 .TP
404 .B cruft (deb)
405 Looks for cruft in source packages, like files of version control
406 systems and temporary files from the build process.
407
408 .TP
409 .B deb\-format (dfmt)
410 Checks if a binary package was build with a broken version of tar so
411 that dpkg can't handle it correctly.
412
413 .TP
414 .B debconf (dc)
415 Looks for common mistakes in packages using debconf, like missing
416 dependencies or errors in the template file.
417
418 .TP
419 .B debian\-readme (drm)
420 Check if the README.Debian file is merely the debmake template.
421
422 .TP
423 .B debhelper (dh)
424 Looks for common mistakes in source packages using debhelper.
425
426 .TP
427 .B description (des)
428 Check if the
429 .B Description
430 control field of a binary package conforms to the rules in the
431 Policy Manual (section 3.4).
432
433 .TP
434 .B etcfiles (etc)
435 Checks if all files in
436 .B /etc
437 that are shipped with the package are marked as conffiles as
438 required by policy.
439
440 .TP
441 .B fields (fld)
442 Check control fields of a binary or source package.
443
444 .TP
445 .B files (fil)
446 Check if a binary package conforms to policy with respect to
447 types, permissions and ownerships of files and directories.
448
449 .TP
450 .B huge\-usr\-share (hus)
451 Checks whether an architecture-dependent package does
452 have a significantly big \fB/usr/share\fR. Big amounts of
453 architecture independent data in architecture dependent
454 packages waste space on the mirrors.
455
456 .TP
457 .B infofiles (info)
458 Check if a binary package conforms to policy with respect
459 to info documents.
460
461 .TP
462 .B init.d (ini)
463 Check if a binary package conforms to policy with respect
464 to scripts in \fB/etc/init.d\fR.
465
466 .TP
467 .B manpages (man)
468 Check if a binary package conforms to policy with respect
469 to manual pages.
470
471 .TP
472 .B md5sums (md5)
473 If the
474 .B md5sum
475 control file of a binary package exists, check if it is valid.
476
477 .TP
478 .B menus (men)
479 Check if a binary package conforms to policy with respect
480 to 
481 .B menu
482 and 
483 .B doc\-base
484 files.
485
486 .TP
487 .B menu\-format (mnf)
488 Check the syntax of menu files installed by the package.
489
490 .TP
491 .B patch\-systems (pat)
492 Check source package use of patch systems.
493
494 .TP
495 .B perl (prl)
496 Check perl scripts installed by the package for the usage of perl
497 modules, and check that the package declares the appropriate
498 dependencies.
499
500 .TP
501 .B po\-debconf (pd)
502 Looks for common mistakes in packages using po\-debconf.
503
504 .TP
505 .B rules (rul)
506 Looks for common problems in the debian/rules file in source packages.
507
508 .TP
509 .B scripts (scr)
510 Check the the \fB#!\fR lines of scripts in a binary package.
511
512 .TP
513 .B shared\-libs (shl)
514 Check if a binary package conforms to policy with respect to
515 shared libraries and the
516 .B shlibs
517 control file.
518
519 .TP
520 .B spelling (spl)
521 Check a binary package's "Description:" field and copyright file
522 for common spelling errors.
523
524 .TP
525 .B standards\-version (std)
526 Check if a source package contains a valid
527 .B Standards\-Version
528 field in its
529 .I debian/control
530 file.
531
532 .TP
533 .B version\-substvars (v\-s)
534 Check use of version substvars in a source package, particularly whether
535 the relationships between packages allow safe binary NMUs.
536
537 .TP
538 .B watch\-file (watch)
539 Check \fIdebian/watch\fP files in source packages.
540
541 .SH COLLECTION
542
543 .TP
544 .B changelog\-file
545 Copy the changelog file of a package into the lintian directory.
546
547 .TP
548 .B copyright\-file
549 Copy the copyright file of a package into the lintian directory.
550
551 .TP
552 .B debfiles
553 Collects files shipped in the source of the package.
554
555 .TP
556 .B debian\-readme
557 Copy the README.Debian file of a package into the lintian directory.
558
559 .TP
560 .B diffstat
561 Collect the output of the
562 .BR diffstat (1)
563 utility for the Debian diff in a source package.
564
565 .TP
566 .B doc\-base\-files
567 Copy the contents of 
568 .B /usr/share/doc\-base
569 into the lintian directory (below \fBdoc\-base\fR).
570
571 .TP
572 .B file\-info
573 Collect the output of the
574 .BR file (1)
575 utility for each file in a binary package.
576
577 .TP
578 .B init.d
579 Copy 
580 .B /etc/init.d
581 scripts into the lintian directory (below \fBinit.d\fR).
582
583 .TP
584 .B md5sums
585 Collect the md5sums of all files in a binary package.
586
587 .TP
588 .B menu\-files
589 Copy the contents of a binary package's
590 .I usr/share/doc/menu
591 directory into the
592 .I menu
593 directory in the lab.
594
595 .TP
596 .B objdump\-info
597 Collect the output of the
598 .BR objdump (1)
599 utility for each file in a binary package.
600
601 .TP
602 .B override\-file
603 Copy the override file of a package into the lintian directory
604
605 .TP
606 .B scripts
607 Collect information about scripts in binary package.
608
609 .TP
610 .B source-control-file
611 Collects information about binary packages from debian/control
612 in source packages
613
614 .SH FILES
615 Lintian looks for its configuration file in the following locations:
616 .TP
617 The directory given with the \-\-cfg option
618 .TP
619 .I $LINTIAN_CFG
620 .TP 
621 .I $LINTIAN_ROOT/lintianrc
622 .TP
623 .I $HOME/.lintianrc
624 .TP
625 .I /etc/lintianrc
626 .PP
627 Lintian uses the following directories:
628 .TP
629 .I /tmp
630 If no lab location is specified via the LINTIAN_LAB environment variable,
631 configuration, or the
632 .B \-\-lab
633 command-line option, lintian defaults to creating a temporary lab
634 directory in
635 .IR /tmp .
636 To change the directory used, set the TMPDIR environment variable to a
637 suitable directory.
638 .TP
639 .I /usr/share/lintian/checks
640 Scripts that check aspects of a package.
641 .TP
642 .I /usr/share/lintian/collection
643 Scripts that collect information about a package and store it for
644 use by the check scripts.
645 .TP
646 .I /usr/share/lintian/lib
647 Utility scripts used by the other lintian scripts.
648 .TP
649 .I /usr/share/lintian/unpack
650 Scripts that manage the \fIlaboratory\fR.
651
652 .PP
653 The
654 .I /usr/share/lintian
655 directory can be overridden with the
656 .B LINTIAN_ROOT
657 environment variable or the
658 .B \-\-root
659 option.
660
661 .PP
662 When looking for packages in a Debian archive, lintian constructs the path
663 to the archive from the
664 .IR archivedir ,
665 .IR distdir ,
666 .IR release ,
667 .RI and arch
668 as follows:
669 .sp
670 .IR archivedir /dists/ distdir / release / arch
671 .sp
672 Lintian always expects the "/dists/" path component in paths to Debian
673 archives.
674
675 .SH EXIT STATUS
676 .TP
677 .B 0
678 No policy violations (errors) detected. (There might have been warnings, though.)
679 .TP
680 .B 1
681 Policy violations detected.
682 .TP
683 .B 2
684 Lintian run-time error. An error message is sent to stderr.
685
686 .SH USAGE
687 Examples:
688 .TP
689 .B "$ lintian foo.deb"
690 Check binary package foo given by foo.deb.
691 .TP
692 .B "$ lintian foo.dsc"
693 Check source package foo given by foo.dsc.
694 .TP
695 .B "$ lintian foo"
696 Search for package foo in the Debian archive and check it. (Depending
697 on what is found, this command will check either the source or binary
698 package foo, or both.)
699 .TP
700 .B "$ lintian --archivedir /var/packages --dist custom --section main"
701 Check all packages found in the Debian archive at
702 .IR /var/packages/dists/custom/main .
703 .TP
704 .B "$ lintian \-i foo.changes"
705 Check the changes file and, if listed, the source and binary package
706 of the upload. The output will contain detailed information about the
707 reported tags.
708 .TP
709 .B "$ lintian \-c \-\-binary foo"
710 Search for binary package foo in the Debian archive and check it. 
711 .TP
712 .B "$ lintian \-C cpy \-\-source foo"
713 Run the copyright checks on source package foo.
714 .TP
715 .B "$ lintian \-u foo"
716 Unpack package foo in the Lintian laboratory up to level 1. (If it's
717 already unpacked at level 1 or 2, nothing is done.)
718 .TP
719 .B "$ lintian \-l1 \-r foo"
720 Search for package foo in the Debian archive and, if found, reduce the
721 package disk usage in the laboratory to level 1.
722 .TP
723 .B "$ lintian \-r foo"
724 Remove package foo from the Lintian laboratory.
725
726 .SH BUGS
727 Lintian does not handle packages with different binary and source
728 version numbers correctly.
729 .sp
730 Lintian does not have any locking mechanisms yet. (Running several
731 checks simultaneously is likely to fail.)
732 .sp
733 If you discover any other bugs in Lintian, please contact the authors.
734
735 .SH SEE ALSO
736 .BR lintian\-info (1),
737 .B Lintian User's Manual
738 (file:/usr/share/doc/lintian/lintian.html/index.html)
739
740 Packaging tools:
741 .BR debhelper (7),
742 .BR dh_make (8),
743 .BR dpkg-buildpackage (1)
744
745 .SH AUTHORS
746 Richard Braakman <dark@xs4all.nl>
747 .br
748 Christian Schwarz <schwarz@monet.m.isar.de>
749 .br
750 Please use the email address <lintian\-maint@debian.org> for Lintian related
751 comments.