IMPORTANT: Per accedir als fitxer de subversion: http://acacha.org/svn (sense password). Poc a poc s'aniran migrant els enllaços. Encara però funciona el subversion de la farga però no se sap fins quan... (usuari: prova i la paraula de pas 123456)

Lintian disecciona un paquet Debian i mira de buscar-hi errors i violacions de la Debian Policy. Proporciona una sèrie de comprovacions automàtiques que permeten verificar si un paquet compleix la Debian policy així com mostrar alguns dels errors més comuns.


Instal·lació

$ sudo apt-get install lintian

Fitxers instal·lats:

$ dpkg -L lintian
/.
/etc
/etc/lintianrc
/usr
/usr/bin
/usr/bin/lintian
/usr/bin/lintian-info
/usr/share
/usr/share/lintian
/usr/share/lintian/checks
/usr/share/lintian/checks/deb-format
/usr/share/lintian/checks/watch-file
/usr/share/lintian/checks/cruft.desc
/usr/share/lintian/checks/scripts.desc
/usr/share/lintian/checks/shared-libs.desc
/usr/share/lintian/checks/po-debconf.desc
/usr/share/lintian/checks/binaries.desc
/usr/share/lintian/checks/debian-source-dir
/usr/share/lintian/checks/debhelper.desc
/usr/share/lintian/checks/conffiles.desc
/usr/share/lintian/checks/version-substvars
/usr/share/lintian/checks/control-files
/usr/share/lintian/checks/changes-file
/usr/share/lintian/checks/init.d.desc
/usr/share/lintian/checks/md5sums
/usr/share/lintian/checks/ocaml
/usr/share/lintian/checks/huge-usr-share.desc
/usr/share/lintian/checks/debian-readme.desc
/usr/share/lintian/checks/control-files.desc
/usr/share/lintian/checks/changes-file.desc
/usr/share/lintian/checks/shared-libs
/usr/share/lintian/checks/description
/usr/share/lintian/checks/debconf.desc
/usr/share/lintian/checks/standards-version
/usr/share/lintian/checks/menu-format.desc
/usr/share/lintian/checks/patch-systems
/usr/share/lintian/checks/debhelper
/usr/share/lintian/checks/version-substvars.desc
/usr/share/lintian/checks/debian-source-dir.desc
/usr/share/lintian/checks/changelog-file
/usr/share/lintian/checks/rules.desc
/usr/share/lintian/checks/init.d
/usr/share/lintian/checks/huge-usr-share
/usr/share/lintian/checks/scripts
/usr/share/lintian/checks/manpages.desc
/usr/share/lintian/checks/etcfiles.desc
/usr/share/lintian/checks/description.desc
/usr/share/lintian/checks/control-file
/usr/share/lintian/checks/po-debconf
/usr/share/lintian/checks/copyright-file.desc
/usr/share/lintian/checks/lintian.desc
/usr/share/lintian/checks/nmu
/usr/share/lintian/checks/fields.desc
/usr/share/lintian/checks/standards-version.desc
/usr/share/lintian/checks/menu-format
/usr/share/lintian/checks/binaries
/usr/share/lintian/checks/cruft
/usr/share/lintian/checks/menus.desc
/usr/share/lintian/checks/deb-format.desc
/usr/share/lintian/checks/infofiles.desc
/usr/share/lintian/checks/files.desc
/usr/share/lintian/checks/changelog-file.desc
/usr/share/lintian/checks/infofiles
/usr/share/lintian/checks/nmu.desc
/usr/share/lintian/checks/copyright-file
/usr/share/lintian/checks/ocaml.desc
/usr/share/lintian/checks/fields
/usr/share/lintian/checks/menus
/usr/share/lintian/checks/etcfiles
/usr/share/lintian/checks/conffiles
/usr/share/lintian/checks/debian-readme
/usr/share/lintian/checks/files
/usr/share/lintian/checks/common_data.pm
/usr/share/lintian/checks/watch-file.desc
/usr/share/lintian/checks/manpages
/usr/share/lintian/checks/patch-systems.desc
/usr/share/lintian/checks/debconf
/usr/share/lintian/checks/control-file.desc
/usr/share/lintian/checks/md5sums.desc
/usr/share/lintian/checks/rules
/usr/share/lintian/collection
/usr/share/lintian/collection/override-file
/usr/share/lintian/collection/debfiles.desc
/usr/share/lintian/collection/scripts.desc
/usr/share/lintian/collection/ar-info
/usr/share/lintian/collection/menu-files
/usr/share/lintian/collection/init.d.desc
/usr/share/lintian/collection/strings.desc
/usr/share/lintian/collection/md5sums
/usr/share/lintian/collection/unpacked
/usr/share/lintian/collection/override-file.desc
/usr/share/lintian/collection/debian-readme.desc
/usr/share/lintian/collection/file-info
/usr/share/lintian/collection/source-control-file
/usr/share/lintian/collection/file-info.desc
/usr/share/lintian/collection/doc-base-files.desc
/usr/share/lintian/collection/changelog-file
/usr/share/lintian/collection/source-control-file.desc
/usr/share/lintian/collection/init.d
/usr/share/lintian/collection/scripts
/usr/share/lintian/collection/ar-info.desc
/usr/share/lintian/collection/copyright-file.desc
/usr/share/lintian/collection/diffstat.desc
/usr/share/lintian/collection/changelog-file.desc
/usr/share/lintian/collection/doc-base-files
/usr/share/lintian/collection/copyright-file
/usr/share/lintian/collection/debfiles
/usr/share/lintian/collection/objdump-info.desc
/usr/share/lintian/collection/menu-files.desc
/usr/share/lintian/collection/debian-readme
/usr/share/lintian/collection/objdump-info
/usr/share/lintian/collection/strings
/usr/share/lintian/collection/diffstat
/usr/share/lintian/collection/unpacked.desc
/usr/share/lintian/collection/md5sums.desc
/usr/share/lintian/data
/usr/share/lintian/data/spelling
/usr/share/lintian/data/spelling/corrections-multiword
/usr/share/lintian/data/spelling/corrections
/usr/share/lintian/data/spelling/corrections-case
/usr/share/lintian/data/output
/usr/share/lintian/data/output/ftp-master-fatal
/usr/share/lintian/data/output/ftp-master-nonfatal
/usr/share/lintian/data/output/manual-references
/usr/share/lintian/data/shared-libs
/usr/share/lintian/data/shared-libs/ldconfig-dirs
/usr/share/lintian/data/standards-version
/usr/share/lintian/data/standards-version/release-dates
/usr/share/lintian/data/debhelper
/usr/share/lintian/data/debhelper/dh_packages
/usr/share/lintian/data/debhelper/miscDepends_commands
/usr/share/lintian/data/debhelper/maint_commands
/usr/share/lintian/data/debhelper/dh_commands 
/usr/share/lintian/data/debhelper/filename-config-files
/usr/share/lintian/data/changelog-file
/usr/share/lintian/data/changelog-file/ubuntu-dists
/usr/share/lintian/data/init.d
/usr/share/lintian/data/init.d/virtual_facilities
/usr/share/lintian/data/README
/usr/share/lintian/data/doc-base
/usr/share/lintian/data/doc-base/sections
/usr/share/lintian/data/binaries
/usr/share/lintian/data/binaries/multiarch
/usr/share/lintian/data/fields
/usr/share/lintian/data/fields/perl-provides
/usr/share/lintian/data/fields/no-build-depends
/usr/share/lintian/data/fields/virtual-packages
/usr/share/lintian/data/fields/architectures
/usr/share/lintian/data/fields/obsolete-packages
/usr/share/lintian/data/fields/essential
/usr/share/lintian/data/fields/metapackages
/usr/share/lintian/data/files
/usr/share/lintian/data/files/locale-codes
/usr/share/lintian/data/files/incorrect-locale-codes
/usr/share/lintian/data/files/triplets
/usr/share/lintian/data/files/fonts
/usr/share/lintian/lib
/usr/share/lintian/lib/Checker.pm
/usr/share/lintian/lib/Util.pm
/usr/share/lintian/lib/Lintian
/usr/share/lintian/lib/Lintian/Command.pm
/usr/share/lintian/lib/Lintian/Collect.pm
/usr/share/lintian/lib/Lintian/Output.pm
/usr/share/lintian/lib/Lintian/Relation
/usr/share/lintian/lib/Lintian/Relation/Version.pm
/usr/share/lintian/lib/Lintian/Collect
/usr/share/lintian/lib/Lintian/Collect/Binary.pm
/usr/share/lintian/lib/Lintian/Collect/Source.pm
/usr/share/lintian/lib/Lintian/Collect/Changes.pm
/usr/share/lintian/lib/Lintian/Relation.pm
/usr/share/lintian/lib/Lintian/Check.pm
/usr/share/lintian/lib/Lintian/Output
/usr/share/lintian/lib/Lintian/Output/XML.pm
/usr/share/lintian/lib/Lintian/Output/LetterQualifier.pm
/usr/share/lintian/lib/Lintian/Output/ColonSeparated.pm
/usr/share/lintian/lib/Lintian/Tag
/usr/share/lintian/lib/Lintian/Tag/Info.pm
/usr/share/lintian/lib/Lintian/DepMap.pm
/usr/share/lintian/lib/Lintian/DepMap
/usr/share/lintian/lib/Lintian/DepMap/Properties.pm
/usr/share/lintian/lib/Lintian/Command
/usr/share/lintian/lib/Lintian/Command/Simple.pm
/usr/share/lintian/lib/Lintian/Schedule.pm
/usr/share/lintian/lib/Lintian/Tags.pm
/usr/share/lintian/lib/Lintian/Data.pm
/usr/share/lintian/lib/Text_utils.pm
/usr/share/lintian/lib/Read_pkglists.pm
/usr/share/lintian/lib/Lab.pm
/usr/share/lintian/unpack
/usr/share/lintian/unpack/unpack-srcpkg-l1
/usr/share/lintian/unpack/unpack-changes-l1
/usr/share/lintian/unpack/list-srcpkg
/usr/share/lintian/unpack/unpack-binpkg-l1
/usr/share/lintian/unpack/list-binpkg
/usr/share/lintian/unpack/list-udebpkg
/usr/share/doc
/usr/share/doc/lintian
/usr/share/doc/lintian/lintian.html
/usr/share/doc/lintian/lintian.html/index.html
/usr/share/doc/lintian/lintian.html/ch1.html
/usr/share/doc/lintian/lintian.html/ch2.html
/usr/share/doc/lintian/lintian.html/ch3.html
/usr/share/doc/lintian/CREDITS
/usr/share/doc/lintian/desc-files
/usr/share/doc/lintian/changelog.gz
/usr/share/doc/lintian/copyright
/usr/share/doc/lintian/README.gz
/usr/share/doc/lintian/lintian.sgml.gz
/usr/share/doc/lintian/lintian.txt.gz
/usr/share/doc-base
/usr/share/doc-base/lintian
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/lintian.1.gz
/usr/share/man/man1/lintian-info.1.gz
/var
/var/lib
/var/lib/lintian
/var/spool
/var/spool/lintian

Documentació

Interpretació dels missatges

Vegeu un exemple de sortida al executar Lintian a un paquet concret (a l'exemple el paquet ubuntucustom)

Now running lintian...
W: ubuntucustom source: dh-make-template-in-source debian/prerm.ex
W: ubuntucustom source: dh-make-template-in-source debian/postinst.ex
W: ubuntucustom source: dh-make-template-in-source debian/postrm.ex
W: ubuntucustom source: dh-make-template-in-source debian/preinst.ex
W: ubuntucustom source: out-of-date-standards-version 3.8.4 (current is 3.9.1)
W: ubuntucustom: copyright-has-url-from-dh_make-boilerplate
E: ubuntucustom: section-is-dh_make-template
E: ubuntucustom: depends-on-essential-package-without-using-version depends: mount
E: ubuntucustom: depends-on-essential-package-without-using-version depends: coreutils
E: ubuntucustom: depends-on-essential-package-without-using-version depends: grep
E: ubuntucustom: depends-on-essential-package-without-using-version depends: sed 
W: ubuntucustom: new-package-should-close-itp-bug
W: ubuntucustom: wrong-bug-number-in-closes l3:#nnnn
E: ubuntucustom: manpage-is-dh_make-template usr/share/man/man1/customcd.1.gz
W: ubuntucustom: manpage-section-mismatch usr/share/man/man1/customcd.1.gz:5 1 != SECTION
W: ubuntucustom: binary-without-manpage usr/bin/createPreseedFiles
W: ubuntucustom: binary-without-manpage usr/sbin/create_repository
W: ubuntucustom: executable-not-elf-or-script ./usr/bin/createPreseedFiles
Finished running lintian.

On els:

  • W: Són warnings
  • E: Són errors...


Exemples

W:ubuntucustom source: dh-make-template-in-source debian/XXXXX.ex

Aquests errors es sol·lucionen eliminant els fitxers d'exemple (extensió .EX) que són creats a dins la carpeta debian per eines com dh_make

copyright-has-url-from-dh_make-boilerplate

Si consulteu:

http://lintian.debian.org/tags/copyright-has-url-from-dh_make-boilerplate.html

Us comenten que possiblement és per que encara teniu el text:

url://example.com

Al fitxer debian/copyright. Un cop esborrat ja no apareixerà el warning.

E: section-is-dh_make-template

Aquest error és degut a un fitxer debian/control que té la secció establerta a unknown (el valor per defecte que posa dh_make).

Valors possibles:

admin, cli-mono, comm, database, devel, debug, doc, editors, electronics, embedded, fonts, games, gnome, graphics, gnu-r, gnustep, hamradio, haskell,  
httpd, interpreters, java, kde, kernel, libs, libdevel, lisp, localization, mail, math, misc, net, news, ocaml, oldlibs, otherosfs, perl, php, python, 
ruby, science, shells, sound, tex, text, utils, vcs, video, web, x11, xfce, zope. 

La llista completa a Debian unstable:

http://packages.debian.org/unstable/

A Ubuntu Oneiric:

http://packages.ubuntu.com/oneiric/

També hi ha la secció debian-installer que és per als paquets utilitzats durant la instal·lació.

E: depends-on-essential-package-without-using-version depends

No cal indicar com a dependències els paquets que formen part del que s'anomena build-essential, que són els conjunt de paquets esencials per a construir aplicacions. De fet el paquet build-essential és un paquet tonto que instal·la les eines essencials i se suposa que tothom és responsable d'instal·lar aquest paquet quan està construint aplicacions.

apt-cache depends build-essential
build-essential
|Depèn: libc6-dev
 Depèn: <libc-dev>
   libc6-dev
 Depèn: gcc
 Depèn: g++
 Depèn: make
 Depèn: dpkg-dev

A més cal tenir en compte que alguns d'aquests paquets tenen altres dependències... Per exemple, per indicar alguns paquets que no cal posar:

ubuntucustom: depends-on-essential-package-without-using-version depends: mount
ubuntucustom: depends-on-essential-package-without-using-version depends: coreutils
ubuntucustom: depends-on-essential-package-without-using-version depends: grep
ubuntucustom: depends-on-essential-package-without-using-version depends: sed

La llista completa d'aplicacions/paquets la podeu trobar al fitxer /usr/share/doc/build-essential/list que es part del paquet build-essential.

$ cat /usr/share/doc/build-essential/list | more
                   List of Build-Essential packages
                   as of 2010-03-14, Debian sid

This file lists the non-essential packages that are build-essential.
The list is not closed under the "depends on" relation, so one will
usually need to install more packages than given here.

This list attempts to document the set of build-essential packages as
well as possible.  However, it is not authoritative (actually, there
is no authoritative list at all); the definition of the
"build-essential" class of packages given in Debian Policy Manual
(version >= 3.6.1.1), section 4 "Source packages" (more precisely
subsection 4.2 "Package relationships") is the definitive answer.
Here's the definition (as of Policy 3.6.1.1):

   It is not necessary to explicitly specify build-time relationships
   on a minimal set of packages that are always needed to compile,
   link and put in a Debian package a standard "Hello World!" program
   written in C or C++.  The required packages are called
   _build-essential_, and an informational list can be found in
   `/usr/share/doc/build-essential/list' (which is contained in the
   `build-essential' package).

The list is given below in a format which is readable by both humans and
programs.  The format is described at the end of this file. 

BEGIN LIST OF PACKAGES
libc6-dev [!alpha !ia64 !hurd-i386] | libc0.3-dev [hurd-i386] | libc6.1-dev [alpha ia64] | libc-dev
  Provides the ISO C standard library
  Indirectly depended on by g++, but we'll ignore
 it since libc6-dev is used for non-C++ programs too.

libc6-dev-sparc64 [sparc]
  Used only on the sparc architecture.

gcc (>= 4:4.4.3)
g++ (>= 4:4.4.3)

 NOTE:
 The libstdc++ -dev library is not needed, as g++ depends on it

make
 Also depended on by dpkg-dev, but make does warrant its own
 dependency since debian/rules will need it even if dpkg-dev
 stopped depending on it

dpkg-dev (>= 1.13.5)
 Provides dpkg-genchanges and other scripts.  Versioned, because
 of support for the build-time dependency fields in /debian/control
 and dpkg-architecture support for OS and CPU information.

 NOTE:
 Although this list does not contain them, all `Essential: yes'
 packages are build-essential as well.  A list of such packages
 can be found by executing the following command
    `grep-status -FEssential -sPackage -ni yes'
 when the `grep-dctrl' package is installed and in its default
 configuration.  Such list is installed with this package as
 the file
    `/usr/share/doc/build-essential/essential-packages-list'

hurd-dev [hurd-i386]
 Provides libpthread.so (and other such essential components).

END LIST OF PACKAGES

Here's the format definition:

  - First line is the following, without any leading or trailing
    whitespace:
       BEGIN LIST OF PACKAGES

  - Last line is the following, without any leading or trailing
    whitespace:
       END LIST OF PACKAGES

  - A line with leading whitespace is a comment.

  - Other lines are joined with end-of-line replaced by comma, and
    the result is parsed like the body of the Build-Depends field.
    The list of build-essential packages for a particular
    architecture is constructed from the result list by ignoring all
    the package name - package version pairs which would be ignored
    if we were building for that architecture and then removing the
    architecture specifications.

The Python program list2depends parses stdin as if it were this
file and outputs one line that is suitable for use in a dependency
field body of a Debian binary package.

Local Variables:
mode: text
End: 

manpage-is-dh_make-template

El problema és que no heu canviat la plantilla de creació de paquets Debian i inclou el missatge:

package - program to do something
       

out-of-date-standards-version

Si us dona un missatge similar a:

W: ubuntucustom source: out-of-date-standards-version 3.8.4 (current is 3.9.1)

Aleshores cal actualitzar la línia 'Standards-Version del fitxer debian/control. Podeu consultar per a que serveix aquesta línia a:

http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Standards-Version
http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Standards-Version

new-package-should-close-itp-bug.html

Aquest missatge apareix segons el que tingueu al fitxer debian/changelog. Sembla que si el paquet no ha de ser un paquet oficial de Debian podem saltar aquest error o també podem modificar el fitxer de changelog per que no aparegui la línia:

* Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>

binary-without-manpage

Lintian us avisarà dels executable dels quals no teniu manual. Per que no surti aquest warning toca crear el manual.

manpage-section-mismatch usr/share/man/man1/customcd.1.gz:5 1 != SECTION

La pàgina de manual (man) no és correcta. Normalment l'error és que el fitxer de manual indica una secció concreta (és la extensió del fitxer, per exemple customcd.1 seria de la secció 1) però no heu modificat el text SECTION de la plantilla que proporciona l'eina dh_make

$ groff -Tascii -man debian/customcd.1
CUSTOMCD(SECTION)                                            CUSTOMCD(SECTION)
...

Cal canviar SECTION pel número de secció (un valor de 1-8). Consulteu el manual de man:

$ man man

Per saber les seccions possibles.

executable-not-elf-or-script

Normalment és degut a un fitxer "executable" que realment no és un binari sinó que és un script però no li heu indicat el shebang. Un exemple:

W: ubuntucustom: executable-not-elf-or-script ./usr/bin/createPreseedFiles
$ cat ./usr/bin/createPreseedFiles
#/bin/bash

Com podeu veure falta l'exclamació (el shebang és #!)

Vegeu també

Enllaços externs