Adding side stream changes to Maemian. Working to integrate full upstream libraries...
authorJeremiah Foster <jeremiah@test.maemo.org>
Tue, 2 Jun 2009 14:04:27 +0000 (17:04 +0300)
committerJeremiah Foster <jeremiah@test.maemo.org>
Tue, 2 Jun 2009 14:04:27 +0000 (17:04 +0300)
446 files changed:
lib/Maemian/Check.pm [new file with mode: 0644]
lib/Maemian/Data.pm [new file with mode: 0644]
lib/Maemian/Schedule.pm [new file with mode: 0644]
lib/Read_pkglists.pm [new file with mode: 0644]
nokia-lintian/COPYING [new file with mode: 0644]
nokia-lintian/checks/binaries [new file with mode: 0644]
nokia-lintian/checks/binaries.desc [new file with mode: 0644]
nokia-lintian/checks/changelog-file [new file with mode: 0644]
nokia-lintian/checks/changelog-file.desc [new file with mode: 0644]
nokia-lintian/checks/common_data.pm [new file with mode: 0644]
nokia-lintian/checks/conffiles [new file with mode: 0644]
nokia-lintian/checks/conffiles.desc [new file with mode: 0644]
nokia-lintian/checks/control-file [new file with mode: 0644]
nokia-lintian/checks/control-file.desc [new file with mode: 0644]
nokia-lintian/checks/control-files [new file with mode: 0644]
nokia-lintian/checks/control-files.desc [new file with mode: 0644]
nokia-lintian/checks/copyright-file [new file with mode: 0644]
nokia-lintian/checks/copyright-file.desc [new file with mode: 0644]
nokia-lintian/checks/cruft [new file with mode: 0644]
nokia-lintian/checks/cruft.desc [new file with mode: 0644]
nokia-lintian/checks/debconf [new file with mode: 0644]
nokia-lintian/checks/debconf.desc [new file with mode: 0644]
nokia-lintian/checks/debhelper [new file with mode: 0644]
nokia-lintian/checks/debhelper.desc [new file with mode: 0644]
nokia-lintian/checks/debian-readme [new file with mode: 0644]
nokia-lintian/checks/debian-readme.desc [new file with mode: 0644]
nokia-lintian/checks/description [new file with mode: 0644]
nokia-lintian/checks/description.desc [new file with mode: 0644]
nokia-lintian/checks/etcfiles [new file with mode: 0644]
nokia-lintian/checks/etcfiles.desc [new file with mode: 0644]
nokia-lintian/checks/fields [new file with mode: 0644]
nokia-lintian/checks/fields.desc [new file with mode: 0644]
nokia-lintian/checks/files [new file with mode: 0644]
nokia-lintian/checks/files.desc [new file with mode: 0644]
nokia-lintian/checks/huge-usr-share [new file with mode: 0644]
nokia-lintian/checks/huge-usr-share.desc [new file with mode: 0644]
nokia-lintian/checks/infofiles [new file with mode: 0644]
nokia-lintian/checks/infofiles.desc [new file with mode: 0644]
nokia-lintian/checks/init.d [new file with mode: 0644]
nokia-lintian/checks/init.d.desc [new file with mode: 0644]
nokia-lintian/checks/lintian.desc [new file with mode: 0644]
nokia-lintian/checks/manpages [new file with mode: 0644]
nokia-lintian/checks/manpages.desc [new file with mode: 0644]
nokia-lintian/checks/md5sums [new file with mode: 0644]
nokia-lintian/checks/md5sums.desc [new file with mode: 0644]
nokia-lintian/checks/menu-format [new file with mode: 0644]
nokia-lintian/checks/menu-format.desc [new file with mode: 0644]
nokia-lintian/checks/menus [new file with mode: 0644]
nokia-lintian/checks/menus.desc [new file with mode: 0644]
nokia-lintian/checks/nmu [new file with mode: 0644]
nokia-lintian/checks/nmu.desc [new file with mode: 0644]
nokia-lintian/checks/patch-systems [new file with mode: 0644]
nokia-lintian/checks/patch-systems.desc [new file with mode: 0644]
nokia-lintian/checks/po-debconf [new file with mode: 0644]
nokia-lintian/checks/po-debconf.desc [new file with mode: 0644]
nokia-lintian/checks/rules [new file with mode: 0644]
nokia-lintian/checks/rules.desc [new file with mode: 0644]
nokia-lintian/checks/scripts [new file with mode: 0644]
nokia-lintian/checks/scripts.desc [new file with mode: 0644]
nokia-lintian/checks/shared-libs [new file with mode: 0644]
nokia-lintian/checks/shared-libs.desc [new file with mode: 0644]
nokia-lintian/checks/standards-version [new file with mode: 0644]
nokia-lintian/checks/standards-version.desc [new file with mode: 0644]
nokia-lintian/checks/version-substvars [new file with mode: 0644]
nokia-lintian/checks/version-substvars.desc [new file with mode: 0644]
nokia-lintian/checks/watch-file [new file with mode: 0644]
nokia-lintian/checks/watch-file.desc [new file with mode: 0644]
nokia-lintian/collection/changelog-file [new file with mode: 0755]
nokia-lintian/collection/changelog-file.desc [new file with mode: 0644]
nokia-lintian/collection/copyright-file [new file with mode: 0755]
nokia-lintian/collection/copyright-file.desc [new file with mode: 0644]
nokia-lintian/collection/debfiles [new file with mode: 0755]
nokia-lintian/collection/debfiles.desc [new file with mode: 0644]
nokia-lintian/collection/debian-readme [new file with mode: 0755]
nokia-lintian/collection/debian-readme.desc [new file with mode: 0644]
nokia-lintian/collection/diffstat [new file with mode: 0755]
nokia-lintian/collection/diffstat.desc [new file with mode: 0644]
nokia-lintian/collection/doc-base-files [new file with mode: 0755]
nokia-lintian/collection/doc-base-files.desc [new file with mode: 0644]
nokia-lintian/collection/file-info [new file with mode: 0755]
nokia-lintian/collection/file-info.desc [new file with mode: 0644]
nokia-lintian/collection/init.d [new file with mode: 0755]
nokia-lintian/collection/init.d.desc [new file with mode: 0644]
nokia-lintian/collection/md5sums [new file with mode: 0755]
nokia-lintian/collection/md5sums.desc [new file with mode: 0644]
nokia-lintian/collection/menu-files [new file with mode: 0755]
nokia-lintian/collection/menu-files.desc [new file with mode: 0644]
nokia-lintian/collection/objdump-info [new file with mode: 0755]
nokia-lintian/collection/objdump-info.desc [new file with mode: 0644]
nokia-lintian/collection/override-file [new file with mode: 0755]
nokia-lintian/collection/override-file.desc [new file with mode: 0644]
nokia-lintian/collection/scripts [new file with mode: 0755]
nokia-lintian/collection/scripts.desc [new file with mode: 0644]
nokia-lintian/collection/source-control-file [new file with mode: 0755]
nokia-lintian/collection/source-control-file.desc [new file with mode: 0644]
nokia-lintian/data/README [new file with mode: 0644]
nokia-lintian/data/binaries/multiarch [new file with mode: 0644]
nokia-lintian/data/doc-base/sections [new file with mode: 0644]
nokia-lintian/data/fields/obsolete-packages [new file with mode: 0644]
nokia-lintian/data/shared-libs/ldconfig-dirs [new file with mode: 0644]
nokia-lintian/debian/changelog [new file with mode: 0644]
nokia-lintian/debian/compat [new file with mode: 0644]
nokia-lintian/debian/control [new file with mode: 0644]
nokia-lintian/debian/copyright [new file with mode: 0644]
nokia-lintian/debian/dirs [new file with mode: 0644]
nokia-lintian/debian/doc-base [new file with mode: 0644]
nokia-lintian/debian/docs [new file with mode: 0644]
nokia-lintian/debian/patches/00list [new file with mode: 0644]
nokia-lintian/debian/patches/500-backport-1.23.21-checks.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/500-backport-1.23.22-checks-binaries.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/500-backport-1.23.22-frontend.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/500-backport-1.23.22-tar-wildcard.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/500-backport-1.23.23-tilda-bts-381965.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/800-allow-architecture-armel.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/800-allow-comments-in-debian-control.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/800-allow-relocatable-objects.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/800-correct-perm2oct.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/800-implement-tag-override.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/801-allow-dynamic-loaders.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/801-implement-check-tag.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/801-implement-dbg-checks.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/802-implement-overridedir.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/803-ignore-unknown-elf-format.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/804-xargs-fix-bts-399322.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/805-add-known-maemo-sections.dpatch [new file with mode: 0755]
nokia-lintian/debian/patches/806-binary-check-fix.dpatch [new file with mode: 0644]
nokia-lintian/debian/patches/807-correspondent-docs-to-devs-check.dpatch [new file with mode: 0755]
nokia-lintian/debian/postrm [new file with mode: 0755]
nokia-lintian/debian/rules [new file with mode: 0755]
nokia-lintian/debian/rules.OSSO [new file with mode: 0644]
nokia-lintian/debian/scripts/mergechangelogs [new file with mode: 0755]
nokia-lintian/depcheck/buglist [new file with mode: 0644]
nokia-lintian/depcheck/dependencies.py [new file with mode: 0755]
nokia-lintian/depcheck/deppages.pl [new file with mode: 0755]
nokia-lintian/depcheck/package.py [new file with mode: 0644]
nokia-lintian/depcheck/relation.py [new file with mode: 0644]
nokia-lintian/depcheck/report2html.pl [new file with mode: 0644]
nokia-lintian/depcheck/version.py [new file with mode: 0644]
nokia-lintian/doc/CREDITS [new file with mode: 0644]
nokia-lintian/doc/README [new file with mode: 0644]
nokia-lintian/doc/desc-files [new file with mode: 0644]
nokia-lintian/doc/lintian.sgml [new file with mode: 0644]
nokia-lintian/doc/lintianrc.example [new file with mode: 0644]
nokia-lintian/frontend/depcheck [new file with mode: 0755]
nokia-lintian/frontend/lintian [new file with mode: 0755]
nokia-lintian/frontend/lintian-info [new file with mode: 0755]
nokia-lintian/lib/Checker.pm [new file with mode: 0644]
nokia-lintian/lib/Dep.pm [new file with mode: 0644]
nokia-lintian/lib/Lab.pm [new file with mode: 0644]
nokia-lintian/lib/Lintian/Collect.pm [new file with mode: 0644]
nokia-lintian/lib/Lintian/Collect/Binary.pm [new file with mode: 0644]
nokia-lintian/lib/Lintian/Collect/Source.pm [new file with mode: 0644]
nokia-lintian/lib/Lintian/Data.pm [new file with mode: 0644]
nokia-lintian/lib/Manual_refs.pm [new file with mode: 0644]
nokia-lintian/lib/Pipeline.pm [new file with mode: 0644]
nokia-lintian/lib/Read_pkglists.pm [new file with mode: 0644]
nokia-lintian/lib/Read_taginfo.pm [new file with mode: 0644]
nokia-lintian/lib/Spelling.pm [new file with mode: 0644]
nokia-lintian/lib/Tags.pm [new file with mode: 0644]
nokia-lintian/lib/Tags/ColonSeparated.pm [new file with mode: 0644]
nokia-lintian/lib/Text_utils.pm [new file with mode: 0644]
nokia-lintian/lib/Util.pm [new file with mode: 0644]
nokia-lintian/lib/manual_refs [new file with mode: 0644]
nokia-lintian/lib/scan_script.pl [new file with mode: 0644]
nokia-lintian/man/lintian-info.1 [new file with mode: 0644]
nokia-lintian/man/lintian.1 [new file with mode: 0644]
nokia-lintian/private/TODO [new file with mode: 0644]
nokia-lintian/private/manual_refs_update.pl [new file with mode: 0755]
nokia-lintian/private/tags-never-seen [new file with mode: 0644]
nokia-lintian/private/update-never-seen [new file with mode: 0755]
nokia-lintian/reporting/checkout-release [new file with mode: 0755]
nokia-lintian/reporting/config [new file with mode: 0644]
nokia-lintian/reporting/harness [new file with mode: 0755]
nokia-lintian/reporting/html_reports [new file with mode: 0755]
nokia-lintian/reporting/images/ico.png [new file with mode: 0644]
nokia-lintian/reporting/images/l.png [new file with mode: 0644]
nokia-lintian/reporting/images/logo-small.png [new file with mode: 0644]
nokia-lintian/reporting/lintian-dummy.cfg [new file with mode: 0644]
nokia-lintian/reporting/lintian.css [new file with mode: 0644]
nokia-lintian/reporting/templates/clean.tmpl [new file with mode: 0644]
nokia-lintian/reporting/templates/foot.tmpl [new file with mode: 0644]
nokia-lintian/reporting/templates/head.tmpl [new file with mode: 0644]
nokia-lintian/reporting/templates/index.tmpl [new file with mode: 0644]
nokia-lintian/reporting/templates/maintainer.tmpl [new file with mode: 0644]
nokia-lintian/reporting/templates/maintainers.tmpl [new file with mode: 0644]
nokia-lintian/reporting/templates/packages.tmpl [new file with mode: 0644]
nokia-lintian/reporting/templates/tag.tmpl [new file with mode: 0644]
nokia-lintian/reporting/templates/tags.tmpl [new file with mode: 0644]
nokia-lintian/testset/binary/INSTALL [new file with mode: 0644]
nokia-lintian/testset/binary/Makefile [new file with mode: 0644]
nokia-lintian/testset/binary/debian/NEWS.Debian [new file with mode: 0644]
nokia-lintian/testset/binary/debian/README.Debian [new file with mode: 0644]
nokia-lintian/testset/binary/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/binary/debian/conffiles [new file with mode: 0644]
nokia-lintian/testset/binary/debian/control [new file with mode: 0644]
nokia-lintian/testset/binary/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/binary/debian/doc-base [new file with mode: 0644]
nokia-lintian/testset/binary/debian/goodbye.desktop [new file with mode: 0644]
nokia-lintian/testset/binary/debian/hello.desktop [new file with mode: 0644]
nokia-lintian/testset/binary/debian/menu [new file with mode: 0644]
nokia-lintian/testset/binary/debian/menu-method [new file with mode: 0644]
nokia-lintian/testset/binary/debian/postinst [new file with mode: 0644]
nokia-lintian/testset/binary/debian/rules [new file with mode: 0755]
nokia-lintian/testset/binary/debian/templates [new file with mode: 0644]
nokia-lintian/testset/binary/hello.c [new file with mode: 0644]
nokia-lintian/testset/cdbs-test/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/cdbs-test/debian/compat [new file with mode: 0644]
nokia-lintian/testset/cdbs-test/debian/control [new file with mode: 0644]
nokia-lintian/testset/cdbs-test/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/cdbs-test/debian/rules [new file with mode: 0755]
nokia-lintian/testset/cdbs-test/debian/watch [new file with mode: 0644]
nokia-lintian/testset/cdbs-test/setup.py [new file with mode: 0644]
nokia-lintian/testset/cdbs-test_1.orig.tar.gz [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/compat [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/control [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/copyright.full-apache-2 [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/copyright.full-gfdl [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/copyright.full-gpl [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/copyright.iso-8859-1 [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/copyright.misc-errors [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/copyright.no-errors [new file with mode: 0644]
nokia-lintian/testset/copyright/debian/rules [new file with mode: 0755]
nokia-lintian/testset/debconf/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/compat [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/control [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test-noscripts.templates [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test-postinst.postinst [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test-postinst.postrm [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test-postinst.templates [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test-preinst.postrm [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test-preinst.preinst [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test-preinst.templates [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test.config [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test.postinst [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test.templates [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test.templates.de [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-test.templates.in [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-udeb.postinst [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/debconf-udeb.templates [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/POTFILES.in [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/de.po [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/fr.po [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/lang.po [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/nds.po [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/output [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/pt_BR.po [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/sample-file.po [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/po/templates.pot [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/pycompat [new file with mode: 0644]
nokia-lintian/testset/debconf/debian/rules [new file with mode: 0755]
nokia-lintian/testset/debug/debian/_symbols [new file with mode: 0644]
nokia-lintian/testset/debug/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/debug/debian/control [new file with mode: 0644]
nokia-lintian/testset/debug/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/debug/debian/rules [new file with mode: 0755]
nokia-lintian/testset/debug/hello.c [new file with mode: 0644]
nokia-lintian/testset/debug/libhello.c [new file with mode: 0644]
nokia-lintian/testset/debug/libhello.h [new file with mode: 0644]
nokia-lintian/testset/description/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/description/debian/control [new file with mode: 0644]
nokia-lintian/testset/description/debian/rules [new file with mode: 0755]
nokia-lintian/testset/dh-test/debian/README.Debian [new file with mode: 0644]
nokia-lintian/testset/dh-test/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/dh-test/debian/control [new file with mode: 0644]
nokia-lintian/testset/dh-test/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/dh-test/debian/postinst [new file with mode: 0644]
nokia-lintian/testset/dh-test/debian/rules [new file with mode: 0755]
nokia-lintian/testset/dh7-minimal/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/dh7-minimal/debian/compat [new file with mode: 0644]
nokia-lintian/testset/dh7-minimal/debian/control [new file with mode: 0644]
nokia-lintian/testset/dh7-minimal/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/dh7-minimal/debian/rules [new file with mode: 0755]
nokia-lintian/testset/dh7-test/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/dh7-test/debian/compat [new file with mode: 0644]
nokia-lintian/testset/dh7-test/debian/control [new file with mode: 0644]
nokia-lintian/testset/dh7-test/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/dh7-test/debian/rules [new file with mode: 0755]
nokia-lintian/testset/dh7-test/debian/watch [new file with mode: 0644]
nokia-lintian/testset/dh7-test_1.dfsg.orig.tar.gz [new file with mode: 0644]
nokia-lintian/testset/diffs/.bzr/dummy [new file with mode: 0644]
nokia-lintian/testset/diffs/ChangeLog [new file with mode: 0644]
nokia-lintian/testset/diffs/Makefile [new file with mode: 0644]
nokia-lintian/testset/diffs/binary.c [new file with mode: 0644]
nokia-lintian/testset/diffs/config.cache [new file with mode: 0644]
nokia-lintian/testset/diffs/config.log [new file with mode: 0644]
nokia-lintian/testset/diffs/config.status [new file with mode: 0644]
nokia-lintian/testset/diffs/configure [new file with mode: 0755]
nokia-lintian/testset/diffs/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/diffs/debian/config.cache [new file with mode: 0644]
nokia-lintian/testset/diffs/debian/control [new file with mode: 0644]
nokia-lintian/testset/diffs/debian/files [new file with mode: 0644]
nokia-lintian/testset/diffs/debian/patches/00list [new file with mode: 0644]
nokia-lintian/testset/diffs/debian/rules [new file with mode: 0755]
nokia-lintian/testset/diffs/debian/substvars [new file with mode: 0644]
nokia-lintian/testset/diffs/subdir-bad/config.cache [new file with mode: 0644]
nokia-lintian/testset/diffs/subdir-bad/config.log [new file with mode: 0644]
nokia-lintian/testset/diffs/subdir-bad/config.status [new file with mode: 0644]
nokia-lintian/testset/diffs/subdir-bad/configure [new file with mode: 0755]
nokia-lintian/testset/diffs/subdir-good/config.cache [new file with mode: 0644]
nokia-lintian/testset/diffs/subdir-good/config.log [new file with mode: 0644]
nokia-lintian/testset/diffs/subdir-good/config.status [new file with mode: 0644]
nokia-lintian/testset/diffs/subdir-good/configure [new file with mode: 0755]
nokia-lintian/testset/diffs/svn-commit.tmp [new file with mode: 0644]
nokia-lintian/testset/diffs_1.orig.tar.gz [new file with mode: 0644]
nokia-lintian/testset/empty/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/empty/debian/control [new file with mode: 0644]
nokia-lintian/testset/empty/debian/rules [new file with mode: 0755]
nokia-lintian/testset/etcfiles/debian/README.Debian [new file with mode: 0644]
nokia-lintian/testset/etcfiles/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/etcfiles/debian/conffiles [new file with mode: 0644]
nokia-lintian/testset/etcfiles/debian/conffiles.only [new file with mode: 0644]
nokia-lintian/testset/etcfiles/debian/control [new file with mode: 0644]
nokia-lintian/testset/etcfiles/debian/rules [new file with mode: 0755]
nokia-lintian/testset/etcfiles/improper [new file with mode: 0644]
nokia-lintian/testset/etcfiles/proper [new file with mode: 0644]
nokia-lintian/testset/filenames/debian/.be/dummy [new file with mode: 0644]
nokia-lintian/testset/filenames/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/filenames/debian/control [new file with mode: 0644]
nokia-lintian/testset/filenames/debian/doc-base [new file with mode: 0644]
nokia-lintian/testset/filenames/debian/rules [new file with mode: 0755]
nokia-lintian/testset/filenames/files/ .tif [new file with mode: 0644]
nokia-lintian/testset/filenames/files/".tif [new file with mode: 0644]
nokia-lintian/testset/filenames/files/'\ [new file with mode: 0644]
nokia-lintian/testset/filenames/files/Maelstrom Sound [new file with mode: 0644]
nokia-lintian/testset/foo++/debian/README.Debian [new file with mode: 0644]
nokia-lintian/testset/foo++/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/foo++/debian/control [new file with mode: 0644]
nokia-lintian/testset/foo++/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/foo++/debian/rules [new file with mode: 0755]
nokia-lintian/testset/foo++/debian/watch [new file with mode: 0644]
nokia-lintian/testset/libbaz/Makefile [new file with mode: 0644]
nokia-lintian/testset/libbaz/baz.c [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/compat [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/control [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/dev.postinst [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/dev.prerm [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/lib.postinst [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/lib.prerm [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/lib.shlibs [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/lib.symbols [new file with mode: 0644]
nokia-lintian/testset/libbaz/debian/rules [new file with mode: 0755]
nokia-lintian/testset/libbaz/debian/source.lintian-overrides [new file with mode: 0644]
nokia-lintian/testset/libbaz/extra.c [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/config [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/control [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/postinst [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/postrm [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/preinst [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/prerm [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/rules [new file with mode: 0755]
nokia-lintian/testset/maintainer-scripts/debian/triggers [new file with mode: 0644]
nokia-lintian/testset/maintainer-scripts/debian/watch [new file with mode: 0644]
nokia-lintian/testset/manpages/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/manpages/debian/control [new file with mode: 0644]
nokia-lintian/testset/manpages/debian/overrides [new file with mode: 0644]
nokia-lintian/testset/manpages/debian/postinst [new file with mode: 0644]
nokia-lintian/testset/manpages/debian/rules [new file with mode: 0755]
nokia-lintian/testset/manpages/foo.info [new file with mode: 0644]
nokia-lintian/testset/manpages/include.3 [new file with mode: 0644]
nokia-lintian/testset/manpages/included.3 [new file with mode: 0644]
nokia-lintian/testset/manpages/program.1 [new file with mode: 0644]
nokia-lintian/testset/manpages/test.1p [new file with mode: 0644]
nokia-lintian/testset/manpages/test.1p.de [new file with mode: 0644]
nokia-lintian/testset/manpages/test.1p.utf-8 [new file with mode: 0644]
nokia-lintian/testset/manpages/true.1 [new file with mode: 0644]
nokia-lintian/testset/non-us/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/non-us/debian/control [new file with mode: 0644]
nokia-lintian/testset/non-us/debian/rules [new file with mode: 0755]
nokia-lintian/testset/relations/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/relations/debian/control [new file with mode: 0644]
nokia-lintian/testset/relations/debian/rules [new file with mode: 0755]
nokia-lintian/testset/relations/debian/tmp/DEBIAN/control [new file with mode: 0644]
nokia-lintian/testset/runtests [new file with mode: 0755]
nokia-lintian/testset/scripts/csh-foo [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/changelog [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/control [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/copyright [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/patches/00list [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/patches/00list.sparc [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/patches/00options [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/patches/02_i_dont_have_a_description.patch [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/patches/03_specified_without_dpatch.dpatch [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/postinst [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/postrm [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/preinst [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/rules [new file with mode: 0755]
nokia-lintian/testset/scripts/debian/scripts.conffiles [new file with mode: 0644]
nokia-lintian/testset/scripts/debian/watch [new file with mode: 0644]
nokia-lintian/testset/scripts/envfoo [new file with mode: 0755]
nokia-lintian/testset/scripts/fish-foo [new file with mode: 0644]
nokia-lintian/testset/scripts/gccbug.dpatch [new file with mode: 0755]
nokia-lintian/testset/scripts/guile-bizarre [new file with mode: 0644]
nokia-lintian/testset/scripts/init-lsb-broken [new file with mode: 0644]
nokia-lintian/testset/scripts/init-lsb-other [new file with mode: 0644]
nokia-lintian/testset/scripts/init-no-lsb [new file with mode: 0644]
nokia-lintian/testset/scripts/init-skeleton [new file with mode: 0644]
nokia-lintian/testset/scripts/jruby-broken [new file with mode: 0644]
nokia-lintian/testset/scripts/lefty-foo [new file with mode: 0644]
nokia-lintian/testset/scripts/make-foo [new file with mode: 0644]
nokia-lintian/testset/scripts/perl-bizarre-1 [new file with mode: 0644]
nokia-lintian/testset/scripts/perl-bizarre-2 [new file with mode: 0644]
nokia-lintian/testset/scripts/perl-bizarre-3 [new file with mode: 0644]
nokia-lintian/testset/scripts/perlfoo [new file with mode: 0644]
nokia-lintian/testset/scripts/phpfoo [new file with mode: 0644]
nokia-lintian/testset/scripts/py2foo [new file with mode: 0755]
nokia-lintian/testset/scripts/pyfoo [new file with mode: 0755]
nokia-lintian/testset/scripts/rubyfoo [new file with mode: 0644]
nokia-lintian/testset/scripts/sh-broken [new file with mode: 0644]
nokia-lintian/testset/scripts/suidperlfoo [new file with mode: 0644]
nokia-lintian/testset/scripts/tkfoo [new file with mode: 0755]
nokia-lintian/testset/scripts/wishfoo [new file with mode: 0644]
nokia-lintian/testset/scripts/xsession-test [new file with mode: 0644]
nokia-lintian/testset/scripts_6ds.orig.tar.gz [new file with mode: 0644]
nokia-lintian/testset/tags.binary [new file with mode: 0644]
nokia-lintian/testset/tags.binary.sed [new file with mode: 0644]
nokia-lintian/testset/tags.cdbs-test [new file with mode: 0644]
nokia-lintian/testset/tags.copyright [new file with mode: 0644]
nokia-lintian/testset/tags.debconf [new file with mode: 0644]
nokia-lintian/testset/tags.debug [new file with mode: 0644]
nokia-lintian/testset/tags.description [new file with mode: 0644]
nokia-lintian/testset/tags.dh-test [new file with mode: 0644]
nokia-lintian/testset/tags.dh7-minimal [new file with mode: 0644]
nokia-lintian/testset/tags.dh7-test [new file with mode: 0644]
nokia-lintian/testset/tags.diffs [new file with mode: 0644]
nokia-lintian/testset/tags.empty [new file with mode: 0644]
nokia-lintian/testset/tags.etcfiles [new file with mode: 0644]
nokia-lintian/testset/tags.filenames [new file with mode: 0644]
nokia-lintian/testset/tags.foo++ [new file with mode: 0644]
nokia-lintian/testset/tags.libbaz [new file with mode: 0644]
nokia-lintian/testset/tags.maintainer-scripts [new file with mode: 0644]
nokia-lintian/testset/tags.manpages [new file with mode: 0644]
nokia-lintian/testset/tags.non-us [new file with mode: 0644]
nokia-lintian/testset/tags.relations [new file with mode: 0644]
nokia-lintian/testset/tags.scripts [new file with mode: 0644]
nokia-lintian/unpack/list-binpkg [new file with mode: 0755]
nokia-lintian/unpack/list-srcpkg [new file with mode: 0755]
nokia-lintian/unpack/list-udebpkg [new file with mode: 0755]
nokia-lintian/unpack/unpack-binpkg-l1 [new file with mode: 0755]
nokia-lintian/unpack/unpack-binpkg-l2 [new file with mode: 0755]
nokia-lintian/unpack/unpack-srcpkg-l1 [new file with mode: 0755]
nokia-lintian/unpack/unpack-srcpkg-l2 [new file with mode: 0755]

diff --git a/lib/Maemian/Check.pm b/lib/Maemian/Check.pm
new file mode 100644 (file)
index 0000000..9ae1b85
--- /dev/null
@@ -0,0 +1,193 @@
+# Maemian::Check -- Maemian checks shared between multiple scripts
+
+# Copyright (C) 2009 Jeremiah C. Foster
+# Copyright (C) 2009 Russ Allbery
+# Copyright (C) 2004 Marc Brockschmidt
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, see <http://www.gnu.org/licenses/>.
+
+package Maemian::Check;
+
+use strict;
+use warnings;
+
+use Exporter ();
+use Tags qw(tag);
+
+our @ISA    = qw(Exporter);
+our @EXPORT = qw(check_maintainer);
+
+=head1 NAME
+
+Maemian::Check -- Maemian checks shared between multiple scripts
+
+=head1 SYNOPSIS
+
+    use Maemian::Check qw(check_maintainer);
+
+    check_maintainer ($maintainer, $field);
+
+=head1 DESCRIPTION
+
+This module provides functions to do some Maemian checks that need to be
+done in multiple places. There are certain low-level checks, such as
+validating a maintainer name and e-mail address or checking spelling,
+which apply in multiple situations and should be done in multiple checks
+scripts or in checks scripts and the Maemian front-end.
+
+The functions provided by this module issue tags directly, usually either
+taking the tag name to issue as an argument or dynamically constructing
+the tag name based on function parameters.  The caller is responsible for
+ensuring that all tags are declared in the relevant *.desc file with
+proper descriptions and other metadata.  The possible tags issued by each
+function are described in the documentation for that function.
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item check_maintainer(MAINTAINER, FIELD)
+
+Checks the maintainer name and address MAINTAINER for Policy compliance
+and other issues.  FIELD is the context in which the maintainer name and
+address was seen and should be one of C<maintainer> (the Maintainer field
+in a control file), C<uploader> (the Uploaders field in a control file),
+or C<changed-by> (the Changed-By field in a changes file).
+
+The following tags may be issued by this function.  The string C<%s> in
+the tags below will be replaced with the value of FIELD.
+
+=over 4
+
+=item %s-address-is-on-localhost
+
+The e-mail address portion of MAINTAINER is at C<localhost> or some other
+similar domain.
+
+=item %s-address-looks-weird
+
+MAINTAINER may be syntactically correct, but it isn't conventionally
+formatted.  Currently this tag is only issued for missing whitespace
+between the name and the address.
+
+=item %s-address-malformed
+
+MAINTAINER doesn't fit the basic syntax of a maintainer name and address
+as specified in Policy.
+
+=item %s-address-missing
+
+MAINTAINER does not contain an e-mail address in angle brackets (<>).
+
+=item %s-name-missing
+
+MAINTAINER does not contain a full name before the address, or the e-mail
+address was not in angle brackets.
+
+=item %s-not-full-name
+
+The name portion of MAINTAINER is a single word.  This tag is not issued
+for a FIELD of C<changed-by>.
+
+=item wrong-debian-qa-address-set-as-maintainer
+
+MAINTAINER appears to be the Debian QA Group, but the e-mail address
+portion is wrong for orphaned packages.  This tag is only issued for a
+FIELD of C<maintainer>.
+
+=item wrong-debian-qa-group-name
+
+MAINTAINER appears to be the Debian QA Group, but the name portion is not
+C<Debian QA Group>.  This tag is only issued for a FIELD of C<maintainer>.
+
+=back
+
+The last two tags are issued here rather than in a location more specific
+to checks of the Maintainer control field because they take advantage of
+the parsing done by the rest of the function.
+
+=cut
+
+sub check_maintainer {
+    my ($maintainer, $field) = @_;
+
+    # Do the initial parse.
+    $maintainer =~ /^([^<\s]*(?:\s+[^<\s]+)*)?(\s*)(?:<(.+)>)?(.*)$/;
+    my ($name, $del, $mail, $extra) = ($1, $2, $3, $4);
+    if (not $mail and $name =~ m/@/) {
+       # Name probably missing and address has no <>.
+       $mail = $name;
+       $name = undef;
+    }
+
+    # Some basic tests.
+    my $malformed;
+    if ($extra) {
+        tag "$field-address-malformed", $maintainer;
+        $malformed = 1;
+    }
+    tag "$field-address-looks-weird", $maintainer
+        if (not $del and $name and $mail);
+
+    # Wookey really only has one name.  If we get more of these, consider
+    # removing the check.  Skip the full name check for changes files as it's
+    # not important there; we'll get it from the debian/control checks if
+    # needed.
+    if (not $name) {
+        tag "$field-name-missing", $maintainer;
+    } elsif ($name !~ /^\S+\s+\S+/ and $name ne 'Wookey') {
+        tag "$field-not-full-name", $name
+            if $field ne 'changed-by';
+    }
+
+    # This should really be done with Email::Valid.  Don't issue the malformed
+    # tag twice if we already saw problems.
+    if (not $mail) {
+        tag "$field-address-missing", $maintainer;
+    } else {
+       if (not $malformed and $mail !~ /^[^()<>@,;:\\\"\[\]]+@(\S+\.)+\S+/) {
+            tag "$field-address-malformed", $maintainer;
+       }
+       if ($mail =~ /(?:localhost|\.localdomain|\.localnet)$/) {
+            tag "$field-address-is-on-localhost", $maintainer;
+       }
+
+       # Some additional checks that we only do for maintainer fields.
+       if ($field eq 'maintainer') {
+            if ($mail eq 'debian-qa@lists.debian.org') {
+                tag 'wrong-debian-qa-address-set-as-maintainer', $maintainer;
+            } elsif ($mail eq 'packages@qa.debian.org') {
+                tag 'wrong-debian-qa-group-name', $maintainer
+                    if ($name ne 'Debian QA Group');
+            }
+       }
+    }
+}
+
+=back
+
+=head1 AUTHOR
+
+Originally written by Russ Allbery <rra@debian.org> for Maemian. Based on
+code from checks scripts by Marc Brockschmidt and Richard Braakman. Adapted for 
+Maemian by Jeremiah C. Foster
+
+=head1 SEE ALSO
+
+lintian(1)
+
+=cut
+
+1;
diff --git a/lib/Maemian/Data.pm b/lib/Maemian/Data.pm
new file mode 100644 (file)
index 0000000..e529069
--- /dev/null
@@ -0,0 +1,213 @@
+# -*- perl -*-
+# Lintian::Data -- interface to query lists of keywords
+
+# Copyright (C) 2008 Russ Allbery
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, see <http://www.gnu.org/licenses/>.
+
+package Lintian::Data;
+use strict;
+
+use Carp qw(croak);
+
+# The constructor loads a list into a hash in %data, which is private to this
+# module.  Use %data as a cache to avoid loading the same list more than once
+# (which means lintian doesn't support having the list change over the life of
+# the proces.  The returned object knows what list, stored in %data, it is
+# supposed to act on.
+{
+    my %data;
+    sub new {
+        my ($class, $type, $separator) = @_;
+        croak('no data type specified') unless $type;
+        unless (exists $data{$type}) {
+            my $dir = $ENV{LINTIAN_ROOT} . '/data';
+            open(LIST, '<', "$dir/$type")
+                or croak("unknown data type $type");
+            local ($_, $.);
+            while (<LIST>) {
+                chomp;
+                s/^\s+//;
+                next if /^\#/;
+                next if /^$/;
+                my ($key, $val);
+                if (defined $separator) {
+                    ($key, $val) = split(/$separator/, $_, 2);
+                } else {
+                    ($key, $val) = ($_ => 1);
+                }
+                $data{$type}{$key} = $val;
+            }
+        }
+        my $self = { data => $data{$type} };
+        bless($self, $class);
+        return $self;
+    }
+}
+
+# Query a data object for whether a particular keyword is valid.
+sub known {
+    my ($self, $keyword) = @_;
+    return (exists $self->{data}{$keyword}) ? 1 : undef;
+}
+
+# Return all known keywords (in no particular order).
+sub all {
+    my ($self) = @_;
+    return keys(%{ $self->{data} });
+}
+
+# Query a data object for the value attached to a particular keyword.
+sub value {
+    my ($self, $keyword) = @_;
+    return (exists $self->{data}{$keyword}) ? $self->{data}{$keyword} : undef;
+}
+
+1;
+
+=head1 NAME
+
+Lintian::Data - Lintian interface to query lists of keywords
+
+=head1 SYNOPSIS
+
+    my $list = Lintian::Data->new('type');
+    if ($list->known($keyword)) {
+        # do something ...
+    }
+    my $hash = Lintian::Data->new('another-type', '\s+');
+    if ($list->value($keyword) > 1) {
+        # do something ...
+    }
+    my @keywords = $list->all;
+
+=head1 DESCRIPTION
+
+Lintian::Data provides a way of loading a list of keywords or key/value
+pairs from a file in the Lintian root and then querying that list.
+The lists are stored in the F<data> directory of the Lintian root and
+consist of one keyword or key/value pair per line.  Blank lines and
+lines beginning with C<#> are ignored.  Leading and trailing whitespace
+is stripped.
+
+If requested, the lines are split into key/value pairs with a given
+separator regular expression.  Otherwise, keywords are taken verbatim
+as they are listed in the file and may include spaces.
+
+This module allows lists such as menu sections, doc-base sections,
+obsolete packages, package fields, and so forth to be stored in simple,
+easily editable files.
+
+=head1 CLASS METHODS
+
+=over 4
+
+=item new(TYPE [,SEPARATOR])
+
+Creates a new Lintian::Data object for the given TYPE.  TYPE is a partial
+path relative to the F<data> directory and should correspond to a file in
+that directory.  The contents of that file will be loaded into memory and
+returned as part of the newly created object.  On error, new() throws an
+exception.
+
+If SEPARATOR is given, it will be used as a regular expression for splitting
+the lines into key/value pairs.
+
+A given file will only be loaded once.  If new() is called again with the
+same TYPE argument, the data previously loaded will be reused, avoiding
+multiple file reads.
+
+=back
+
+=head1 INSTANCE METHODS
+
+=over 4
+
+=item all()
+
+Returns all keywords listed in the data file as a list (in no particular
+order; the original order is not preserved).  In a scalar context, returns
+the number of keywords.
+
+=item known(KEYWORD)
+
+Returns true if KEYWORD was listed in the data file represented by this
+Lintian::Data instance and false otherwise.
+
+=item value(KEYWORD)
+
+Returns the value attached to KEYWORD if it was listed in the data
+file represented by this Lintian::Data instance and the undefined value
+otherwise. If SEPARATOR was not given, the value will '1'.
+
+=back
+
+=head1 DIAGNOSTICS
+
+=over 4
+
+=item no data type specified
+
+new() was called without a TYPE argument.
+
+=item unknown data type %s
+
+The TYPE argument to new() did not correspond to a file in the F<data>
+directory of the Lintian root.
+
+=back
+
+=head1 FILES
+
+=over 4
+
+=item LINTIAN_ROOT/data
+
+The files loaded by this module must be located in this directory.
+Relative paths containing a C</> are permitted, so files may be organized
+in subdirectories in this directory.
+
+=back
+
+=head1 ENVIRONMENT
+
+=over 4
+
+=item LINTIAN_ROOT
+
+This variable must be set to Lintian's root directory (normally
+F</usr/share/lintian> when Lintian is installed as a Debian package).  The
+B<lintian> program normally takes care of doing this.  This module doesn't
+care about the contents of this directory other than expecting the F<data>
+subdirectory of this directory to contain its files.
+
+=back
+
+=head1 AUTHOR
+
+Originally written by Russ Allbery <rra@debian.org> for Lintian.
+
+=head1 SEE ALSO
+
+lintian(1)
+
+=cut
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/lib/Maemian/Schedule.pm b/lib/Maemian/Schedule.pm
new file mode 100644 (file)
index 0000000..3fe5899
--- /dev/null
@@ -0,0 +1,117 @@
+# Copyright (C) 2008 Frank Lichtenheld <frank@lichtenheld.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::Schedule;
+
+use strict;
+use warnings;
+
+use Util;
+
+sub new {
+    my ($class, %options) = @_;
+    my $self = {};
+
+    bless($self, $class);
+
+    $self->{opts} = \%options;
+    $self->{schedule} = [];
+    $self->{unique} = {};
+
+    return $self;
+}
+
+# schedule a package for processing
+sub add_file {
+    my ($self, $type, $file, %pkg_info) = @_;
+
+    my ($pkg, $ver, $arch);
+    if ($type eq 's') {
+       ($pkg, $ver, $arch) =
+           (@pkg_info{qw(source version)}, 'source');
+    } else {
+       ($pkg, $ver, $arch) =
+           @pkg_info{qw(package version architecture)};
+    }
+    $pkg  ||= '';
+    $ver  ||= '';
+    $arch ||= '';
+
+    my $s = "$type $pkg $ver $arch $file";
+    my %h = ( type => $type, package => $pkg, version => $ver,
+             architecture => $arch, file => $file );
+
+    if ( $self->{unique}{$s}++ ) {
+       if ($self->{opts}{verbose}) {
+           printf "N: Ignoring duplicate %s package $pkg (version $ver)\n",
+               $type eq 'b' ? 'binary' : ($type eq 's' ? 'source': 'udeb');
+       }
+       return;
+    }
+
+    push(@{$self->{schedule}}, \%h);
+    return 1;
+}
+
+sub add_deb {
+    my ($self, $type, $file) = @_;
+
+    my $info = get_deb_info($file);
+    return unless defined $info;
+    return $self->add_file($type, $file, %$info);
+}
+
+sub add_dsc {
+    my ($self, $file) = @_;
+
+    my $info = get_dsc_info($file);
+    return unless defined $info;
+    return $self->add_file('s', $file, %$info);
+}
+
+sub add_pkg_list {
+    my ($self, $packages_file) = @_;
+
+    open(IN, '<', $packages_file)
+       or die("cannot open packages file $packages_file for reading: $!");
+    while (<IN>) {
+       chomp;
+       my ($type, $pkg, $ver, $file) = split(/\s+/, $_, 4);
+       if ($type eq 's') {
+           $self->add_file($type, $file, source => $pkg, version => $ver);
+       } else {
+           $self->add_file($type, $file, package => $pkg, version => $ver);
+       }
+    }
+    close(IN);
+}
+
+# for each package (the sort is to make sure that source packages are
+# before the corresponding binary packages--this has the advantage that binary
+# can use information from the source packages if these are unpacked)
+my %type_sort = ('b' => 1, 'u' => 1, 's' => 2 );
+sub get_all {
+    return sort({$type_sort{$b->{type}} <=> $type_sort{$a->{type}}}
+               @{$_[0]->{schedule}});
+}
+
+sub count {
+    return scalar @{$_[0]->{schedule}};
+}
+
+1;
diff --git a/lib/Read_pkglists.pm b/lib/Read_pkglists.pm
new file mode 100644 (file)
index 0000000..587cc87
--- /dev/null
@@ -0,0 +1,194 @@
+# Hey emacs! This is a -*- Perl -*- script!
+# Read_pkglists -- Perl utility functions to read Lintian's package lists
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use warnings;
+use lib "$ENV{'MAEMIAN_ROOT'}/lib";
+use Util;
+
+use vars qw($BINLIST_FORMAT $SRCLIST_FORMAT $UDEBLIST_FORMAT %source_info %binary_info %udeb_info %bin_src_ref);
+
+# these banner lines have to be changed with every incompatible change of the
+# binary and source list file formats
+$BINLIST_FORMAT = "Lintian's list of binary packages in the archive--V3";
+$SRCLIST_FORMAT = "Lintian's list of source packages in the archive--V3";
+$UDEBLIST_FORMAT = "Lintian's list of udeb packages in the archive--V2";
+
+%source_info = ();
+%binary_info = ();
+%udeb_info = ();
+%bin_src_ref = ();
+
+sub read_src_list {
+  my ($src_list,$quiet) = @_;
+  my $MAEMIAN_LAB = $ENV{'MAEMIAN_LAB'};
+
+  if (%source_info) {
+    warn "\%source_info exists, nothing to do in read_src_list\n" unless $quiet;
+    return;
+  }
+
+  $src_list or ($src_list = "$MAEMIAN_LAB/info/source-packages");
+  return unless -s $src_list;
+
+  open(IN, '<', $src_list) or fail("cannot open source list file $src_list: $!");
+
+  # compatible file format?
+  my $f;
+  chop($f = <IN>);
+  if ($f ne $SRCLIST_FORMAT) {
+    close(IN);
+    return 0 if $quiet;
+    fail("the source list file $src_list has an incompatible file format (run lintian --setup-lab)");
+  }
+
+  # compatible format, so read file
+  while (<IN>) {
+    chop;
+    next if /^\s*$/o;
+    my ($src,$ver,$maint,$uploaders,$arch,$std,$bin,$files,$file,$timestamp) = split(/\;/,$_);
+
+    my $src_struct;
+    %$src_struct =
+      (
+       'source' => $src,
+       'version' => $ver,
+       'maintainer' => $maint,
+       'uploaders' => $uploaders,
+       'architecture' => $arch,
+       'standards-version' => $std,
+       'binary' => $bin,
+       'files' => $files,
+       'file' => $file,
+       'timestamp' => $timestamp,
+       );
+
+    $source_info{$src} = $src_struct;
+  }
+
+  close(IN);
+}
+
+sub read_bin_list {
+  my ($bin_list,$quiet) = @_;
+  my $MAEMIAN_LAB = $ENV{'MAEMIAN_LAB'};
+
+  if (%binary_info) {
+    warn "\%binary_info exists, nothing to do in read_bin_list\n" unless $quiet;
+    return;
+  }
+
+  $bin_list or ($bin_list = "$MAEMIAN_LAB/info/binary-packages");
+  return unless -s $bin_list;
+
+  open(IN, '<', $bin_list) or fail("cannot open binary list file $bin_list: $!");
+
+  # compatible file format?
+  my $f;
+  chop($f = <IN>);
+  if ($f ne $BINLIST_FORMAT) {
+    close(IN);
+    return 0 if $quiet;
+    fail("the binary list file $bin_list has an incompatible file format (run lintian --setup-lab)");
+  }
+
+  # compatible format, so read file
+  while (<IN>) {
+    chop;
+
+    next if /^\s*$/o;
+    my ($bin,$ver,$source,$source_ver,$file,$timestamp) = split(/\;/o,$_);
+
+    my $bin_struct;
+    %$bin_struct =
+      (
+       'package' => $bin,
+       'version' => $ver,
+       'source' => $source,
+       'source-version' => $source_ver,
+       'file' => $file,
+       'timestamp' => $timestamp,
+       );
+
+    $binary_info{$bin} = $bin_struct;
+  }
+
+  close(IN);
+}
+
+sub read_udeb_list {
+  my ($udeb_list,$quiet) = @_;
+  my $MAEMIAN_LAB = $ENV{'MAEMIAN_LAB'};
+  
+  if (%udeb_info) {
+    warn "\%udeb_info exists, nothing to do in read_bin_list\n" unless $quiet;
+    return;
+  }
+  
+  $udeb_list or ($udeb_list = "$MAEMIAN_LAB/info/udeb-packages");
+  return unless -s $udeb_list;
+  
+  open(IN, '<', $udeb_list) or fail("cannot open udeb list file $udeb_list: $!");
+  
+  # compatible file format?
+  my $f;
+  chop($f = <IN>);
+  if ($f ne $UDEBLIST_FORMAT) {
+    close(IN);
+    return 0 if $quiet;
+    fail("the udeb list file $udeb_list has an incompatible file format (run lintian --setup-lab)");
+  }
+  
+  # compatible format, so read file
+  while (<IN>) {
+    chop;
+    
+    next if /^\s*$/o;
+    my ($udeb,$ver,$source,$source_ver,$file,$timestamp) = split(/\;/o,$_);
+    
+    my $udeb_struct;
+    %$udeb_struct =
+      (
+       'package' => $udeb,
+       'version' => $ver,
+       'source' => $source,
+       'source-version' => $source_ver,
+       'file' => $file,
+       'timestamp' => $timestamp,
+      );
+    
+    $udeb_info{$udeb} = $udeb_struct;
+  }
+
+  close(IN);
+}
+
+sub get_bin_src_ref {
+  read_src_list();
+  for my $source (keys %source_info) {
+    for my $binary (split(/,\s+/o,$source_info{$source}->{'binary'})) {
+      $bin_src_ref{$binary} = $source;
+    }
+  }
+}
+
+1;
+__END__
diff --git a/nokia-lintian/COPYING b/nokia-lintian/COPYING
new file mode 100644 (file)
index 0000000..d511905
--- /dev/null
@@ -0,0 +1,339 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/nokia-lintian/checks/binaries b/nokia-lintian/checks/binaries
new file mode 100644 (file)
index 0000000..5c6d2ac
--- /dev/null
@@ -0,0 +1,352 @@
+# binaries -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::binaries;
+use strict;
+use Tags;
+use Util;
+
+use File::Spec;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my $arch;
+my $dynsyms = 0;
+my $needs_libc = '';
+my $needs_libc_file;
+my $needs_libc_count = 0;
+my $needs_depends_line = 0;
+my $has_perl_lib = 0;
+
+my %COMMENT;
+my %NOTE;
+my %RPATH;
+my %NEEDED;
+my %CXXABI;
+my %OCAML;
+my %SONAME;
+my %KLIBC;
+
+# read architecture file
+if (open(IN, '<', "fields/architecture")) {
+    chop($arch = <IN>);
+    close(IN);
+}
+
+my $file;
+
+# read data from objdump-info file
+open(IN, '<', "objdump-info")
+    or fail("cannot find objdump-info for $type package $pkg");
+while (<IN>) {
+    chop;
+
+    next if m/^\s*$/o;
+
+    if (m/^-- (\S+)\s*$/o) {
+       $file = $1;
+       $dynsyms = 0;
+    } elsif ($dynsyms) {
+       # The .*? near the end is added because a number of optional fields
+       # might be printed.  The symbol name should be the last word.
+       if (m/^[0-9a-fA-F]+.{6}\w\w?\s+(\S+)\s+[0-9a-zA-Z]+\s+(\S+)\s+(\S+)$/){
+           my ($foo, $sec, $sym) = ($1, $2, $3);
+           if ($arch ne 'hppa') {
+               if ($foo eq '.text' and $sec eq 'Base' and
+                   $sym eq '__gmon_start__') {
+                   tag "binary-compiled-with-profiling-enabled", "$file";
+               }
+           } else {
+               if ( ($sec =~ /^GLIBC_.*/) and ($sym eq '_mcount') ) {
+                   tag "binary-compiled-with-profiling-enabled", "$file";
+               }
+           }
+
+           if ($foo eq '.text' and $sec eq 'Base' and $sym eq 'caml_main') {
+               $OCAML{$file} = 1;
+           }
+       }
+    } else {
+       if (m/^\s*NEEDED\s*(\S+)/o) {
+           push @{$NEEDED{$file}}, $1;
+       } elsif (m/^\s*RPATH\s*(\S+)/o) {
+           foreach (split m/:/, $1) {
+               $RPATH{$file}{$_}++;
+           }
+       } elsif (m/^\s*SONAME\s*(\S+)/o) {
+           $SONAME{$1} ||= [];
+           push @{$SONAME{$1}}, $file;
+       } elsif (m/^\s*\d+\s+\.comment\s+/o) {
+           $COMMENT{$file} = 1;
+       } elsif (m/^\s*\d+\s+\.note\s+/o) {
+           $NOTE{$file} = 1;
+       } elsif (m/^DYNAMIC SYMBOL TABLE:/) {
+           $dynsyms = 1;
+       } elsif (m/^objdump: (.*?): File format not recognized$/) {
+            tag "apparently-corrupted-elf-binary", "$file";
+       } elsif (m/^objdump: \.(.*?): Packed with UPX$/) {
+           tag "binary-file-compressed-with-upx", "$file";
+       } elsif (m/objdump: \.(.*?): Invalid operation$/) {
+           # Don't anchor this regex since it can be interspersed with other
+           # output and hence not on the beginning of a line.
+           tag "binary-with-bad-dynamic-table", "$file" unless $file =~ m%^\./usr/lib/debug/%;
+       } elsif (m/CXXABI/) {
+           $CXXABI{$file} = 1;
+       } elsif (m%Requesting program interpreter:\s+/lib/klibc-\S+\.so%) {
+           $KLIBC{$file} = 1;
+       }
+    }
+}
+close(IN);
+
+# For the package naming check, filter out SONAMEs where all the files are at
+# paths other than /lib, /usr/lib, or /usr/X11R6/lib.  This avoids false
+# positives with plugins like Apache modules, which may have their own SONAMEs
+# but which don't matter for the purposes of this check.  Also filter out
+# nsswitch modules
+sub lib_soname_path {
+    my (@paths) = @_;
+    foreach my $path (@paths) {
+       next if $path =~ m%^(\.?/)?lib/libnss_[^.]+\.so(\.[0-9]+)$%;
+       return 1 if $path =~ m%^(\.?/)?lib/[^/]+$%;
+       return 1 if $path =~ m%^(\.?/)?usr/lib/[^/]+$%;
+       return 1 if $path =~ m%^(\.?/)?usr/X11R6/lib/[^/]+$%;
+    }
+    return 0;
+}
+my @sonames = sort grep { lib_soname_path (@{$SONAME{$_}}) } keys %SONAME;
+
+# try to identify transition strings
+my $base_pkg = $pkg;
+$base_pkg =~ s/c102\b//o;
+$base_pkg =~ s/c2a?\b//o;
+$base_pkg =~ s/\dg$//o;
+$base_pkg =~ s/gf$//o;
+$base_pkg =~ s/-udeb$//o;
+$base_pkg =~ s/^lib64/lib/o;
+
+my $match_found = 0;
+foreach my $expected_name (@sonames) {
+    $expected_name =~ s/([0-9])\.so\./$1-/;
+    $expected_name =~ s/\.so(\.|\z)//;
+    $expected_name =~ s/_/-/g;
+
+    if ((lc($expected_name) eq $pkg)
+       || (lc($expected_name) eq $base_pkg)) {
+       $match_found = 1;
+       last;
+    }
+}
+
+tag "package-name-doesnt-match-sonames", "@sonames"
+    if @sonames && !$match_found;
+
+my %directories;
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chomp;
+    next unless /^[dl]/;
+    my $dir = (split(' ', $_, 6))[-1];
+    $dir =~ s,^\./,/,;
+    $dir =~ s,/+$,,;
+    $dir =~ s/ link to .*//;
+    $dir =~ s/ -> .*//;
+
+    $directories{$dir}++;
+}
+close IN;
+
+# process all files in package
+open(IN,, '<', "file-info")
+    or fail("cannot find file-info for $type package $pkg");
+while (<IN>) {
+    chop;
+
+    m/^(.+?):\s+(.*)$/o or fail("an error in the file pkg is preventing lintian from checking this package: $_");
+    my ($file,$info) = ($1,$2);
+
+    # binary or object file?
+    next unless ($info =~ m/^[^,]*\bELF\b/) or ($info =~ m/\bcurrent ar archive\b/);
+
+    # Warn about Architecture: all packages that contain shared libraries, but
+    # only if those libraries aren't installed in a multiarch directory.  The
+    # package may be a support package for cross-compiles.
+    if ($arch eq 'all') {
+       my ($arch) = ($file =~ m,^\./(?:usr/)?lib/([^/]+)/,);
+       my $multiarch = Lintian::Data->new('binaries/multiarch');
+       unless ($arch and $multiarch->known($arch)) {
+           tag "arch-independent-package-contains-binary-or-object", "$file";
+       }
+    }
+
+    # ELF?
+    next unless $info =~ m/^[^,]*\bELF\b/o;
+
+    if ($file =~ m,^\./etc/,) {
+       tag "binary-in-etc", "$file";
+    }
+
+    if ($file =~ m,^\./usr/share/,) {
+       tag "arch-dependent-file-in-usr-share", "$file";
+    }
+
+    # stripped?
+    if ($info =~ m,not stripped\s*$,o) {
+       # Is it an object file (which generally can not be stripped),
+       # a kernel module, debugging symbols, or perhaps a debugging package?
+       # Ocaml executables are exempted, see #252695
+       unless ($file =~ m,\.k?o$, or $pkg =~ m/-dbg$/ or $pkg =~ m/debug/
+               or $file =~ m,/lib/debug/, or exists $OCAML{$file}) {
+           tag "unstripped-binary-or-object", "$file";
+       }
+    } else {
+       # stripped but a debug or profiling library?
+       if (($file =~ m,/lib/debug/,o) or ($file =~ m,/lib/profile/,o)) {
+           tag "library-in-debug-or-profile-should-not-be-stripped", "$file";
+       } else {
+           # appropriately stripped, but is it stripped enough?
+           if (exists $NOTE{$file}) {
+               tag "binary-has-unneeded-section", "$file .note";
+           }
+           if (exists $COMMENT{$file}) {
+               tag "binary-has-unneeded-section", "$file .comment";
+           }
+       }
+    }
+
+    # rpath is disallowed, except in private directories
+    if (exists $RPATH{$file}) {
+       foreach my $rpath (map {File::Spec->canonpath($_)} keys %{$RPATH{$file}}) {
+           next if $rpath =~ m,^/usr/lib/(games/)?\Q$pkg\E(?:/|\z),;
+           next if $rpath =~ m,^\$ORIGIN$,;
+           next if $directories{$rpath};
+           tag "binary-or-shlib-defines-rpath", "$file $rpath";
+       }
+    }
+
+    # binary or shared object?
+    next unless ($info =~ m/executable/) or ($info =~ m/shared object/);
+    next if $type eq 'udeb';
+
+    # Perl library?
+    if ($file =~ m,^\./usr/lib/perl5/.*\.so$,) {
+       $has_perl_lib = 1;
+    }
+
+    # Something other than detached debugging symbols in /usr/lib/debug paths.
+    if ($file =~ m,^\./usr/lib/debug/(lib\d*|s?bin|usr|opt|dev|emul)/,) {
+       if (exists($NEEDED{$file})) {
+           tag "debug-file-should-use-detached-symbols", $file;
+       }
+    }
+
+    # statically linked?
+    if (!exists($NEEDED{$file}) || !defined($NEEDED{$file})) {
+       if ($info =~ m/shared object/o) {
+            # Some exceptions: detached debugging information and the dynamic
+            # loader (which itself has no dependencies).
+            next if ($file =~ m%^\./usr/lib/debug/%);
+            next if ($file =~ m%^\./lib/(?:[\w/]+/)?ld-[\d.]+\.so$%);
+           tag "shared-lib-without-dependency-information", "$file";
+       } else {
+           # Some exceptions: files in /boot, /usr/lib/debug/*, named *-static or
+           # *.static, or *-static as package-name.
+           next if ($file =~ m%^./boot/%);
+           # klibc binaries appear to be static.
+           next if ($KLIBC{$file});
+           # Location of debugging symbols:
+           next if ($file =~ m%^./usr/lib/debug/%);
+           next if ($file =~ /(\.|-)static$/);
+           next if ($pkg =~ /-static$/);
+           tag "statically-linked-binary", "$file";
+       }
+    } else {
+       my $lib;
+       my $no_libc = 1;
+       $needs_depends_line = 1;
+       for $lib (@{$NEEDED{$file}}) {
+           if ($lib =~ /^libc\.so\.(\d+.*)/) {
+               $needs_libc = "libc$1";
+               $needs_libc_file = $file unless $needs_libc_file;
+               $needs_libc_count++;
+               $no_libc = 0;
+           }
+       }
+       if ($no_libc and not $file =~ m,/libc\b,) {
+           if ($info =~ m/shared object/) {
+               tag "library-not-linked-against-libc", "$file";
+           } else {
+               tag "program-not-linked-against-libc", "$file";
+           }
+       }
+    }
+}
+close(IN);
+
+# Find the package dependencies, which is used by various checks.
+my $depends = '';
+if (-f 'fields/pre-depends') {
+    $depends = slurp_entire_file('fields/pre-depends');
+}
+if (-f 'fields/depends') {
+    $depends .= ', ' if $depends;
+    $depends .= slurp_entire_file('fields/depends');
+}
+$depends =~ s/\n/ /g;
+
+# Check for a libc dependency.
+if ($needs_depends_line) {
+    if ($depends && $needs_libc && $pkg !~ /^libc[\d.]+(-|\z)/) {
+        # Match libcXX or libcXX-*, but not libc3p0.
+        my $re = qr/(?:^|,)\s*\Q$needs_libc\E\b/o;
+        if ($depends !~ /$re/) {
+            my $others = '';
+           $needs_libc_count--;
+            if ($needs_libc_count > 0) {
+                $others = " and $needs_libc_count others";
+            }
+            tag "missing-dependency-on-libc",
+               "needed by $needs_libc_file$others";
+        }
+    } elsif (!$depends) {
+       tag "missing-depends-line";
+    }
+}
+
+# Check for a Perl dependency.
+if ($has_perl_lib) {
+    my $re = qr/(?:^|,)\s*perlapi-[\d.]+(?:\s*\[[^\]]+\])?\s*(?:,|\z)/;
+    unless ($depends =~ /$re/) {
+       tag 'missing-dependency-on-perlapi';
+    }
+}
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl ts=8 sw=4
diff --git a/nokia-lintian/checks/binaries.desc b/nokia-lintian/checks/binaries.desc
new file mode 100644 (file)
index 0000000..6a84e3e
--- /dev/null
@@ -0,0 +1,182 @@
+Check-Script: binaries
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: bin
+Type: binary, udeb
+Unpack-Level: 1
+Needs-Info: objdump-info, file-info
+Info: This script checks binaries and object files for bugs.
+
+Tag: arch-independent-package-contains-binary-or-object
+Type: error
+Info: The package contains a binary or object file but is tagged
+ Architecture: all.
+ .
+ If this package contains binaries or objects for cross-compiling or
+ binary blobs for other purposes independent of the host architecture
+ (such as BIOS updates or firmware), please add a Lintian override.
+
+Tag: unstripped-binary-or-object
+Type: error
+Ref: policy 10.1, policy 10.2
+Info: The package installs an unstripped binary or object file.
+ .
+ Please note, that shared libraries have to be stripped with the
+ <tt>--strip-unneeded</tt> option.
+
+Tag: library-in-debug-or-profile-should-not-be-stripped
+Type: error
+Info: Libraries in <tt>.../lib/debug</tt> or in
+ <tt>.../lib/profile</tt> usually should not be stripped.
+
+Tag: statically-linked-binary
+Type: error
+Info: The package installs a statically linked binary or object file.
+ .
+ Usually this is a bug. Otherwise, please install an override if your package
+ is an exception. Note that binaries named *-static and *.static are already
+ excluded, just as any binaries in packages named *-static.
+
+Tag: library-not-linked-against-libc
+Type: warning
+Info: The package installs a library which is not dynamically linked
+ against libc.
+
+Tag: program-not-linked-against-libc
+Type: warning
+Info: The package installs a binary which is not dynamically linked
+ against libc.
+
+Tag: binary-or-shlib-defines-rpath
+Type: warning
+Ref: http://wiki.debian.org/RpathIssue
+Info: The binary or shared library sets RPATH.  This overrides the normal
+ library search path, possibly interfering with local policy and causing
+ problems for multilib, among other issues.
+ .
+ The only time a binary or shared library in a Debian package should set
+ RPATH is if it is linked to private shared libraries in the same package.
+ In that case, place those private shared libraries in
+ <tt>/usr/lib/<i>package</i></tt>.  Libraries used by binaries in other
+ packages should be placed in <tt>/lib</tt> or <tt>/usr/lib</tt> as
+ appropriate, with a proper SONAME, in which case RPATH is unncessary.
+ .
+ To fix this problem, look for link lines like:
+     gcc test.o -o test -Wl,--rpath,/usr/local/lib
+ or
+     gcc test.o -o test -R/usr/local/lib
+ and remove the <tt>-Wl,--rpath</tt> or <tt>-R</tt> argument.  You can also
+ use the chrpath utility to remove the RPATH.
+
+Tag: binary-has-unneeded-section
+Type: info
+Info: The binary or shared library is stripped, but still contains a
+ section that is not useful.  You should call strip with
+ <tt>--remove-section=.comment --remove-section=.note</tt> to remove the
+ <tt>.note</tt> and <tt>.comment</tt> sections.
+ .
+ <tt>dh_strip</tt> will do this automatically for you, but
+ <tt>install -s</tt> not because it calls strip without any arguments.
+
+Tag: missing-depends-line
+Type: warning
+Info: The package contains an ELF binary with dynamic dependencies,
+ but does not have a Depends line in its control file.  This usually
+ means that a call to <tt>dpkg-shlibdeps</tt> is missing from the
+ package's <tt>debian/rules</tt> file.
+
+Tag: shared-lib-without-dependency-information
+Type: warning
+Info: The listed shared library doesn't include information about which
+ other libraries the library was linked against. (When running `<tt>ldd
+ foo.so</tt>' ldd should report about these other libraries. In your
+ case, ldd just reports `statically linked'.)
+ .
+ To fix this, you should explicitly specify the libraries which are
+ used (e.g., `-lc') when building the shared library with `ld'.
+ .
+ If you have questions about this, please contact &debdev;.
+
+Tag: arch-dependent-file-in-usr-share
+Type: error
+Ref: fhs 4.11
+Info: This package installs an ELF binary in the <tt>/usr/share</tt>
+ hierarchy, which is reserved for architecture-independent files.
+
+Tag: binary-in-etc
+Type: error
+Ref: fhs 3.7
+Info: This package installs an ELF binary in <tt>/etc</tt>.
+ The Filesystem Hierarchy Standard forbids this.
+
+Tag: binary-compiled-with-profiling-enabled
+Type: warning
+Info: While profiling is useful for testing and debugging purposes, enabling
+ it causes a program to leave gmon.out files whenever a user runs it.
+
+Tag: binary-file-compressed-with-upx
+Type: error
+Info: Debian does not allow binaries to be compressed by UPX.
+
+Tag: package-name-doesnt-match-sonames
+Type: warning
+Info: The package name of a library package should usually reflect
+ the soname of the included library. The package name can determined
+ from the library file name with the following code snippet:
+ .
+  $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | sed -e's/\([0-9]\)\.so\./\1-/; s/\.so\.//'
+Ref: Library Packaging guide 5
+
+Tag: binary-with-bad-dynamic-table
+Type: error
+Info: This appears to be an ELF file but objdump -T cannot parse it.
+ If it is external debugging symbols for another file, it should be
+ installed under /usr/lib/debug.
+
+Tag: apparently-corrupted-elf-binary
+Type: warning
+Info: This appears to be an ELF file but objdump -T doesn't recognize it
+ as valid.  This may be a mistake or a corrupted file, you may need to
+ install binutils-multiarch on the system running lintian so that
+ non-native binaries are handled correctly, or it may be a
+ misidentification of a file as ELF that actually isn't.
+
+Tag: missing-dependency-on-libc
+Type: error
+Ref: policy 8.6
+Info: The listed file appears to be linked against the C library, but the
+ package doesn't depend on the C library package.  Normally this indicates
+ that ${shlibs:Depends} was omitted from the Depends line for this package
+ in <tt>debian/control</tt>.
+ .
+ All shared libraries and compiled binaries must be run through
+ dpkg-shlibdeps to find out any libraries they are linked against (often
+ via the dh_shlibdeps debhelper command).  The package containing these
+ files must then depend on ${shlibs:Depends} in <tt>debian/control</tt> to
+ get the proper package dependencies for those libraries.
+
+Tag: missing-dependency-on-perlapi
+Type: error
+Ref: Perl policy 4.4.2
+Info: This package includes a *.so file in <tt>/usr/lib/perl5</tt>,
+ normally indicating that it includes a binary Perl module.  Binary Perl
+ modules must depend on perlapi-$Config{version} (from the Config module).
+ If the package is using debhelper, this problem is usually due to a
+ missing dh_perl call in <tt>debian/rules</tt> or a missing
+ ${perl:Depends} substitution variable in the Depends line in
+ <tt>debian/control</tt>.
+
+Tag: debug-file-should-use-detached-symbols
+Type: warning
+Info: This file is in a location generally used for detached debugging
+ symbols, but it appears to contain a complete copy of the executable or
+ library instead of only the debugging symbols.  Files in subdirectories
+ of <tt>/usr/lib/debug</tt> mirroring the main file system should contain
+ only debugging information generated by <tt>objcopy
+ --only-keep-debug</tt>.  Binaries or shared objects built with extra
+ debugging should be installed directly in <tt>/usr/lib/debug</tt> or in
+ subdirectories corresponding to the package, not in the directories that
+ mirror the main file system.
+ .
+ If you are using dh_strip with the --dbg-package flag, don't also install
+ the library in <tt>/usr/lib/debug</tt>.  dh_strip does all the work for
+ you.
diff --git a/nokia-lintian/checks/changelog-file b/nokia-lintian/checks/changelog-file
new file mode 100644 (file)
index 0000000..32d04fa
--- /dev/null
@@ -0,0 +1,387 @@
+# changelog-file -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::changelog_file;
+use strict;
+use Spelling;
+use Dep;
+use Tags;
+use Util;
+
+use Encode qw(decode);
+use Parse::DebianChangelog;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+my $found_html=0;
+my $found_text=0;
+my $native_pkg;
+my $foreign_pkg;
+my $ppkg = quotemeta($pkg);
+
+my @doc_files;
+
+my %file_info;
+my %is_a_symlink;
+
+# Read file info...
+open(IN, '<', "file-info")
+    or fail("cannot find file-info for $type package $pkg");
+while (<IN>) {
+    chop;
+
+    m/^(.*?):\s+(.*)$/o or
+       fail("an error in the file pkg is preventing lintian from checking this package: $_");
+    my ($file,$info) = ($1,$2);
+
+    next unless $file =~ m/doc/o;
+    $file =~ s,^(\./)?,,;
+    $file_info{$file} = $info;
+}
+close(IN);
+
+# Modify the file_info by following symbolic links.
+for my $file (keys %file_info) {
+    if ($file_info{$file} =~ m/^(?:broken )?symbolic link to (.*)/) {
+       $is_a_symlink{$file} = 1;
+       # Figure out the link destination.  This algorithm is
+       # not perfect but should be good enough.  (If it fails,
+       # all that happens is that an evil symlink causes a bogus warning).
+       my $newfile;
+       my $link = $1;
+       if ($link =~ m/^\//) {
+           # absolute path; replace
+           $newfile = $link;
+       } else {
+           $newfile = $file;   # relative path; base on $file
+           $newfile =~ s,/[^/]+$,,; # strip final pathname component
+           # strip another component for every leading ../ in $link
+           while ($link =~ m,^\.\./,) {
+               $newfile =~ s,/[^/]+$,,;
+               $link =~ s,^\.\./,,;
+           }
+           # concatenate the results
+           $newfile .= '/' . $link;
+       }
+       if (exists $file_info{$newfile}) {
+           $file_info{$file} = $file_info{$newfile};
+       }
+    }
+}
+
+# TODO: better check for incorrect case, /../i and /../ without i is used
+# together at random it seems here
+
+# Read package contents...
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chop;
+
+    s,^(\./),,;
+    # skip packages which have a /usr/share/doc/$pkg -> foo symlink
+    if (m, usr/share/doc/$ppkg -> ,) {
+       return 0;
+    }
+
+    # we are only interested in files or symlinks in /usr/(share/)?doc/$pkg
+    if (m,usr/(share/)?doc/$ppkg/([^/\s]+), ) {
+       my $file = $2;
+       my $file1 = "usr/share/doc/$pkg/$file";
+
+       push(@doc_files, $file);
+
+       # Check a few things about the NEWS.Debian file.
+       if ($file =~ /^NEWS.Debian(\.gz)?$/i) {
+           if (not $file =~ /\.gz$/) {
+               tag "debian-news-file-not-compressed", "$file1";
+           } elsif ($file ne 'NEWS.Debian.gz') {
+               tag "wrong-name-for-debian-news-file", "$file1";
+           }
+       }
+
+       # check if changelog files are compressed with gzip -9
+       next unless $file =~ m/^changelog(\.html)?(\.gz)?$|changelog.debian(\.gz)?$/i;
+
+       if (not $file =~ m/\.gz$/) {
+           tag "changelog-file-not-compressed", "$file";
+       } else {
+           my $max_compressed = 0;
+           if (exists $file_info{$file1} && defined $file_info{$file1}) {
+               if ($file_info{$file1} =~ m/max compression/o) {
+                   $max_compressed = 1;
+               }
+           }
+           if (not $max_compressed) {
+               unless ($is_a_symlink{$file1}) {
+                   tag "changelog-not-compressed-with-max-compression", "$file";
+               }
+           }
+       }
+
+       if ($file =~ m/^changelog\.html(\.gz)?$/ ) {
+           $found_html = 1;
+       }
+       if ($file =~ m/^changelog(\.gz)?$/ ) {
+           $found_text = 1;
+       }
+    }
+
+    #  next unless m,^(\S+).*usr/share/doc/$ppkg/([^/\s]+)( -> [^/\s]+)?$,o;
+}
+close(IN);
+
+# ignore packages which don't have a /usr/share/doc/$pkg directory, since
+# the copyright check will complain about this
+if ($#doc_files < 0) {
+    return 0;
+}
+
+# Check a NEWS.Debian file if we have one.  We should additionally check here
+# that the entries don't begin with an asterisk, but that hasn't been done
+# yet.  Save the version, distribution, and urgency for later checks against
+# the changelog file.
+my $news;
+if (-f 'NEWS.Debian') {
+    my $line = file_is_encoded_in_non_utf8('NEWS.Debian', $type, $pkg);
+    if ($line) {
+       tag "debian-news-file-uses-obsolete-national-encoding", "at line $line"
+    }
+    my $changes = Parse::DebianChangelog->init( { infile => 'NEWS.Debian', quiet => 1 } );
+    if (my @errors = $changes->get_parse_errors) {
+       for (@errors) {
+           tag "syntax-error-in-debian-news-file", "line $_->[1]", "\"$_->[2]\"";
+       }
+    }
+
+    # Some checks on the most recent entry.
+    if ($changes->data and defined (($changes->data)[0])) {
+        ($news) = $changes->data;
+        if ($news->Distribution && $news->Distribution =~ /unreleased/i) {
+            tag "debian-news-entry-has-strange-distribution", $news->Distribution;
+        }
+        spelling_check('spelling-error-in-news-debian', $news->Changes);
+    }
+}
+
+if ( $found_html && !$found_text ) {
+    tag "html-changelog-without-text-version", "";
+}
+
+# is this a native Debian package?
+open(IN, '<', "fields/version")
+    or fail("cannot open fields/version file for reading: $!");
+chop(my $version = <IN>);
+close(IN);
+
+$native_pkg  = ($version !~ m/-/);
+$foreign_pkg = (!$native_pkg and $version !~ m/-0\./);
+# A version of 1.2.3-0.1 could be either, so in that
+# case, both vars are false
+
+if ($native_pkg) {
+    my @foo;
+    # native Debian package
+    if (grep m/^changelog(\.gz)?$/,@doc_files) {
+       # everything is fine
+    } elsif (@foo = grep m/^changelog\.debian(\.gz)$/i,@doc_files) {
+       tag "wrong-name-for-changelog-of-native-package", "usr/share/doc/$pkg/$foo[0]";
+    } else {
+       tag "changelog-file-missing-in-native-package", "";
+    }
+} else {
+    # non-native (foreign :) Debian package
+
+    # 1. check for upstream changelog
+    my $found_upstream_text_changelog = 0;
+    if (grep m/^changelog(\.html)?(\.gz)?$/,@doc_files) {
+       $found_upstream_text_changelog = 1 unless $1;
+       # everything is fine
+    } else {
+       # search for changelogs with wrong file name
+       my $found = 0;
+       for (@doc_files) {
+           if (m/^change/i and not m/debian/i) {
+               tag "wrong-name-for-upstream-changelog", "usr/share/doc/$pkg/$_";
+               $found = 1;
+               last;
+           }
+       }
+       if (not $found) {
+           # This tag is disabled for now since a lot of packages fail this
+           # aspect of policy and I want to clarify policy WRT multi-binary
+           # packages first.
+           #tag "no-upstream-changelog", "";
+       }
+    }
+
+    # 2. check for Debian changelog
+    if (grep m/^changelog\.Debian(\.gz)?$/,@doc_files) {
+       # everything is fine
+    } elsif (my @foo = grep m/^changelog\.debian(\.gz)?$/i,@doc_files) {
+       tag "wrong-name-for-debian-changelog-file", "usr/share/doc/$pkg/$foo[0]";
+    } else {
+       if ($foreign_pkg && $found_upstream_text_changelog) {
+           tag "debian-changelog-file-missing-or-wrong-name", "";
+       } elsif ($foreign_pkg) {
+           tag "debian-changelog-file-missing", "";
+       }
+       # TODO: if uncertain whether foreign or native, either changelog.gz or
+       # changelog.debian.gz should exists though... but no tests catches
+       # this (extremely rare) border case... Keep in mind this is only
+       # happening if we have a -0.x version number... So not my priority to
+       # fix --Jeroen
+    }
+}
+
+# Everything below involves opening and reading the changelog file, so bail
+# with a warning at this point if all we have is a symlink.
+if (-l 'changelog') {
+    tag "debian-changelog-file-is-a-symlink", "";
+    return 0;
+}
+
+# Bail at this point if the changelog file doesn't exist.  We will have
+# already warned about this.
+unless (-f 'changelog') {
+    return 0;
+}
+
+# check that changelog is UTF-8 encoded
+my $line = file_is_encoded_in_non_utf8("changelog", $type, $pkg);
+if ($line) {
+    tag "debian-changelog-file-uses-obsolete-national-encoding", "at line $line"
+}
+
+my $changes = Parse::DebianChangelog->init( { infile => 'changelog',
+                                             quiet => 1 } );
+if (my @errors = $changes->get_parse_errors) {
+    foreach (@errors) {
+       tag "syntax-error-in-debian-changelog", "line $_->[1]", "\"$_->[2]\"";
+    }
+}
+
+my @entries = $changes->data;
+if (@entries) {
+    foreach (@entries) {
+       if ($_->Maintainer) {
+           if ($_->Maintainer =~ /<([^>\@]+\@unknown)>/) {
+               tag "debian-changelog-file-contains-debmake-default-email-address", $1;
+           } elsif ($_->Maintainer =~ /<([^>\@]+\@[^>.]*)>/) {
+               tag "debian-changelog-file-contains-invalid-email-address", $1;
+           }
+       }
+    }
+
+    if (@entries > 1) {
+       my $first_timestamp = $entries[0]->Timestamp;
+       my $second_timestamp = $entries[1]->Timestamp;
+
+       if ($first_timestamp && $second_timestamp) {
+           tag "latest-debian-changelog-entry-without-new-date"
+               unless (($first_timestamp - $second_timestamp) > 0);
+       }
+
+       my $first_version = $entries[0]->Version;
+       my $second_version = $entries[1]->Version;
+       if ($first_version and $second_version) {
+           tag "latest-debian-changelog-entry-without-new-version"
+               unless Dep::versions_gt ($first_version, $second_version)
+                    or $entries[0]->Changes =~ /backport/i;
+       }
+    }
+
+    # Some checks should only be done against the most recent changelog entry.
+    my $entry = $entries[0];
+    if (@entries == 1 and $entry->Version =~ /-1$/) {
+        tag 'new-package-should-close-itp-bug'
+            unless @{ $entry->Closes };
+    }
+    my $changes = $entry->Changes;
+    while ($changes =~ /(closes\s*(?:bug)?\#?\s?\d{6,})[^\w]/ig) {
+       tag "possible-missing-colon-in-closes", "$1" if $1;
+    }
+
+    # Compare against NEWS.Debian if available.
+    if ($news and $news->Version and $entry->Version eq $news->Version) {
+        for my $field (qw/Distribution Urgency/) {
+            if ($entry->$field ne $news->$field) {
+                tag 'changelog-news-debian-mismatch', lc ($field),
+                    $entry->$field . ' != ' . $news->$field;
+            }
+        }
+    }
+
+    # We have to decode into UTF-8 to get the right length for the length
+    # check.  For some reason, use open ':utf8' isn't sufficient.  If the
+    # changelog uses a non-UTF-8 encoding, this will mangle it, but it doesn't
+    # matter for the length check.
+    #
+    # Parse::DebianChangelog adds an additional space to the beginning of each
+    # line, so we have to adjust for that in the length check.
+    my @lines = split ("\n", decode ('utf-8', $changes));
+    for my $i (0 .. $#lines) {
+        if (length ($lines[$i]) > 81 && $lines[$i] !~ /^[\s.o*+-]*\S+$/) {
+            tag 'debian-changelog-line-too-long', "line " . ($i + 1);
+        }
+    }
+
+    # Strip out all lines that contain the word spelling to avoid false
+    # positives on changelog entries for spelling fixes.
+    $changes =~ s/^.*spelling.*\n//gm;
+    spelling_check('spelling-error-in-changelog', $changes);
+}
+
+# read the changelog itself
+#
+# emacs only looks at the last "local variables" in a file, and only at
+# one within 3000 chars of EOF and on the last page (^L), but that's a bit
+# pesky to replicate.  Demanding a match of $prefix and $suffix ought to
+# be enough to avoid false positives.
+open (IN, '<', "changelog")
+    or fail("cannot find changelog for $type package $pkg");
+my ($prefix, $suffix);
+while (<IN>) {
+
+    if (/closes:\s*(((?:bug)?\#?\s?\d*)[[:alpha:]]\w*)/io
+       || /closes:\s*(?:bug)?\#?\s?\d+
+             (?:,\s*(?:bug)?\#?\s?\d+)*
+             (?:,\s*(((?:bug)?\#?\s?\d*)[[:alpha:]]\w*))/iox) {
+       tag "wrong-bug-number-in-closes", "l$.:$1" if $2;
+    }
+
+    if (/^(.*)Local\ variables:(.*)$/i) {
+       $prefix = $1;
+       $suffix = $2;
+    }
+    # emacs allows whitespace between prefix and variable, hence \s*
+    if (defined $prefix && defined $suffix
+       && /^\Q$prefix\E\s*add-log-mailing-address:.*\Q$suffix\E$/) {
+       tag "debian-changelog-file-contains-obsolete-user-emacs-settings";
+    }
+}
+close IN;
+
+}
+
+1;
+
+# vim: syntax=perl ts=8 sw=4
diff --git a/nokia-lintian/checks/changelog-file.desc b/nokia-lintian/checks/changelog-file.desc
new file mode 100644 (file)
index 0000000..cb2e7bc
--- /dev/null
@@ -0,0 +1,236 @@
+Check-Script: changelog-file
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: chg
+Type: binary
+Unpack-Level: 1
+Needs-Info: file-info, changelog-file
+Info: This script checks if a binary package conforms to policy
+ with regards to changelog files.
+ .
+ Each binary package with a /usr/share/doc/&lt;foo&gt; directory must have
+ a Debian changelog file in "changelog.Debian.gz" unless the Debian
+ changelog and the upstream one is the same file; in this case, it
+ must be in "changelog.gz".
+ .
+ If there is an upstream changelog file, it must be named
+ "changelog.gz".
+ .
+ Both changelog files should be compressed using "gzip -9".
+ Even if they start out small, they will become large with time.
+
+Tag: html-changelog-without-text-version
+Type: error
+Info: If the upstream changelog file is HTML formatted, a text version
+ should also be accessible as "changelog.gz". (This can be created by
+ "lynx -dump -nolist")
+Ref: policy 12.7
+
+Tag: changelog-file-not-compressed
+Type: warning
+Info: Changelog files should be compressed using "gzip -9".  Even if they
+ start out small, they will become large with time.
+Ref: policy 12.7
+
+Tag: debian-news-file-not-compressed
+Type: warning
+Info: NEWS.Debian files should be compressed using "gzip -9".  The file
+ must always have the same name.
+Ref: devref 6.3.4
+
+Tag: changelog-not-compressed-with-max-compression
+Type: warning
+Info: Changelog files should be compressed using "gzip -9"; i.e., using
+ the maximum compression level via the -9 option to gzip.
+Ref: policy 12.7
+
+Tag: wrong-name-for-changelog-of-native-package
+Type: warning
+Info: The changelog file of a native Debian package (i.e., if there is
+ no upstream source) should usually be installed as
+ /usr/share/doc/<i>pkg</i>/changelog.gz
+Ref: policy 12.7
+
+Tag: changelog-file-missing-in-native-package
+Type: error
+Info: Each Debian package (which provides a /usr/share/doc/<i>pkg</i>
+ directory) has to install a changelog file. Since this package seems
+ to be a native Debian package (i.e., there is no upstream source),
+ the file should usually be installed as
+ /usr/share/doc/<i>pkg</i>/changelog.gz
+Ref: policy 12.7
+
+Tag: wrong-name-for-upstream-changelog
+Type: warning
+Info: If there is an upstream changelog file, it should usually be
+ installed as /usr/share/doc/<i>pkg</i>/changelog.gz
+Ref: policy 12.7
+
+Tag: no-upstream-changelog
+Type: warning
+Info: The package does not install an upstream changelog file. 
+Ref: policy 12.7
+
+Tag: wrong-name-for-debian-changelog-file
+Type: warning
+Info: The Debian changelog file should usually be installed as
+ /usr/share/doc/<i>pkg</i>/changelog.Debian.gz
+Ref: policy 12.7
+
+Tag: wrong-name-for-debian-news-file
+Type: warning
+Info: The Debian news file must be installed as
+ /usr/share/doc/<i>pkg</i>/NEWS.Debian.gz with exactly that capitalization
+ or automated tools may not find it correctly.
+Ref: devref 6.3.4
+
+Tag: debian-changelog-file-missing
+Type: error
+Info: Each Debian package (which provides a /usr/share/doc/<i>pkg</i>
+ directory) has to install a Debian changelog file
+ /usr/share/doc/<i>pkg</i>/changelog.Debian.gz
+Ref: policy 12.7
+
+Tag: debian-changelog-file-is-a-symlink
+Type: warning
+Info: The Debian changelog file is a symlink to a file in a different
+ directory or not found in this package. Please don't do this. It makes
+ package checking and manipulation unnecessarily difficult. Because it was
+ a symlink, the Debian changelog file was not checked for other
+ problems. (Symlinks to another file in /usr/share/doc/<i>pkg</i> or a
+ subdirectory thereof are fine and should not trigger this warning.)
+ .
+ To refer to the changelog, copyright, and other documentation files of
+ another package that this one depends on, please symlink the entire
+ /usr/share/doc/<i>pkg</i> directory rather than individual files.
+
+Tag: debian-changelog-file-missing-or-wrong-name
+Type: error
+Info: Each Debian package (which provides a /usr/share/doc/<i>pkg</i>
+ directory) must install a Debian changelog file in
+ /usr/share/doc/<i>pkg</i>/changelog.Debian.gz
+ .
+ A common error is to name the Debian changelog like an upstream changelog
+ (/usr/share/doc/<i>pkg</i>/changelog.gz); therefore, lintian will apply
+ further checks to such a file if it exists even after issuing this error.
+Ref: policy 12.7
+
+Tag: debian-changelog-file-contains-obsolete-user-emacs-settings
+Type: warning
+Info: The add-log-mailing-address variable is no longer honored in
+ debian-changelog-mode, and should not appear in packages' changelog
+ files.  Instead, put something like this in your ~/.emacs:
+ .
+ (setq debian-changelog-mailing-address "userid@debian.org")
+
+Tag: debian-changelog-file-contains-debmake-default-email-address
+Type: error
+Info: The changelog file contains an email address (&lt;..@unknown&gt;)
+ that was not updated to the maintainer's real address.
+
+Tag: debian-changelog-file-contains-invalid-email-address
+Type: error
+Info: The changelog file contains an invalid email address: the domain
+ needs at least one dot. This is looks like a mistake.
+
+Tag: debian-changelog-file-uses-obsolete-national-encoding
+Type: error
+Info: The Debian changelog file must be valid UTF-8, an encoding of
+ the Unicode character set.
+ .
+ There are many ways to convert a changelog from an obsoleted encoding
+ like ISO-8859-1; you may for example use "iconv" like:
+ .
+  $ iconv -f ISO-8859-1 -t UTF-8 changelog &gt; changelog.new
+  $ mv changelog.new changelog
+
+Tag: debian-news-file-uses-obsolete-national-encoding
+Type: error
+Info: The NEWS.Debian file must be valid UTF-8, an encoding of the Unicode
+ character set.
+ .
+ There are many ways to convert a changelog from an obsoleted encoding
+ like ISO-8859-1; you may for example use "iconv" like:
+ .
+  $ iconv -f ISO-8859-1 -t UTF-8 NEWS.Debian &gt; NEWS.Debian.new
+  $ mv NEWS.Debian.new NEWS.Debian
+
+Tag: latest-debian-changelog-entry-without-new-date
+Type: warning
+Info: The latest Debian changelog entry has either the same or even an
+ older date as the entry before.
+
+Tag: latest-debian-changelog-entry-without-new-version
+Type: warning
+Info: The latest Debian changelog entry has a version number that's either
+ the same or smaller than the version number of the entry before.
+
+Tag: syntax-error-in-debian-changelog
+Type: warning
+Info: While parsing the Debian changelog, a syntax error was found.
+Ref: policy 4.4
+
+Tag: syntax-error-in-debian-news-file
+Type: warning
+Info: While parsing the NEWS.Debian file, a syntax error was found.
+Ref: devref 6.3.4
+
+Tag: wrong-bug-number-in-closes
+Type: warning
+Info: Bug numbers can only contain digits.
+Ref: policy 4.4
+
+Tag: possible-missing-colon-in-closes
+Type: warning
+Info: To close a bug in the Debian changelog, the word "closes" must be
+ followed by a colon.  This entry looked like it was intended to close a
+ bug, but there's no colon after "closes".
+Ref: policy 4.4
+
+Tag: debian-news-entry-has-strange-distribution
+Type: warning
+Info: The latest entry in NEWS.Debian has an unusual distribution name.
+ This field is ignored by the archive software, so its value doesn't truly
+ matter, but it may be confusing to users reading the entry if the
+ distribution doesn't match the distribution for the same entry in the
+ Debian changelog file.
+
+Tag: spelling-error-in-changelog
+Type: warning
+Info: Lintian found a spelling error in the latest entry of the Debian
+ changelog.  Lintian has a list of common misspellings that it looks for.
+ It does not have a dictionary like a spelling checker does.
+ .
+ When writing a changelog entry for a spelling fix that includes the
+ misspelling, ensure the word "spelling" is on the same line as the
+ misspelled word to avoid triggering this warning.
+
+Tag: spelling-error-in-news-debian
+Type: warning
+Info: Lintian found a spelling error in the latest entry of the
+ NEWS.Debian file.  Lintian has a list of common misspellings that it
+ looks for.  It does not have a dictionary like a spelling checker does.
+
+Tag: new-package-should-close-itp-bug
+Type: warning
+Info: This package appears to be the first packaging of a new upstream
+ software package (there is only one changelog entry and the Debian
+ revision is 1), but it does not close any bugs.  The initial upload of a
+ new package should close the corresponding ITP bug for that package.
+ .
+ This warning can be ignored if the package is not intended for Debian or
+ if it is a split of an existing Debian package.
+Ref: devref 5.1
+
+Tag: debian-changelog-line-too-long
+Type: warning
+Info: The given line of the latest changelog entry is over 80 columns.
+ Such changelog entries may look poor in terminal windows and mail
+ messages and be annoying to read.  Please wrap changelog entries at 80
+ columns or less where possible.
+
+Tag: changelog-news-debian-mismatch
+Type: warning
+Info: The latest entries in the Debian changelog file and NEWS.Debian file
+ are for the same version but the given field doesn't match.  The
+ changelog information is canonical and the NEWS.Debian information is
+ ignored, but it may be confusing to users to have them be different.
diff --git a/nokia-lintian/checks/common_data.pm b/nokia-lintian/checks/common_data.pm
new file mode 100644 (file)
index 0000000..013a019
--- /dev/null
@@ -0,0 +1,183 @@
+#! /usr/bin/perl -w
+
+package common_data;
+use base qw(Exporter);
+
+our @EXPORT = qw
+(
+   %known_archs %known_sections %known_non_us_parts %known_archive_parts
+   %known_prios %known_source_fields %known_binary_fields %known_udeb_fields
+   %known_obsolete_fields %known_essential %known_build_essential
+   %known_obsolete_packages %known_obsolete_emacs %known_virtual_packages
+   %known_libstdcs %known_tcls %known_tclxs %known_tks %known_tkxs
+   %known_libpngs %known_x_metapackages
+   %non_standard_archs %all_cpus %all_oses
+   %known_doc_base_formats
+);
+
+# To let "perl -cw" test know we use these variables;
+use vars qw
+(
+  %known_archs %known_sections %known_non_us_parts %known_archive_parts
+  %known_prios %known_source_fields %known_binary_fields %known_udeb_fields
+  %known_obsolete_fields %known_essential %known_build_essential
+  %known_obsolete_emacs %known_virtual_packages
+  %known_libstdcs %known_tcls %known_tclxs %known_tks %known_tkxs
+  %known_libpngs %known_x_metapackages
+  %all_cpus %all_oses
+  %known_doc_base_formats
+);
+
+# simple defines for commonly needed data
+
+# From /usr/share/dpkg/cputable, included here to make lintian results
+# consistent no matter what dpkg one has installed.
+%all_cpus = map { $_ => 1 }
+    ('i386', 'ia64', 'alpha', 'amd64', 'armeb', 'arm', 'hppa', 'm32r', 'm68k',
+     'mips', 'mipsel', 'powerpc', 'ppc64', 's390', 's390x', 'sh3', 'sh3eb',
+     'sh4', 'sh4eb', 'sparc');
+
+# From /usr/share/dpkg/triplettable, included here to make lintian results
+# consistent no matter what dpkg one has installed.  This lists all of the
+# foo-<cpu> rules.  Note that linux is not present in the current dpkg and
+# hence is not present here.
+%all_oses = map { $_ => 1 }
+    ('kfreebsd', 'knetbsd', 'hurd', 'freebsd', 'openbsd', 'netbsd', 'darwin',
+     'solaris');
+
+# Yes, this includes combinations that are rather unlikely to ever exist, like
+# hurd-sh3, but the chances of those showing up as errors are rather low and
+# this reduces the necessary updating.
+#
+# armel and lpia are special cases, so handle them separately here.  (They're
+# handled separately in /usr/share/dpkg/triplettable.)  any and all are also
+# special cases.
+%known_archs = map { $_ => 1 }
+    grep { !$known_archs{$_} }
+        (keys %all_cpus,
+         map { my $os = $_; map { "$os-$_" } keys %all_cpus } keys %all_oses),
+    ('armel', 'lpia', 'any', 'all');
+
+%known_sections = map { $_ => 1 }
+    ('admin', 'comm', 'devel', 'doc', 'editors', 'electronics',
+     'embedded', 'games', 'gnome', 'graphics', 'hamradio', 'interpreters',
+     'kde', 'libdevel', 'libs', 'mail', 'math', 'misc', 'net', 'news',
+     'oldlibs', 'otherosfs', 'perl', 'python', 'science', 'shells',
+     'sound', 'tex', 'text', 'utils', 'web', 'x11'
+    );
+
+%known_non_us_parts = map { $_ => 1 } ('non-free', 'contrib', 'main' );
+
+%known_archive_parts = map { $_ => 1 }
+    ('non-free', 'contrib', 'non-US', 'non-us' );
+
+%known_prios = map { $_ => 1 }
+    ('required', 'important', 'standard', 'optional', 'extra');
+
+# The Ubuntu original-maintainer field is handled separately.
+%known_source_fields = map { $_ => 1 }
+    ('source', 'version', 'maintainer', 'binary', 'architecture',
+     'standards-version', 'files', 'build-depends', 'build-depends-indep',
+     'build-conflicts', 'build-conflicts-indep', 'format', 'origin',
+     'uploaders', 'python-version', 'autobuild', 'homepage', 'vcs-arch',
+     'vcs-bzr', 'vcs-cvs', 'vcs-darcs', 'vcs-git', 'vcs-hg', 'vcs-mtn',
+     'vcs-svn', 'vcs-browser', 'dm-upload-allowed', 'bugs', 'checksums-sha1',
+     'checksums-sha256', 'checksums-md5');
+
+# The Ubuntu original-maintainer field is handled separately.
+%known_binary_fields = map { $_ => 1 }
+    ('package', 'version', 'architecture', 'depends', 'pre-depends',
+     'recommends', 'suggests', 'enhances', 'conflicts', 'provides',
+     'replaces', 'breaks', 'essential', 'maintainer', 'section', 'priority',
+     'source', 'description', 'installed-size', 'python-version', 'homepage',
+     'bugs', 'origin');
+
+# The Ubuntu original-maintainer field is handled separately.
+%known_udeb_fields = map { $_ => 1 }
+    ('package', 'version', 'architecture', 'subarchitecture', 'depends',
+     'recommends', 'enhances', 'provides', 'replaces', 'breaks', 'replaces',
+     'maintainer', 'section', 'priority', 'source', 'description',
+     'installed-size', 'kernel-version', 'installer-menu-item', 'bugs',
+     'origin');
+
+%known_obsolete_fields = map { $_ => 1 }
+    ('revision', 'package-revision', 'package_revision',
+     'recommended', 'optional', 'class');
+
+%known_essential = map { $_ => 1 }
+    ('base-files', 'base-passwd', 'bash', 'bsdutils', 'coreutils',
+     'debianutils', 'diff', 'dpkg', 'e2fsprogs', 'findutils', 'grep', 'gzip',
+     'hostname', 'login', 'mktemp', 'mount', 'ncurses-base', 'ncurses-bin',
+     'perl-base', 'sed', 'sysvinit', 'sysvinit-utils', 'tar', 'util-linux');
+
+%known_build_essential = map { $_ => 1 }
+    ('libc6-dev', 'libc-dev', 'gcc', 'g++', 'make', 'dpkg-dev');
+
+# Still in the archive but shouldn't be the primary Emacs dependency.
+%known_obsolete_emacs = map { $_ => 1 }
+    ('emacs21');
+
+# Used only (at least lintian 1.23.1) for giving a warning about a
+# virtual-only dependency
+%known_virtual_packages = map { $_ => 1 }
+    ('x-terminal-emulator', 'x-window-manager', 'xserver', 'awk', 'c-compiler',
+     'c-shell', 'dotfile-module', 'emacsen', 'fortran77-compiler',
+     'ftp-server', 'httpd', 'ident-server', 'info-browser',
+     'ispell-dictionary', 'kernel-image',
+     'linux-kernel-log-daemon', 'lambdamoo-core', 'lambdamoo-server',
+     'libc-dev', 'man-browser', 'pdf-preview', 'pdf-viewer',
+     'postscript-preview', 'postscript-viewer',
+     'system-log-daemon', 'tclsh', 'telnet-client', 'telnet-server',
+     'time-daemon', 'ups-monitor', 'wish', 'wordlist', 'www-browser',
+     'imap-client', 'imap-server', 'mail-reader', 'mail-transport-agent',
+     'news-reader', 'news-transport-system', 'pop3-server',
+     'mp3-encoder', 'mp3-decoder',
+     'java-compiler', 'java2-compiler',
+     'java-virtual-machine',
+     'java1-runtime', 'java2-runtime',
+     'dict-client',
+     'foomatic-data',
+     'audio-mixer', 'x-audio-mixer',
+     'debconf-2.0',
+     'aspell-dictionary',
+     'radius-server',
+     'libgl-dev', 'libglu-dev',
+     'automaken'
+    );
+
+%known_libstdcs = map { $_ => 1 }
+    ('libstdc++2.9-glibc2.1', 'libstdc++2.10', 'libstdc++2.10-glibc2.2',
+     'libstdc++3', 'libstdc++3.0', 'libstdc++4', 'libstdc++5',
+     'libstdc++6', 'lib64stdc++6',
+    );
+
+%known_tcls = map { $_ => 1 }
+    ( 'tcl74', 'tcl8.0', 'tcl8.2', 'tcl8.3', 'tcl8.4', 'tcl8.5', );
+
+%known_tclxs = map { $_ => 1 }
+    ( 'tclx76', 'tclx8.0.4', 'tclx8.2', 'tclx8.3', 'tclx8.4', );
+
+%known_tks = map { $_ => 1 }
+    ( 'tk40', 'tk8.0', 'tk8.2', 'tk8.3', 'tk8.4', 'tk8.5', );
+
+%known_tkxs = map { $_ => 1 }
+    ( 'tkx8.2', 'tkx8.3', );
+
+%known_libpngs = map { $_ => 1 }
+    ( 'libpng12-0', 'libpng2', 'libpng3', );
+
+%known_x_metapackages = map { $_ => 1 }
+    ( 'x-window-system', 'x-window-system-dev', 'x-window-system-core',
+      'xorg', 'xorg-dev', );
+
+# Supported documentation formats for doc-base files.
+%known_doc_base_formats = map { $_ => 1 }
+    ( 'html', 'text', 'pdf', 'postscript', 'info', 'dvi', 'debiandoc-sgml' );
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/checks/conffiles b/nokia-lintian/checks/conffiles
new file mode 100644 (file)
index 0000000..33c2d1d
--- /dev/null
@@ -0,0 +1,66 @@
+# conffiles -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::conffiles;
+use strict;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my $cf = "control/conffiles";
+
+# conffiles?
+unless (-f $cf) {
+    return 0;
+}
+
+my %conffiles = ();
+
+open(IN, '<', $cf) or fail("cannot open $cf for reading: $!");
+while (<IN>) {
+    chop;
+    next if m/^\s*$/o;
+
+    $conffiles{"$_"}++;
+    if ($conffiles{"$_"} > 1) {
+       tag "duplicate-conffile", "$_";
+    }
+
+    if (m,^/?usr/,o) {
+       tag "file-in-usr-marked-as-conffile", "$_";
+    } else {
+       unless (m,^/?etc/,o) {
+           tag "non-etc-file-marked-as-conffile", "$_";
+       }
+    }
+
+    unless (m,^/,o) {
+       tag "relative-conffile", "$_";
+    }
+}
+close(IN);
+
+}
+
+1;
diff --git a/nokia-lintian/checks/conffiles.desc b/nokia-lintian/checks/conffiles.desc
new file mode 100644 (file)
index 0000000..75f6f09
--- /dev/null
@@ -0,0 +1,35 @@
+Check-Script: conffiles
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: cnf
+Type: binary
+Unpack-Level: 1
+Info: This script checks if the `conffiles' control file of a binary
+ package is correct.
+
+Tag: file-in-usr-marked-as-conffile
+Type: error
+Info: Files below <tt>/usr</tt> may not be marked as conffiles, since
+ <tt>/usr</tt> might be mounted read-only and thus, the local system
+ administrator would not have a chance to modify this configuration
+ file.
+
+Tag: non-etc-file-marked-as-conffile
+Type: warning
+Info: A file installed in some other directory than <tt>/etc</tt>
+ is marked as conffile. A conffile typically implies a configuration file, and
+ policy mandates such files to be in /etc
+Status: untested
+Ref: policy 10.7.2
+
+Tag: relative-conffile
+Type: error
+Ref: policy E.1
+Info: All entries in the conffile control file should have an absolute
+ path specification.
+
+Tag: duplicate-conffile
+Type: error
+Info: The file is listed more than once in your <tt>debian/conffiles</tt> file.
+ Usually, this is because debhelper (dh_installdeb, compat level 3 or higher)
+ will add any files in your package located in /etc automatically to the list
+ of conffiles, so if you do that manually too, you'll get duplicates.
diff --git a/nokia-lintian/checks/control-file b/nokia-lintian/checks/control-file
new file mode 100644 (file)
index 0000000..d778696
--- /dev/null
@@ -0,0 +1,146 @@
+# control-file -- lintian check script -*- perl -*-
+#
+# Copyright (C) 2004 Marc Brockschmidt
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::control_file;
+use strict;
+use lib "$ENV{'LINTIAN_ROOT'}/checks/";
+use common_data;
+use Dep;
+use Util;
+use Tags;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+if (-l "debfiles/control") {
+    tag "debian-control-file-is-a-symlink", "";
+}
+
+# check that control is UTF-8 encoded
+my $line = file_is_encoded_in_non_utf8("debfiles/control", $type, $pkg);
+if ($line) {
+    tag "debian-control-file-uses-obsolete-national-encoding", "at line $line"
+}
+
+# Check that each field is only used once:
+my $seen_fields = {};
+open (CONTROL, '<', "debfiles/control")
+    or fail "Couldn't read debfiles/control: $!";
+while (<CONTROL>) {
+       s/\s*\n$//;
+       next if /^\#/;
+
+       #Reset seen_fields if we enter a new section:
+       $seen_fields = {} if /^$/;
+
+       #line with field:
+       if (/^(\S+):/) {
+               my $field = lc ($1);
+               if ($seen_fields->{$field}) {
+                       tag "debian-control-with-duplicate-fields", "$field: $$seen_fields{$field}, $.";
+               }
+               $seen_fields->{$field} = $.;
+               if ($field =~ /^xs-vcs-/) {
+                       my $base = $field;
+                       $base =~ s/^xs-//;
+                       tag "xs-vcs-header-in-debian-control", "$field"
+                           if $known_source_fields{$base};
+               }
+       }
+}
+close CONTROL;
+
+my ($header, @binary_controls) = read_dpkg_control("debfiles/control");
+
+for my $binary_control (@binary_controls) {
+       tag "build-info-in-binary-control-file-section", "Package ".$binary_control->{"package"}
+           if ($binary_control->{"build-depends"} || $binary_control->{"build-depends-indep"} ||
+               $binary_control->{"build-conflicts"} || $binary_control->{"build-conflicts-indep"});
+}
+
+# Make sure that a stronger dependency field doesn't imply any of the elements
+# of a weaker dependency field.  dpkg-gencontrol will fix this up for us, but
+# we want to check the source package since dpkg-gencontrol may silently "fix"
+# something that's a more subtle bug.
+#
+# Also check if a package declares a simple dependency on itself, since
+# similarly dpkg-gencontrol will clean this up for us but it may be a sign of
+# another problem.
+my @dep_fields = qw(pre-depends depends recommends suggests);
+for my $control (@binary_controls) {
+       for my $strong (0 .. ($#dep_fields - 1)) {
+               next unless $control->{$dep_fields[$strong]};
+               my $parsed = Dep::parse ($control->{$dep_fields[$strong]});
+               tag "package-depends-on-itself", $control->{package}, $dep_fields[$strong]
+                   if Dep::implies($parsed, Dep::parse($control->{package}));
+               for my $weak (($strong + 1) .. $#dep_fields) {
+                       next unless $control->{$dep_fields[$weak]};
+                       for my $dependency (split /\s*,\s*/, $control->{$dep_fields[$weak]}) {
+                               next unless $dependency;
+                               tag "stronger-dependency-implies-weaker", $control->{package}, "$dep_fields[$strong] -> $dep_fields[$weak]", $dependency
+                                   if Dep::implies($parsed, Dep::parse($dependency));
+                       }
+               }
+       }
+}
+
+# Check that every package is in the same archive category, except that
+# sources in main can deliver both main and contrib packages.  The source
+# package may or may not have a section specified; if it doesn't, derive the
+# expected archive category from the first binary package by leaving $category
+# undefined until parsing the first binary section.  Missing sections will be
+# caught by other checks.
+my $category;
+if ($header->{'section'}) {
+       if ($header->{'section'} =~ m%^([^/]+)/%) {
+               $category = $1;
+       } else {
+               $category = '';
+       }
+} else {
+       tag "no-section-field-for-source", "";
+}
+for my $binary_control (@binary_controls) {
+       next unless $binary_control->{'section'};
+       if (!defined ($category)) {
+               if ($binary_control->{'section'} =~ m%^([^/]+)/%) {
+                       $category = ($1 eq 'contrib') ? '' : $1;
+               } else {
+                       $category = '';
+               }
+               next;
+       }
+       tag "section-category-mismatch", "Package " . $binary_control->{'package'}
+               if ($category && $binary_control->{'section'} !~ m%^$category/%);
+       tag "section-category-mismatch", "Package " . $binary_control->{'package'}
+               if (!$category && $binary_control->{'section'} =~ m%^([^/]+)/% && $1 ne 'contrib');
+}
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 8
+# End:
+# vim: syntax=perl sw=4 ts=4 noet shiftround
diff --git a/nokia-lintian/checks/control-file.desc b/nokia-lintian/checks/control-file.desc
new file mode 100644 (file)
index 0000000..139cdc7
--- /dev/null
@@ -0,0 +1,87 @@
+Check-Script: control-file
+Author: Marc 'HE' Brockschmidt <marc@marcbrockschmidt.de>
+Abbrev: dctl
+Type: source
+Unpack-Level: 1
+Needs-Info: debfiles
+Info: This script checks debian/control files in source packages
+
+Tag: debian-control-file-uses-obsolete-national-encoding
+Type: error
+Info: The Debian control file should be valid UTF-8, an encoding of
+ the Unicode character set.
+ .
+ There are many ways to convert a control from an obsoleted encoding
+ like ISO-8859-1; you may for example use "iconv" like:
+ .
+  $ iconv -f ISO-8859-1 -t UTF-8 control &gt; control.new
+  $ mv control.new control
+
+Tag: build-info-in-binary-control-file-section
+Type: error
+Ref: policy 5.2
+Info: The control file has a Build-Depends, Build-Depends-Indep,
+ Build-Conflicts, or Build-Conflicts-Indep field in a binary
+ section.  These specify source package relationships, and should be in
+ the source section of the control file.
+
+Tag: debian-control-with-duplicate-fields
+Type: error
+Info: One of the paragraphs of your debian/control contains the same
+ field more than once. This can lead to an unexpected behaviour of dpkg
+ and apt.
+
+Tag: debian-control-file-is-a-symlink
+Type: warning
+Info: The <tt>debian/control</tt> file is a symlink rather than a regular
+ file. Using symlinks for required source package files is unnecessary and
+ makes package checking and manipulation more difficult. If the control
+ file should be available in the source package under multiple names, make
+ <tt>debian/control</tt> the real file and the other names symlinks to it.
+
+Tag: no-section-field-for-source
+Type: warning
+Ref: policy 5.2
+Info: The package does not have a "Section:" field in the source package
+ section of its control file.  The Section field is required for source
+ packages at the request of the Debian ftp-masters.
+
+Tag: section-category-mismatch
+Type: error
+Info: The <tt>debian/control</tt> file places the indicated binary package
+ in a different archive category (main, contrib, non-free) than its source
+ package or other binary packages built from the same source package.  The
+ source package and any binary packages it builds must be in the same
+ category of the archive.  A source package in main may only build binary
+ packages in main, a source package in non-free may only build binary
+ packages in non-free, and so forth.
+
+Tag: xs-vcs-header-in-debian-control
+Type: info
+Info: There is an XS-Vcs-* field in the <tt>debian/control</tt> file.  As
+ of dpkg 1.14.6, the XS- prefix is no longer necessary.  dpkg now
+ recognizes these headers and handles them correctly.  Consider removing
+ the XS- prefix for this field.
+
+Tag: stronger-dependency-implies-weaker
+Type: warning
+Ref: policy 7.2
+Info: In the <tt>debian/control</tt> stanza for the given package, a
+ stronger dependency field implies one of the dependencies in a weaker
+ dependency field.  In other words, the Depends field of the package
+ requires that one of the packages listed in Recommends or Suggests be
+ installed, or a package is listed in Recommends as well as Suggests.
+ .
+ Current versions of dpkg-gencontrol will silently fix this problem by
+ removing the weaker dependency, but it may indicate a more subtle bug
+ (misspelling or forgetting to remove the stronger dependency when it was
+ moved to the weaker field).
+
+Tag: package-depends-on-itself
+Type: warning
+Ref: policy 7.2
+Info: The given package declares a dependency on itself in its
+ <tt>debian/control</tt> stanza.  Current versions of dpkg-gencontrol will
+ silently fix this problem by removing the dependency, but it may indicate
+ a more subtle bug (misspelling or cutting and pasting the wrong package
+ name).
diff --git a/nokia-lintian/checks/control-files b/nokia-lintian/checks/control-files
new file mode 100644 (file)
index 0000000..d12ce36
--- /dev/null
@@ -0,0 +1,121 @@
+# control-files -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::control_files;
+use strict;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my %ctrl_deb =
+    (
+     'clilibs', 0644,
+     'config', 0755,
+     'control', 0644,
+     'conffiles', 0644,
+     'md5sums', 0644,
+     'postinst', 0755,
+     'preinst', 0755,
+     'postrm', 0755,
+     'prerm', 0755,
+     'shlibs', 0644,
+     'symbols', 0644,
+     'templates', 0644,
+     'triggers', 0644,
+    );
+
+my %ctrl_udeb =
+    (
+     'config', 0755,
+     'control', 0644,
+     'isinstallable', 0755,
+     'menutest', 0755,
+     'postinst', 0755,
+     'shlibs', 0644,
+     'symbols', 0644,
+     'templates', 0644,
+    );
+
+my %ctrl = $type eq 'udeb' ? %ctrl_udeb : %ctrl_deb;
+my %ctrl_alt = $type eq 'udeb' ? %ctrl_deb : %ctrl_udeb;
+
+# process control-index file
+open(IN, '<', "control-index") or fail("cannot open control-index file: $!");
+while (<IN>) {
+    chop;
+
+    my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
+    my $operm;
+
+    next if $file eq './';
+
+    $file =~ s,^(\./),,;
+    $file =~ s/ link to .*//;
+    $file =~ s/ -> .*//;
+
+    next if $file eq './';
+
+    # valid control file?
+    unless ( exists $ctrl{$file} ) {
+       if ( exists $ctrl_alt{$file} ) {
+           tag "not-allowed-control-file", "$file";
+           next;
+       } else {
+           tag "unknown-control-file", "$file";
+           next;
+       }
+    }
+
+    # I'm not sure about the udeb case
+    if ($type ne 'udeb' and $size == 0) {
+       tag "control-file-is-empty", "$file";
+    }
+
+
+    # skip `control' control file (that's an exception: dpkg doesn't care and
+    # this file isn't installed on the systems anyways)
+    next if $file eq 'control';
+
+    $operm = perm2oct($perm);
+
+    # correct permissions?
+    unless ($operm == $ctrl{$file}) {
+       tag "control-file-has-bad-permissions",
+           sprintf("$file %04o != %04o",$operm,$ctrl{$file});
+    }
+
+    # correct owner?
+    unless ($owner eq 'root/root') {
+       tag "control-file-has-bad-owner", "$file $owner != root/root";
+    }
+
+# for other maintainer scripts checks, see the scripts check
+}
+close IN;
+
+} # </run>
+
+1;
+
+# vim: syntax=perl sw=4 ts=8
diff --git a/nokia-lintian/checks/control-files.desc b/nokia-lintian/checks/control-files.desc
new file mode 100644 (file)
index 0000000..155ef13
--- /dev/null
@@ -0,0 +1,33 @@
+Check-Script: control-files
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: ctl
+Type: binary, udeb
+Unpack-Level: 1
+
+Tag: unknown-control-file
+Type: warning
+Ref: policy B.2
+Info: The package contains an unknown control file.  Policy says that
+ putting additional files in the package control area is not generally a
+ good idea.
+
+Tag: not-allowed-control-file
+Type: error
+Info: The package contains a control file that is not allowed in this
+ type of package. Some control files are only allowed in either .deb
+ or .udeb packages and must not be included in packages of the other
+ type. You should probably just remove the file.
+
+Tag: control-file-is-empty
+Type: warning
+Info: The package contains an empty control file, which is most probably
+ an error.
+
+Tag: control-file-has-bad-permissions
+Type: error
+Info: The postinst, postrm, preinst, and prerm control files should use
+ mode 0755; all other control files should use 0644.
+
+Tag: control-file-has-bad-owner
+Type: error
+Info: All control files should be owned by root/root.
diff --git a/nokia-lintian/checks/copyright-file b/nokia-lintian/checks/copyright-file
new file mode 100644 (file)
index 0000000..3f87743
--- /dev/null
@@ -0,0 +1,332 @@
+# copyright-file -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::copyright_file;
+use strict;
+use Dep;
+use Spelling;
+use Tags;
+use Util;
+
+use Encode qw(decode);
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my $ppkg = quotemeta($pkg);
+
+my $found = 0;
+my $linked = 0;
+
+use lib "$ENV{'LINTIAN_ROOT'}/checks/";
+use common_data;
+
+# Read package contents...
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chop;
+    if (m,usr/(share/)?doc/$ppkg/copyright(\.\S+)?(\s+\-\>\s+.*)?$,) {
+       my ($ext,$link) = ($2,$3);
+
+       $ext = '' if (! defined $ext);
+       #an extension other than .gz doesn't count as copyright file
+       next unless ($ext eq '') or ($ext eq '.gz');
+       $found = 1;
+
+       #search for an extension
+       if ($ext eq '.gz') {
+           tag "copyright-file-compressed", "";
+           last;
+       }
+
+       #make sure copyright is not a symlink
+       if ($link) {
+           tag "copyright-file-is-symlink", "";
+           last;
+       }
+
+       #otherwise, pass
+       if (($ext eq '') and not $link) {
+           # everything is ok.
+           last;
+       }
+       fail("unhandled case: $_");
+
+    } elsif (m,usr/share/doc/$ppkg \-\>\s+(\S+),) {
+       my ($link) = ($1);
+
+       $found = 1;
+       $linked = 1;
+
+       # check if this symlink references a directory elsewhere
+       if ($link =~ m,^(\.\.)?/,) {
+           tag "usr-share-doc-symlink-points-outside-of-usr-share-doc", "$link";
+           last;
+       }
+
+       # link might point to a subdirectory of another /usr/share/doc
+       # directory
+       $link =~ s,/.*,,;
+
+       # this case is allowed, if this package depends on link
+       # and both packages come from the same source package
+
+       if (not open (VERSION, '<', "fields/version")) {
+           fail("Can't open fields/version: $!");
+       } else {
+           chomp(my $our_version = <VERSION>);
+           close VERSION;
+
+           # depend on $link pkg?
+           if ((not depends_on($link, $our_version)) &&
+                not (exists($known_essential{$link}) &&
+                defined($known_essential{$link}))) {
+               # no, it does not.
+
+               tag "usr-share-doc-symlink-without-dependency", "$link";
+               last;
+           }
+       }
+
+       # We can only check if both packages come from the same source
+       # if our source package is currently unpacked in the lab, too!
+       if (-d "source") {      # yes, it's unpacked
+
+           # $link from the same source pkg?
+           if (-l "source/binary/$link") {
+               # yes, everything is ok.
+           } else {
+               # no, it is not.
+               tag "usr-share-doc-symlink-to-foreign-package", "$link";
+           }
+       } else {                # no, source is not available
+           tag "cannot-check-whether-usr-share-doc-symlink-points-to-foreign-package", "";
+       }
+
+       # everything is ok.
+       last;
+    } elsif (m,usr/doc/copyright/$ppkg$,) {
+       tag "old-style-copyright-file", "";
+       $found = 1;
+       last;
+    }
+}
+close(IN);
+
+if (not $found) {
+    tag "no-copyright-file", "";
+}
+
+# check that copyright is UTF-8 encoded
+my $line = file_is_encoded_in_non_utf8("copyright", $type, $pkg);
+if ($line) {
+    tag "debian-copyright-file-uses-obsolete-national-encoding", "at line $line"
+}
+
+# check contents of copyright file
+open(IN, '<', "copyright") or fail("cannot open copyright file copyright: $!");
+# gulp whole file
+local $/ = undef;
+$_ = <IN>;
+close(IN);
+
+# We have to decode into UTF-8 to get the right length for the length
+# check.  For some reason, use open ':utf8' isn't sufficient.  If the
+# file uses a non-UTF-8 encoding, this will mangle it, but it doesn't
+# matter for the length check.
+my @lines = split ("\n", decode ('utf-8', $_));
+for my $i (0 .. $#lines) {
+    if (length ($lines[$i]) > 80) {
+       tag "debian-copyright-line-too-long", "line " . ($i+1);
+    }
+}
+
+my $wrong_directory_detected = 0;
+
+if (m,\<fill in (http/)?ftp site\>, or m/\<Must follow here\>/) {
+    tag "helper-templates-in-copyright", "";
+}
+
+if (m,usr/share/common-licenses/(GPL|LGPL|BSD|Artistic)\.gz,) {
+    tag "copyright-refers-to-compressed-license", "$&";
+}
+
+if (m,usr/share/common-licences,) {
+    tag "copyright-refers-to-incorrect-directory", "$&";
+    $wrong_directory_detected = 1;
+}
+
+if (m,usr/share/doc/copyright,) {
+    tag "copyright-refers-to-old-directory", "";
+    $wrong_directory_detected = 1;
+}
+
+if (m,usr/doc/copyright,) {
+    tag "copyright-refers-to-old-directory", "";
+    $wrong_directory_detected = 1;
+}
+
+# Lame check for old FSF zip code.  Try to avoid false positives from other
+# Cambridge, MA addresses.
+if (m/(Free\s*Software\s*Foundation.*02139|02111-1307)/s) {
+    tag "old-fsf-address-in-copyright-file", "";
+}
+
+# Whether the package is covered by the GPL, used later for the libssl check.
+my $gpl;
+
+if (length($_) > 12000
+    and ((m/\bGNU GENERAL PUBLIC LICENSE\s*TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\b/m
+          and m/\bVersion 2\s/)
+         or (m/\bGNU GENERAL PUBLIC LICENSE\s*Version 3/ and m/\bTERMS AND CONDITIONS\s/))) {
+    tag "copyright-file-contains-full-gpl-license";
+    $gpl = 1;
+}
+
+if (length($_) > 12000
+    and m/\bGNU Free Documentation License\s*Version 1\.2/ and m/\b1\. APPLICABILITY AND DEFINITIONS/) {
+    tag "copyright-file-contains-full-gfdl-license";
+}
+
+if (length($_) > 10000
+    and m/\bApache License\s+Version 2\.0,/
+    and m/TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION/) {
+    tag "copyright-file-contains-full-apache-2-license";
+}
+
+if (m/^This copyright info was automatically extracted from the perl module\./) {
+    tag "helper-templates-in-copyright", "";
+}
+
+if (m,(under )?(the )?(same )?(terms )?as Perl itself,i &&
+    !m,usr/share/common-licenses/,) {
+    tag "copyright-file-lacks-pointer-to-perl-license", "";
+}
+
+# wtf?
+if ((m,common-licenses(/\S+),) && (! m,/usr/share/common-licenses/,)) {
+    tag "copyright-does-not-refer-to-common-license-file", "$1";
+}
+
+# This check is a bit prone to false positives, since some other licenses
+# mention the GPL.  Also exclude any mention of the GPL following what looks
+# like mail headers, since sometimes e-mail discussions of licensing are
+# included in the copyright file but aren't referring to the license of the
+# package.
+if (m,/usr/share/common-licenses,
+    || m/Zope Public License/
+    || m/LICENSE AGREEMENT FOR PYTHON 1.6.1/
+    || m/LaTeX Project Public License/
+    || m/(^From:.*^To:|^To:.*^From:).*(GNU General Public License|GPL)/ms
+    || m/AFFERO GENERAL PUBLIC LICENSE/
+    || m/GNU Free Documentation License\s*Version 1\.1/
+    || m/CeCILL FREE SOFTWARE LICENSE AGREEMENT/
+    || m/CNRI OPEN SOURCE GPL-COMPATIBLE LICENSE AGREEMENT/
+    || $wrong_directory_detected) {
+    # False positive or correct reference.  Ignore.
+} elsif (m/GNU Free Documentation License/i or m/\bGFDL\b/) {
+    tag "copyright-should-refer-to-common-license-file-for-gfdl";
+} elsif (m/GNU (Lesser|Library) General Public License/i or m/\bLGPL\b/) {
+    tag "copyright-should-refer-to-common-license-file-for-lgpl";
+} elsif (m/GNU General Public License/i or m/\bGPL\b/) {
+    tag "copyright-should-refer-to-common-license-file-for-gpl";
+    $gpl = 1;
+}
+
+if (m,Upstream Author\(s\),) {
+    tag "copyright-lists-upstream-authors-with-dh_make-boilerplate";
+}
+
+if (m,url://example\.com,) {
+    tag "copyright-has-url-from-dh_make-boilerplate";
+}
+
+if (m{\# Please also look if there are files or directories which have a\n\# different copyright/license attached and list them here\.}) {
+    tag "copyright-contains-dh_make-todo-boilerplate", "";
+}
+if (m{This copyright info was automatically extracted from the perl module\.\nIt may not be accurate, so you better check the module sources\nif you don\'t want to get into legal troubles\.}) {
+    tag "copyright-contains-dh-make-perl-boilerplate", "";
+}
+
+if ($found && !$linked && !/(Copyright|Copr\.|\302\251)(.*|[\(C\):\s]+)\b\d{4}\b|\bpublic\s+domain\b/i) {
+    tag 'copyright-without-copyright-notice';
+}
+
+spelling_check('spelling-error-in-copyright', $_);
+
+# Now, check for linking against libssl if the package is covered by the GPL.
+# (This check was requested by ftp-master.)  First, see if the package is
+# under the GPL alone and try to exclude packages with a mix of GPL and LGPL
+# or Artistic licensing or with an exception or exemption.
+if ($gpl || m,/usr/share/common-licenses/GPL,) {
+    unless (m,exception|exemption|/usr/share/common-licenses/(?!GPL)\S,) {
+       my @depends;
+       if (open(DEP, '<', 'fields/depends')) {
+           @depends = split (/\s*,\s*/, scalar <DEP>);
+       }
+       if (open(DEP, '<', 'fields/pre-depends')) {
+           push @depends, split (/\s*,\s*/, scalar <DEP>);
+       }
+       close DEP;
+       if (grep { /^libssl[0-9.]+(\s|\z)/ && !/\|/ } @depends) {
+           tag 'possible-gpl-code-linked-with-openssl';
+       }
+    }
+}
+
+} # </run>
+
+# -----------------------------------
+
+# returns true, if $foo depends on $bar
+sub depends_on {
+    my ($package, $version) = @_;
+
+    my ($deps, $predeps) = ("", "");
+
+    my $f = "fields/depends";
+    if (-f $f) {
+       open(I, '<', $f) or die "cannot open depends file $f: $!";
+       chop($deps = <I>);
+       close(I);
+    }
+
+    $f = "fields/pre-depends";
+    if (-f $f) {
+       open(I, '<', $f) or die "cannot open pre-depends file $f: $!";
+       chop($predeps = <I>);
+       close(I);
+    }
+
+    return 1 if Dep::implies(Dep::parse($deps), Dep::parse($package));
+    return 1 if Dep::implies(Dep::parse($predeps), Dep::parse($package));
+
+    return 0;
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl ts=8 sw=4
diff --git a/nokia-lintian/checks/copyright-file.desc b/nokia-lintian/checks/copyright-file.desc
new file mode 100644 (file)
index 0000000..4481595
--- /dev/null
@@ -0,0 +1,276 @@
+Check-Script: copyright-file
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: cpy
+Type: binary
+Unpack-Level: 1
+Needs-Info: copyright-file
+Info: This script checks if a binary package conforms to policy
+ with regard to copyright files.
+ .
+ Each binary package must either have a /usr/share/doc/&lt;foo&gt;/copyright file
+ or must have a symlink /usr/share/doc/&lt;foo&gt; -&gt; &lt;bar&gt;, where &lt;bar&gt; comes
+ from the same source package and pkg foo declares a "Depends" relation
+ on bar.
+
+Tag: no-copyright-file
+Type: error
+Info: Each binary package has to include a plain file
+ /usr/share/doc/<i>pkg</i>/copyright
+Ref: policy 12.5
+Tested: empty
+
+Tag: copyright-refers-to-old-directory
+Type: error
+Info: The common licenses (GPL, BSD, Artistic, etc) have been moved from
+ /usr/doc/copyright to /usr/share/common-licenses.
+ Copyright files should be updated.
+Ref: policy 12.5
+
+Tag: copyright-file-compressed
+Type: error
+Info: The copyright file /usr/share/doc/<i>pkg</i>/copyright must not be
+ compressed.
+Ref: policy 12.5
+
+Tag: copyright-file-is-symlink
+Type: error
+Info: The copyright file /usr/share/doc/<i>pkg</i>/copyright must not be a
+ symbolic link.
+Ref: policy 12.5
+
+Tag: copyright-file-contains-full-gpl-license
+Type: error
+Info: The copyright file /usr/share/doc/<i>pkg</i>/copyright contains the
+ complete text of the GPL v2 or v3.  It should refer to the file
+ <tt>/usr/share/common-licenses/GPL-2</tt> or <tt>GPL-3</tt> instead.
+Ref: policy 12.5
+
+Tag: copyright-file-contains-full-gfdl-license
+Type: error
+Info: The copyright file /usr/share/doc/<i>pkg</i>/copyright contains the
+ complete text of the GFDL v1.2.  It should refer to the file
+ <tt>/usr/share/common-licenses/GFDL-1.2</tt> instead.
+Ref: policy 12.5
+
+Tag: copyright-file-contains-full-apache-2-license
+Type: error
+Info: The copyright file /usr/share/doc/<i>pkg</i>/copyright contains the
+ complete text of the Apache 2.0 license.  It should refer to the file
+ <tt>/usr/share/common-licenses/Apache-2.0</tt> instead.
+Ref: policy 12.5
+
+Tag: usr-share-doc-symlink-without-dependency
+Type: error
+Info: If the package installs a symbolic link /usr/share/doc/<i>pkg1</i> -&gt;
+ <i>pkg2</i>, then <i>pkg1</i> has to depend on <i>pkg2</i> with the same
+ version as <i>pkg1</i>.
+ .
+ Note, that adding the "Depends:" entry just to fix this bug is not a good
+ solution. It's suggested that you include a real /usr/share/doc/<i>pkg1</i>
+ directory within <i>pkg1</i> and copy the copyright file into that directory.
+Ref: policy 12.5
+
+Tag: usr-share-doc-symlink-to-foreign-package
+Type: error
+Info: If the package installs a symbolic link /usr/share/doc/<i>pkg1</i> -&gt;
+ <i>pkg2</i>, then <i>pkg1</i> and <i>pkg2</i> must both come from the same
+ source package.
+ .
+ It's suggested that you include a real /usr/share/doc/<i>pkg1</i> directory
+ within <i>pkg1</i> and copy the copyright file to that directory.
+Ref: policy 12.5
+
+Tag: cannot-check-whether-usr-share-doc-symlink-points-to-foreign-package
+Type: info
+Info: There is a symlink /usr/share/doc/<i>pkg1</i> -&gt; <i>pkg2</i>
+ in your package. This means that <i>pkg1</i> and <i>pkg2</i> must
+ both come from the same source package. I can't check this right now
+ however since I'm only checking a binary package and I only can check
+ this when I'm checking both the binary and the corresponding source
+ package.
+
+Tag: old-style-copyright-file
+Type: error
+Info: The package installs a /usr/doc/copyright/<i>pkg</i> file. Instead,
+ you should place the copyright file in /usr/share/doc/<i>pkg</i>/copyright.
+Ref: policy 12.5
+
+Tag: old-fsf-address-in-copyright-file
+Type: warning
+Info: The /usr/share/doc/<i>pkg</i>/copyright file refers to the old postal
+ address of the Free Software Foundation (FSF). The new address is:
+ .
+   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+   MA 02110-1301, USA.
+
+Tag: helper-templates-in-copyright
+Type: error
+Info: The /usr/share/doc/<i>pkg</i>/copyright file still contains the template
+ contents from a packaging helper. Please include the actual license and
+ download information about the package.
+
+Tag: copyright-refers-to-compressed-license
+Type: error
+Info: The /usr/share/doc/<i>pkg</i>/copyright file refers to a standard license
+ /usr/share/common-licenses/{GPL,LGPL,Artistic,BSD}.gz as a compressed
+ file. Please update the reference (the licenses are installed
+ uncompressed).
+
+Tag: usr-share-doc-symlink-points-outside-of-usr-share-doc
+Type: error
+Info: The /usr/share/doc/<i>pkg</i> symbolic link is pointing to a directory
+ outside of <tt>/usr/share/doc</tt>.
+Ref: policy 12.5
+
+Tag: copyright-does-not-refer-to-common-license-file
+Type: warning
+Info: If your package uses any one of the licenses in
+ <tt>/usr/share/common-licenses</tt>, the copyright file should refer to
+ files therein.
+Ref: policy 12.5
+
+Tag: copyright-refers-to-incorrect-directory
+Type: error
+Ref: policy 12.5
+Info: In the directory name /usr/share/common-licenses, licenses is spelled
+ with an `s', not with as licences with a `c'.
+
+Tag: copyright-file-lacks-pointer-to-perl-license
+Type: error
+Ref: policy 12.5
+Info: If your package is released under the same terms as Perl itself,
+ it should refer to the Artistic and GPL license files in the
+ <tt>/usr/share/common-licenses</tt> directory.
+
+Tag: copyright-should-refer-to-common-license-file-for-gpl
+Type: error
+Ref: policy 12.5
+Info: The strings "GNU General Public License" or "GPL" appear in the
+ copyright file for this package, but the copyright file does not
+ reference <tt>/usr/share/common-licenses</tt> as the location of the GPL
+ on Debian systems.
+ .
+ If the package uses some other license that just mentions the GPL and
+ that Lintian should detect as an exception, please file a Lintian bug.
+ If the copyright file must mention the GPL for reasons other than stating
+ the license of the package, please add a Lintian override.
+
+Tag: copyright-should-refer-to-common-license-file-for-gfdl
+Type: error
+Ref: policy 12.5
+Info: The strings "GNU Free Documentation License" or "GFDL" appear in the
+ copyright file for this package, but the copyright file does not
+ reference <tt>/usr/share/common-licenses</tt> as the location of the GFDL
+ on Debian systems.
+ .
+ If the package uses some other license that just mentions the GFDL and
+ that Lintian should detect as an exception, please file a Lintian bug.
+ If the copyright file must mention the GPL for reasons other than stating
+ the license of the package, please add a Lintian override.
+
+Tag: copyright-should-refer-to-common-license-file-for-lgpl
+Type: error
+Ref: policy 12.5
+Info: The strings "GNU Lesser General Public License", "GNU Library
+ General Public License", or "LGPL" appear in the copyright file for this
+ package, but the copyright file does not reference
+ <tt>/usr/share/common-licenses</tt> as the location of the LGPL on Debian
+ systems.
+ .
+ If the package uses some other license that just mentions the LGPL and
+ that Lintian should detect as an exception, please file a Lintian bug.
+ If the copyright file must mention the GPL for reasons other than stating
+ the license of the package, please add a Lintian override.
+
+Tag: copyright-lists-upstream-authors-with-dh_make-boilerplate
+Type: warning
+Info: There is "Upstream Author(s)" in your copyright file. This was most
+ likely a remnant from the dh_make template.
+ .
+ There's either one upstream author, in which case you should remove the
+ "(s)", or there are several upstream authors, in which case you should
+ remove the "(" and ")".
+ .
+ o/~ join us now and carefully edit debian/copyright files! o/~
+
+Tag: copyright-has-url-from-dh_make-boilerplate
+Type: warning
+Ref: 12.5
+Info: There is "url://example.com" in your copyright file. This was most
+ likely a remnant from the dh_make template.
+ .
+ Make sure you include the real location where you obtained the
+ upstream sources (if any).
+
+Tag: debian-copyright-file-uses-obsolete-national-encoding
+Type: warning
+Info: The Debian copyright file should be valid UTF-8, an encoding of
+ the Unicode character set.
+ .
+ There are many ways to convert a copyright file from an obsoleted encoding
+ like ISO-8859-1; you may for example use "iconv" like:
+ .
+  $ iconv -f ISO-8859-1 -t UTF-8 copyright &gt; copyright.new
+  $ mv copyright.new copyright
+
+Tag: copyright-contains-dh_make-todo-boilerplate
+Type: warning
+Ref: policy 12.5
+Info: The string "Please also look if..." appears in the copyright
+ file, which indicates that you either didn't check the whole source
+ to find additional copyright/license, or that you didn't remove that
+ paragraph after having done so.
+
+Tag: copyright-contains-dh-make-perl-boilerplate
+Type: warning
+Ref: policy 12.5
+Info: The string "This copyright info was automatically extracted..."
+ appears in the copyright file, which indicates that you either didn't
+ check the whole source to find additional copyright/license, or that
+ you didn't remove that paragraph after having done so.
+
+Tag: copyright-without-copyright-notice
+Type: warning
+Ref: http://ftp-master.debian.org/REJECT-FAQ.html
+Info: The copyright file for this package does not appear to contain a
+ copyright notice.  You should copy the copyright notice from the upstream
+ source (or add one of your own for a native package).  A copyright notice
+ must consist of Copyright, Copr., or the Unicode symbol of C in a circle
+ followed by the years and the copyright holder.  A copyright notice is
+ not required for a work to be copyrighted, but Debian requires the
+ copyright file include the authors and years of copyright, and including
+ a valid copyright notice is the best way to do that.
+ .
+ If the package is in the public domain rather than copyrighted, be sure
+ to mention "public domain" in the copyright file.  Please be aware that
+ this is very rare and not the same as a DFSG-free license.  True public
+ domain software is generally limited to such special cases as a work
+ product of a United States government agency.
+
+Tag: spelling-error-in-copyright
+Type: warning
+Info: Lintian found a spelling error in the copyright file.  Lintian has a
+ list of common misspellings that it looks for.  It does not have a
+ dictionary like a spelling checker does.
+
+Tag: possible-gpl-code-linked-with-openssl
+Type: warning
+Info: This package appears to be covered by the GNU GPL but depends on
+ the OpenSSL libssl package and does not mention a license exemption or
+ exception for OpenSSL in its copyright file.  The GPL (including version
+ 3) is incompatible with some terms of the OpenSSL license, and therefore
+ Debian does not allow GPL-licensed code linked with OpenSSL libraries
+ unless there is a license exception explicitly permitting this.
+ .
+ If only the Debian packaging, or some other part of the package not
+ linked with OpenSSL, is covered by the GNU GPL, please add a lintian
+ override for this tag.  Lintian currently has no good way of
+ distinguishing between that case and problematic packages.
+
+Tag: debian-copyright-line-too-long
+Type: warning
+Info: One or more lines in the copyright file contain more than 80 characters.
+ For the benefit of users of 80x25 terminals, it is recommended that the
+ lines do not exceed 80 characters.
+Ref: policy 12.5
+
diff --git a/nokia-lintian/checks/cruft b/nokia-lintian/checks/cruft
new file mode 100644 (file)
index 0000000..ae58ad3
--- /dev/null
@@ -0,0 +1,240 @@
+# cruft -- lintian check script -*- perl -*-
+#
+# based on debhelper check,
+# Copyright (C) 1999 Joey Hess
+# Copyright (C) 2000 Sean 'Shaleh' Perry
+# Copyright (C) 2002 Josip Rodin
+# Copyright (C) 2007 Russ Allbery
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::cruft;
+use strict;
+
+use Dep;
+use Tags;
+use Util;
+
+use Cwd;
+use File::Find;
+use File::Basename;
+
+# All the packages that may provide config.{sub,guess} during the build, used
+# to suppress warnings about outdated autotools helper files.
+my $autotools_pkgs = join ' | ',
+    qw(autotools-dev automake automaken automake1.4 automake1.7 automake1.8
+       automake1.9 automake1.10);
+
+# Directory checks.  These regexes match a directory that shouldn't be in the
+# source package and associate it with a tag (minus the leading
+# source-contains or diff-contains).  Note that only one of these regexes
+# should trigger for any single directory.
+my @directory_checks =
+    ([ qr,^(.+/)?CVS$,        => 'cvs-control-dir'  ],
+     [ qr,^(.+/)?\.svn$,      => 'svn-control-dir'  ],
+     [ qr,^(.+/)?\.bzr$,      => 'bzr-control-dir'  ],
+     [ qr,^(.+/)?\{arch\}$,   => 'arch-control-dir' ],
+     [ qr,^(.+/)?\.arch-ids$, => 'arch-control-dir' ],
+     [ qr!^(.+/)?,,.+$!       => 'arch-control-dir' ],
+     [ qr,^(.+/)?\.git$,      => 'git-control-dir'  ],
+     [ qr,^(.+/)?\.hg$,       => 'hg-control-dir'   ],
+     [ qr,^(.+/)?\.be$,       => 'bts-control-dir'  ],
+     [ qr,^(.+/)?\.ditrack$,  => 'bts-control-dir'  ],
+    );
+
+# File checks.  These regexes match files that shouldn't be in the source
+# package and associate them with a tag (minus the leading source-contains or
+# diff-contains).  Note that only one of these regexes should trigger for any
+# given file.  If the third column is a true value, don't issue this tag
+# unless the file is included in the diff; it's too common in source packages
+# and not important enough to worry about.
+my @file_checks =
+    ([ qr,^(.+/)?svn-commit\.(.+\.)?tmp$, => 'svn-commit-file'        ],
+     [ qr,^(.+/)?svk-commit.+\.tmp$,      => 'svk-commit-file'        ],
+     [ qr,^(.+/)?\.arch-inventory$,       => 'arch-inventory-file'    ],
+     [ qr,^(.+/)?\.\#(.+?)\.\d+(\.\d+)*$, => 'cvs-conflict-copy'      ],
+     [ qr,^(.+/)?(.+?)\.(r\d+)$,          => 'svn-conflict-file'      ],
+     [ qr,\.(orig|rej)$,                  => 'patch-failure-file',  1 ],
+     [ qr,((^|/)\.[^/]+\.swp|~)$,         => 'editor-backup-file',  1 ],
+    );
+
+# Records files warned about in the diff so that we don't warn about them
+# again in the source checks.
+my %warned;
+
+# Whether this is a native Debian package.
+my $native;
+
+my $dir;
+my $atdinbd;
+
+# Used in the find function.
+my $pkg;
+my $info;
+
+sub run {
+
+$pkg = shift;
+my $type = shift;
+$info = shift;
+
+if (-e "debfiles/files" and not -z "debfiles/files") {
+    tag 'debian-files-list-in-source';
+}
+
+# This doens't really belong here, but there isn't a better place at the
+# moment to put this check.
+if ($info->native) {
+    my $version = $info->field('version');
+    if ($version =~ /-/ and $version !~ /-0\.[^-]+$/) {
+        tag 'native-package-with-dash-version';
+    }
+}
+
+# Check if this is a documentation package that's not arch: all.  This doesn't
+# really belong here either.
+my $arch;
+if (open IN, '<', "fields/architecture") {
+    chop($arch = <IN>);
+    close IN;
+    if ($pkg =~ /-docs?$/ && $arch ne 'all') {
+        tag 'documentation-package-not-architecture-independent';
+    }
+}
+
+# Read build-depends file and see if it depends on autotools-dev or automake.
+# I'm not thrilled with having the automake exception as well, but people do
+# depend on autoconf and automake and then use autoreconf to update
+# config.guess and config.sub, and automake depends on autotools-dev.
+$atdinbd = 0;
+if (open IN, '<', "fields/build-depends") {
+    my $bd;
+    chop($bd = <IN>);
+    close IN;
+    $atdinbd = 1 if Dep::implies(Dep::parse($bd), Dep::parse($autotools_pkgs));
+}
+
+check_diffstat("diffstat");
+find(\&find_cruft, 'unpacked');
+
+} # </run>
+
+# -----------------------------------
+
+# Check the diff for problems.  Record any files we warn about in %warned so
+# that we don't warn again when checking the full unpacked source.  Takes the
+# name of a file containing diffstat output.
+#
+# Exclude the lintian package itself from many of these checks, since it
+# includes many of these problems in its test suite.
+sub check_diffstat {
+    my ($diffstat) = @_;
+    open(STAT, '<', $diffstat) or fail("cannot open $diffstat: $!");
+    local $_;
+    while (<STAT>) {
+        my ($file) = (m,^\s+(.*?)\s+\|,)
+            or fail("syntax error in diffstat file: $_");
+
+        # We only care about diffs that add files.  If the file is being
+        # modified, that's not a problem with the diff and we'll catch it
+        # later when we check the source.  This regex doesn't catch only file
+        # adds, just any diff that doesn't remove lines from a file, but it's
+        # a good guess.
+        next unless m,\|\s+\d+\s+\++$,;
+
+        # diffstat output contains only files, but we consider the directory
+        # checks to trigger if the diff adds any files in those directories.
+        my ($directory) = ($file =~ m,^(.*)/[^/]+$,);
+        if ($directory and not $warned{$directory}) {
+            for my $rule (@directory_checks) {
+                if ($directory =~ /$rule->[0]/) {
+                    tag "diff-contains-$rule->[1]", $directory;
+                    $warned{$directory} = 1;
+                }
+            }
+        }
+
+        # Now the simpler file checks.
+        for my $rule (@file_checks) {
+            if ($file =~ /$rule->[0]/) {
+                tag "diff-contains-$rule->[1]", $file;
+                $warned{$file} = 1;
+            }
+        }
+
+        # Additional special checks only for the diff, not the full source.
+        if ($file =~ m,^debian/substvars$,) {
+            tag 'diff-contains-substvars', $file;
+        }
+    }
+    close(STAT) or fail("error reading diffstat file: $!");
+}
+
+# Check each file in the source package for problems.  By the time we get to
+# this point, we've already checked the diff and warned about anything added
+# there, so we only warn about things that weren't in the diff here.
+#
+# Report problems with native packages using the "diff-contains" rather than
+# "source-contains" tag.  The tag isn't entirely accurate, but it's better
+# than creating yet a third set of tags, and this gets the severity right.
+sub find_cruft {
+    (my $name = $File::Find::name) =~ s,^(\./)?unpacked/,,;
+    my $prefix = ($info->native ? "diff-contains" : "source-contains");
+    if (-d and not $warned{$name}) {
+        for my $rule (@directory_checks) {
+            if ($name =~ /$rule->[0]/) {
+                tag "${prefix}-$rule->[1]", $name unless $pkg eq 'lintian';
+            }
+        }
+    }
+    -f or return; # we just need normal files for the rest
+
+    unless ($warned{$name}) {
+        for my $rule (@file_checks) {
+            next if ($rule->[2] and not $info->native);
+            if ($name =~ /$rule->[0]/) {
+                tag "${prefix}-$rule->[1]", $name unless $pkg eq 'lintian';
+            }
+        }
+    }
+
+    # Tests of autotools files are a special case.  Ignore debian/config.cache
+    # as anyone doing that probably knows what they're doing and is using it
+    # as part of the build.
+    if ($name =~ m,^(.+/)?config.(?:cache|log|status)$,) {
+        if ($name !~ m,^debian/config\.cache$, and $pkg ne 'lintian') {
+            tag "configure-generated-file-in-source", $name;
+        }
+    } elsif ($name =~ m,^(.+/)?config.(?:guess|sub)$, and not $atdinbd) {
+        my $b = basename $name;
+        open (F, '<', $b) or die "can't open $name: $!";
+        while (<F>) {
+            last if $. > 10; # it's on the 6th line, but be a bit more lenient
+            if (/^(?:timestamp|version)='(\d+)(.+)'$/ and $1 < 2004) {
+                tag "outdated-autotools-helper-file", $name, "$1$2";
+            }
+        }
+        close F;
+    }
+}
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: ts=8 sw=4 noet syntax=perl
diff --git a/nokia-lintian/checks/cruft.desc b/nokia-lintian/checks/cruft.desc
new file mode 100644 (file)
index 0000000..353a58e
--- /dev/null
@@ -0,0 +1,265 @@
+Check-Script: cruft
+Author: Sean 'Shaleh' Perry <shaleh@debian.org>
+Abbrev: deb
+Type: source
+Unpack-Level: 2
+Info: This looks for cruft in Debian packaging or upstream source
+Needs-Info: debfiles, diffstat
+
+Tag: native-package-with-dash-version
+Type: warning
+Info: Native packaging should only be used if a piece of software was
+ written specifically to be turned into a Debian package. In this case,
+ the version number should not contain a debian revision part.
+ .
+ Native source packages are sometimes created by accident. In most cases
+ the reason is the location of the original source tarball. dpkg-source
+ searches for this in ../package_upstream-version.orig.tar.gz.
+
+Tag: documentation-package-not-architecture-independent
+Type: warning
+Info: Documentation packages usually shouldn't carry anything that requires
+ recompiling on various architectures, in order to save space on mirrors.
+
+Tag: debian-files-list-in-source
+Type: error
+Info: Leaving <tt>debian/files</tt> causes problems for the autobuilders,
+ since that file will likely include the list of .deb files for another
+ architecture, which will cause dpkg-buildpackage run by the buildd to fail.
+ .
+ The clean rule for the package should remove this file.
+
+Tag: diff-contains-cvs-control-dir
+Type: warning
+Info: The Debian diff or native package contains files in a CVS directory.
+ These are usually artifacts of the revision control system used by the
+ Debian maintainer and not useful in a diff or native package.  Passing
+ <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
+
+Tag: source-contains-cvs-control-dir
+Type: info
+Info: The upstream source contains a CVS directory.  It was most likely
+ included by accident since CVS directories usually don't belong in
+ releases.  When packaging a CVS snapshot, export from CVS rather than use
+ a checkout.  If an upstream release tarball contains CVS directories, you
+ usually should report this as a bug to upstream.
+
+Tag: diff-contains-svn-control-dir
+Type: warning
+Info: The Debian diff or native package contains files in an .svn
+ directory.  These are usually artifacts of the revision control system
+ used by the Debian maintainer and not useful in a diff or native package.
+ Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
+
+Tag: source-contains-svn-control-dir
+Type: info
+Info: The upstream source contains an .svn directory.  It was most likely
+ included by accident since Subversion version control directories
+ usually don't belong in releases.  When packaging a Subversion snapshot,
+ export from subversion rather than checkout.  If an upstream release
+ tarball contains .svn directories, this should be reported as a bug to
+ upstream since it can double the size of the tarball to no purpose.
+
+Tag: diff-contains-bzr-control-dir
+Type: warning
+Info: The Debian diff or native package contains files in a .bzr
+ directory.  These are usually artifacts of the revision control system
+ used by the Debian maintainer and not useful in a diff or native package.
+ Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
+
+Tag: source-contains-bzr-control-dir
+Type: info
+Info: The upstream source contains a .bzr directory. It was most likely
+ included by accident since bazaar-ng version control directories usually
+ don't belong in releases and may contain the entire repository.  When
+ packaging a bzr snapshot, use bzr export to create a clean tree.  If an
+ upstream release tarball contains .bzr directories, you should usually
+ report this as a bug upstream.
+
+Tag: diff-contains-arch-control-dir
+Type: warning
+Info: The Debian diff or native package contains files in an {arch} or
+ .arch-ids directory or a directory starting with <tt>,,</tt> (used by baz
+ for debugging traces).  These are usually artifacts of the revision
+ control system used by the Debian maintainer and not useful in a diff or
+ native package.  Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the
+ equivalent will automatically exclude them.
+
+Tag: source-contains-arch-control-dir
+Type: info
+Info: The upstream source contains an {arch} or .arch-ids directory or a
+ directory starting with <tt>,,</tt> (used by baz for debugging traces).
+ It was most likely included by accident since Arch version control
+ directories usually don't belong in releases.  If an upstream release
+ tarball contains these directories, you should usually report this as a
+ bug upstream.
+
+Tag: diff-contains-git-control-dir
+Type: warning
+Info: The Debian diff or native package contains files in a .git
+ directory.  These are usually artifacts of the revision control system
+ used by the Debian maintainer and not useful in a diff or native package.
+ Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
+
+Tag: source-contains-git-control-dir
+Type: info
+Info: The upstream source contains a .git directory. It was most likely
+ included by accident since git version control directories usually don't
+ belong in releases and may contain a complete copy of the repository.  If
+ an upstream release tarball contains .git directories, you should usually
+ report this as a bug upstream.
+
+Tag: diff-contains-hg-control-dir
+Type: warning
+Info: The Debian diff or native package contains files in a .hg
+ directory.  These are usually artifacts of the revision control system
+ used by the Debian maintainer and not useful in a diff or native package.
+ Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the equivalent will
+ automatically exclude them.
+
+Tag: source-contains-hg-control-dir
+Type: info
+Info: The upstream source contains a .hg directory. It was most likely
+ included by accident since hg version control directories usually don't
+ belong in releases and may contain a complete copy of the repository.  If
+ an upstream release tarball contains .hg directories, you should usually
+ report this as a bug upstream.
+
+Tag: diff-contains-svn-commit-file
+Type: warning
+Info: The Debian diff or native package contains an
+ <tt>svn-commit(.NNN).tmp</tt>, almost certainly a left-over from a failed
+ Subversion commit by the Debian package maintainer.
+
+Tag: source-contains-svn-commit-file
+Type: info
+Info: The upstream source contains an <tt>svn-commit(.NNN).tmp</tt>,
+ almost certainly a left-over from a failed Subversion commit.  You may
+ want to report this as an upstream bug.
+
+Tag: diff-contains-svk-commit-file
+Type: warning
+Info: The Debian diff or native package contains an
+ <tt>svk-commitNNN.tmp</tt>, almost certainly a left-over from a failed
+ svk commit by the Debian package maintainer.
+
+Tag: source-contains-svk-commit-file
+Type: info
+Info: The upstream source contains an <tt>svk-commitNNN.tmp</tt>,
+ almost certainly a left-over from a failed Subversion commit.  You may
+ want to report this as an upstream bug.
+Tag: diff-contains-arch-inventory-file
+Type: warning
+Info: The Debian diff or native package contains an
+ <tt>.arch-inventory</tt> file.  This is Arch metadata that should
+ normally not be distributed.
+
+Tag: source-contains-arch-inventory-file
+Type: info
+Info: The upstream source contains an <tt>.arch-inventory</tt> file.  This
+ is Arch metadata that should normally not be distributed.  You may want
+ to report this as an upstream bug.
+
+Tag: diff-contains-cvs-conflict-copy
+Type: warning
+info: The Debian diff or native package contains a CVS conflict copy.
+ These have file names like <tt>.#file.version</tt> and are generated by
+ CVS when a conflict was detected when merging local changes with updates
+ from a source repository.  They're useful only while resolving the
+ conflict and should not be included in the package.
+
+Tag: source-contains-cvs-conflict-copy
+Type: info
+info: The upstream source contains a CVS conflict copy.  These have file
+ names like <tt>.#file.version</tt> and are generated by CVS when a
+ conflict was detected when merging local changes with updates from a
+ source repository.  They're useful only while resolving the conflict and
+ were probably included by accident.  You may want to report this as an
+ upstream bug.
+Tag: diff-contains-svn-conflict-file
+Type: warning
+info: The Debian diff or native package contains a file that looks like a
+ Subversion conflict file.  These are generated by Subversion when a
+ conflict was detected while merging local changes with updates from a
+ source repository.  Use <tt>svn resolved</tt> to remove them and clear
+ the Subversion conflict state after you have resolved the conflict.
+
+Tag: source-contains-svn-conflict-file
+Type: info
+info: The upstream source contains a file that looks like a Subversion
+ conflict file.  These are generated by Subversion when a conflict was
+ detected while merging local changes with updates from a source
+ repository.  They're useful only while resolving the conflict and
+ were probably included by accident.  You may want to report this as an
+ upstream bug.
+
+Tag: diff-contains-patch-failure-file
+Type: warning
+Info: The Debian diff or native package contains a file that looks like
+ the files left behind by the <tt>patch</tt> utility when it cannot
+ completely apply a diff.  This may be left over from a patch applied by
+ the maintainer.  Normally such files should not be included in the
+ package.
+
+Tag: diff-contains-editor-backup-file
+Type: info
+Info: The Debian diff or native package contains a file ending in
+ <tt>~</tt> or of the form <tt>.xxx.swp</tt>, which is normally either an
+ Emacs or vim backup file or a backup file created by programs such as
+ <tt>autoheader</tt> or <tt>debconf-updatepo</tt>.  This usually causes no
+ harm, but it's messy and bloats the size of the Debian diff to no useful
+ purpose.
+
+Tag: diff-contains-substvars
+Type: warning
+Info: Lintian found a substvars file in the Debian diff for this source 
+ package. The debian/substvars file is usually generated and modified
+ dynamically by debian/rules targets, in which case it must be removed by
+ the clean target.
+Ref: policy 4.9
+
+Tag: configure-generated-file-in-source
+Type: warning
+Info: Leaving config.cache/status causes autobuilders problems.
+ config.cache and config.status are produced by GNU autoconf's configure
+ scripts. If they are left in the source package, autobuilders may pick
+ up settings for the wrong architecture.
+ .
+ The clean rule in <tt>debian/rules</tt> should remove this file. This
+ should ideally be done by fixing the upstream build system to do it when
+ you run the appropriate cleaning command (and don't forget to forward the
+ fix to the upstream authors so it doesn't happen in the next release). If
+ that is already implemented, then make sure you are indeed cleaning it in
+ the clean rule. If all else fails, a simple rm -f should work.
+ .
+ Note that Lintian cannot reliably detect the removal in the clean rule,
+ so once you fix this, please ignore or override this warning.
+
+Tag: outdated-autotools-helper-file
+Type: error
+Info: The referenced file has a time stamp older than year 2004 and the
+ package does not build-depend on autotools-dev or automake and therefore
+ apparently does not update it. This usually means that the source package
+ will not work correctly on all currently released architectures.
+ .
+ Read /usr/share/doc/autotools-dev/README.Debian.gz (from the
+ autotools-dev package) for information on how to fix this problem.
+
+Tag: diff-contains-bts-control-dir
+Type: warning
+Info: The Debian diff or native package contains files in a directory
+ used by a bug tracking system, which are not useful in a diff or native
+ package. Passing <tt>-i</tt> to <tt>dpkg-buildpackage</tt> or the
+ equivalent will automatically exclude them.
+
+Tag: source-contains-bts-control-dir
+Type: info
+Info: The upstream source contains a directory used by a bug tracking
+ system. It was most likely included by accident since bug tracking system
+ directories usually don't belong in releases.
diff --git a/nokia-lintian/checks/debconf b/nokia-lintian/checks/debconf
new file mode 100644 (file)
index 0000000..f643e03
--- /dev/null
@@ -0,0 +1,566 @@
+# debconf -- lintian check script -*- perl -*-
+
+# Copyright (C) 2001 Colin Watson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::debconf;
+use strict;
+use Tags;
+
+use Dep;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+# From debconf-devel(7), section 'THE TEMPLATES FILE', up to date with debconf
+# version 1.3.22.  Added indices for cdebconf (indicates sort order for
+# choices); debconf doesn't support it, but it ignores it, which is safe
+# behavior.
+my %template_fields;
+map { $template_fields{$_}=1 }
+    qw(template type choices indices default description);
+
+# From debconf-devel(7), section 'THE TEMPLATES FILE', up to date with debconf
+# version 1.3.22
+my %valid_types;
+map { $valid_types{$_}=1 } qw(
+       string
+       password
+       boolean
+       select
+       multiselect
+       note
+       text
+       title
+       error
+       );
+
+# From debconf-devel(7), section 'THE DEBCONF PROTOCOL' under 'INPUT', up to
+# date with debconf version 1.5.3.
+my %valid_priorities = map { $_ => 1 }
+    qw(low medium high critical);
+
+# All the packages that provide debconf functionality.  Anything using debconf
+# needs to have dependencies that satisfy one of these.
+my @debconfs = qw(debconf debconf-2.0 cdebconf cdebconf-udeb libdebconfclient0
+                  libdebconfclient0-udeb);
+
+my $seenconfig='';
+my $seentemplates='';
+my $usespreinst='';
+my $usesmultiselect='';
+
+if ($type eq 'source') {
+    open(BINARY, '<', "fields/binary") or fail("Can't open fields/binary: $!");
+    my $binaries = <BINARY>;
+    close BINARY;
+    chomp $binaries;
+    my @files = map { "$_.templates" } split /,\s+/, $binaries;
+    push @files, "templates";
+
+    foreach my $file (@files) {
+       my $templates_file = "debfiles/$file";
+       my $binary = $file;
+       $binary =~ s/\.?templates$//;
+       # Single binary package (so @files contains "templates" and
+       # "binary.templates")?
+       if (!$binary and $#files == 1) {
+           $binary = $binaries;
+       }
+
+       if (-f $templates_file) {
+           my @templates = read_dpkg_control($templates_file, "templates file");
+
+           foreach my $template (@templates) {
+               if (exists $template->{template} and exists $template->{_choices}) {
+                   tag "template-uses-unsplit-choices",
+                       "$binary - $template->{template}";
+               }
+           }
+       }
+    }
+
+    # The remainder of the checks are for binary packages, so we exit now
+    return 0;
+}
+
+if (open(PREINST, '<', "control/preinst")) {
+    while (<PREINST>) {
+       s/#.*//;    # Not perfect for Perl, but should be OK
+       if (m,/usr/share/debconf/confmodule, or
+               m/(?:Debconf|Debian::DebConf)::Client::ConfModule/) {
+           $usespreinst=1;
+           last;
+       }
+    }
+    close PREINST;
+}
+
+if (-f "control/config") {
+    $seenconfig=1;
+}
+if (-f "control/templates") {
+    $seentemplates=1;
+}
+
+# This still misses packages that use debconf only in the postrm.  Packages
+# that ask debconf questions in the postrm should load the confmodule in the
+# postinst so that debconf can register their templates.
+return unless $seenconfig or $seentemplates or $usespreinst;
+
+# parse depends info for later checks
+
+# Consider every package to depend on itself.
+my $version;
+if (-f "fields/version") {
+    open(IN, '<', "fields/version") or fail("Can't open fields/version: $!");
+    chomp($_ = <IN>);
+    $version = "$pkg (= $_)";
+    close IN;
+}
+
+my (%dependencies, @alldeps);
+
+for my $field (qw(depends pre-depends)) {
+    if (-f "fields/$field") {
+       open(IN, '<', "fields/$field") or fail("Can't open fields/$field: $!");
+       chomp($_ = <IN>);
+       close IN;
+       $_ .= ", $version" if defined $version;
+        push @alldeps, $_;
+       $dependencies{$field} = Dep::parse($_);
+    } else {
+       my $dep = $version;
+       push @alldeps, $dep;
+       $dependencies{$field} = Dep::parse($dep);
+    }
+}
+
+my $alldependencies = Dep::parse(join ', ', @alldeps);
+
+# See if the package depends on dbconfig-common.  Packages that do are allowed
+# to have a config file with no templates, since they use the dbconfig-common
+# templates.
+my $usesdbconfig = Dep::implies($alldependencies, Dep::parse('dbconfig-common'));
+
+# Check that both debconf control area files are present.
+if ($seenconfig and not $seentemplates and not $usesdbconfig) {
+    tag "no-debconf-templates", "";
+} elsif ($seentemplates and not $seenconfig and not $usespreinst and $type ne 'udeb') {
+    tag "no-debconf-config", "";
+}
+
+if ($seenconfig and not -x "control/config") {
+    tag "debconf-config-not-executable", "";
+}
+
+# First check that templates look valid
+if ($seentemplates) {
+    open(TMPL, '<', "control/templates")
+        or fail("Can't open control/templates: $!");
+    local $/ = "\n\n";
+    while (<TMPL>) {
+       chomp;
+       my %fields = ();
+       my $name = 'unknown';
+
+       foreach my $line (split "\n", $_) {
+           if ($line =~ s/^([-_.A-Za-z0-9]+):\s*(.+)//) {
+               $fields{$1}++;
+               $name = $2 if ($1 eq 'Template');
+           }
+       }
+
+       foreach (keys %fields) {
+           if ($fields{$_} > 1) {
+               tag "duplicate-fields-in-templates", "$name $_";
+               #  Templates file is corrupted, no need to report
+               #  further errors
+               $seentemplates = '';
+           }
+       }
+    }
+    close TMPL;
+}
+
+# Lots of template checks.
+
+my @templates = $seentemplates ? read_dpkg_control("control/templates", "templates file") : ();
+my %potential_db_abuse;
+my @templates_seen;
+
+foreach my $template (@templates) {
+    my $isselect='';
+
+    if (not exists $template->{template}) {
+       tag "no-template-name", "";
+       $template->{template} = 'no-template-name';
+    } else {
+       push @templates_seen, $template->{template};
+       if ($template->{template}!~m|[A-Za-z0-9.+-](?:/[A-Za-z0-9.+-])|) {
+           tag "malformed-template-name", "$template->{template}";
+       }
+    }
+
+    if (not exists $template->{type}) {
+       tag "no-template-type", "$template->{template}";
+    } elsif (not $valid_types{$template->{type}}) {
+       tag "unknown-template-type", "$template->{type}";
+    } elsif ($template->{type} eq 'select') {
+       $isselect=1;
+    } elsif ($template->{type} eq 'multiselect') {
+       $isselect=1;
+       $usesmultiselect=1;
+    } elsif ($template->{type} eq 'error') {
+        unless (Dep::implies($alldependencies, Dep::parse('debconf (>= 1.4.69) | cdebconf'))) {
+            tag "debconf-error-requires-versioned-depends", "$template->{template}"
+                unless $type eq 'udeb';
+        }
+    } elsif ($template->{type} eq 'boolean') {
+       tag "boolean-template-has-bogus-default",
+           "$template->{template} $template->{default}"
+               if defined $template->{default}
+                   and $template->{default} ne 'true'
+                   and $template->{default} ne 'false';
+    }
+
+    if ($template->{choices} && ($template->{choices} !~ /^\s*$/)) {
+       my $nrchoices = count_choices ($template->{choices});
+       for my $key (keys %$template) {
+           if ($key =~ /^choices-/) {
+               if (! $template->{$key} || ($template->{$key} =~ /^\s*$/)) {
+                   tag "empty-translated-choices", "$template->{template} $key";
+               }
+               if (count_choices ($template->{$key}) != $nrchoices) {
+                   tag "mismatch-translated-choices", "$template->{template} $key";
+               }
+           }
+       }
+       if ($template->{choices} =~ /^\s*(yes\s*,\s*no|no\s*,\s*yes)\s*$/i) {
+           tag "select-with-boolean-choices", "$template->{template}";
+       }
+    }
+
+    if ($isselect and not exists $template->{choices}) {
+       tag "select-without-choices", "$template->{template}";
+    }
+
+    if (not exists $template->{description}) {
+       tag "no-template-description", "$template->{template}";
+    } elsif ($template->{description}=~m/^\s*(.*?)\s*?\n\s*\1\s*$/) {
+       # Check for duplication. Should all this be folded into the
+       # description checks?
+       tag "duplicate-long-description-in-template",
+             "$template->{template}";
+    }
+
+    my %languages;
+    foreach my $field (sort keys %$template) {
+       # Tests on translations
+       my ($mainfield, $lang) = split m/-/, $field, 2;
+       if (defined $lang) {
+           $languages{$lang}{$mainfield}=1;
+       }
+       unless ($template_fields{$mainfield}) { # Ignore language codes here
+           tag "unknown-field-in-templates", "$template->{template} $field";
+       }
+    }
+
+    if ($template->{template} && $template->{type}) {
+        $potential_db_abuse{$template->{template}} = 1
+            if (($template->{type} eq "note") or ($template->{type} eq "text"));
+    }
+
+    # Check the description against the best practices in the Developer's
+    # Reference, but skip all templates where the short description contains
+    # the string "for internal use".
+    my ($short, $extended);
+    if (defined $template->{description}) {
+        $template->{description} =~ m/^([^\n]*)\n(.*)$/s;
+        ($short, $extended) = ($1, $2);
+        unless (defined $short) {
+            $short = $template->{description};
+        }
+    } else {
+        ($short, $extended) = ('', '');
+    }
+    my $type = $template->{type} || '';
+    unless ($short =~ /for internal use/i) {
+       my $isprompt = grep { $_ eq $type } qw(string password);
+        my $isselect = grep { $_ eq $type } qw(select multiselect);
+       if ($isprompt) {
+           if ($short && ($short !~ m/:$/ || $short =~ m/^(what|who|when|where|which|how)/i)) {
+               tag "malformed-prompt-in-templates", $template->{template};
+           }
+        }
+        if ($isselect) {
+           if ($short =~ /^(Please|Cho+se|Enter|Select|Specify|Give)/) {
+               tag "using-imperative-form-in-templates", $template->{template};
+           }
+       }
+       if ($type eq 'boolean') {
+           if ($short !~ /\?/) {
+               tag "malformed-question-in-templates", $template->{template};
+           }
+       }
+       if (defined ($extended) && $extended =~ /\?/) {
+           tag "using-question-in-extended-description-in-templates", $template->{template};
+       }
+       if ($type eq 'note') {
+           if ($short =~ /[.?;:]$/) {
+               tag "malformed-title-in-templates", $template->{template};
+           }
+       }
+       if (length ($short) > 75) {
+           tag "too-long-short-description-in-templates", $template->{template};
+       }
+        if (defined $template->{description}) {
+            if ($template->{description} =~ /(\A|\s)(I|[Mm]y|[Ww]e|[Oo]ur|[Oo]urs|mine|myself|ourself|me|us)(\Z|\s)/) {
+                tag "using-first-person-in-templates", $template->{template};
+            }
+            if ($template->{description} =~ /[ \'\"]yes[ \'\",;.]/i and $type eq 'boolean') {
+                tag "making-assumptions-about-interfaces-in-templates", $template->{template};
+            }
+        }
+
+       # Check whether the extended description is too long.
+       if ($extended) {
+           my $lines = 0;
+           for my $string (split ("\n", $extended)) {
+               while (length ($string) > 80) {
+                   my $pos = rindex ($string, ' ', 80);
+                   if ($pos == -1) {
+                       $pos = index ($string, ' ');
+                   }
+                   if ($pos == -1) {
+                       $string = '';
+                   } else {
+                       $string = substr ($string, $pos + 1);
+                       $lines++;
+                   }
+               }
+               $lines++;
+           }
+           if ($lines > 20) {
+               tag "too-long-extended-description-in-templates", $template->{template};
+           }
+       }
+    }
+}
+
+# Check the maintainer scripts.
+
+my $config_calls_db_input;
+my $db_purge;
+my %templates_used;
+my %template_aliases;
+for my $file (qw(config prerm postrm preinst postinst)) {
+    my $potential_makedev = {};
+    if (open(IN, '<', "control/$file")) {
+       my $usesconfmodule='';
+       my $obsoleteconfmodule='';
+       my $db_input='';
+       my $isdefault='';
+       my $usesseen='';
+
+       # Only check scripts.
+       my $fl = <IN>;
+       unless ($fl && $fl =~ /^\#!/) {
+           close IN;
+           next;
+       }
+
+       while (<IN>) {
+           s/#.*//;    # Not perfect for Perl, but should be OK
+           next unless m/\S/;
+           while (s%\\$%%) {
+               my $next = <IN>;
+               last unless $next;
+               $_ .= $next;
+           }
+           if (m,(?:\.|source)\s+/usr/share/debconf/confmodule, ||
+                   m/(use|require)\s+Debconf::Client::ConfModule/) {
+               $usesconfmodule=1;
+           }
+           if (not $obsoleteconfmodule and
+               m,(/usr/share/debconf/confmodule\.sh|
+                  Debian::DebConf::Client::ConfModule),x) {
+               tag "loads-obsolete-confmodule", "$file:$. $1";
+               $usesconfmodule=1;
+               $obsoleteconfmodule=1;
+           }
+           if ($file eq 'config' and m/db_input/) {
+               $config_calls_db_input = 1;
+           }
+           if ($file eq 'postinst' and not $db_input and m/db_input/
+               and not $config_calls_db_input) {
+               # TODO: Perl?
+               tag "postinst-uses-db-input", ""
+                   unless $type eq 'udeb';
+               $db_input=1;
+           }
+           if (m%/dev/%) {
+               $potential_makedev->{$.} = 1;
+           }
+           if (m/^\s*(?:db_input|db_text)\s+[\"\']?(\S+?)[\"\']?\s+(\S+)\s/) {
+               my ($priority, $template) = ($1, $2);
+               $templates_used{$template} = 1;
+               if ($priority !~ /^\$\S+$/) {
+                   tag "unknown-debconf-priority", "$file:$. $1"
+                       unless ($valid_priorities{$priority});
+                   tag "possible-debconf-note-abuse", "$file:$. $template"
+                       if ($potential_db_abuse{$template}
+                           and (not ($potential_makedev->{($. - 1)} and ($priority eq "low")))
+                           and ($priority =~ /^(low|medium)$/));
+               }
+           }
+           if (m/^\s*(?:db_get|db_set(?:title)?)\s+[\"\']?(\S+?)[\"\']?(\s|\Z)/) {
+               $templates_used{$1} = 1;
+           }
+           if (m/^\s*db_register\s+[\"\']?(\S+?)[\"\']?\s+(\S+)\s/) {
+               my ($template, $question) = ($1, $2);
+               push @{$template_aliases{$template}}, $question;
+           }
+           if (not $isdefault and m/db_fset.*isdefault/) {
+               # TODO: Perl?
+               tag "isdefault-flag-is-deprecated", "$file";
+               $isdefault=1;
+           }
+           if (not $db_purge and m/db_purge/) {    # TODO: Perl?
+               $db_purge=1;
+           }
+       }
+
+       if ($file eq 'postinst' or $file eq 'config') {
+           unless ($usesconfmodule) {
+               tag "$file-does-not-load-confmodule", ""
+                   unless ($type eq 'udeb' || ($file eq 'postinst' && !$seenconfig));
+           }
+       }
+
+       if ($file eq 'postrm') {
+           unless ($db_purge) {
+               tag "postrm-does-not-purge-debconf", "";
+           }
+       }
+
+       close IN;
+    } elsif ($file eq 'postinst') {
+       tag "$file-does-not-load-confmodule", ""
+           unless ($type eq 'udeb' || !$seenconfig);
+    } elsif ($file eq 'postrm') {
+       tag "postrm-does-not-purge-debconf", ""
+           unless ($type eq 'udeb');
+    }
+}
+
+foreach my $template (@templates_seen) {
+    my $used = 0;
+
+    if ($templates_used{$template}) {
+       $used = 1;
+    } else {
+       foreach my $alias (@{$template_aliases{$template}}) {
+           if ($templates_used{$alias}) {
+               $used = 1;
+               last;
+           }
+       }
+    }
+    tag "unused-debconf-template", $template
+       unless $used or $pkg eq "debconf";
+}
+
+# Check that the right dependencies are in the control file.  Accept any
+# package that might provide debconf functionality.
+
+my $anydebconf = Dep::parse(join (' | ', @debconfs));
+if ($usespreinst) {
+    unless (Dep::implies($dependencies{'pre-depends'}, $anydebconf)) {
+       tag "missing-debconf-dependency-for-preinst", ""
+           unless $type eq 'udeb';
+    }
+} else {
+    unless (Dep::implies($alldependencies, $anydebconf) or $usesdbconfig) {
+       tag "missing-debconf-dependency", "";
+    }
+}
+
+# Now make sure that no scripts are using debconf as a registry.
+# Unfortunately this requires us to unpack to level 2 and grep all the
+# scripts in the package.
+# the following checks is ignored if the package being checked is debconf
+# itself.
+
+return 0 if ($pkg eq "debconf") || ($type eq 'udeb');
+
+open(SCRIPTS, '<', "scripts") or fail("cannot open lintian scripts file: $!");
+while (<SCRIPTS>) {
+    chomp;
+
+    # From checks/scripts.
+    my ($calls_env, $interpreter, $filename) = m/^(env )?(\S*) (.*)$/
+       or fail("bad line in scripts file: $_");
+
+    open(IN, '<', "unpacked/$filename") or fail("cannot open $filename: $!");
+    while (<IN>) {
+       s/#.*//;    # Not perfect for Perl, but should be OK
+       if (m,/usr/share/debconf/confmodule, or
+               m/(?:Debconf|Debian::DebConf)::Client::ConfModule/) {
+           tag "debconf-is-not-a-registry", "$filename";
+           last;
+       }
+    }
+    close IN;
+}
+close SCRIPTS;
+
+} # </run>
+
+# -----------------------------------
+
+# Count the number of choices. Splitting code copied from debconf 1.5.8
+# (Debconf::Question).
+sub count_choices {
+    my ($choices) = @_;
+    my @items;
+    my $item = '';
+    for my $chunk (split /(\\[, ]|,\s+)/, $choices) {
+       if ($chunk =~ /^\\([, ])$/) {
+           $item .= $1;
+       } elsif ($chunk =~ /^,\s+$/) {
+           push (@items, $item);
+           $item = '';
+       } else {
+           $item .= $chunk;
+       }
+    }
+    push (@items, $item) if $item ne '';
+    return scalar (@items);
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl ts=8
diff --git a/nokia-lintian/checks/debconf.desc b/nokia-lintian/checks/debconf.desc
new file mode 100644 (file)
index 0000000..415e4b7
--- /dev/null
@@ -0,0 +1,325 @@
+Check-Script: debconf
+Author: Colin Watson <cjw44@flatline.org.uk>
+Abbrev: dc
+Type: binary, udeb, source
+Unpack-Level: 2
+Info: This looks for common mistakes in packages using debconf.
+Needs-Info: scripts
+
+Tag: missing-debconf-dependency
+Type: warning
+Info: Packages using debconf should depend on it, since debconf is not an
+ essential package.
+
+Tag: missing-debconf-dependency-for-preinst
+Type: warning
+Info: Packages using debconf in their preinst script must pre-depend
+ on debconf, with appropriate discussion on &debdev;.  Since debconf is
+ almost always already installed, this is normally better than depending
+ on it and falling back to a different configuration system.
+Tag: duplicate-fields-in-templates
+Type: error
+Info: A template contains two identical fields (with identical values or
+ not). This is either an error in this template, or two templates are
+ not properly separated by a lone newline.
+
+Tag: unknown-field-in-templates
+Type: error
+Info: See the Debconf Programmer's Tutorial for a list of the possible
+ fields in a debconf templates file.
+
+Tag: no-template-name
+Type: error
+Info: The templates file contains a template without a `Template:' field.
+
+Tag: malformed-template-name
+Type: error
+Info: The `Template:' field should contain more than one component, each
+ separated by a slash (`/'). Each component may only consist of the
+ alphanumeric characters, `+', `-', and `.'.
+
+Tag: no-template-type
+Type: error
+Info: The templates file contains a template without a `Type:' field.
+
+Tag: unknown-template-type
+Type: error
+Info: A `Type:' field in a templates file provided by this package uses an
+ unknown data type. Valid types are currently `string', `boolean', `select',
+ `multiselect', `note', `text', and `password'.
+
+Tag: empty-translated-choices
+Type: error
+Info: When the translation of a Choices: field is empty, the whole question
+ is skipped (and nothing is selected). Please verify that the translation
+ you're using is valid.
+
+Tag: mismatch-translated-choices
+Type: error
+Info: A `Choices:' field is a comma separated list, and translated
+ `Choices:' fields must have the exact same number of elements.  One
+ of the translations does not follow this rule, you should contact the
+ translator and request for a new translation where elements of `Choices:'
+ fields have no embedded commas.
+ .
+ Cdebconf understands escaped commas in such fields, but packages
+ outside the scope of debian-installer must not have them until they are
+ also supported by debconf.
+
+Tag: select-without-choices
+Type: error
+Info: Templates using the `select' or `multiselect' data types must provide
+ a `Choices:' field listing the possible values of the template.
+
+Tag: boolean-template-has-bogus-default
+Type: error
+Info: The `boolean' type in a debconf template, can have only two values: true
+ and false. The default has been set to something different.
+
+Tag: no-template-description
+Type: error
+Info: The templates file contains a template without a `Description:' field.
+
+Tag: duplicate-long-description-in-template
+Type: warning
+Info: The long description of one of the templates provided by this package
+ is a duplicate of the short description. If you cannot provide a good
+ extended description, it is better to leave it blank.
+
+Tag: config-does-not-load-confmodule
+Type: warning
+Info: The config script must load one of the debconf libraries.
+
+Tag: postinst-uses-db-input
+Type: warning
+Info: It is generally not a good idea for postinst scripts to use debconf
+ commands like <tt>db_input</tt>. Typically, they should restrict themselves
+ to <tt>db_get</tt> to request previously acquired information, and have the
+ config script do the actual prompting.
+
+Tag: postinst-does-not-load-confmodule
+Type: warning
+Info: Even if your postinst does not involve debconf, you currently need to
+ make sure it loads one of the debconf libraries. This will be changed in
+ the future.
+
+Tag: loads-obsolete-confmodule
+Type: warning
+Info: The maintainer script uses an obsolete name for a debconf confmodule.
+ Shell scripts should source <tt>/usr/share/debconf/confmodule</tt>, while
+ Perl scripts should use <tt>Debconf::Client::ConfModule</tt>.
+
+Tag: postrm-does-not-purge-debconf
+Type: warning
+Info: Packages using debconf should call <tt>db_purge</tt> or its equivalent
+ in their postrm. If the package uses debhelper, dh_installdebconf(1) should
+ take care of this.
+
+Tag: isdefault-flag-is-deprecated
+Type: warning
+Info: The 'isdefault' flag on debconf questions is deprecated as of debconf
+ 0.5.00, and has been replaced by 'seen' with the inverse meaning. From
+ debconf 0.5 onwards there should be very few reasons to use isdefault/seen
+ anyway, as backing up works much better now. See
+ /usr/share/doc/debconf-doc/changelog.gz for more information.
+ .
+ The misuse of isdefault often leads to questions being asked twice in one
+ installation run, or, worse, on every upgrade. Please test your package
+ carefully to make sure this does not happen.
+
+Tag: debconf-config-not-executable
+Type: error
+Info: The debconf `config' script in the package control area must be
+ executable.
+
+Tag: no-debconf-config
+Type: warning
+Info: The package contains a `templates' file in its control area but has no
+ corresponding `config' script. This is occasionally OK, but is usually an
+ error.
+
+Tag: no-debconf-templates
+Type: warning
+Info: The package contains a `config' script in its control area but has no
+ corresponding `templates' file. This is occasionally OK, but is usually an
+ error.
+
+Tag: debconf-is-not-a-registry
+Type: warning
+Info: In the Unix tradition, Debian packages should have human-readable and
+ human-editable configuration files. This package uses debconf commands
+ outside its maintainer scripts, which often indicates that it is taking
+ configuration information directly from the debconf database. Typically,
+ packages should use debconf-supplied information to generate configuration
+ files, and - to avoid losing configuration information on upgrades - should
+ parse these configuration files in the `config' script if it is necessary
+ to ask the user for changes.
+ .
+ Some standalone programs may legitimately use debconf to prompt the user
+ for questions. If you maintain a package containing such a program, please
+ install an override. Other exceptions to this check include configuration
+ scripts called from the package's post-installation script.
+
+Tag: debconf-error-requires-versioned-depends
+Type: info
+Info: Debconf only supports the error template type as of version 1.4.69.
+ Packages that use this template type should declare a dependency on that
+ version of debconf.
+ .
+ Since error types were added after debconf-2.0, one cannot use the normal
+ debconf-2.0 alternative to allow for cdebconf or other implementations.
+ Instead, use <tt>debconf (&gt;= 1.4.69) | cdebconf (&gt;= 0.39)</tt>.
+ .
+ All versions of debconf back to etch support error templates, but the
+ debconf released with sarge didn't, so this dependency is still helpful
+ for oldstable backports.
+
+Tag: malformed-prompt-in-templates
+Type: warning
+Info: The short description of a select, multiselect, string and password
+ debconf template is a prompt and not a title. Avoid question style
+ prompts ("IP Address?") in favour of "opened" prompts ("IP address:").
+ The use of colons is recommended.
+ .
+ If this template is only used internally by the package and not displayed
+ to the user, put "for internal use" in the short description.
+Ref: devref 6.5.4.2
+
+Tag: malformed-title-in-templates
+Type: warning
+Info: The short description of a note debconf template should be written
+ as a title and therefore should not end with a period, question mark,
+ colon, or semicolon.
+Ref: devref 6.5.4.2.4
+
+Tag: malformed-question-in-templates
+Type: warning
+Info: The short description of a boolean debconf template should be
+ phrased in the form of a question which should be kept short and should
+ generally end with a question mark. Terse writing style is permitted and
+ even encouraged if the question is rather long.
+ .
+ If this template is only used internally by the package and not displayed
+ to the user, put "for internal use" in the short description.
+Ref: devref 6.5.4.2.2
+
+Tag: using-question-in-extended-description-in-templates
+Type: warning
+Info: The extended description of a debconf template should never include
+ a question.
+ .
+ If this template is only used internally by the package and not displayed
+ to the user, put "for internal use" in the short description.
+Ref: devref 6.5.3.2
+
+Tag: using-imperative-form-in-templates
+Type: warning
+Info: Do not use useless imperative constructions such as "Please choose...",
+ "Enter...". The interface will make it obvious that the user needs to
+ choose or enter something.
+Ref: devref 6.5.4.2
+
+Tag: using-first-person-in-templates
+Type: warning
+Info: You should avoid the use of first person ("I will do this..." or
+ "We recommend..."). The computer is not a person and the Debconf
+ templates do not speak for the Debian developers. You should use neutral
+ construction and often the passive form.
+ .
+ If this template is only used internally by the package and not displayed
+ to the user, put "for internal use" in the short description.
+Ref: devref 6.5.2.5
+
+Tag: making-assumptions-about-interfaces-in-templates
+Type: warning
+Info: Template text should not make reference to widgets belonging to
+ some debconf interfaces. Sentences like "If you answer Yes..." have no
+ meaning for users of graphical interfaces which use checkboxes for
+ boolean questions.
+Ref: devref 6.5.2.4
+
+Tag: too-long-short-description-in-templates
+Type: warning
+Info: The short description should be kept short (50 characters or so) so
+ that it may be accomodated by most debconf interfaces. Keeping it short
+ also helps translators, as usually translations tend to end up being
+ longer than the original.
+Ref: devref 6.5.3.2
+
+Tag: too-long-extended-description-in-templates
+Type: warning
+Info: Some debconf interfaces cannot deal very well with descriptions of
+ more than about 20 lines, so try to keep the extended description below
+ this limit.
+Ref: devref 6.5.3.2
+
+Tag: unknown-debconf-priority
+Type: error
+Info: The given maintainer script calls db_input or or db_text with a
+ first argument that doesn't match one of the known priorities.  The
+ supported priorities are low, medium, high, and critical.
+Ref: debconf-devel(7)
+
+Tag: possible-debconf-note-abuse
+Type: warning
+Info: Debconf notes should be used only for important notes that the
+ user really should see, since debconf will go to great pains to make
+ sure the user sees it.
+ .
+ Displaying a note with a low priority is conflicting with this statement,
+ since using a low or medium priority shows that the note is not
+ important.
+ .
+ The right fix is NOT to increase the priority of the note, but to move
+ it somewhere else in the inline documentation, for example in a
+ README.Debian file for notes about package usability or NEWS.Debian for
+ changes in the package behavior, or to simply drop it if it is not
+ needed (e.g. "welcome" notes). Changing the templates type to "error"
+ can also be appropriate, such as for input validation errors.
+Ref: policy 3.9.1
+
+Tag: select-with-boolean-choices
+Type: warning
+Info: Select templates with only yes and no choices should use the boolean
+ type instead.
+Ref: debconf-devel(7)
+
+Tag: template-uses-unsplit-choices
+Type: warning
+Experimental: yes
+Info: The use of _Choices in templates is deprecated.
+ An _Choices field must be translated as a single string.
+ .
+ Using __Choices allows each choice to be translated separately, easing
+ translation and is therefore recommended.
+ .
+ Instead of simply replacing all occurrences of "_Choices" by "__Choices",
+ apply the method described in po-debconf(7) under "SPLITTING CHOICES
+ LIST", to avoid breaking existing translations.
+ .
+ If in doubt, please ask for help on the debian-i18n mailing list.
+Ref: po-debconf(7)
+
+Tag: unused-debconf-template
+Type: info
+Info: Templates which are not used by the package should be removed from
+ the templates file.
+ .
+ This will reduce the size of the templates database and prevent
+ translators from unnecessarily translating the template's text.
+ .
+ In some cases, the template is used but lintian is unable to determine
+ this.  Common causes are:
+ .
+ - the maintainer scripts embed a variable in to the template name in
+ order to allow a template to be selected from a range of similar
+ templates (e.g. 'db_input low start_$service_at_boot')
+ .
+ - the template is not used by the maintainer scripts but is used by
+ a program in the package
+ .
+ - the maintainer scripts are written in perl.  lintian currently only
+ understands the shell script debconf functions.
+ .
+ If any of the above applies, please install an override.
diff --git a/nokia-lintian/checks/debhelper b/nokia-lintian/checks/debhelper
new file mode 100644 (file)
index 0000000..d97bae0
--- /dev/null
@@ -0,0 +1,263 @@
+# debhelper format -- lintian check script -*- perl -*-
+
+# Copyright (C) 1999 by Joey Hess
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::debhelper;
+use strict;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Dep;
+
+my %commands;
+
+my $seencommand = '';
+my $needbuilddepends = '';
+my $needtomodifyscripts = '';
+my $needversiondepends = '';
+my $seenversiondepends = '0';
+my $compat = '';
+my $usescdbs = '';
+my $seendhpython = '';
+my $usescdbspython = '';
+
+# If there is no debian/compat file present but cdbs is being used, cdbs will
+# create one automatically.  Currently it always uses compatibility level 4.
+# It may be better to look at what version of cdbs the package depends on and
+# from that derive the compatibility level....
+
+my $cdbscompat = 5;
+
+# Parse the debian/rules file, and try to figure out if debhelper commands
+# are run in it that like to modify maintainer scripts. Those debhelper
+# commands can be found by "grep -l autoscript /usr/bin/dh_*", but I'll
+# hardcode them here.
+
+map { $commands{$_}=1 } qw(dh_desktop
+                          dh_gconf
+                          dh_icons
+                          dh_installcatalogs
+                          dh_installdebconf
+                           dh_installdefoma
+                           dh_installdocs
+                          dh_installemacsen
+                          dh_installinfo
+                          dh_installinit
+                          dh_installmenu
+                          dh_installmime
+                          dh_installmodules
+                          dh_installtex
+                          dh_installudev
+                          dh_installwm
+                          dh_installxfonts
+                          dh_installxmlcatalogs
+                          dh_makeshlibs
+                          dh_pycentral
+                          dh_pysupport
+                          dh_python
+                          dh_scrollkeeper
+                          dh_suidregister
+                          dh_usrlocal
+                          );
+
+# The version at which debhelper commands were introduced.  Packages that use
+# one of these commands must have a dependency on that version of debhelper or
+# newer.
+my %versions
+    = (dh_icons           => '5.0.51~',
+       dh_installifupdown => '5.0.44~',
+       dh_lintian         => '6.0.7~',
+       dh                 => '7');
+
+open(RULES, '<', "debfiles/rules") or fail("cannot read debian/rules: $!");
+my $dhcompatvalue;
+my @versioncheck;
+while (<RULES>) {
+    if (m/^\s+(dh_\w+)/) {
+        my $dhcommand = $1;
+       if ($dhcommand =~ /dh_testversion(?:\s+(.+))?/) {
+           $needversiondepends = $1 if ($1);
+            tag "dh_testversion-is-deprecated", "";
+       }
+       if ($dhcommand eq 'dh_dhelp') {
+           tag "dh_dhelp-is-deprecated", "";
+       }
+       if ($dhcommand eq 'dh_suidregister') {
+           tag "dh_suidregister-is-obsolete", "";
+       }
+       # if command is passed -n, it does not modify the scripts
+       if ($commands{$dhcommand} and not m/\s+\-n\s+/) {
+           $needtomodifyscripts = 1;
+       }
+        if ($versions{$dhcommand}) {
+            push (@versioncheck, $dhcommand);
+        }
+       $seencommand = 1;
+       $needbuilddepends = 1;
+    } elsif (m,^\s+dh\s+,) {
+       $seencommand = 1;
+       $needbuilddepends = 1;
+       push (@versioncheck, 'dh');
+    } elsif (m,^include\s+/usr/share/cdbs/1/rules/debhelper.mk,) {
+       $seencommand = 1;
+       $needbuilddepends = 1;
+       $needtomodifyscripts = 1;
+
+       # CDBS sets DH_COMPAT but doesn't export it.  It does, however, create
+       # a debian/compat file if none was found; that logic is handled later.
+       $dhcompatvalue = $cdbscompat;
+       $usescdbs = 1;
+    } elsif (/^\s*export\s+DH_COMPAT\s*:?=\s*(\d+)/) {
+       $needversiondepends = $1;
+    } elsif (/^\s*export\s+DH_COMPAT/) {
+       $needversiondepends = $dhcompatvalue if $dhcompatvalue;
+    } elsif (/^\s*DH_COMPAT\s*:?=\s*(\d+)/) {
+       $dhcompatvalue = $1;
+    }
+    if (/^\s+dh_python\s/) {
+        $seendhpython = 1;
+    } elsif (m,^include\s+/usr/share/cdbs/1/class/python-distutils.mk,) {
+        $usescdbspython = 1;
+    }
+}
+close RULES;
+
+return unless $seencommand;
+
+# We may need to make a difference between deb and udeb packages
+# so try to find out
+my (%pkgs, $single_pkg);
+opendir(BINPKGS, 'control')
+    or fail("Can't open control directory.");
+while(my $binpkg = readdir(BINPKGS)) {
+    next if $binpkg =~ /^\.\.?$/;
+    if (-d "control/$binpkg") {
+        if (open TYPE, "<", "control/$binpkg/xc-package-type") {
+            $pkgs{$binpkg} = <TYPE> || 'deb';
+        } else {
+            $pkgs{$binpkg} = 'deb';
+        }
+       $single_pkg = $pkgs{$binpkg};
+    }
+}
+$single_pkg = undef unless keys(%pkgs) == 1;
+
+# If we got this far, they need to have #DEBHELPER# in their scripts.  Search
+# for scripts that look like maintainer scripts.  Also collect dependency
+# information from debian/control and check compatibility level.
+my $depends;
+opendir(DEBIAN, 'debfiles')
+    or fail("Can't open debfiles directory.");
+while (defined(my $file=readdir(DEBIAN))) {
+    if ($file =~ m/^(?:(.*)\.)?(?:post|pre)(?:inst|rm)$/) {
+        my $binpkg = $1 || '';
+       open(IN, '<', "debfiles/$file")
+           or fail("Can't open debfiles/$file: $!");
+       my $seentag = '';
+       while (<IN>) {
+           if (m/\#DEBHELPER\#/) {
+               $seentag = 1;
+               last;
+           }
+       }
+       close IN;
+
+       if ((! $seentag) and $needtomodifyscripts) {
+           unless (($binpkg && $pkgs{$binpkg} && ($pkgs{$binpkg} =~ /udeb/i))
+                   or (!$binpkg && $single_pkg && ($single_pkg =~ /udeb/i))) {
+               tag "maintainer-script-lacks-debhelper-token", "debian/$file";
+           }
+       }
+    } elsif ($file =~ m/^compat$/) {
+       open (IN, '<', "debfiles/$file")
+           or fail("Can't open debfiles/$file: $!");
+       $compat = <IN>;
+       close IN;
+       if ($compat) {
+           chomp $compat;
+           if ($needversiondepends) {
+               tag "declares-possibly-conflicting-debhelper-compat-versions", "rules=$needversiondepends compat=$compat";
+           } else {
+               $needversiondepends = $compat;
+           }
+       } else {
+           tag "debhelper-compat-file-is-empty", "";
+       }
+    } elsif ($file =~ m/^control$/) {
+        my ($control) = read_dpkg_control("debfiles/$file");
+        $depends = '';
+        for my $field ('build-depends', 'build-depends-indep') {
+            next unless $control->{$field};
+            $depends .= ', ' if $depends;
+            $depends .= $control->{$field};
+        }
+        $depends = Dep::parse($depends);
+        if ($needbuilddepends && ! Dep::implies($depends, Dep::parse('debhelper'))) {
+           tag "package-uses-debhelper-but-lacks-build-depends", "";
+       }
+    } elsif ($file =~ m/^ex\.|\.ex$/i) {
+        tag "dh-make-template-in-source", "debian/$file";
+    }
+}
+closedir(DEBIAN);
+
+# Check for Python policy usage and the required debhelper dependency for
+# dh_python policy support.  Assume people who intentionally set pycompat to
+# something earlier than 2 know what they're doing.  Skip CDBS packages since
+# CDBS creates pycompat internally at build time.
+if ($seendhpython && !$usescdbspython) {
+    if (open(PYCOMPAT, '<', "debfiles/pycompat")) {
+       local $/;
+       my $pycompat = <PYCOMPAT>;
+       close PYCOMPAT;
+       if ($pycompat >= 2 && ! Dep::implies($depends, Dep::parse('debhelper (>= 5.0.37.2)'))) {
+           tag "package-needs-python-policy-debhelper", "";
+       }
+    } else {
+       tag "uses-dh-python-with-no-pycompat", "";
+    }
+}
+
+if ($usescdbs and not $needversiondepends) {
+    $needversiondepends = $cdbscompat;
+}
+$needversiondepends ||= 1;
+if ($needversiondepends < 4) {
+    tag "package-uses-deprecated-debhelper-compat-version", $needversiondepends;
+} elsif ($needversiondepends > 4 and ! Dep::implies($depends, Dep::parse("debhelper (>= $needversiondepends)"))) {
+    tag "package-lacks-versioned-build-depends-on-debhelper", $needversiondepends;
+} elsif (@versioncheck) {
+    for my $program (@versioncheck) {
+        my $required = $versions{$program};
+        tag 'debhelper-script-needs-versioned-build-depends', $program, "(>= $required)"
+            unless Dep::implies($depends, Dep::parse("debhelper (>= $required)"));
+    }
+}
+
+}
+
+1;
+
+# vim: syntax=perl
diff --git a/nokia-lintian/checks/debhelper.desc b/nokia-lintian/checks/debhelper.desc
new file mode 100644 (file)
index 0000000..c2e9f63
--- /dev/null
@@ -0,0 +1,114 @@
+Check-Script: debhelper
+Author: Joey Hess <joeyh@debian.org>
+Abbrev: dh
+Type: source
+Unpack-Level: 2
+Info: This looks for common mistakes in debhelper source packages.
+Needs-Info: debfiles, source-control-file
+
+Tag: maintainer-script-lacks-debhelper-token
+Type: warning
+Info: This package is built using debhelper commands that may modify
+ maintainer scripts, but the maintainer scripts do not contain
+ the "#DEBHELPER#" token debhelper uses to modify them.
+ .
+ Adding the token to the scripts is recommended.
+
+Tag: package-uses-debhelper-but-lacks-build-depends
+Type: error
+Info: If a package uses debhelper, it must declare a Build-Depends
+ on debhelper.
+
+Tag: package-lacks-versioned-build-depends-on-debhelper
+Type: info
+Info: If a package sets debhelper's compatibility version to &gt;= 5,
+ either via DH_COMPAT, or via debian/compat, or via dh_testversion
+ (which is deprecated), it should declare a versioned Build-Depends on
+ the needed version of debhelper.
+ .
+ All versions of debhelper back to etch support compatibility version 5,
+ but the debhelper released with sarge did not, so this dependency is
+ still helpful for oldstable backports.
+
+Tag: dh-make-template-in-source
+Type: warning
+Info: This package contains debian/*.ex and/or debian/ex.* files
+ installed by dh_make. These are intended to be filled in with the
+ package's details and renamed for use by various debhelper commands.
+ If they are not being used, they should be removed.
+
+Tag: dh_testversion-is-deprecated
+Type: warning
+Ref: dh_testversion(1)
+Info: This package calls dh_testversion in its <tt>debian/rules</tt> file.
+ dh_testversion is deprecated. Packages using debhelper should use
+ versioned build dependencies to ensure that the correct version of
+ debhelper is installed.
+
+Tag: dh_dhelp-is-deprecated
+Type: warning
+Info: This package calls dh_dhelp in its <tt>debian/rules</tt> file.
+ dh_dhelp is deprecated as it is not part of the canonical debhelper suite
+ and due to be removed since it supports only one single documentation
+ system (dhelp).
+ .
+ Simply use dh_installdocs, which creates doc-base files and supports all of
+ the documentation systems that way.
+
+Tag: dh_suidregister-is-obsolete
+Type: warning
+Ref: dh_suidregister(1)
+Info: suidregister is obsoleted by dpkg-statoverride, so registration of
+ files in with dh_suidregister is unnecessary, and even harmful.
+
+Tag: debhelper-compat-file-is-empty
+Type: error
+Ref: debhelper(7)
+Info: The source package has an empty debian/compat file. This is an error,
+ the compat level of debhelper should be in there.
+
+Tag: declares-possibly-conflicting-debhelper-compat-versions
+Type: error
+Ref: debhelper(7)
+Info: The source package declares the debhelper compatibility version
+ both in the <tt>debian/compat</tt> file and in the <tt>debian/rules</tt>
+ file. If these ever get out of synchronisation, the package may not build
+ as expected.
+
+Tag: package-uses-deprecated-debhelper-compat-version
+Type: warning
+Ref: debhelper(7)
+Info: The debhelper compatibility version used by this package is marked
+ as deprecated by the debhelper developer. You should really consider
+ using a newer compatibility version.
+ .
+ The compatibility version can be set in (preferred)
+ <tt>debian/compat</tt> or by setting and exporting DH_COMPAT in
+ <tt>debian/rules</tt>.  If it is not set in either place, debhelper
+ defaults to the deprecated compatibility version 1.
+
+Tag: package-needs-python-policy-debhelper
+Type: info
+Info: The source package requests dh_python compatibility level 2 (or
+ higher) in <tt>debian/pycompat</tt> but doesn't depend on a new enough
+ debhelper.  A Build-Depends on debhelper (&gt;= 5.0.37.2) is required for
+ this support.
+ .
+ All versions of debhelper back to etch support this, but the debhelper
+ released with sarge did not, so this dependency is still helpful for
+ oldstable backports.
+
+Tag: uses-dh-python-with-no-pycompat
+Type: warning
+Info: This package uses dh_python but apparently does not tell it to use
+ the current Python policy by putting 2 in <tt>debian/pycompat</tt>.  This
+ may mean that the package has not been converted to the current Python
+ policy, in which case it probably should be.
+
+Tag: debhelper-script-needs-versioned-build-depends
+Type: warning
+Info: The given debhelper script was introduced in a later version of
+ debhelper than the package Build-Depends on.  The package Build-Depends
+ should be updated to require that version of debhelper.  Giving the
+ version followed by <tt>~</tt> is recommended so that backports will
+ satisfy the dependency.
diff --git a/nokia-lintian/checks/debian-readme b/nokia-lintian/checks/debian-readme
new file mode 100644 (file)
index 0000000..6dfbedb
--- /dev/null
@@ -0,0 +1,65 @@
+# debian-readme -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::debian_readme;
+use strict;
+use Spelling;
+use Tags;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+my $readme = "";
+my $template;
+
+if (open(IN, '<', "README.Debian")) {
+    local $_;
+    while (<IN>) {
+        if (m,/usr/doc\b,) {
+            tag 'readme-debian-mentions-usr-doc', "line $.";
+        }
+        $readme .= $_;
+    }
+    close(IN);
+}
+
+my @template =
+    ('Comments regarding the Package',
+     'So far nothing to say',
+     '<possible notes regarding this package - if none, delete this file>');
+my $regex = join ('|', @template);
+if ($readme =~ m/$regex/io) {
+    tag("readme-debian-contains-debmake-template");
+} elsif ($readme =~ m/^\s*-- [^<]*<[^> ]+.\@unknown>/m) {
+    tag("readme-debian-contains-debmake-default-email-address");
+}
+
+spelling_check('spelling-error-in-readme-debian', $readme);
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/checks/debian-readme.desc b/nokia-lintian/checks/debian-readme.desc
new file mode 100644 (file)
index 0000000..ad3cd43
--- /dev/null
@@ -0,0 +1,38 @@
+Check-Script: debian-readme
+Author: Richard Braakman <dark@xs4all.nl>
+Abbrev: drm
+Type: binary
+Unpack-Level: 1
+Needs-Info: debian-readme
+Info: This script checks the README.Debian file for various problems.
+
+Tag: readme-debian-mentions-usr-doc
+Type: warning
+Info: The README.Debian file installed by this package apparently points
+ users at /usr/doc.  /usr/doc has been retired and all documentation
+ migrated to /usr/share/doc.  This reference should probably also be
+ updated.
+
+Tag: readme-debian-contains-debmake-template
+Type: warning
+Info: The README.Debian file installed by this package contains one of the
+ template phrases from the README.Debian provided by deb-make or dh_make:
+ .
+  Comments regarding the package
+  So far nothing to say
+  &lt;possible notes regarding this package - if none, delete this file&gt;
+ .
+ If there is real information in the file, please delete any generic
+ template phrases.  If there is nothing to say in the file, it is best
+ removed.
+
+Tag: readme-debian-contains-debmake-default-email-address
+Type: warning
+Info: The README.Debian file contains an email address (&lt;..@unknown&gt;)
+ that was not updated to the maintainer's real address.
+
+Tag: spelling-error-in-readme-debian
+Type: warning
+Info: Lintian found a spelling error in the README.Debian file.  Lintian
+ has a list of common misspellings that it looks for.  It does not have a
+ dictionary like a spelling checker does.
diff --git a/nokia-lintian/checks/description b/nokia-lintian/checks/description
new file mode 100644 (file)
index 0000000..9fc049d
--- /dev/null
@@ -0,0 +1,162 @@
+# description -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::description;
+use strict;
+use Spelling;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my $ppkg = quotemeta($pkg);
+my $cf = "fields/description";
+my $tabs = 0;
+my $lines = 0;
+my $template = 0;
+my $unindented_list = 0;
+my $synopsis;
+my $description;
+
+# description?
+unless (-f $cf) {
+    tag "package-has-no-description", "";
+    return 0;
+}
+
+open(IN, '<', $cf) or fail("cannot open $cf for reading: $!");
+
+# 1st line contains synopsis
+$synopsis = <IN>;
+$description = $synopsis;
+chomp $synopsis;
+
+if ($synopsis =~ m/^\s*$/) {
+    tag "description-synopsis-is-empty", "";
+} else {
+    # Current dpkg-gencontrol appears to fix this automatically so this
+    # tag will never trigger with a current dpkg-dev.
+    if ($synopsis =~ m/^\s/) {
+       tag "description-synopsis-has-leading-spaces", "";
+    }
+    if ($synopsis =~ m/^\s*$ppkg\b/i) {
+       tag "description-starts-with-package-name", "";
+    }
+    if ($synopsis =~ m/\.\s*$/) {
+       tag "description-synopsis-might-not-be-phrased-properly", "";
+    }
+    if ($synopsis =~ m/\t/) {
+       tag "description-contains-tabs", "" unless $tabs++;
+    }
+    if (length($synopsis) >= 80) {
+       tag "description-too-long", "";
+    }
+    if ($synopsis =~ m/^\s*missing\s*$/i) {
+       tag "description-is-debmake-template", "" unless $template++;
+    } elsif ($synopsis =~ m/<insert up to 60 chars description>/) {
+       tag "description-is-dh_make-template", "" unless $template++;
+    }
+}
+
+while (<IN>) {
+    $description .= $_;
+    chomp;
+    next if m/^\s*$/o;
+    next if m/^\.\s*$/o;
+
+    if ($lines == 0) {
+       my $firstline = lc $_;
+       my $lsyn = lc $synopsis;
+       if ($firstline =~ /^\Q$lsyn\E$/) {
+           tag "description-synopsis-is-duplicated", "";
+       } else {
+           $firstline =~ s/[^a-zA-Z0-9]+//g;
+           $lsyn =~ s/[^a-zA-Z0-9]+//g;
+           if ($firstline eq $lsyn) {
+               tag "description-synopsis-is-duplicated", "";
+           }
+       }
+    }
+
+    $lines++;
+
+    if (m/^\.\s*\S/o) {
+       tag "description-contains-invalid-control-statement", "";
+    } elsif (m/^[\-\*]/o) {
+       # Print it only the second time.  Just one is not enough to be sure that
+       # it's a list, and after the second there's no need to repeat it.
+       tag "possible-unindented-list-in-extended-description", "" if $unindented_list++ == 2;
+    }
+
+    if (m/\t/o) {
+       tag "description-contains-tabs", "" unless $tabs++;
+    }
+
+    if (m,^\s*Homepage: https?://,i) {
+        tag "description-contains-homepage";
+    }
+
+    my $wo_quotes = $_;
+    $wo_quotes =~ s,(\"|\')(.*?)(\1),,;
+    while ($wo_quotes =~ m,(?:\W|^)((\w+)(\s+(\2))+)(?:\W|$),i) {
+       my $words = $1;
+       $wo_quotes =~ s/\Q$words//;
+        tag "description-contains-duplicated-word", "$words";
+    }
+
+    if ($lines == 1) {
+       # checks for the first line of the extended description:
+       if (m/^\s/o) {
+           tag "description-starts-with-leading-spaces", "";
+       }
+       if (m/^\s*missing\s*$/oi) {
+           tag "description-is-debmake-template", "" unless $template++;
+       } elsif (m/<insert long description, indented with spaces>/) {
+           tag "description-is-dh_make-template", "" unless $template++;
+       }
+    }
+
+    if (length($_) >= 80) {
+       tag "extended-description-line-too-long", "";
+    }
+}
+close(IN);
+
+if ($lines == 0) {
+    tag "extended-description-is-empty", "" unless $type eq 'udeb';
+}
+
+if ($description) {
+    spelling_check('spelling-error-in-description', $description);
+    spelling_check_picky('spelling-error-in-description', $description);
+}
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 ts=8
diff --git a/nokia-lintian/checks/description.desc b/nokia-lintian/checks/description.desc
new file mode 100644 (file)
index 0000000..2fb68a9
--- /dev/null
@@ -0,0 +1,119 @@
+Check-Script: description
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: des
+Type: binary, udeb
+Unpack-Level: 1
+
+Tag: package-has-no-description
+Type: error
+Info: The binary package does not have a "Description:" control field.
+Tested: empty
+
+Tag: description-synopsis-is-empty
+Type: error
+Info: The first line in the "Description:" is empty.
+
+Tag: extended-description-is-empty
+Type: error
+Status: untested
+Info: The extended description (the lines after the first line of the
+ "Description:" field) is empty.
+
+Tag: description-contains-invalid-control-statement
+Type: error
+Info: The description contains a line starting with a dot (.). This is
+ not allowed.
+Ref: policy 5.6.13
+
+Tag: description-too-long
+Type: error
+Info: The first line of the "Description:" must not exceed 80 characters.
+Ref: policy 3.4.1
+
+Tag: description-synopsis-has-leading-spaces
+Type: error
+Status: untested
+Info: The first line of the "Description:" should not have leading spaces.
+
+Tag: description-starts-with-package-name
+Type: error
+Info: The first line of the "Description:" should not start with the
+ package name. For example, the package <tt>foo</tt> should not
+ have a description like this: `foo is a program that...'.
+Ref: policy 3.4.1
+
+Tag: description-contains-tabs
+Type: error
+Info: The package "Description:" must not contain tab characters.
+Ref: policy 5.6.13
+
+Tag: description-starts-with-leading-spaces
+Type: warning
+Info: The package "Description:" starts with leading spaces. Usually,
+ leading spaces are used to switch `verbatim display' on (i.e., lines
+ are not wrapped) so this might be a bug in the package.
+
+Tag: possible-unindented-list-in-extended-description
+Type: warning
+Info: The package "Description:" contains an unindented line which
+ starts with a dash (-) or asterisk (*). If this was meant to be a
+ list of items these lines need to be indented (dselect would
+ word-wrap these lines otherwise).
+Ref: policy 5.6.13
+
+Tag: description-is-debmake-template
+Type: error
+Info: The synopsis or the extended description just says "Missing",
+ which is a template provided by debmake.
+
+Tag: description-is-dh_make-template
+Type: error
+Info: The synopsis or the extended description has not been changed
+ from the template provided by dh_make.
+
+Tag: description-synopsis-might-not-be-phrased-properly
+Type: warning
+Info: The synopsis (first line in the package "Description:" field, the
+ short description) ends with a full stop "." character. This is not
+ necessary, as the synopsis doesn't need to be a full sentence. It is
+ recommended that a descriptive phrase is used instead.
+ .
+ Note also that the synopsis is not part of the rest of the "Description:"
+ field.
+Ref: policy 3.4.1
+
+Tag: description-synopsis-is-duplicated
+Type: error
+Info: The first line of the extended Description: should not repeat the
+ synopsis exactly. This indicates that either the synopsis is badly formed
+ or that the extended description has been wrongly copied and pasted.
+Ref: policy 3.4.2
+
+Tag: extended-description-line-too-long
+Type: warning
+Info: One or more lines in the extended part of the "Description:" field
+ have been found to contain more than 80 characters. For the benefit of
+ users of 80x25 terminals, it is recommended that the lines do not exceed
+ 80 characters.
+Ref: policy 3.4.1
+
+Tag: description-contains-homepage
+Type: warning
+Info: The extended description contains a "Homepage:" pseudo-header
+ following the old Developer's Reference recommendation.  As of 1.14.6,
+ dpkg now supports Homepage: as a regular field in
+ <tt>debian/control</tt>.  This header should be moved from the extended
+ description to the fields for the relevant source or binary packages.
+
+Tag: spelling-error-in-description
+Type: warning
+Info: Lintian found a spelling or capitalization error in the package
+ description.  Lintian has a list of common misspellings that it looks
+ for.  It does not have a dictionary like a spelling checker does.  It is
+ particularly picky about spelling and capitalization in package
+ descriptions since they're very visible to end users.
+
+Tag: description-contains-duplicated-word
+Type: warning
+Info: The description contains a duplicated word.  Usually this is a
+ mistake, or at least an awkward phrasing.
diff --git a/nokia-lintian/checks/etcfiles b/nokia-lintian/checks/etcfiles
new file mode 100644 (file)
index 0000000..bfca2c2
--- /dev/null
@@ -0,0 +1,77 @@
+# etcfiles -- lintian check script -*- perl -*-
+
+# Copyright (C) 2000 by Sean 'Shaleh' Perry
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::etcfiles;
+use strict;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my %conffiles;
+
+my $conffiles = "control/conffiles";
+
+# load conffiles
+if (open(IN, '<', $conffiles)) {
+    while (<IN>) {
+       chop;
+       next if m/^\s*$/o;
+       s,^/,,;
+       $conffiles{$_} = 1;
+    }
+    close(IN);
+}
+
+# Read package contents...
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chop;
+
+    my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
+    my $link;
+
+    $file =~ s,^(\./),,;
+    $file =~ s/ link to .*//;
+
+    if ($perm =~ m/^l/) {
+       ($file, $link) = split(' -> ', $file);
+    }
+
+    # skip it unless it is a file in /etc
+    next unless $file =~ m,^etc, and $perm =~ m,^-,;
+
+    # If there is a /etc/foo, it must be a conffile (with a few exceptions).
+    if (not exists($conffiles{$file})
+       and $file !~ m,/README$,
+       and $file ne 'etc/init.d/skeleton'
+       and $file ne 'etc/init.d/rc'
+       and $file ne 'etc/init.d/rcS') {
+       tag "file-in-etc-not-marked-as-conffile", "/$file";
+    }
+}
+close(IN);
+
+}
+
+1;
diff --git a/nokia-lintian/checks/etcfiles.desc b/nokia-lintian/checks/etcfiles.desc
new file mode 100644 (file)
index 0000000..610ec39
--- /dev/null
@@ -0,0 +1,12 @@
+Check-Script: etcfiles
+Author: Sean 'Shaleh' Perry <shaleh@debian.org>
+Abbrev: etc
+Type: binary
+Needs-Info: etcfiles
+Unpack-Level: 1
+
+Tag: file-in-etc-not-marked-as-conffile
+Type: error
+Ref: policy 10.7
+Info: Files in <tt>/etc</tt> must be marked conffiles if they are included
+ in a package.  Otherwise they should be created by maintainer scripts.
diff --git a/nokia-lintian/checks/fields b/nokia-lintian/checks/fields
new file mode 100644 (file)
index 0000000..dc72f16
--- /dev/null
@@ -0,0 +1,997 @@
+# fields -- lintian check script (rewrite) -*- perl -*-
+#
+# Copyright (C) 2004 Marc Brockschmidt
+#
+# Parts of the code were taken from the old check script, which
+# was Copyright (C) 1998 Richard Braakman (also licensed under the
+# GPL 2 or higher)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::fields;
+use strict;
+
+use lib "$ENV{'LINTIAN_ROOT'}/checks/";
+use common_data;
+use Dep;
+use Tags;
+use Util;
+use Lintian::Data;
+
+# The allowed Python dependencies currently.  This is the list of alternatives
+# that, either directly or through transitive dependencies that can be relied
+# upon, ensure /usr/bin/python will exist for the use of dh_python.
+my $python_depend = 'python | python-dev | python-all | python-all-dev | '
+    . join (' | ', map { "python$_ | python$_-dev" } qw(2.4 2.5));
+
+# Certain build tools must be listed in Build-Depends even if there are no
+# arch-specific packages because they're required in order to run the clean
+# rule.  (See Policy 7.6.)  The following is a list of package dependencies;
+# regular expressions that, if they match anywhere in the debian/rules file,
+# say that this package is allowed (and required) in Build-Depends; and
+# optional tags to use for reporting the problem if some information other
+# than the default is required.
+my @global_clean_depends = (
+       [ ant => '^include\s*/usr/share/cdbs/1/rules/ant.mk' ],
+       [ cdbs => '^include\s+/usr/share/cdbs/' ],
+       [ dbs => '^include\s+/usr/share/dbs/' ],
+       [ debhelper => '^include\s+/usr/share/cdbs/1/rules/debhelper.mk' ],
+       [ dpatch => '^include\s+/usr/share/cdbs/1/rules/dpatch.mk' ],
+       [ quilt => '^include\s+/usr/share/cdbs/1/rules/patchsys-quilt.mk' ],
+       [ dpatch => '^include\s+/usr/share/dpatch/' ],
+       [ quilt => '^include\s+/usr/share/quilt/' ],
+       [ $python_depend => '/usr/share/cdbs/1/class/python-distutils.mk', 'missing-python-build-dependency' ],
+);
+
+# These are similar, but the resulting dependency is only allowed, not
+# required.
+#
+# The xsfclean rule is specific to the packages maintained by the X Strike
+# Force, but there are enough of those to make the rule worthwhile.
+my @global_clean_allowed = (
+       [ patchutils => '^include\s+/usr/share/cdbs/1/rules/dpatch.mk' ],
+       [ patchutils => '^include\s+/usr/share/cdbs/1/rules/patchsys-quilt.mk' ],
+       [ patchutils => '^include\s+/usr/share/cdbs/1/rules/simple-patchsys.mk' ],
+       [ 'python-central' => '^DEB_PYTHON_SYSTEM\s*:?=\s*pycentral' ],
+       [ 'python-support' => '^DEB_PYTHON_SYSTEM\s*:?=\s*pysupport' ],
+       [ 'python-setuptools' => '/usr/share/cdbs/1/class/python-distutils.mk' ],
+       [ quilt => '^clean:\s+xsfclean\b' ],
+);
+
+# A list of packages; regular expressions that, if they match anywhere in the
+# debian/rules file, this package must be listed in either Build-Depends or
+# Build-Depends-Indep as appropriate; and optional tags as above.
+my @global_depends = (
+       [ $python_depend => '^\t\s*dh_python\s', 'missing-dh_python-build-dependency' ],
+       [ 'python-central' => '^\t\s*dh_pycentral\s' ],
+       [ 'python-support' => '^\t\s*dh_pysupport\s' ],
+       [ 'python-central' => '^DEB_PYTHON_SYSTEM\s*:?=\s*pycentral' ],
+       [ 'python-support' => '^DEB_PYTHON_SYSTEM\s*:?=\s*pysupport' ],
+);
+
+# Similarly, this list of packages, regexes, and optional tags say that if the
+# regex matches in one of clean, build-arch, binary-arch, or a rule they
+# depend on, this package is allowed (and required) in Build-Depends.
+my @rule_clean_depends = (
+       [ debhelper => '^\t\s*dh_.+' ],
+       [ dpatch => '^\t\s*dpatch\s' ],
+       [ 'libmodule-build-perl' => '(^\t|\|\|)\s*(perl|\$\(PERL\))\s+Build\b' ],
+       [ "po-debconf" => '^\t\s*debconf-updatepo\s' ],
+       [ $python_depend => '^\t\s*python\s', 'missing-python-build-dependency' ],
+       [ $python_depend => '\ssetup\.py\b', 'missing-python-build-dependency' ],
+       [ quilt => '^\t\s*(\S+=\S+\s+)*quilt\s' ],
+       [ yada => '^\t\s*yada\s' ],
+);
+
+# Similar, but the resulting dependency is only allowed, not required.  We
+# permit a versioned dependency on perl-base because that used to be the
+# standard suggested dependency.  No package should be depending on just
+# perl-base, since it's Priority: required.
+my @rule_clean_allowed = (
+       [ patch => '^\t\s*(?:perl debian/)?yada\s+unpatch' ],
+       [ 'perl | perl-base (>= 5.6.0-16)' => '(^\t|\|\|)\s*(perl|\$\(PERL\))\s' ],
+       [ 'python-setuptools' => '\ssetup\.py\b' ],
+);
+
+# A simple list of regular expressions which, if they match anywhere in
+# debian/rules, indicate the requirements for debian/rules clean are complex
+# enough that we can't know what packages are permitted in Build-Depends and
+# should bypass the build-depends-without-arch-dep check completely.
+my @global_clean_bypass = (
+       '^include\s*/usr/share/cdbs/1/class/ant.mk',
+       '^\s+dh\s+'
+);
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+my $version;
+my $arch_indep;
+
+# Load obsolete packages list.
+my $obsolete_packages = Lintian::Data->new ('fields/obsolete-packages');
+
+local $/ = undef; #Read everything in one go
+
+unless (-d "fields") {
+       fail("directory in lintian laboratory for $type package $pkg missing: fields");
+}
+
+#---- Package
+
+if ($type eq "binary"){
+       if (not open (FH, '<', "fields/package")) {
+               tag "no-package-name", "";
+       } else {
+               my $name = <FH>;
+               close FH;
+
+               unfold("package", \$name);
+               tag "bad-package-name", "" unless $name =~ /^[A-Z0-9][-+\.A-Z0-9]+$/i;
+               tag "package-not-lowercase", "" if ($name =~ /[A-Z]/)
+       }
+}
+
+#---- Version
+
+if (not open (FH, '<', "fields/version")) {
+       tag "no-version-field", "";
+} else {
+       $version = <FH>;
+       close FH;
+
+       unfold("version", \$version);
+
+       if (@_ = _valid_version($version)) {
+               my ($epoch, $upstream, $debian) = @_;
+               if ($upstream !~ /^\d/i) {
+                       tag "upstream-version-not-numeric", "$version";
+               }
+               if (defined $debian) {
+                       tag "debian-revision-should-not-be-zero", "$version"
+                               if $debian eq '-0';
+                       my $ubuntu;
+                       $debian =~ /^-([^.]+)(?:\.[^.]+)?(?:\.[^.]+)?(\..*)?$/;
+                       my $extra = $2;
+                       if (defined $extra) {
+                               $debian =~ /^-([^.]+ubuntu[^.]+)(?:\.\d+){1,3}(\..*)?$/;
+                               $ubuntu = 1;
+                               $extra = $2;
+                       }
+                       if (not defined $1 or defined $extra) {
+                               tag "debian-revision-not-well-formed", "$version";
+                       }
+                       if ($debian =~ /^-[^.-]+\.[^.-]+\./ and not $ubuntu) {
+                               tag "binary-nmu-uses-old-version-style", "$version"
+                                       if $type eq 'binary';
+                               tag "binary-nmu-debian-revision-in-source", "$version"
+                                       if $type eq 'source';
+                       }
+               }
+               if ($version =~ /\+b\d+$/ && $type eq "source") {
+                       tag "binary-nmu-debian-revision-in-source", "$version";
+               }
+       } else {
+               tag "bad-version-number", "$version";
+       }
+}
+
+#---- Architecture
+
+if (not open (FH, '<', "fields/architecture")) {
+       tag "no-architecture-field", "";
+} else {
+       my $archs = <FH>;
+       close FH;
+
+       unfold("architecture", \$archs);
+
+       my @archs = split / /, $archs;
+
+       if (@archs > 1 && grep { $_ eq "any" || $_ eq "all" } @archs) {
+               tag "magic-arch-in-arch-list", "";
+       }
+
+       for my $arch (@archs) {
+               tag "unknown-architecture", "$arch" unless $known_archs{$arch};
+       }
+
+       if ($type eq "binary") {
+               tag "too-many-architectures", "" if (@archs > 1);
+               tag "arch-any-in-binary-pkg", "" if (grep { $_ eq "any" } @archs);
+                tag "aspell-package-not-arch-all", ""
+                    if ($pkg =~ /^aspell-[a-z]{2}(-.*)?$/ && (@archs > 1 || $archs[0] ne 'all'));
+       }
+
+       # Used for later tests.
+       $arch_indep = 1 if (@archs == 1 && $archs[0] eq 'all');
+}
+
+#---- Subarchitecture (udeb)
+
+if (open(FH, '<', "fields/subarchitecture")) {
+       my $subarch = <FH>;
+       close(FH);
+
+       unfold("subarchitecture", \$subarch);
+}
+
+#---- Maintainer
+#---- Uploaders
+
+for my $f (qw(maintainer uploaders)) {
+       if (not open (FH, '<', "fields/$f")) {
+               tag "no-maintainer-field", "" if $f eq "maintainer";
+       } else {
+               my $maintainer = <FH>;
+               close FH;
+
+               # Note, not expected to hit on uploaders anymore, as dpkg now strips
+               # newlines for the .dsc, and the newlines don't hurt in debian/control
+               unfold($f, \$maintainer);
+
+               $maintainer =~ s/^\s*(.+?)\s*$/$1/; #Remove leading and trailing whitespace
+
+               if ($f eq "uploaders") {
+                       check_maint($_, "uploader") for (split /\s*,\s*/, $maintainer);
+               } else {
+                       check_maint($maintainer, $f);
+                       if ($type eq 'source'
+                           && $maintainer =~ /\@lists(\.alioth)?\.debian\.org\b/
+                           && ! -f 'fields/uploaders') {
+                               tag 'no-human-maintainers';
+                       }
+               }
+       }
+}
+
+#---- Source
+
+if ($type eq "source") {
+       if (not open (FH, '<', "fields/source")) {
+               tag "no-source-field", "";
+       } else {
+               my $source = <FH>;
+               close FH;
+
+               unfold("source", \$source);
+
+               if ($type eq 'source') {
+                       if ($source ne $pkg) {
+                               tag "source-field-does-not-match-pkg-name", "$_";
+                       }
+               } else {
+                       if ($source !~ /[A-Z0-9][-+\.A-Z0-9]+                      #Package name
+                                       \s*
+                                       (?:\((?:\d+:)?(?:[-\.+:A-Z0-9]+?)(?:-[\.+A-Z0-9]+)?\))?\s*$/ix) { #Version
+                               tag "source-field-malformed", "$source";
+                       }
+               }
+       }
+}
+
+#---- Essential
+
+if (open (FH, '<', "fields/essential")) {
+       my $essential = <FH>;
+       close FH;
+
+       unfold("essential", \$essential);
+
+       tag "essential-in-source-package", "" if ($type eq "source");
+       tag "essential-no-not-needed", "" if ($essential eq "no");
+       tag "unknown-essential-value", "" if ($essential ne "no" and $essential ne "yes");
+       tag "new-essential-package", "" if ($essential eq "yes" and ! $known_essential{$pkg});
+}
+
+#---- Section
+
+if (not open (FH, '<', "fields/section")) {
+       tag 'no-section-field' if ($type eq 'binary');
+} else {
+       my $section = <FH>;
+       close FH;
+
+       unfold("section", \$section);
+
+       if ($type eq 'udeb') {
+           unless ($section eq 'debian-installer') {
+               tag "wrong-section-for-udeb", "$section";
+           }
+       } else {
+           my @parts = split /\//, $section, 2;
+
+           if ($parts[0] =~ /non-US/i) {
+               tag "non-us-spelling", "" if ($parts[0] ne "non-US");
+               if ($parts[1] and not $known_non_us_parts{$parts[1]}) {
+                   tag "unknown-section", "$section";
+               }
+           } elsif (scalar @parts > 1) {
+               tag "unknown-section", "$section" unless $known_archive_parts{$parts[0]};
+               tag "unknown-section", "$section" unless $known_sections{$parts[1]};
+           } elsif ($parts[0] eq 'unknown') {
+               tag "section-is-dh_make-template";
+           } else {
+               tag "unknown-section", "$section" unless $known_sections{$parts[0]};
+           }
+
+           # Check package name <-> section.
+           if ($pkg =~ /-docs?$/) {
+               tag "doc-package-should-be-section-doc", $pkg
+                   unless $parts[-1] eq 'doc';
+           } elsif ($pkg =~ /^lib.*-perl$/) {
+               tag "perl-package-should-be-section-perl", $pkg
+                   unless $parts[-1] eq 'perl';
+           } elsif ($pkg =~ /^python-/) {
+               tag "python-package-should-be-section-python", $pkg
+                   unless $parts[-1] eq 'python';
+           } elsif ($pkg =~ /^lib.*-dev$/) {
+                tag "dev-package-should-be-section-libdevel", $pkg
+                    unless $parts[-1] eq 'libdevel';
+            }
+        }
+}
+
+#---- Priority
+
+if (not open (FH, '<', "fields/priority")) {
+       tag "no-priority-field", "" if $type eq "binary";
+} else {
+       my $priority = <FH>;
+       close FH;
+
+       unfold("priority", \$priority);
+
+       tag "unknown-priority", "$priority" if (! $known_prios{$priority});
+
+       if ($pkg =~ /-dbg$/) {
+               tag "debug-package-should-be-priority-extra", $pkg
+                   unless $priority eq 'extra';
+        }
+}
+
+#---- Standards-Version
+# handled in checks/standards-version
+
+#---- Description
+# handled in checks/description
+
+#--- Homepage
+
+if (open (FH, '<', "fields/homepage")) {
+       my $homepage = <FH>;
+       close(FH);
+
+       unfold("homepage", \$homepage);
+
+       if ($homepage =~ /^\s*<(?:UR[LI]:)?.*>\s*$/i) {
+               tag "superfluous-clutter-in-homepage", $homepage;
+       }
+
+       require URI;
+       my $uri = URI->new($homepage);
+
+       unless ($uri->scheme) { # not an absolute URI
+               tag "bad-homepage", $homepage;
+       }
+}
+
+#---- Installer-Menu-Item (udeb)
+
+if (open(FH, '<', "fields/installer-menu-item")) {
+       my $menu_item = <FH>;
+       close(FH);
+
+       unfold('installer-menu-item', \$menu_item);
+
+       $menu_item =~ /^\d+$/ or tag "bad-menu-item", "$menu_item";
+}
+
+
+#---- Package relations (binary package)
+
+# Check whether the package looks like a meta-package, used for later
+# dependency checks.  We consider a package to possibly be a meta-package if
+# it is a binary package, arch: all, with no files outside of /usr/share/doc.
+my $metapackage = 0;
+if ($type eq 'binary' && $arch_indep) {
+       $metapackage = 1;
+       open (IN, '<', "index") or fail("cannot open index file index: $!");
+       local $_;
+       local $/ = "\n";
+       while (<IN>) {
+               my ($mode, $file) = (split(' ', $_, 6))[0,5];
+               next unless $file;
+               $metapackage = 0 unless ($mode =~ /^d/ || $file =~ m%^\./usr/share/doc/%);
+       }
+       close IN;
+}
+if (($type eq "binary") || ($type eq 'udeb')) {
+       my (%deps, %fields, %parsed);
+       my $debugpackage = 0;
+       my ($debugbase, $debugfound);
+       if ($pkg =~ /^([^-]+)(?:-.*)?-dbg$/) {
+               $debugpackage = 1;
+               $debugbase = $1;
+       }
+       for my $field (qw(depends pre-depends recommends suggests conflicts provides replaces breaks)) {
+               if (open(FH, '<', "fields/$field")) {
+                       #Get data and clean it
+                       my $data = <FH>;
+                       unfold($field, \$data);
+                       $data =~ s/^\s*(.+?)\s*$/$1/;
+                       $fields{$field} = $data;
+                       $parsed{$field} = Dep::parse ($data);
+
+                       my (@seen_libstdcs, @seen_tcls, @seen_tclxs, @seen_tks, @seen_tkxs, @seen_libpngs);
+
+                       my $is_dep_field = sub { grep { $_ eq $_[0] } qw(depends pre-depends recommends suggests) };
+
+                       tag "package-uses-breaks" if $field eq "breaks";
+
+                       tag "alternates-not-allowed", "$field"
+                           if ($data =~ /\|/ && ! &$is_dep_field($field));
+
+                       for my $dep (split /\s*,\s*/, $data) {
+                               my (@alternatives, @seen_obsolete_packages);
+                               push @alternatives, [_split_dep($_), $_] for (split /\s*\|\s*/, $dep);
+
+                               if (&$is_dep_field($field)) {
+                                       push @seen_libstdcs, $alternatives[0]->[0]
+                                           if defined $known_libstdcs{$alternatives[0]->[0]};
+                                       push @seen_tcls, $alternatives[0]->[0]
+                                           if defined $known_tcls{$alternatives[0]->[0]};
+                                       push @seen_tclxs, $alternatives[0]->[0]
+                                           if defined $known_tclxs{$alternatives[0]->[0]};
+                                       push @seen_tks, $alternatives[0]->[0]
+                                           if defined $known_tks{$alternatives[0]->[0]};
+                                       push @seen_tkxs, $alternatives[0]->[0]
+                                           if defined $known_tkxs{$alternatives[0]->[0]};
+                                       push @seen_libpngs, $alternatives[0]->[0]
+                                           if defined $known_libpngs{$alternatives[0]->[0]};
+                               }
+
+                               # Only for (Pre-)?Depends.
+                               tag "virtual-package-depends-without-real-package-depends", "$field: $alternatives[0]->[0]"
+                                   if ($known_virtual_packages{$alternatives[0]->[0]}
+                                       && ($field eq "depends" || $field eq "pre-depends"));
+
+                                # Check defaults for transitions.  Here, we only care that the first alternative is current.
+                                tag "depends-on-old-emacs", "$field: $alternatives[0]->[0]"
+                                    if (&$is_dep_field($field) && $known_obsolete_emacs{$alternatives[0]->[0]});
+
+                               for my $part_d (@alternatives) {
+                                       my ($d_pkg, $d_version, $d_arch, $rest, $part_d_orig) = @$part_d;
+
+                                       # We have found a Depends: on our non-dbg equivalent.
+                                       if ($debugpackage && $field eq "depends" && $d_pkg =~ /^\Q$debugbase/) {
+                                               $debugfound = 1;
+                                       }
+
+                                       tag "versioned-provides", "$part_d_orig"
+                                           if ($field eq "provides" && $d_version->[0]);
+
+                                       tag "breaks-without-version", "$part_d_orig"
+                                           if ($field eq "breaks" && !$d_version->[0]);
+
+                                       tag "obsolete-relation-form", "$field: $part_d_orig"
+                                           if ($d_version && grep { $d_version->[0] eq $_ } ("<", ">"));
+
+                                       tag "bad-version-in-relation", "$field: $part_d_orig"
+                                           if ($d_version->[0] && ! defined((_valid_version($d_version->[1]))[1]));
+
+                                       tag "package-relation-with-self", "$field: $part_d_orig"
+                                           if ($pkg eq $d_pkg) && ($field ne 'conflicts');
+
+                                       tag "bad-relation", "$field: $part_d_orig"
+                                           if $rest;
+
+                                       push @seen_obsolete_packages, $part_d_orig
+                                           if ($obsolete_packages->known($d_pkg) && &$is_dep_field($field));
+
+                                       tag "depends-on-x-metapackage", "$field: $part_d_orig"
+                                           if ($known_x_metapackages{$d_pkg} && ! $metapackage && &$is_dep_field($field));
+
+                                       tag "depends-on-essential-package-without-using-version", "$field: $part_d_orig"
+                                           if ($known_essential{$d_pkg} && ! $d_version->[0] && &$is_dep_field($field));
+
+                                       tag "package-depends-on-an-x-font-package", "$field: $part_d_orig"
+                                           if ($field =~ /^(pre-)?depends$/ && $d_pkg =~ /^xfont.*/ && $d_pkg ne 'xfonts-utils' && $d_pkg ne 'xfongs-encodings');
+
+                                       tag "needlessly-depends-on-awk", "$field"
+                                           if ($d_pkg eq "awk" && ! $d_version->[0] && &$is_dep_field($field));
+
+                                       tag "depends-on-libdb1-compat", "$field"
+                                           if ($d_pkg eq "libdb1-compat" && $pkg !~ /^libc(6|6.1|0.3)/ && $field =~ /^(pre-)depends$/);
+
+                                       tag "depends-on-python-minimal", "$field",
+                                           if ($d_pkg =~ /^python[\d.]*-minimal$/ && &$is_dep_field($field)
+                                               && $pkg !~ /^python[\d.]*-minimal$/);
+
+                                       tag "doc-package-depends-on-main-package", "$field"
+                                           if ("$d_pkg-doc" eq $pkg && $field =~ /^(pre-)depends$/);
+
+                                       tag "old-versioned-python-dependency", "$field: $part_d_orig"
+                                           if ($d_pkg eq 'python' && $d_version->[0] eq '<<' && &$is_dep_field($field)
+                                               && $arch_indep && $pkg =~ /^python-/ && ! -f "fields/python-version");
+                               }
+
+                               for my $pkg (@seen_obsolete_packages) {
+                                       if ($pkg eq $alternatives[0]->[0] or
+                                           scalar @seen_obsolete_packages == scalar @alternatives) {
+                                               tag "depends-on-obsolete-package", "$field: $pkg";
+                                       } else {
+                                               tag "ored-depends-on-obsolete-package", "$field: $pkg";
+                                       }
+                               }
+                       }
+                       tag "package-depends-on-multiple-libstdc-versions", @seen_libstdcs
+                           if (scalar @seen_libstdcs > 1);
+                       tag "package-depends-on-multiple-tcl-versions", @seen_tcls
+                           if (scalar @seen_tcls > 1);
+                       tag "package-depends-on-multiple-tclx-versions", @seen_tclxs
+                           if (scalar @seen_tclxs > 1);
+                       tag "package-depends-on-multiple-tk-versions", @seen_tks
+                           if (scalar @seen_tks > 1);
+                       tag "package-depends-on-multiple-tkx-versions", @seen_tkxs
+                           if (scalar @seen_tkxs > 1);
+                       tag "package-depends-on-multiple-libpng-versions", @seen_libpngs
+                           if (scalar @seen_libpngs > 1);
+               }
+       }
+
+       tag "dbg-package-missing-depends", $debugbase
+               if ($debugpackage && !$debugfound);
+
+       # If Conflicts or Breaks is set, make sure it's not inconsistent with
+       # the other dependency fields.
+       for my $conflict (qw/conflicts breaks/) {
+               next unless $fields{$conflict};
+               for my $field (qw(depends pre-depends recommends suggests)) {
+                       next unless $parsed{$field};
+                       for my $package (split /\s*,\s*/, $fields{$conflict}) {
+                               tag "conflicts-with-dependency", $field, $package
+                                   if Dep::implies($parsed{$field}, Dep::parse($package));
+                       }
+               }
+       }
+}
+
+#---- Package relations (source package)
+
+if ($type eq "source") {
+
+       #Get number of arch-indep packages:
+       my $arch_indep_packages = 0;
+       my $arch_dep_packages = 0;
+       if (not open(CONTROL, '<', "debfiles/control")) {
+               fail("Can't open debfiles/control: $!");
+       } else {
+               local $/ = "\n"; #Read this linewise
+               while (<CONTROL>) {
+                       if (/^Architecture: all/) {
+                               $arch_indep_packages++;
+                       } elsif (/^Architecture:/) {
+                               $arch_dep_packages++;
+                       }
+               }
+       }
+
+       # Search through rules and determine which dependencies are required.
+       # The keys in %needed and %needed_clean are the dependencies; the
+       # values are the tags to use or the empty string to use the default
+       # tag.
+       my (%needed, %needed_clean, %allowed_clean, $bypass_needed_clean);
+       open (RULES, '<', "debfiles/rules")
+           or fail("cannot read debfiles/rules: $!");
+       my $target = "none";
+       local $/ = "\n";        # Read this linewise
+       my @rules = qw(clean binary-arch build-arch);
+        my $maybe_skipping;
+       while (<RULES>) {
+               if (/^ifn?(eq|def)\s/) {
+                       $maybe_skipping++;
+               } elsif (/^endif\s/) {
+                       $maybe_skipping--;
+               }
+               for my $rule (@global_clean_depends) {
+                       if ($_ =~ /$rule->[1]/) {
+                               if ($maybe_skipping) {
+                                       $allowed_clean{$rule->[0]} = 1;
+                               } else {
+                                       $needed_clean{$rule->[0]} = $rule->[2] || $needed_clean{$rule->[0]} || '';
+                               }
+                       }
+               }
+               for my $rule (@global_clean_allowed) {
+                       if ($_ =~ /$rule->[1]/) {
+                               $allowed_clean{$rule->[0]} = 1;
+                       }
+               }
+               for my $rule (@global_clean_bypass) {
+                       if ($_ =~ /$rule/) {
+                               $bypass_needed_clean = 1;
+                       }
+               }
+               for my $rule (@global_depends) {
+                       if ($_ =~ /$rule->[1]/ && !$maybe_skipping) {
+                               $needed{$rule->[0]} = $rule->[2] || $needed{$rule->[0]} || '';
+                       }
+               }
+               if (/^(\S+?):+(.*)/) {
+                       $target = $1;
+                       if (grep ($_ eq $target, @rules)) {
+                               push (@rules, split (' ', $2));
+                       }
+               }
+               if (grep ($_ eq $target, @rules)) {
+                       for my $rule (@rule_clean_depends) {
+                               if ($_ =~ /$rule->[1]/) {
+                                       if ($maybe_skipping) {
+                                               $allowed_clean{$rule->[0]} = 1;
+                                       } else {
+                                               $needed_clean{$rule->[0]} = $rule->[2] || $needed_clean{$rule->[0]} || '';
+                                       }
+                               }
+                       }
+                       for my $rule (@rule_clean_allowed) {
+                               if ($_ =~ /$rule->[1]/) {
+                                       $allowed_clean{$rule->[0]} = 1;
+                               }
+                       }
+               }
+       }
+       close RULES;
+       $/ = undef;             # Back to reading everything.
+
+       tag "build-depends-indep-without-arch-indep", ""
+               if (-e "fields/build-depends-indep" && $arch_indep_packages == 0);
+
+       my $is_dep_field = sub { grep { $_ eq $_[0] } qw(build-depends build-depends-indep) };
+
+       my %depend;
+       for my $field (qw(build-depends build-depends-indep build-conflicts build-conflicts-indep)) {
+               if (open(FH, '<', "fields/$field")) {
+                       #Get data and clean it
+                       my $data = <FH>;
+                       unfold($field, \$data);
+                       $data =~ s/^\s*(.+?)\s*$/$1/;
+                       $depend{$field} = $data;
+
+                       for my $dep (split /\s*,\s*/, $data) {
+                               my @alternatives;
+                               push @alternatives, [_split_dep($_), $_] for (split /\s*\|\s*/, $dep);
+
+                               tag "virtual-package-depends-without-real-package-depends", "$field: $alternatives[0]->[0]"
+                                   if ($known_virtual_packages{$alternatives[0]->[0]} && &$is_dep_field($field));
+
+                               for my $part_d (@alternatives) {
+                                       my ($d_pkg, $d_version, $d_arch, $rest, $part_d_orig) = @$part_d;
+
+                                       for my $arch (@{$d_arch->[0]}) {
+                                               if (!$known_archs{$arch}) {
+                                                       tag "invalid-arch-string-in-source-relation", "$arch [$field: $part_d_orig]"
+                                               }
+                                       }
+
+                                       tag "build-depends-on-build-essential", $field
+                                           if ($d_pkg eq "build-essential");
+
+                                       tag "depends-on-build-essential-package-without-using-version", "$d_pkg [$field: $part_d_orig]"
+                                           if ($known_build_essential{$d_pkg} && ! $d_version->[1]);
+
+                                       tag "build-depends-on-essential-package-without-using-version", "$field: $part_d_orig"
+                                           if ($d_pkg ne "coreutils" && $known_essential{$d_pkg} && ! $d_version->[0]);
+                                       tag "build-depends-on-obsolete-package", "$field: $part_d_orig"
+                                           if ($obsolete_packages->known($d_pkg) && &$is_dep_field($field));
+
+                                       tag "build-depends-on-x-metapackage", "$field: $part_d_orig"
+                                           if ($known_x_metapackages{$d_pkg} && &$is_dep_field($field));
+
+                                       tag "build-depends-on-1-revision", "$field: $part_d_orig"
+                                           if ($d_version->[0] eq '>=' && $d_version->[1] =~ /-1$/ && &$is_dep_field($field));
+
+                                       tag "bad-relation", "$field: $part_d_orig"
+                                           if $rest;
+                               }
+                       }
+               }
+       }
+
+       # Check for duplicates.
+       my $build_all = $depend{'build-depends'} || '';
+       $build_all .= ', ' if $depend{'build-depends'} && $depend{'build-depends-indep'};
+       $build_all .= $depend{'build-depends-indep'} || '';
+       my @dups = Dep::get_dups(Dep::parse($build_all));
+       for my $dup (@dups) {
+               tag "package-has-a-duplicate-build-relation", join (', ', @$dup);
+       }
+
+       # Make sure build dependencies and conflicts are consistent.
+       $depend{'build-depends'} = Dep::parse($depend{'build-depends'} || '');
+       $depend{'build-depends-indep'} = Dep::parse($depend{'build-depends-indep'} || '');
+       for ($depend{'build-conflicts'}, $depend{'build-conflicts-indep'}) {
+               next unless $_;
+               for my $conflict (split /\s*,\s*/, $_) {
+                       if (Dep::implies($depend{'build-depends'}, Dep::parse($conflict))
+                           || Dep::implies($depend{'build-depends-indep'}, Dep::parse($conflict))) {
+                               tag "build-conflicts-with-build-dependency", $conflict;
+                       }
+               }
+       }
+
+       # Make sure that all the required build dependencies are there.  Don't
+       # issue missing-build-dependency errors for debhelper, since there's
+       # another test that does that and it would just be a duplicate.
+       for my $package (keys %needed_clean) {
+               my $dep = Dep::parse($package);
+               my $tag = $needed_clean{$package} || 'missing-build-dependency';
+               unless (Dep::implies($depend{'build-depends'}, $dep)) {
+                       if (Dep::implies($depend{'build-depends-indep'}, $dep)) {
+                               tag "clean-should-be-satisfied-by-build-depends", $package;
+                       } else {
+                               if ($tag eq 'missing-build-dependency') {
+                                       tag $tag, $package if $package ne 'debhelper';
+                               } else {
+                                       tag $tag;
+                               }
+                       }
+               }
+       }
+       for my $package (keys %needed) {
+               my $dep = Dep::parse($package);
+               my $tag = $needed{$package} || 'missing-build-dependency';
+
+               # dh_python deactivates itself if the new Python build policy
+               # is enabled.
+               if ($tag eq 'missing-dh_python-build-dependency') {
+                       next if -f 'debfiles/pycomat';
+                       next if -f 'fields/python-version';
+               }
+               unless (Dep::implies($depend{'build-depends'}, $dep)) {
+                       unless (Dep::implies($depend{'build-depends-indep'}, $dep)) {
+                               if ($tag eq 'missing-build-dependency') {
+                                       tag $tag, $package;
+                               } else {
+                                       tag $tag;
+                               }
+                       }
+               }
+       }
+
+       # This check is a bit tricky.  We want to allow in Build-Depends a
+       # dependency with any version, since reporting this tag over version
+       # mismatches would be confusing and quite likely wrong.  The approach
+       # taken is to strip the version information off all dependencies
+       # allowed in Build-Depends, strip the version information off of the
+       # dependencies in Build-Depends, and then allow any dependency in
+       # Build-Depends that's implied by the dependencies we require or allow
+       # there.
+       #
+       # We also have to map | to , when building the list of allowed
+       # packages so that the implications will work properly.
+       #
+       # This is confusing.  There should be a better way to do this.
+       if (-e "fields/build-depends" && $arch_dep_packages == 0 && !$bypass_needed_clean) {
+               open(FH, '<', "fields/build-depends")
+                   or fail("cannot read fields/build-depends: $!");
+               my $build_depends = <FH>;
+               close FH;
+               my @packages = split /\s*,\s*/, $build_depends;
+               my @allowed = map { s/[\(\[][^\)\]]+[\)\]]//g; s/\|/,/g; $_ } keys (%needed_clean), keys (%allowed_clean);
+               my $dep = Dep::parse (join (',', @allowed));
+               foreach my $pkg (@packages) {
+                       my $name = $pkg;
+                       $name =~ s/[\[\(][^\)\]]+[\)\]]//g;
+                       $name =~ s/\s+$//;
+                       $name =~ s/\s+/ /g;
+                       unless (Dep::implies($dep, Dep::parse($name))) {
+                               tag "build-depends-without-arch-dep", $name;
+                       }
+               }
+       }
+}
+
+#----- Origin
+
+if (open(FH, '<', "fields/origin")) {
+       my $origin = <FH>;
+       close(FH);
+
+       unfold('origin', \$origin);
+
+       tag "redundant-origin-field", "" if $origin =~ /^\s*debian\s*$/i;
+}
+
+#----- Bugs
+
+if (open(FH, '<', "fields/bugs")) {
+       my $bugs = <FH>;
+       close FH;
+
+       unfold('bugs', \$bugs);
+
+       tag "redundant-bugs-field"
+           if $bugs =~ m,^\s*debbugs://bugs.debian.org/?\s*$,i;
+}
+
+#----- Python-Version
+
+if (open(FH, '<', "fields/python-version")) {
+       my $pyversion = <FH>;
+       close FH;
+
+       unfold('python-version', \$pyversion);
+
+       my @valid = ([ '\d+\.\d+', '\d+\.\d+' ],
+                    [ '\d+\.\d+' ],
+                    [ '\>=\s*\d+\.\d+', '\<\<\s*\d+\.\d+' ],
+                    [ '\>=\s*\d+\.\d+' ],
+                    [ 'current', '\>=\s*\d+\.\d+' ],
+                    [ 'current' ],
+                    [ 'all' ]);
+
+       my @pyversion = split(/\s*,\s*/, $pyversion);
+       if (@pyversion > 2) {
+               if (grep { !/^\d+\.\d+$/ } @pyversion) {
+                       tag "malformed-python-version", "$pyversion";
+               }
+       } else {
+               my $okay = 0;
+               for my $rule (@valid) {
+                       if ($pyversion[0] =~ /^$rule->[0]$/
+                           && (($pyversion[1] && $rule->[1] && $pyversion[1] =~ /^$rule->[1]$/)
+                                || (! $pyversion[1] && ! $rule->[1]))) {
+                               $okay = 1;
+                               last;
+                       }
+               }
+               tag "malformed-python-version", "$pyversion" unless $okay;
+       }
+}
+
+#----- Dm-Upload-Allowed
+
+if (open(FH, '<', 'fields/dm-upload-allowed')) {
+       my $dmupload = <FH>;
+       close FH;
+
+       unfold('dm-upload-allowed', \$dmupload);
+
+       unless ($dmupload =~ /^\s*yes\s*$/) {
+               tag "malformed-dm-upload-allowed", "$dmupload";
+       }
+}
+
+#----- Field checks (without checking the value)
+
+for my $field (glob("fields/*")) {
+       $field =~ s!^fields/!!;
+
+       next if ($field eq 'original-maintainer') and $version =~ /ubuntu/;
+
+       tag "obsolete-field", "$field"
+           if $known_obsolete_fields{$field};
+
+       tag "unknown-field-in-dsc", "$field"
+           if ($type eq "source" && ! $known_source_fields{$field} && ! $known_obsolete_fields{$field});
+
+       tag "unknown-field-in-control", "$field"
+           if ($type eq "binary" && ! $known_binary_fields{$field} && ! $known_obsolete_fields{$field});
+
+       tag "unknown-field-in-control", "$field"
+           if ($type eq "udeb" && ! $known_udeb_fields{$field} && ! $known_obsolete_fields{$field});
+}
+
+}
+
+# splits "foo (>= 1.2.3) [!i386 ia64]" into
+# ( "foo", [ ">=", "1.2.3" ], [ [ "i386", "ia64" ], 1 ], "" )
+#                                                  ^^^   ^^
+#                                 true, if ! was given   ||
+#           rest (should always be "" for valid dependencies)
+sub _split_dep {
+       my $dep = shift;
+       my ($pkg, $version, $darch) = ("", ["",""], [[],""]);
+
+       $pkg = $1 if $dep =~ s/^\s*([^\s\[\(]+)\s*//;
+
+       if (length $dep) {
+               if ($dep =~ s/\s* \( \s* (<<|<=|<|=|>=|>>|>) \s* ([^\s(]+) \s* \) \s*//x) {
+                       @$version = ($1, $2);
+               }
+               if ($dep && $dep =~ s/\s*\[([^\]]+)\]\s*//) {
+                       my $t = $1;
+                       $darch->[1] = 1 if ($t =~ s/!//g);
+                       $darch->[0] = [ split /\s+/, $t ];
+               }
+       }
+
+       return ($pkg, $version, $darch, $dep);
+}
+
+sub _valid_version {
+       my $ver = shift;
+
+       # epoch check means nothing here... This check is only useful to detect
+       # weird characters in version (and to get the debian revision)
+       if ($ver =~ m/^(\d+:)?([-\.+:~A-Z0-9]+?)(-[\.+~A-Z0-9]+)?$/i) {
+               return ($1, $2, $3);
+       } else {
+               return ();
+       }
+}
+
+sub unfold {
+       my $field = shift;
+       my $line = shift;
+
+       $$line =~ s/\n$//;
+
+       if ($$line =~ s/\n//g) {
+               tag "multiline-field", "$field";
+       }
+}
+
+sub check_maint {
+       my ($maintainer, $f) = @_;
+       $maintainer =~ /^([^<\s]*(?:\s+[^<\s]+)*)?(\s*)(?:<(.+)>)?(.*)$/, 
+       my ($name, $del, $mail, $crap) = ($1, $2, $3, $4);
+
+       if (!$mail && $name =~ m/@/) { # name probably missing and address has no <>
+               $mail = $name;
+               $name = undef;
+       }
+
+       tag "$f-address-malformed", "$maintainer" if $crap;
+       tag "$f-address-looks-weird", "$maintainer" if ! $del && $name && $mail;
+
+       # Wookey really only has one name.  If we get more of these, consider
+       # removing the check.
+       if (! $name) {
+               tag "$f-name-missing", "$maintainer";
+       } elsif ($name !~ /^\S+\s+\S+/ && $name ne 'Wookey') {
+               tag "$f-not-full-name", "$name";
+       }
+                       
+       #This should be done with Email::Valid:
+       if (!$mail) {
+               tag "$f-address-missing", "$maintainer";
+       } else {
+               tag "$f-address-malformed", "$maintainer" 
+                   unless ($mail =~ /^[^()<>@,;:\\"[\]]+@(\S+\.)+\S+/); #"
+
+               tag "$f-address-is-on-localhost", "$maintainer"
+                   if ($mail =~ /(?:localhost|\.localdomain|\.localnet)$/);
+
+               tag "wrong-debian-qa-address-set-as-maintainer", "$maintainer"
+                   if ($f eq "maintainer" && $mail eq 'debian-qa@lists.debian.org');
+
+               tag "wrong-debian-qa-group-name", "$maintainer"
+                   if ($f eq "maintainer" && $mail eq 'packages@qa.debian.org' &&
+                               $name ne 'Debian QA Group');
+       }
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 8
+# End:
+# vim: syntax=perl sw=4 ts=4 noet shiftround
diff --git a/nokia-lintian/checks/fields.desc b/nokia-lintian/checks/fields.desc
new file mode 100644 (file)
index 0000000..e5ab4eb
--- /dev/null
@@ -0,0 +1,755 @@
+Check-Script: fields
+Author: Marc 'HE' Brockschmidt <marc@marcbrockschmidt.de>
+Abbrev: fld
+Type: binary, udeb, source
+Unpack-Level: 1
+Needs-Info: debfiles
+Info: This script checks the syntax of the fields in package control files,
+ as described in the Policy Manual.
+
+Tag: no-package-name
+Type: error
+Info: The package does not have a `Package:' field in its control file.
+Ref: policy 5.3
+
+Tag: bad-package-name
+Type: error
+Info: A package name should be at least two characters long, must consist
+ of the alphanumerics and `+' `-' and `.', and must start with an
+ alphanumeric character.
+Ref: policy 5.6.7
+
+Tag: package-not-lowercase
+Type: error
+Info: New packages should not use uppercase characters in their names.
+Ref: policy 5.6.7
+
+Tag: no-version-field
+Type: error
+Info: The package does not have a `Version:' field in its control file.
+Ref: policy 5.3
+
+Tag: bad-version-number
+Type: error
+Info: The version number fails one of the syntactic requirements of dpkg.
+Ref: policy 5.6.12
+
+Tag: upstream-version-not-numeric
+Type: error
+Info: The upstream version number should start with a digit. 
+Ref: policy 5.6.12
+
+Tag: debian-revision-not-well-formed
+Type: warning
+Info: The debian version part (the part after the -) should consist of one
+ or two dot-separated parts: one for a regular maintainer release or two
+ for a source-NMU,
+
+Tag: debian-revision-should-not-be-zero
+Type: warning
+Info: The debian version part (the part after the -) should start with one,
+ not with zero. This is to ensure that a correctly-done Maintainer Upload will
+ always have a higher version number than a Non-Maintainer upload: a NMU could
+ have been prepared which introduces this upstream version with
+ Debian-revision -0.1
+Ref: devref 5.11.2
+
+Tag: no-architecture-field
+Type: error
+Info: The package does not have an `Architecture:' field in its control file.
+Ref: policy 5.3
+
+Tag: magic-arch-in-arch-list
+Type: error
+Info: The special architecture values `all' and `any' only make sense if
+ they occur alone.
+Ref:  policy 5.6.8
+
+Tag: unknown-architecture
+Type: warning
+Info: This package claims to be for an unknown architecture.  The
+ architecture should be one of the values supported by dpkg or one of the
+ special values "all" or "any".  The special value "source" is only used
+ in *.changes files and does not make sense in a binary package or a *.dsc
+ file.
+
+Tag: too-many-architectures
+Type: error
+Info: A binary package should list exactly one architecture (the one it is
+ compiled for), or the special value `all' if it is architecture-independent.
+Ref: policy 5.6.8
+
+Tag: arch-any-in-binary-pkg
+Type: error
+Info: The special architecture value `any' does not make sense in a binary
+ package.
+Ref: policy 5.6.8
+
+Tag: aspell-package-not-arch-all
+Type: warning
+Info: This package appears to be an aspell dictionary package, but it is
+ not Architecture: all.  The binary hashes should be built at install-time
+ by calling aspell-autobuildhash, so the contents of the package should be
+ architecture-independent.
+Ref: aspell-autobuildhash(8)
+
+Tag: no-maintainer-field
+Type: error
+Info: The package does not have a `Maintainer:' field in its control file.
+Ref: policy 5.3
+Tested: empty
+
+Tag: maintainer-name-missing
+Type: error
+Info: The maintainer field seems to contain just an email address. It must
+ contain the package maintainer's name and email address.
+Ref: policy 5.6.2
+
+Tag: maintainer-address-missing
+Type: error
+Info: The maintainer field should contain the package maintainer's name and
+ email address, with the name followed by the address inside angle
+ brackets (&lt; and &gt;).  The address seems to be missing.
+Ref: policy 5.6.2
+
+Tag: maintainer-address-malformed
+Type: error
+Info: The maintainer field could not be parsed according to the rules in
+ the Policy Manual.
+Ref: policy 5.6.2
+
+Tag: maintainer-not-full-name
+Type: warning
+Info: The `name' part of this maintainer field is just one word, so it
+ might not be a full name.
+
+Tag: maintainer-address-looks-weird
+Type: warning
+Info: The maintainer address does not have whitespace between the name
+ and the email address.
+
+Tag: maintainer-address-is-on-localhost
+Type: error
+Info: The maintainer address includes localhost(.localdomain), which is
+ an invalid e-mail address.
+Ref: policy 5.6.2
+
+Tag: uploader-name-missing
+Type: error
+Info: The uploader field seems to contain just an email address. It must
+ contain the package uploader's name and email address.
+Ref: policy 5.6.2
+
+Tag: uploader-address-missing
+Type: error
+Info: The uploader field should contain the package uploader's name and
+ email address, with the name followed by the address inside angle
+ brackets (&lt; and &gt;).  The address seems to be missing.
+Ref: policy 5.6.2
+
+Tag: uploader-address-malformed
+Type: error
+Info: The uploader field could not be parsed according to the rules in
+ the Policy Manual.
+Ref: policy 5.6.2
+
+Tag: uploader-not-full-name
+Type: warning
+Info: The `name' part of this uploader field is just one word, so it
+ might not be a full name.
+
+Tag: uploader-address-looks-weird
+Type: warning
+Info: The uploader address does not have whitespace between the name
+ and the email address.
+
+Tag: uploader-address-is-on-localhost
+Type: error
+Info: The uploader address includes localhost(.localdomain), which is
+ an invalid e-mail address.
+Ref: policy 5.6.2
+
+Tag: wrong-debian-qa-address-set-as-maintainer
+Type: error
+Info: Orphaned packages should no longer have the address
+ &lt;debian-qa@lists.debian.org&gt; in the Maintainer field.
+ .
+ The correct Maintainer field for orphaned packages is
+ Debian QA Group &lt;packages@qa.debian.org&gt;.
+Ref: devref 5.9.4
+
+Tag: wrong-debian-qa-group-name
+Type: error
+Info: Orphaned packages should have "Debian QA Group
+ &lt;packages@qa.debian.org&gt;" in the maintainer field.
+Ref: devref 5.9.4
+
+Tag: no-human-maintainers
+Type: warning
+Info: The Maintainer address for this package is a mailing list and there
+ are no Uploaders listed.  Team-maintained packages should list the human
+ maintainers in the Uploaders field.
+Ref: devref 5.12
+
+Tag: no-source-field
+Type: error
+Info: The package does not have a `Source:' field in its control file.
+Ref: policy 5.2
+
+Tag: source-field-does-not-match-pkg-name
+Type: error
+Info: The source package's filename is not the same as the name given
+ in its Source field.  The Source field should name the package.
+Ref: policy 5.6.1
+
+Tag: source-field-malformed
+Type: error
+Info: In a binary package, the Source field should identify the source
+ package from which the package was compiled.  It should be the
+ source package name, optionally followed by a version number
+ between parentheses.
+Ref: policy 5.6.1
+
+Tag: essential-in-source-package
+Type: error
+Info: This field should only appear in binary packages.
+Ref: policy 5.6.9
+Tag: essential-no-not-needed
+Type: error
+Info: Having `Essential: no' is the same as not having the field at all,
+ so it just makes the Packages file longer with no benefit.
+Ref: policy 5.6.9
+
+Tag: unknown-essential-value
+Type: error
+Info: The only valid values for the Essential field are yes and no.
+Ref: policy 5.6.9
+
+Tag: no-section-field
+Type: warning
+Info: The package does not have a `Section:' field in its control file.
+ .
+ The field is mandatory for source packages and optional for binary
+ packages, which use the source package's value as default is nothing
+ else is specified.
+Ref: policy 5.3
+
+Tag: unknown-section
+Type: warning
+Info: The `Section:' field in this package's control file is not one of
+ the sections in use on the ftp archive.  Valid sections are currently
+ admin, comm, devel, doc, editors, electronics, embedded, games,
+ gnome, graphics, hamradio, interpreters, kde, libdevel, libs, mail, 
+ math, misc, net, news, oldlibs, otherosfs, perl, python, science, shells, 
+ sound, tex, text, utils, web, and x11.
+ .
+ The section name should be preceded by `non-free/' if the package
+ is in the non-free distribution, and by `contrib/' if the package
+ is in the contrib distribution.
+Ref: policy 2.4
+
+Tag: section-is-dh_make-template
+Type: error
+Info: The `Section:' field in this package's control file is set to
+ unknown.  This is not a valid section, and usually means a dh_make
+ template control file was used and never modified to set the correct
+ section.
+Ref: policy 2.4
+
+Tag: wrong-section-for-udeb
+Type: warning
+Info: udeb packages should have `Section: debian-installer'.
+
+Tag: no-priority-field
+Type: warning
+Info: The package does not have a `Priority:' field in its control file.
+ .
+ The Priority field can be included in a binary package by passing
+ the -ip or -isp flags to dpkg-gencontrol when building the package.
+ The field is optional in binary packages.
+Ref: policy 5.3
+
+Tag: unknown-priority
+Type: error
+Info: The `Priority:' field in this package's control file is not one of
+ the priorities defined in the Policy Manual.
+Ref: policy 2.5
+
+Tag: superfluous-clutter-in-homepage
+Type: warning
+Info: The `Homepage:' field in this package's control file contains
+ superfluous markup around the URL, like enclosing &lt; and &gt;.
+ This is unnecessary and needlessly complicates using this information.
+
+Tag: bad-homepage
+Type: warning
+Info: The `Homepage:' field in this package's control file does not
+ contain a valid absolute URL. Most probably you forgot to specificy
+ the scheme (e.g. http).
+
+Tag: obsolete-field
+Type: error
+Info: This field is listed in the Policy Manual as obsolete and
+ not-to-be-present in any package.
+Ref: policy D.2.6
+
+Tag: unknown-field-in-dsc
+Type: info
+Info: See the Policy Manual for a list of the possible fields in
+ a source package control file.
+Ref: policy 5.4
+
+Tag: unknown-field-in-control
+Type: info
+Info: See the Policy Manual for a list of the possible fields in
+ a binary package control file.
+ .
+ In udeb packages the fields pre-depends, conflicts, essential and
+ suggests are disallowed, but they can contain the new fields
+ subarchitecture and installer-menu-item.
+Ref: policy 5.3 
+
+Tag: multiline-field
+Type: error
+Info: Most control fields must have only a single line of data.
+Ref: policy 5.1
+
+Tag: alternates-not-allowed
+Type: error
+Info: Only the `Depends', `Recommends', `Suggests' and `Pre-Depends'
+ fields may specify alternate dependencies using the `|' symbol.
+Ref: policy 7.1
+
+Tag: versioned-provides
+Type: error
+Ref: policy 7.1
+Info: The `Provides' field may not specify a version range.
+
+Tag: obsolete-relation-form
+Ref: policy 7.1
+Type: warning
+Info: The forms `&lt;' and `&gt;' mean `&lt;=' and `&gt;=', not `&lt;&lt;'
+ and `&gt;&gt;' as one might expect.  For that reason these forms are
+ obsolete, and should not be used in new packages.  Use the longer forms
+ instead.
+
+Tag: bad-version-in-relation
+Ref: policy 5.6.12
+Type: error
+Info: The version number used in this relationship does not match the
+ defined format of a version number.
+
+Tag: package-relation-with-self
+Type: warning
+Info: The package declares a relationship with itself.  This is not very
+ useful, except in the case of a package Conflicting with itself, if its
+ package name doubles as a virtual package.
+
+Tag: bad-relation
+Type: error
+Info: The package declares a relationship that could not be parsed according
+ to the rules given in the Policy Manual.
+Ref: policy 7.1
+
+Tag: new-essential-package
+Type: warning
+Info: This package has the Essential flag set.  New Essential packages
+ are sufficiently rare that it seems worth warning about.  They should
+ be discussed on debian-devel first.
+Ref: policy 3.8
+
+Tag: non-us-spelling
+Type: info
+Info: Although non-us works for a section name, non-US is preferred.
+
+Tag: doc-package-depends-on-main-package
+Type: warning
+Info: The name of this package suggests that it is a documentation package.
+ It is usually not desirable for documentation packages to depend on the
+ packages they document, because users may want to install the docs before
+ they decide whether they want to install the package.  Also, documentation
+ packages are often architecture-independent, so on other architectures
+ the package on which it depends may not even exist.
+
+Tag: depends-on-obsolete-package
+Type: error
+Info: The package depends on a package that has been superseded.
+  If the superseded package is part of an ORed group, it should not be
+  the first package in the group.
+
+Tag: ored-depends-on-obsolete-package
+Type: info
+Info: The package depends on an ORed group of packages which includes
+  a package that has been superseded.
+
+Tag: build-depends-on-obsolete-package
+Type: error
+Info: The package build-depends on a package that has been superseded.
+
+Tag: depends-on-old-emacs
+Type: warning
+Info: The package lists an old version of Emacs as its first dependency.
+ It should probably be updated to support the current version of Emacs
+ in the archive and then list that version first in the list of Emacs
+ flavors it supports.
+ .
+ If the package intentionally only supports older versions of Emacs (if,
+ for example, it was included with later versions of Emacs), add a lintian
+ override.
+
+Tag: depends-on-x-metapackage
+Type: error
+Info: Packages that are not themselves metapackages must not depend on X
+ Window System metapackages.
+ .
+ The metapackages xorg, xorg-dev, x-window-system, x-window-system-dev, and
+ x-window-system-core exist only for the benefit of users and dependencies
+ for other metapackages and should not be used in regular package
+ dependencies.
+
+Tag: build-depends-on-x-metapackage
+Type: error
+Info: Packages must not build-depend on X Window System metapackages.
+ .
+ The metapackages xorg, xorg-dev, x-window-system, x-window-system-dev, and
+ x-window-system-core exist only for the benefit of users and should not
+ be used in package build dependencies.
+
+Tag: depends-on-essential-package-without-using-version
+Type: error
+Ref: policy 3.5
+Info: The package declares a depends on an essential package, e.g. dpkg,
+ without using a versioned depends.  Packages do not need to depend on
+ essential packages; essential means that they will always be present.
+ The only reason to list an explicit dependency on an essential package
+ is if you need a particular version of that package, in which case the
+ version should be given in the dependency.
+
+Tag: build-depends-on-essential-package-without-using-version
+Type: error
+Ref: policy 4.2
+Info: The package declares a build-depends on an essential package, e.g. dpkg,
+ without using a versioned depends.  Packages do not need to build-depend on
+ essential packages; essential means that they will always be present.
+ The only reason to list an explicit dependency on an essential package
+ is if you need a particular version of that package, in which case the
+ version should be given in the dependency.
+
+Tag: virtual-package-depends-without-real-package-depends
+Type: warning
+Info: The package declares a depends on a virtual package without listing a
+ real package as an alternative first.
+ .
+ If this package could ever be a build dependency, it should list a real
+ package as the first alternative to any virtual package in its Depends.
+ Otherwise, the build daemons will not be able to provide a consistent
+ build environment.
+ .
+ If it will never be a build dependency, this isn't necessary, but you may
+ want to consider doing so anyway if there is a real package providing
+ that virtual package that most users will want to use.
+
+Tag: invalid-arch-string-in-source-relation
+Type: error
+Ref: policy 5.6.8
+Info: The architecture string in the source relation does not follow policy.
+ A common cause of this is a comma in the arch, i.e. [i386, m68k], it should
+ be [i386 m68k].
+
+Tag: depends-on-build-essential-package-without-using-version
+Type: error
+Ref: policy 4.2
+Info: The package declares a depends on a build essential package without
+ using a versioned depends.  Packages do not have to build-depend on any
+ package included in build-essential.  It is the responsibility of anyone
+ building packages to have all build-essential packages installed.  The
+ only reason for an explicit dependency on a package included in
+ build-essential is if a particular version of that package is required,
+ in which case the dependency should include the version.
+
+Tag: package-depends-on-an-x-font-package
+Type: error
+Info: Packages must not depend on X Window System font packages.
+ .
+ If one or more of the fonts so packaged are necessary for proper operation
+ of the package with which they are associated the font package may be
+ Recommended; if the fonts merely provide an enhancement, a Suggests
+ relationship may be used.
+Ref: policy 11.8.5
+
+Tag: build-depends-indep-without-arch-indep
+Type: error
+Ref: policy 7.7
+Info: The control file specifies source relations for architecture-independent
+ packages, but no architecture-independent packages are built.
+
+Tag: build-depends-without-arch-dep
+Type: info
+Ref: policy 7.7
+Info: The control file lists the given package in Build-Depends, but no
+ architecture-dependent packages are built. If all the packages built are
+ architecture-independent, the only packages that should be listed in
+ Build-Depends are those required to run the clean target (such as
+ debhelper if you use dh_clean). Other build dependencies should be listed
+ in Build-Depends-Indep instead.
+
+Tag: clean-should-be-satisfied-by-build-depends
+Type: error
+Ref: policy 7.7
+Info: The specified package is required to run the clean target of
+ <tt>debian/rules</tt> and therefore must be listed in Build-Depends, not
+ Build-Depends-Indep, even if no architecture-dependent packages are
+ built.
+
+Tag: missing-build-dependency
+Type: error
+Ref: policy 4.2
+Info: The package doesn't specify a build dependency on a package that is
+ used in <tt>debian/rules</tt>.
+ .
+ lintian intentionally does not take into account transitive dependencies.
+ Even if the package build-depends on some package that in turn
+ build-depends on the needed package, an explicit build dependency should
+ be added.  Otherwise, a latent bug is created that will appear without
+ warning if the other package is ever updated to change its dependencies.
+ Even if this seems unlikely, please always add explicit build
+ dependencies on every non-essential, non-build-essential package that is
+ used directly during the build.
+
+Tag: missing-python-build-dependency
+Type: error
+Ref: policy 4.2
+Info: The package appears to use Python as part of its build process in
+ <tt>debian/rules</tt> but doesn't depend on Python.
+ .
+ Normally, packages that use Python as part of the build process should
+ build-depend on one of python, python-all, python-dev, or python-all-dev
+ depending on whether they support multiple versions of Python and whether
+ they're building modules or only using Python as part of the package
+ build process.  Packages that depend on a specific version of Python may
+ build-depend on the appropriate pythonX.Y or pythonX.Y-dev package
+ instead.
+
+Tag: missing-dh_python-build-dependency
+Type: error
+Ref: dh_python(1)
+Info: The package runs dh_python in <tt>debian/rules</tt> but doesn't
+ build-depend on python or python-dev. dh_python requires
+ <tt>/usr/bin/python</tt> to run, so packages using dh_python must
+ build-depend on python (or python-dev or python-all-dev, which in turn
+ depend on python), even if they don't otherwise need Python to build.
+
+Tag: build-conflicts-with-build-dependency
+Type: error
+Ref: policy 7.7
+Info: The package build-conflicts with a package that it also
+ build-depends on.
+
+Tag: package-has-a-duplicate-build-relation
+Type: warning
+Info: The package declares the given build relations on the same package
+ in either Build-Depends or Build-Depends-Indep, but the build relations
+ imply each other and are therefore redundant.
+
+Tag: build-depends-on-1-revision
+Type: warning
+Info: The package declares a build dependency on a version of a package
+ with a -1 Debian revision such as "libfoo (&gt;= 1.2-1)".  Such a
+ dependency will not be satisfied by a backport of libfoo 1.2-1 and
+ therefore makes backporting unnecessarily difficult.  Normally, the -1
+ version is unneeded and a dependency such as "libfoo (&gt;= 1.2)" would
+ be sufficient.  If there was an earlier -0.X version of libfoo that would
+ not satisfy the dependency, use "libfoo (&gt;= 1.2-1~)" instead.
+
+Tag: needlessly-depends-on-awk
+Type: error
+Info: The package seems to declare a relation on awk. awk is a virtual
+ package, but it is special since it's de facto essential. If you don't
+ need to depend on a specific version of awk (which wouldn't work anyway,
+ as dpkg doesn't support versioned provides), you should remove the
+ dependency on awk.
+
+Tag: package-depends-on-multiple-libstdc-versions
+Type: error
+Info: The package seems to declare several relations to a libstdc version.
+ This is not only sloppy but in the case of libraries, it may well break
+ the runtime execution of programs.
+
+Tag: package-depends-on-multiple-tcl-versions
+Type: error
+Info: The package seems to declare several relations to a tcl version.
+ This is not only sloppy but in the case of libraries, it may well break
+ the runtime execution of programs.
+
+Tag: package-depends-on-multiple-tclx-versions
+Type: error
+Info: The package seems to declare several relations to a tclx version.
+ This is not only sloppy but in the case of libraries, it may well break
+ the runtime execution of programs.
+
+Tag: package-depends-on-multiple-tk-versions
+Type: error
+Info: The package seems to declare several relations to a tk version.
+ This is not only sloppy but in the case of libraries, it may well break
+ the runtime execution of programs.
+
+Tag: package-depends-on-multiple-tkx-versions
+Type: error
+Info: The package seems to declare several relations to a tkx version.
+ This is not only sloppy but in the case of libraries, it may well break
+ the runtime execution of programs.
+
+Tag: package-depends-on-multiple-libpng-versions
+Type: error
+Info: The package seems to declare several relations to a libpng version.
+ This is not only sloppy but in the case of libraries, it may well break
+ the runtime execution of programs.
+
+Tag: depends-on-libdb1-compat
+Type: error
+Info: The package seems to declare a relation on libdb1-compat.
+ This library exists for compatibility with applications built against
+ glibc 2.0 or 2.1. There is intentionally no corresponding development
+ package. Do not link new applications against this library!
+
+Tag: depends-on-python-minimal
+Type: error
+Info: The python-minimal package (and versioned variants thereof) exists
+ only to possibly become an Essential package.  Depending on it is always
+ an error since it should never be installed without python.  If it
+ becomes Essential, there is no need to depend on it, and until then,
+ packages that require Python must depend on python.
+
+Tag: dbg-package-missing-depends
+Type: warning
+Info: This package has a name of the form of "X-dbg", indicating it
+ contains detached debugging symbols for the package X.  If so, it should
+ depend on the corresponding package, generally with (= ${binary:Version})
+ since the debugging symbols are only useful with the binaries created by
+ the same build.
+
+Tag: conflicts-with-dependency
+Type: error
+Ref: policy 7.4
+Info: The package seems to conflict with one of its dependencies,
+ recommendations, or suggestions by listing it in Conflicts or Breaks.
+
+Tag: package-uses-breaks
+Type: warning
+Ref: policy 7.3
+Info: This package uses the Breaks control field.  This control field
+ should not be used until the stable release of Debian supports Breaks.
+
+Tag: breaks-without-version
+Type: warning
+Ref: policy 7.3
+Info: This package declares a Breaks relationship with another package
+ that has no version number.  Normally, Breaks should be used to indicate
+ an incompatibility with a specific version of another package, or with
+ all versions predating a fix.  If the two packages can never be installed
+ at the same time, Conflicts should normally be used instead.
+
+Tag: bad-menu-item
+Type: error
+Info: The field Installer-Menu-Item should only contain positive integer
+ values.
+
+Tag: redundant-origin-field
+Type: warning
+Info: You use the Origin field though the field value is the default (Debian).
+ In this case the field is redundant and should be removed.
+
+Tag: binary-nmu-uses-old-version-style
+Type: warning
+Ref: devref 5.10.2.1
+Info: The version number of a binary NMU should be formed by appending
+ <tt>+b</tt> and a digit to the source version.  This version scheme is
+ special-cased by the archive software.  The -x.x.x version number style
+ should no longer be used.
+
+Tag: binary-nmu-debian-revision-in-source
+Type: warning
+Ref: devref 5.10.2.1
+Info: The version number of your source package ends in +b and a number or
+ has a Debian revision containing three parts.  These version numbers are
+ used by binary NMUs and should not be used as the source version.  (The
+ +b form is the current standard; the three-part version number now
+ obsolete.)
+
+Tag: redundant-bugs-field
+Type: warning
+Info: You use the Bugs field though the field value is the default 
+ (debbugs://bugs.debian.org/). In this case the field is redundant and
+ should be removed.
+
+Tag: build-depends-on-build-essential
+Type: error
+Ref: policy 7.7
+Info: You depend on the build-essential package, which is only a
+ meta-package depending on build tools that have to be installed in all
+ build environments.
+
+Tag: malformed-python-version
+Type: error
+Ref: Python policy 2.3
+Info: The Python-Version control field is not in one of the valid
+ formats.  It should be in one of the following formats:
+ .
+     all
+     current
+     current, &gt;= X.Y
+     &gt;= X.Y
+     &gt;= A.B, &lt;&lt; X.Y
+     A.B, X.Y
+ .
+ (One or more specific versions may be listed with the last form.)  A.B
+ and X.Y should be Python versions.
+
+Tag: old-versioned-python-dependency
+Type: warning
+Info: This package appears to be an architecture-indepedent Python module
+ but has a dependency on a version of python less than a particular
+ version and no Python-Version control field.  This normally means that
+ the package isn't using the current Python policy; most
+ architecture-independent Python packages will work with any future
+ version of Python if they follow the new policy.
+ .
+ If this package really does require only a particular range of Python
+ versions, add a Python-Version control field (as described in 2.3 of the
+ Python policy) to resolve this warning.
+
+Tag: malformed-dm-upload-allowed
+Type: error
+Ref: http://www.debian.org/vote/2007/vote_003
+Info: The Dm-Upload-Allowed field in this package is set to something
+ other than "yes".  The only standardized value for this field in the
+ Debian GR is "yes" and other values (including capitalization varients)
+ may not work as expected.
+
+Tag: doc-package-should-be-section-doc
+Type: warning
+Info: This package has a name suggesting that it contains only
+ documentation.  If so, it should be in section "doc".
+
+Tag: python-package-should-be-section-python
+Type: warning
+Info: This package has a name suggesting that it is a Python extension or
+ part of the Python environment.  If so, it should be in section
+ "python".
+
+Tag: perl-package-should-be-section-perl
+Type: warning
+Info: This package has a name suggesting that it is a Perl module package.
+ If so, it should be in section "perl".
+
+Tag: dev-package-should-be-section-libdevel
+Type: warning
+Info: This package has a name suggesting that it is a library development
+ package.  If so, it should be in section "libdevel".
+
+Tag: debug-package-should-be-priority-extra
+Type: warning
+Info: This package has a name suggesting that it contains detached
+ debugging symbols.  If so, it should have priority "extra" since users
+ normally do not need such packages.
diff --git a/nokia-lintian/checks/files b/nokia-lintian/checks/files
new file mode 100644 (file)
index 0000000..4a177c7
--- /dev/null
@@ -0,0 +1,959 @@
+# files -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::files;
+use strict;
+use Dep;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my $file;
+my $source_pkg = "";
+my $pkg_section = "";
+my $is_python;
+my $is_perl;
+my $has_binary_perl_file;
+my @nonbinary_perl_files_in_lib;
+
+my %is_hard_link;
+my %linked_against_libvga;
+my %script = ();
+
+# read data from objdump-info file
+open(IN, '<', "objdump-info")
+    or fail("cannot find objdump-info for $type package $pkg");
+while (<IN>) {
+    chop;
+
+    next if m/^\s*$/;
+
+    if (m,^-- (?:\./)?(\S+)\s*$,) {
+       $file = $1;
+    } elsif (m,^\s*NEEDED\s*(\S+),) {
+       my $lib = $1;
+       $linked_against_libvga{$file} = 1
+           if $lib =~ m/libvga/;
+    }
+}
+close(IN);
+
+# Get source package name, if possible.
+if (open (SOURCE, '<', "fields/source")) {
+    chomp ($source_pkg = (<SOURCE> || ""));
+    close SOURCE;
+}
+
+# Get section.
+if (open (SECTION, '<', "fields/section")) {
+    chomp ($pkg_section = <SECTION>);
+    close SECTION;
+}
+
+# find out which files are scripts
+open(SCRIPTS, '<', "scripts") or fail("cannot open lintian scripts file: $!");
+while (<SCRIPTS>) {
+    chop;
+    m/^(\S*) (.*)$/ or fail("bad line in scripts file: $_");
+    $script{$2} = 1;
+}
+close(SCRIPTS);
+
+# We only want to warn about these once.
+my $warned_x11_predepends = 0;
+my $warned_debug_name = 0;
+
+my %dir_counts;
+my @devhelp;
+my @devhelp_links;
+
+# Read package contents...
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+open(NUMERIC, '<', "index-owner-id")
+    or fail("cannot open index file index-owner-id: $!");
+while (<IN>) {
+    chop;
+
+    my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
+    my $link;
+    my $operm;
+
+    my $numeric = <NUMERIC>;
+    chop $numeric;
+    fail("cannot read index file index-owner-id") unless defined $numeric;
+    my ($owner_id, $file_chk) = (split(' ', $numeric, 6))[1, 5];
+    fail("mismatching contents of index files: $file $file_chk")
+       if $file ne $file_chk;
+
+    $file =~ s,^\./,,;
+
+    if ($file =~ s/ link to (.*)//) {
+        $is_hard_link{$file} = 1;
+       my $link_target = $1;
+       $link_target =~ s,^\./,,;
+       my $link_target_dir = $link_target;
+       $link_target_dir =~ s,[^/]*$,,;
+
+       # It may look weird to sort the file and link target here, but since
+       # it's a hard link, both files are equal and either could be
+       # legitimately reported first.  tar will generate different tar files
+       # depending on the hashing of the directory, and this sort produces
+       # stable lintian output despite that.
+       #
+       # TODO: actually, policy says 'conffile', not '/etc' -> extend!
+       tag "package-contains-hardlink", join (' -> ', sort ($file, $link_target))
+           if $file =~ m,^etc/,
+               or $link_target =~ m,^etc/,
+               or $file !~ m,^\Q$link_target_dir\E[^/]*$,;
+    } elsif ($perm =~ m/^l/) {
+       ($file, $link) = split(' -> ', $file);
+    }
+
+    $operm = perm2oct($perm);
+
+    my ($year) = ($date =~ /^(\d{4})/);
+    if ( $year <= 1984 ) { # value from dak CVS: Dinstall::PastCutOffYear
+       tag "package-contains-ancient-file", "$file $date";
+    }
+
+    my ($owner_uid, $owner_gid) = split ('/', $owner_id);
+    if (!($owner_uid < 100 || $owner_uid == 65534
+         || ($owner_uid >= 60000 && $owner_uid < 65000))
+       || !($owner_gid < 100 || $owner_gid == 65534
+            || ($owner_gid >= 60000 && $owner_gid < 65000))) {
+       tag "wrong-file-owner-uid-or-gid", $file, $owner_id;
+    }
+
+    # *.devhelp and *.devhelp2 files must be accessible from a directory in
+    # the devhelp search path: /usr/share/devhelp/books and
+    # /usr/share/gtk-doc/html.  We therefore look for any links in one of
+    # those directories to another directory.  The presence of such a link
+    # blesses any file below that other directory.
+    if ($link and $file =~ m,usr/share/(devhelp/books|gtk-doc/html)/,) {
+       my $blessed = $link;
+       if ($blessed !~ m,^/,) {
+           my $base = $file;
+           $base =~ s,/+[^/]+$,,;
+           while ($blessed =~ s,^\.\./,,) {
+               $base =~ s,/+[^/]+$,,;
+           }
+           $blessed = "$base/$blessed";
+       }
+       push (@devhelp_links, $blessed);
+    }
+
+    #count directory contents:
+    $dir_counts{$file} ||= 0 if ($perm =~ m/^d/);
+    $dir_counts{$1} = ($dir_counts{$1} || 0) + 1 if ($file =~ m,^(.+/)[^/]+/?$,);
+
+    # ---------------- /etc
+    if ($file =~ m,^etc/,) {
+       if ($file =~ m,^etc/nntpserver, ) {
+           tag "package-uses-obsolete-file", "$file";
+       }
+       # ---------------- /etc/cron.daily, etc.
+       elsif ($file =~ m,^etc/cron\.(daily|hourly|monthly|weekly)/[^\.].*\., ) {
+           tag "run-parts-cron-filename-contains-full-stop", "$file";
+       }
+       # ---------------- /etc/cron.d
+       elsif ($file =~ m,^etc/cron\.d/\S, and $operm != 0644) {
+           tag "bad-permissions-for-etc-cron.d-script", sprintf("$file %04o != 0644",$operm);
+       }
+       # ---------------- /etc/emacs.*
+       elsif ($file =~ m,^etc/emacs.*/\S, and $perm =~ m/^-/
+              and $operm != 0644) {
+           tag "bad-permissions-for-etc-emacs-script", sprintf("$file %04o != 0644",$operm);
+       }
+       # ---------------- /etc/gconf/schemas
+       elsif ($file =~ m,^etc/gconf/schemas/\S,) {
+           tag "package-installs-into-etc-gconf-schemas", "$file";
+       }
+       # ---------------- /etc/init.d
+       elsif ($file =~ m,^etc/init\.d/\S,
+              and $file !~ m,^etc/init\.d/(README|skeleton)$,
+              and $operm != 0755
+              and $perm =~ m/^-/) {
+           tag "non-standard-file-permissions-for-etc-init.d-script",
+               sprintf("$file %04o != 0755",$operm);
+       }
+       #----------------- /etc/pam.conf
+       elsif ($file =~ m,^etc/pam.conf, and $pkg ne "libpam-runtime" ) {
+           tag "config-file-reserved", "$file by libpam-runtime";
+       }
+       # ---------------- /etc/rc.d
+       elsif ($type ne 'udeb' and $file =~ m,^etc/rc\.d/\S, and $pkg !~ /^(sysvinit|file-rc)$/) {
+           tag "package-installs-into-etc-rc.d", "$file";
+       }
+       # ---------------- /etc/rc?.d
+       elsif ($type ne 'udeb' and $file =~ m,^etc/rc(\d|S)\.d/\S, and $pkg !~ /^(sysvinit|file-rc)$/) {
+           tag "package-installs-into-etc-rc.d", "$file";
+       }
+       # ---------------- /etc/rc.boot
+       elsif ($file =~ m,^etc/rc\.boot/\S,) {
+           tag "package-installs-into-etc-rc.boot", "$file";
+       }
+    }
+    # ---------------- /usr
+    elsif ($file =~ m,^usr/,) {
+       # ---------------- /usr/share/doc
+       if ($file =~ m,^usr/share/doc/\S,) {
+           if ($type eq 'udeb') {
+               tag "udeb-contains-documentation-file", "$file";
+           } else {
+               # file not owned by root?
+               if ($owner ne 'root/root') {
+                   tag "bad-owner-for-doc-file", "$file $owner != root/root";
+               }
+
+               # file directly in /usr/share/doc ?
+               if ($perm =~ m/^-/ and $file =~ m,^usr/share/doc/[^/]+$,) {
+                   tag "file-directly-in-usr-share-doc", "$file";
+               }
+
+               # executable in /usr/share/doc ?
+               if ($perm =~ m/^-.*[xs]/ and $file !~ m,^usr/share/doc/([^/]+/)?examples/,) {
+                   if ($script{$file}) {
+                       tag "script-in-usr-share-doc", "$file";
+                   } else {
+                       tag "executable-in-usr-share-doc", $file, (sprintf "%04o", $operm);
+                   }
+               }
+
+               # zero byte file in /usr/share/doc/
+               if ($size == 0 and $perm =~ m,^-, and not $is_hard_link{$file}) {
+                   # exception: examples may contain empty files for various reasons
+                   unless ($file =~ m,^usr/share/doc/([^/]+/)?examples/,) {
+                       tag "zero-byte-file-in-doc-directory", "$file";
+                   }
+               }
+               # gzipped zero byte files:
+               # 276 is 255 bytes (maximal length for a filename) + gzip overhead
+               if ($file =~ m,.gz$, and $size <= 276 and $perm =~ m,^-,) {
+                   unless (`gzip -dc unpacked/$file`) {
+                       tag "zero-byte-file-in-doc-directory", "$file";
+                   }
+               }
+
+               # override files have moved
+               my $tmp = quotemeta($pkg);
+               if ($file =~ m,^usr/share/doc/$tmp/override\.[lL]intian(\.gz)?$,) {
+                   tag "override-file-in-wrong-location", "$file";
+               } elsif ($file =~ m,^usr/share/lintian/overrides/$tmp/.*,) {
+                   tag "override-file-in-wrong-location", "$file";
+               }
+
+               # contains an INSTALL file?
+               if ($file =~ m,^usr/share/doc/$tmp/INSTALL(?:\..+)*$,) {
+                   tag "package-contains-upstream-install-documentation", "$file";
+               }
+
+               # contains a README for another distribution/platform?
+               if ($file =~ m,^usr/share/doc/$tmp/readme\.(apple|aix|atari|be|beos|bsd|bsdi|
+                               cygwin|darwin|irix|gentoo|freebsd|mac|macos|macosx|netbsd|
+                               openbsd|osf|redhat|sco|sgi|solaris|suse|sun|vms|win32|win9x|
+                               windows)(\.txt)?(\.gz)?$,xi){
+                   tag "package-contains-readme-for-other-platform-or-distro", "$file";\r
+               }
+           }
+       }
+       # ---------------- /usr/doc
+       elsif ($file =~ m,^usr/doc/\S,) {
+           if ($file =~ m,^usr/doc/examples/\S+, and $perm =~ m/^d/) {
+               tag "old-style-example-dir", "$file";
+           }
+       }
+       # ---------------- /usr/X11R6/lib/X11/app-defaults
+       elsif ($file =~ m,usr/X11R6/lib/X11/app-defaults,) {
+           tag "old-app-defaults-directory", "$file";
+       }
+
+       #----------------- /usr/{include,lib}/X11/
+       # Packages installing files here will need to pre-depend on x11-common
+       # so that the symlinks will be sorted out first on a sarge upgrade.
+       elsif ($file =~ m,^usr/(?:include|lib)/X11/,
+              && !$warned_x11_predepends && $pkg ne 'x11-common') {
+           my $pre_depends = '';
+           if (open (FH, '<', "fields/pre-depends")) {
+               $pre_depends = <FH>;
+               close FH;
+               $pre_depends =~ s/\n//g;
+           }
+           $pre_depends = Dep::parse($pre_depends);
+           tag "file-in-usr-something-x11-without-pre-depends", "$file"
+               unless Dep::implies($pre_depends, Dep::parse('x11-common (>= 1:7.0.0)'));
+
+           # Always set this so that we don't redo the check, even if we
+           # didn't warn.  If the first instance didn't warn, none will.
+           $warned_x11_predepends = 1;
+       }
+
+       #----------------- /usr/X11R6/
+       elsif ($file =~ m,^usr/X11R6/bin, && $pkg ne 'x11-common') {
+           tag "package-installs-file-to-usr-x11r6-bin", "$file";
+       }
+       elsif ($file =~ m,^usr/X11R6/lib/X11/fonts,) {
+           tag "package-installs-font-to-usr-x11r6", "$file";
+       }
+       elsif ($file =~ m,^usr/X11R6/, and
+              $perm !~ m,^l,) { #links to FHS locations are allowed
+           tag "package-installs-file-to-usr-x11r6", "$file";
+       }
+
+       # ---------------- /usr/lib/debug
+       elsif ($file =~ m,^usr/lib/debug/\S,) {
+           unless ($warned_debug_name) {
+               tag "debug-package-should-be-named-dbg", "$file"
+                   unless ($pkg =~ /-dbg$/);
+               $warned_debug_name = 1;
+           }
+       }
+
+       # ---------------- /usr/lib/sgml
+       elsif ($file =~ m,^usr/lib/sgml/\S,) {
+           tag "file-in-usr-lib-sgml", $file;
+       }
+       # ---------------- perllocal.pod
+       elsif ($file =~ m,^usr/lib/perl.*/perllocal.pod$,) {
+           tag "package-installs-perllocal-pod", "$file";
+       }
+       # ---------------- .packlist files
+       elsif ($file =~ m,^usr/lib/perl.*/.packlist$,) {
+           tag "package-installs-packlist", "$file";
+       }
+       elsif ($file =~ m,^usr/lib/perl5/.*\.(pl|pm)$,) {
+           push @nonbinary_perl_files_in_lib, $file;
+       }
+       elsif ($file =~ m,^usr/lib/perl5/.*\.(bs|so)$,) {
+           $has_binary_perl_file = 1;
+       }
+       # ---------------- /usr/lib -- needs to go after the other usr/lib/*
+       elsif ($file =~ m,^usr/lib/,) {
+           if ($type ne 'udeb' and $file =~ m,\.(gif|jpeg|jpg|png|tiff|xpm|xbm)$, and not defined $link) {
+               tag "image-file-in-usr-lib", "$file"
+           }
+       }
+       # ---------------- /usr/local
+       elsif ($file =~ m,^usr/local/\S+,) {
+           if ($perm =~ m/^d/) {
+               tag "dir-in-usr-local", "$file";
+           } else {
+               tag "file-in-usr-local", "$file";
+           }
+       }
+       # ---------------- /usr/share/man and /usr/X11R6/man
+       elsif ($file =~ m,^usr/X11R6/man/\S+, or $file =~ m,^usr/share/man/\S+,) {
+           if ($type eq 'udeb') {
+               tag "documentation-file", "$file";
+           }
+           if ($perm =~ m/^d/) {
+               tag "stray-directory-in-manpage-directory", "$file"
+                   if ($file !~ m,^usr/(X11R6|share)/man/(?:[^/]+/)?(man\d/)?$,);
+           } elsif ($perm =~ m/^-.*[xt]/) {
+               tag "executable-manpage", "$file";
+           }
+       }
+       # ---------------- /usr/share/info
+       elsif ($file =~ m,^usr/share/info\S+,) {
+           if ($type eq 'udeb') {
+               tag "documentation-file", "$file";
+           }
+       }
+       # ---------------- /usr/share/linda/overrides
+       elsif ($file =~ m,^usr/share/linda/overrides/\S+,) {
+           tag "package-contains-linda-override", $file;
+       }
+       # ---------------- /usr/share
+       elsif ($file =~ m,^usr/share/[^/]+$,) {
+           if ($perm =~ m/^-/) {
+               tag "file-directly-in-usr-share", "$file";
+           }
+       }
+        # ---------------- /usr/bin
+       elsif ($file =~ m,^usr/bin/,) {
+           if ($perm =~ m/^d/ and $file =~ m,^usr/bin/., and $file !~ m,^usr/bin/(X11|mh)/,) {
+               tag "subdir-in-usr-bin", "$file";
+           }
+       }
+       # ---------------- /usr subdirs
+       elsif ($type ne 'udeb' and $file =~ m,^usr/[^/]+/$,) { # FSSTND dirs
+           if ( $file =~ m,^usr/(dict|doc|etc|info|man|adm|preserve)/,) {
+               tag "FSSTND-dir-in-usr", "$file";
+           }
+           # FHS dirs
+           elsif ($file !~ m,^usr/(X11R6|X386|
+                                   bin|games|include|
+                                   lib|lib32|lib64|
+                                   local|sbin|share|
+                                   src|spool|tmp)/,x) {
+               tag "non-standard-dir-in-usr", "$file";
+           } elsif ($file =~ m,^usr/share/doc,) {
+               tag "uses-FHS-doc-dir", "$file";
+           }
+
+           # unless $file =~ m,^usr/[^/]+-linuxlibc1/,; was tied into print
+           # above...
+           # Make an exception for the altdev dirs, which will go away
+           # at some point and are not worth moving.
+       }
+       # ---------------- .desktop files
+       # People have placed them everywhere, but nowadays the consensus seems
+       # to be to stick to the fd.org standard drafts, which says that
+       # .desktop files intended for menus should be placed in
+       # $XDG_DATA_DIRS/applications.  The default for $XDG_DATA_DIRS is
+       # /usr/local/share/:/usr/share/, according to the basedir-spec on
+       # fd.org. As distributor, we should only allow /usr/share.
+       #
+       # KDE hasn't moved its files from /usr/share/applnk, so don't warn
+       # about this yet until KDE adopts the new location.
+       elsif ($file =~ m,^usr/share/gnome/apps/.*\.desktop$,) {
+           tag "desktop-file-in-wrong-dir", $file;
+       }
+
+    }
+    # ---------------- /var subdirs
+    elsif ($type ne 'udeb' and $file =~ m,^var/[^/]+/$,) { # FSSTND dirs
+       if ( $file =~ m,^var/(adm|catman|named|nis|preserve)/, ) {
+           tag "FSSTND-dir-in-var", "$file";
+       }
+       # FHS dirs with exception in Debian policy
+       elsif ( $file !~ m,^var/(account|lib|cache|crash|games|lock|log|opt|run|spool|state|tmp|www|yp)/,) {
+           tag "non-standard-dir-in-var", "$file";
+       }
+    }
+    elsif ($type ne 'udeb' and $file =~ m,^var/lib/games/.,) {
+       tag "non-standard-dir-in-var", "$file";
+    }
+    # ---------------- /var/www
+    # Packages are allowed to create /var/www since it's historically been the
+    # default document root, but they shouldn't be installing stuff under that
+    # directory.
+    elsif ($file =~ m,^var/www/\S+,) {
+       tag "dir-or-file-in-var-www", $file;
+    }
+    # ---------------- /opt
+    elsif ($file =~ m,^opt/.,) {
+       tag "dir-or-file-in-opt", "$file";
+    }
+    elsif ($file =~ m,^hurd/.,) {
+       next;
+    } elsif ($file =~ m,^server/.,) {
+       next;
+    }
+    # ---------------- /tmp, /var/tmp, /usr/tmp
+    elsif ($file =~ m,^tmp/., or $file =~ m,^(var|usr)/tmp/.,) {
+       tag "dir-or-file-in-tmp", "$file";
+    }
+    # ---------------- /mnt
+    elsif ($file =~ m,^mnt/.,) {
+       tag "dir-or-file-in-mnt", "$file";
+    }
+    # ---------------- /bin
+    elsif ($file =~ m,^bin/,) {
+       if ($perm =~ m/^d/ and $file =~ m,^bin/.,) {
+           tag "subdir-in-bin", "$file";
+       }
+    }
+    # ---------------- /srv
+    elsif ($file =~ m,^srv/.,) {
+       tag "dir-or-file-in-srv", "$file";
+    }
+    # ---------------- FHS directory?
+    elsif ($file =~ m,^[^/]+/$, and $file ne './' and
+          $file !~ m,^(bin|boot|dev|etc|home|lib(64|32)?|mnt|opt|root|sbin|srv|tmp|usr|var)/,) {
+       # Make an exception for the base-files package here and other similar
+       # packages because they install a slew of top-level directories for
+       # setting up the base system.  (Specifically, /cdrom, /floppy,
+       # /initrd, and /proc are not mentioned in the FHS).
+       #
+       # Also make an exception for /emul, which is used for multiarch
+       # support in Debian at the moment.
+       tag "non-standard-toplevel-dir", "$file"
+           unless $pkg eq 'base-files'
+               or $pkg eq 'hurd'
+               or $pkg =~ /^rootskel(-bootfloppy)?/
+               or $file =~ m,^emul/,;
+    }
+
+    # ---------------- compatibility symlinks should not be used
+    if ($file =~ m,^usr/(spool|tmp)/, or
+       $file =~ m,^usr/(doc|bin)/X11/, or
+       $file =~ m,^var/adm/,) {
+       tag "use-of-compat-symlink", "$file";
+    }
+
+    # ---------------- .ali files (Ada Library Information)
+    if ($file =~ m,^usr/lib/.*\.ali$, && $operm != 0444) {
+       tag "bad-permissions-for-ali-file", "$file";
+    }
+
+    # ---------------- any files
+    if ($perm !~ m/^d/) {
+       unless ($type eq 'udeb'
+               or $file =~ m,^usr/(bin|dict|doc|games|
+                                   include|info|lib(32|64)?|
+                                   man|sbin|share|src|X11R6)/,x
+               or $file =~ m,^lib(32|64)?/(modules/|libc5-compat/)?,
+               or $file =~ m,^var/(games|lib|www|named)/,
+               or $file =~ m,^(bin|boot|dev|etc|sbin)/,
+               # non-FHS, but still usual
+               or $file =~ m,^usr/[^/]+-linux[^/]*/,
+               or $file =~ m,^usr/iraf/,
+               or $file =~ m,^emul/ia32-linux/(lib|usr/lib)/,) {
+           tag "file-in-unusual-dir", "$file";
+       }
+    }
+
+    # ---------------- .pyc (compiled python files
+    if ($file =~ m,^usr/lib/python\d\.\d/.*.pyc$,) {
+       tag "package-installs-python-pyc", "$file"
+    }
+
+    # ---------------- /usr/lib/site-python
+    if ($file =~ m,^usr/lib/site-python/\S,) {
+       tag "file-in-usr-lib-site-python", "$file";
+    }
+
+    # ---------------- pythonX.Y extensions
+    if ($file =~ m,^usr/lib/python\d\.\d/\S,
+       and not $file =~ m,^usr/lib/python\d\.\d/site-packages/,) {
+        # check if it's one of the Python proper packages
+       unless (defined $is_python) {
+           $is_python = 0;
+           if (open(SOURCE, '<', "fields/source")) {
+               $_ = <SOURCE>;
+               $is_python = 1 if /^python(\d\.\d)?($|\s)/;
+               close(SOURCE);
+           }
+       }
+       tag "third-party-package-in-python-dir", "$file"
+           unless $is_python;
+    }
+    # ---------------- perl modules
+    if ($file =~ m,^usr/(share|lib)/perl/\S,) {
+       # check if it's the "perl" package itself
+       unless (defined $is_perl) {
+           $is_perl = 0;
+           if (open(SOURCE, '<', "fields/source")) {
+               $_ = <SOURCE>;
+               $is_perl = 1 if /^perl($|\s)/;
+               close(SOURCE);
+           }
+       }
+       tag "perl-module-in-core-directory", "$file"
+           unless $is_perl;
+    }
+
+    # ---------------- license files
+    if ($file =~ m,(copying|licen[cs]e)(\.[^/]+)?$,i
+       # Ignore some common extensions; there was at least one file named
+       # "license.el".  These are probably license-displaying code, not
+       # license files.  Also ignore binaries in /usr/bin and friends.
+       #
+       # Another exception is made for .html and .php because preserving
+       # working links is more important than saving some bytes, and
+       # because a package had a HTML form for licenses called like that.
+       # Another exception is made for various picture formats since
+       # those are likely to just be simply pictures.
+       #
+       # DTD files are excluded at the request of the Mozilla suite
+       # maintainers.  Zope products include license files for runtime
+       # display.  underXXXlicense.docbook files are from KDE.
+       #
+       # Ignore extra license files in examples, since various package
+       # building software includes example packages with licenses.
+       and not $file =~ m/\.(el|c|h|py|cc|pl|pm|html|php|rb|xpm|png|jpe?g|gif|svg|dtd)$/
+       and not $file =~ m,^usr/share/zope/Products/.*\.(dtml|pt|cpt)$,
+       and not $file =~ m,/under\S+License\.docbook$,
+       and not $file =~ m,^(usr/)?s?bin/,
+       and not $file =~ m,^usr/share/doc/[^/]+/examples/,
+       and not defined $link) {
+       tag "extra-license-file", "$file";
+    }
+
+    # ---------------- .devhelp2? files
+    if ($file =~ m,\.devhelp2?(\.gz)?$,
+       # If the file is located in a directory not searched by devhelp, we
+       # check later to see if it's in a symlinked directory.
+       and not $file =~ m,^usr/share/(devhelp/books|gtk-doc/html)/,
+       and not $file =~ m,^usr/share/doc/[^/]+/examples/,) {
+       push (@devhelp, $file);
+    }
+
+    # ---------------- weird file names
+    if ($file =~ m,\s+\z,) {
+       tag "file-name-ends-in-whitespace", "$file";
+    }
+
+    # ---------------- plain files
+    if ($perm =~ m/^-/) {
+       my $wanted_operm;
+       # ---------------- backup files and autosave files
+       if ($file =~ /~$/ or $file =~ m,\#[^/]+\#$, or $file =~ m,/\.[^/]+\.swp$,) {
+           tag "backup-file-in-package", "$file";
+       }
+       if ($file =~ m,/\.nfs[^/]+$,) {
+           tag "nfs-temporary-file-in-package", "$file";
+       }
+
+       # ---------------- vcs control files
+       if ($file =~ m/\.((cvs|git|hg)ignore|arch-inventory|hgtags|hg_archival\.txt)$/) {
+           tag "package-contains-vcs-control-file", "$file";
+       }
+
+       # ---------------- subversion and svk commit message backups
+       if ($file =~ m/svn-commit.*\.tmp$/) {
+           tag "svn-commit-file-in-package", "$file";
+       }
+       if ($file =~ m/svk-commit.+\.tmp$/) {
+           tag "svk-commit-file-in-package", "$file";
+       }
+
+       # ---------------- executables with language extensions
+       if ($file =~ m,^(usr/)?(s?bin|games)/[^/]+\.(pl|sh|py|php|rb|tcl|bsh|csh|tcl)$,) {
+           tag "script-with-language-extension", "$file";
+       }
+
+       # ---------------- Autogenerated databases from other OSes
+       if ($file =~ m,/Thumbs\.db(\.gz)?$,i) {
+           tag "windows-thumbnail-database-in-package", "$file";
+       }
+       if ($file =~ m,/\.DS_Store(\.gz)?$,) {
+           tag "macos-ds-store-file-in-package", "$file";
+       }
+       if ($file =~ m,/\._[^_/][^/]*$, and $file !~ m/\.swp$/) {
+           tag "macos-resource-fork-file-in-package", "$file";
+       }
+
+       # ---------------- embedded Javascript libraries
+       if ($file =~ m,/(mochikit|
+                        jquery(\.(min|lite|pack))?|
+                        prototype(-[\d\.]+)?|
+                        scriptaculous|
+                        fckeditor|
+                        cropper(\.uncompressed)?
+                       )\.js(\.gz)?$,ix) {
+           tag "embedded-javascript-library", "$file";
+       }
+
+       # ---------------- general: setuid/setgid files!
+       if ($perm =~ m/s/) {
+           my ($setuid, $setgid) = ("","");
+           # get more info:
+           my ($user,$group) = ("", "");
+
+           if ($owner =~ m,^(.*)/(.*)$,) {
+               $user = $1;
+               $group = $2;
+           }
+           $setuid = $user if ($operm & 04000);
+           $setgid = $group if ($operm & 02000);
+
+           # 1st special case: program is using svgalib:
+           if (exists $linked_against_libvga{$file}) {
+               # setuid root is ok, so remove it
+               if ($setuid eq 'root') {
+                   undef $setuid;
+               }
+           }
+
+           # 2nd special case: program is a setgid game
+           if ($file =~ m,usr/lib/games/\S+, or $file =~ m,usr/games/\S+,) {
+               # setgid games is ok, so remove it
+               if ($setgid eq 'games') {
+                   undef $setgid;
+               }
+           }
+
+           # 3rd special case: allow anything with suid in the name
+           if ($pkg =~ m,-suid,) {
+               undef $setuid;
+           }
+
+           # Check for setuid and setgid that isn't expected.
+           if ($setuid and $setgid) {
+               tag "setuid-gid-binary", $file, sprintf("%04o $owner",$operm);
+           } elsif ($setuid) {
+               tag "setuid-binary", $file, sprintf("%04o $owner",$operm);
+           } elsif ($setgid) {
+               tag "setgid-binary", $file, sprintf("%04o $owner",$operm);
+           }
+
+           # Check for permission problems other than the setuid status.
+           if (($operm & 0444) != 0444) {
+               tag "executable-is-not-world-readable", $file,
+                   sprintf("%04o",$operm);
+           } elsif ($operm != 04755 && $operm != 02755 && $operm != 06755 && $operm != 04754) {
+               tag "non-standard-setuid-executable-perm", $file,
+                   sprintf("%04o",$operm);
+           }
+       }
+       # ---------------- general: executable files
+       elsif ($perm =~ m/[xt]/) {
+           # executable
+           if ($owner =~ m,root/games,) {
+               if ($operm != 2755) {
+                   tag "non-standard-game-executable-perm", $file,
+                       sprintf("%04o != 2755",$operm);
+               }
+           } else {
+               if (($operm & 0444) != 0444) {
+                   tag "executable-is-not-world-readable", $file,
+                       sprintf("%04o != 0755",$operm);
+               } elsif ($operm != 0755) {
+                   tag "non-standard-executable-perm", $file,
+                       sprintf("%04o != 0755",$operm);
+               }
+           }
+       }
+       # ---------------- general: normal (non-executable) files
+       else {
+           # not executable
+           # special case first: game data
+           if ($operm == 0664 and $owner =~ m,root/games, and
+               $file =~ m,var/(lib/)?games/\S+,) {
+               # everything is ok
+           } elsif ($operm == 0444 and $file =~ m,usr/lib/.*\.ali$,) {
+               # Ada library information files should be read-only
+               # since GNAT behaviour depends on that
+               # everything is ok
+           } elsif ($operm == 0600 and $file =~ m,etc/backup.d/,) {
+               # backupninja expects configurations files to be 0600
+           } elsif ($operm != 0644) {
+               tag "non-standard-file-perm", $file,
+                   sprintf("%04o != 0644",$operm);
+           }
+       }
+    }
+    # ---------------- directories
+    elsif ($perm =~ m/^d/) {
+       # special cases first:
+        # game directory with setgid bit
+       if ($file =~ m,var/(lib/)?games/\S+, and $operm == 02775
+            and $owner =~ m,root/games,) {
+            # do nothing, this is allowed, but not mandatory
+        }
+       # otherwise, complain if it's not 0755.
+       elsif ($operm != 0755) {
+           tag "non-standard-dir-perm", $file,
+               sprintf("%04o != 0755", $operm);
+       }
+       if ($file =~ m,/CVS/?$,) {
+           tag "package-contains-vcs-control-dir", "$file";
+       }
+       if ($file =~ m,/\.(svn|bzr|git|hg)/?$,) {
+           tag "package-contains-vcs-control-dir", "$file";
+       }
+       if (($file =~ m,/\.arch-ids/?$,)
+           || ($file =~ m,/\{arch\}/?$,)) {
+           tag "package-contains-vcs-control-dir", "$file";
+       }
+       if ($file =~ m,/\.(be|ditrack)/?$,) {
+           tag "package-contains-bts-control-dir", "$file";
+       }
+       if ($file =~ m,/.xvpics/?$,) {
+           tag "package-contains-xvpics-dir", "$file";
+       }
+       if ($file =~ m,usr/share/doc/[^/]+/examples/examples/?$,) {
+           tag "nested-examples-directory", "$file";
+       }
+    }
+    # ---------------- symbolic links
+    elsif ($perm =~ m/^l/) {
+       # link
+
+       my $mylink = $link;
+       if ($mylink =~ s,//+,/,g) {
+           tag "symlink-has-double-slash", "$file $link";
+       }
+       if ($mylink =~ s,(.)/$,$1,) {
+           tag "symlink-ends-with-slash", "$file $link";
+       }
+
+       # determine top-level directory of file
+       $file =~ m,^/?([^/]*),;
+       my $filetop = $1;
+
+       if ($mylink =~ m,^/([^/]*),) {
+           # absolute link, including link to /
+
+           # determine top-level directory of link
+           $mylink =~ m,^/([^/]*),;
+           my $linktop = $1;
+
+           if ($type ne 'udeb' and $filetop eq $linktop) {
+               # absolute links within one toplevel directory are _not_ ok!
+               tag "symlink-should-be-relative", "$file $link";
+           }
+
+           # Any other case is already definitely non-recursive
+           tag "symlink-is-self-recursive", "$file $link"
+               if $mylink eq '/';
+
+       } else {
+           # relative link, we can assume from here that the link starts nor
+           # ends with /
+
+           my @filecomponents = split('/', $file);
+           # chop off the name of the symlink
+           pop @filecomponents;
+
+           my @linkcomponents = split('/', $mylink);
+
+           # handle `../' at beginning of $link
+           my $lastpop = undef;
+           my $linkcomponent = undef;
+           while ($linkcomponent = shift @linkcomponents) {
+               if ($linkcomponent eq '.') {
+                   tag "symlink-contains-spurious-segments", "$file $link"
+                       unless $mylink eq '.';
+                   next;
+               }
+               last if $linkcomponent ne '..';
+               if (@filecomponents) {
+                   $lastpop = pop @filecomponents;
+               } else {
+                   tag "symlink-has-too-many-up-segments", "$file $link";
+                   goto NEXT_LINK;
+               }
+           }
+
+           if (!defined $linkcomponent) {
+               # After stripping all starting .. components, nothing left
+               tag "symlink-is-self-recursive", "$file $link";
+           }
+
+           # does the link go up and then down into the same directory?
+           # (lastpop indicates there was a backref at all, no linkcomponent
+           # means the symlink doesn't get up anymore)
+           if (defined $lastpop && defined $linkcomponent &&
+               $linkcomponent eq $lastpop) {
+               tag "lengthy-symlink", "$file $link";
+           }
+
+           if ($#filecomponents == -1) {
+               # we've reached the root directory
+               if (($type ne 'udeb') 
+                   && (!defined $linkcomponent)
+                   || ($filetop ne $linkcomponent)) {
+                   # relative link into other toplevel directory.
+                   # this hits a relative symbolic link in the root too.
+                   tag "symlink-should-be-absolute", "$file $link";
+               }
+           }
+
+           # check additional segments for mistakes like `foo/../bar/'
+           foreach (@linkcomponents) {
+               if ($_ eq '..' || $_ eq '.') {
+                   tag "symlink-contains-spurious-segments", "$file $link";
+                   last;
+               }
+           }
+       }
+    NEXT_LINK:
+
+       if ($link =~ m,\.(gz|z|Z|bz|bz2|tgz|zip)\s*$,) {
+           # symlink is pointing to a compressed file
+
+           # symlink has correct extension?
+           unless ($file =~ m,\.$1\s*$,) {
+               tag "compressed-symlink-with-wrong-ext", "$file $link";
+           }
+       }
+    }
+    # ---------------- special files
+    else {
+       # special file
+       tag "special-file", $file, sprintf("%04o",$operm);
+    }
+}
+close(IN);
+
+fail("mismatching contents of index files") if defined <NUMERIC>;
+close(NUMERIC);
+
+#check for sect: games but nothing in /usr/games. Check for any binary to
+#save ourselves from game-data false positives:
+if ($pkg_section =~ m,games$,
+    and (($dir_counts{"usr/games/"} || 0) == 0)
+    and (($dir_counts{"bin/"} || 0) + ($dir_counts{"usr/bin/"} || 0)) > 0) {
+    tag "package-section-games-but-contains-no-game";
+}
+
+if ($pkg_section =~ m,games$,
+    and (($dir_counts{"usr/games/"} || 0)> 0)
+    and (($dir_counts{"bin/"} || 0) + ($dir_counts{"usr/bin/"} || 0)) > 0) {
+    tag "package-section-games-but-has-usr-bin";
+}
+
+# Warn about empty directories, but ignore empty directories in /var (packages
+# create directories to hold dynamically created data) or /etc (configuration
+# files generated by maintainer scripts).  Also skip base-files, which is a
+# very special case.
+#
+# Empty Perl directories are an ExtUtils::MakeMaker artifact that will be
+# fixed in Perl 5.10, and people can cause more problems by trying to fix it,
+# so just ignore them.
+#
+# python-support needs a directory for each package even it might be empty
+foreach my $dir (keys %dir_counts) {
+    next if $dir eq "";
+    next if ($dir =~ m{^var/} or $dir =~ m{^etc/});
+    next if $pkg eq 'base-files';
+    if ($dir_counts{$dir} == 0) {
+       if ($dir ne 'usr/lib/perl5/'
+           and $dir ne 'usr/share/perl5/'
+           and $dir !~ m;^usr/share/python-support/;) {
+           tag "package-contains-empty-directory", $dir;
+       }
+    }
+}
+
+if (!$has_binary_perl_file && @nonbinary_perl_files_in_lib) {
+    foreach my $file (@nonbinary_perl_files_in_lib) {
+       tag "package-installs-nonbinary-perl-in-usr-lib-perl5", "$file";
+    }
+}
+
+# Check for .devhelp2? files that aren't symlinked into paths searched by
+# devhelp.
+for my $file (@devhelp) {
+    my $found = 0;
+    for my $link (@devhelp_links) {
+       if ($file =~ m,^\Q$link,) {
+           $found = 1;
+           last;
+       }
+    }
+    tag 'package-contains-devhelp-file-without-symlink', $file unless $found;
+}
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl ts=8 sw=4
diff --git a/nokia-lintian/checks/files.desc b/nokia-lintian/checks/files.desc
new file mode 100644 (file)
index 0000000..f33fdbc
--- /dev/null
@@ -0,0 +1,768 @@
+Check-Script: files
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: fil
+Type: binary, udeb
+Unpack-Level: 1
+Needs-Info: objdump-info, scripts
+Info: This script checks if a binary package conforms to policy
+ WRT to files and directories.
+
+Tag: package-contains-ancient-file
+Type: error
+Info: Your package contains a file that claims to been generated more
+ than 20 years ago. This is most probably an error. Your package will
+ be rejected by the Debian archive scripts if it contains a file with
+ such a timestamp.
+
+Tag: old-app-defaults-directory
+Type: error
+Info: The app-defaults files have moved to /etc/X11/app-defaults/. Files in
+ the old directory, /usr/X11R6/lib/X11/app-defaults/, will no longer be
+ used by X. The old directory should not exist in packages at all;
+ this prevents X from replacing it with a compatability symlink.
+Ref: policy 11.8.6
+
+Tag: package-installs-font-to-usr-x11r6
+Type: error
+Info: The standard location for X fonts has moved to /usr/share/fonts/X11.
+ Packages providing X fonts must install them into the new path.  Fonts
+ installed into the old /usr/X11R6/lib/X11/fonts path may not be seen by
+ the X server.
+ .
+ If the package uses imake, it must build-depend on xutils-dev (&gt;=
+ 1:1.0.2-2) for the correct paths. If it uses dh_installxfonts to handle X
+ font installation, it must build-depend on debhelper (&gt;= 5.0.31).
+Ref: policy 11.8.5
+
+Tag: package-installs-file-to-usr-x11r6-bin
+Type: error
+Info: Debian has switched to the modular X tree which now uses the regular
+ FHS paths, and all packages must follow. All packages installing binaries
+ must install them into /usr/bin (or some other appropriate location)
+ instead of /usr/X11R6/bin.
+ .
+ The x11-common package attempts to change /usr/X11R6/bin into a symlink
+ to /usr/bin, so if this migration has already occurred, a package
+ installing files into /usr/X11R6/bin may appear to install
+ successfully. However, such a package will be left in an inconsistent
+ state and may orphan files when the compatibility link goes away.
+ .
+ If the package uses imake, it must build-depend on xutils-dev (&gt;=
+ 1:1.0.2-2) for the correct paths.
+Ref: policy 11.8.7
+
+Tag: file-in-usr-something-x11-without-pre-depends
+Type: info
+Info: Packages that install files into /usr/include/X11 or /usr/lib/X11
+ should pre-depend on at least x11-common (&gt;= 1:7.0.0).  These directories
+ used to be symlinks and installing files in them while they are still
+ symlinks will put files in the wrong locations and cause stranded files
+ and other problems.  x11-common is responsible for converting the
+ symlinks to regular directories.
+ .
+ A fresh etch (or later) install will not have problems even without this
+ dependency, but this dependency is needed for upgrades from sarge and is
+ therefore still useful for backports.
+Ref: policy 11.8.7
+
+Tag: package-installs-file-to-usr-x11r6
+Type: error
+Info: Packages using the X Window System should not be configured to install
+ files under the /usr/X11R6/ directory. Debian has switched to the modular
+ X tree which now uses regular FHS paths and all packages should follow.
+ .
+ Programs that use GNU autoconf and automake are usually easily configured
+ at compile time to use /usr/ instead of /usr/X11R6/.  Packages that use
+ imake must build-depend on xutils-dev (&gt;= 1:1.0.2-2) for the correct
+ paths.
+Ref: policy 11.8.7
+
+Tag: config-file-reserved
+Type: error
+Info: This file is reserved by a specific package.  Please email the
+ maintainer of the package in question if you have questions.
+
+Tag: package-uses-obsolete-file
+Type: warning
+Info: the file, /etc/nntpserver, is no longer recommenced.  As of policy
+ revision 2.5.1.0, /etc/news/server is the preferred file to use to specify
+ a news server.
+Ref: policy 11.7
+
+Tag: FSSTND-dir-in-usr
+Type: error
+Info: As of policy version 3.0.0.0, Debian no longer follows the FSSTND.  
+ .
+ Instead, the Filesystem Hierarchy Standard (FHS), version 2.3, is
+ used. You can find it in /usr/share/doc/debian-policy/fhs/ .
+
+Tag: FSSTND-dir-in-var
+Type: error
+Info: As of policy version 3.0.0.0, Debian no longer follows the FSSTND.  
+ .
+ Instead, the Filesystem Hierarchy Standard (FHS), version 2.3, is
+ used. You can find it in /usr/share/doc/debian-policy/fhs/ .
+
+Tag: package-installs-into-etc-gconf-schemas
+Type: warning
+Info: The package installs files into the <tt>/etc/gconf/schemas</tt>
+ directory.  No package should do this; this directory is reserved for
+ local overrides.  Instead, schemas should be installed into
+ <tt>/usr/share/gconf/schemas</tt>.
+
+Tag: package-installs-into-etc-rc.d
+Type: error
+Info: The package installs files into the <tt>/etc/rc.d</tt> or
+ <tt>/etc/rc?.d</tt> which is not allowed.
+Ref: policy 9.3.3
+
+Tag: package-installs-into-etc-rc.boot
+Type: error
+Info: The package installs files in the <tt>/etc/rc.boot</tt> directory,
+ which is obsolete.  See rc.boot(5) for details.
+Ref: policy 9.3.4
+
+Tag: non-standard-file-permissions-for-etc-init.d-script
+Type: error
+Info: Usually, scripts in the <tt>/etc/init.d</tt> directory should have
+ mode 0755.
+
+Tag: file-directly-in-usr-share
+Type: error
+Info: Packages should not install files directly in <tt>/usr/share</tt>,
+ i.e., without a subdirectory.
+ .
+ You should either create a subdirectory <tt>/usr/share/...</tt> for your
+ package or place the file in <tt>/usr/share/misc</tt>.
+
+Tag: file-in-usr-local
+Type: error
+Info: The package installs a file in <tt>/usr/local/...</tt> which is
+ not allowed.
+Ref: policy 9.1.2
+
+Tag: file-in-opt
+Type: error
+Info: The package installs a file in <tt>/opt/...</tt> which is not allowed.
+
+Tag: stray-directory-in-manpage-directory
+Type: error
+Info: This package installs a directory under <tt>/usr/share/man</tt> or
+ <tt>/usr/X11R6/man</tt> that isn't a manual section directory or locale
+ directory.
+Ref: fhs 4.11.5
+
+Tag: executable-manpage
+Type: error
+Info: Manual pages are not meant to be executed.
+
+Tag: dir-in-usr-local
+Type: error
+Info: The package installs a directory in <tt>/usr/local/...</tt> which is
+ not allowed.
+ .
+ If you want to provide an empty directory in <tt>/usr/local</tt> for
+ convenience of the local system administrator, please follow the rules
+ in the policy manual (section 9.1.2), i.e., create the directories in
+ the postinst script but don't fail if this isn't possible (e.g., if
+ <tt>/usr/local</tt> is mounted read-only).
+Ref: policy 9.1.2
+
+Tag: possible-name-space-pollution
+Type: warning
+Info: The package installs a binary which uses a very short file name (one
+ or two characters). This is not forbidden by policy, but short names
+ should be reserved for the user.  Unless this short name has been used
+ for a while already (like the famous `ls', `rm', `cp' commands), you
+ should consider giving these binaries a longer name.
+
+Tag: non-standard-dir-perm
+Type: warning
+Info: The directory has a mode different from 0755, and it's not one of the
+ known exceptions.
+Ref: policy 10.9
+
+Tag: executable-is-not-world-readable
+Type: warning
+Info: All executables should be readable by any user.  Since anyone can
+ download the Debian package and obtain a copy of the executable, no
+ security is gained by making the executable unreadable even for setuid
+ binaries.  If only members of a certain group may execute this file,
+ remove execute permission for world, but leave read permission.
+Ref: policy 10.9
+
+Tag: non-standard-executable-perm
+Type: warning
+Info: Executables that are not setuid or setgid should always have a mode
+ of 0755.  Since anyone can obtain the executable by downloading the
+ Debian package and extracting it, restricting access serves little
+ purpose.
+Ref: policy 10.9
+
+Tag: non-standard-game-executable-perm
+Type: warning
+Info: The file is owned by the games group but is not mode 2755.  If a
+ game does not have to be setgid games, it should be owned by the root
+ group like any other executable.  This executable is either owned by the
+ wrong group or is not setgid when it should be.
+
+Tag: non-standard-setuid-executable-perm
+Type: warning
+Info: The file is setuid or setgid and has a mode different from any of
+ 2755, 4755, 4754, or 6755.  Any other permissions on setuid executables
+ is probably a bug.  In particular, removing root write privileges serves
+ no purpose, group-writable setuid or setgid executables are probably bad
+ ideas, and setgid executables that are not world-executable serve little
+ purpose.
+Ref: policy 10.9
+
+Tag: setuid-binary
+Type: warning
+Info: The file is tagged SETUID. In some cases this is intentional, but in
+ other cases this is a bug. If this is intentional, please add a lintian
+ override to document this fact.
+
+Tag: setgid-binary
+Type: warning
+Info: The file is tagged SETGID. In some cases this is intentional, but in
+ other cases this is a bug. If this is intentional, please add a lintian
+ override to document this fact.
+
+Tag: setuid-gid-binary
+Type: warning
+Info: The file is tagged SETUID and SETGID. In some cases this is
+ intentional, but in other cases this is a bug. If this is intentional,
+ please add a lintian override to document this fact.
+
+Tag: non-standard-file-perm
+Type: warning
+Info: The file has a mode different from 0644. In some cases this is
+ intentional, but in other cases this is a bug.
+Ref: policy 10.9
+
+Tag: special-file
+Type: error
+Info: The package contains a <i>special</i> file (e.g., a device file).
+ This is forbidden by current policy. If your program needs this device,
+ you should create it by calling <tt>makedev</tt> from the postinst
+ script.
+Ref: policy 10.6
+
+Tag: old-style-example-dir
+Type: error
+Info: The package installs some files into the old
+ <tt>/usr/doc/examples</tt> directory.  The new location for examples
+ is <tt>/usr/share/doc/<i>pkg</i>/examples</tt>.
+
+Tag: compressed-symlink-with-wrong-ext
+Type: error
+Info: The package installs a symbolic link pointing to a compressed file,
+ but the symbolic link does not use the same file extension than the
+ referenced file. In most cases, this can produce troubles when the
+ user or a program tries to access the file through the link.
+Ref: policy 10.5
+
+Tag: symlink-has-double-slash
+Type: error
+Info: This symlink contains two successive slashes (//). This is in violation
+ of policy, where it is stated that symlinks should be as short as possible
+ .
+ If you use debhelper, running dh_link after creating the package structure
+ will fix this problem for you.
+Ref: policy 10.5
+
+Tag: symlink-ends-with-slash
+Type: error
+Info: This symlink ends with a slash (/). This is in violation
+ of policy, where it is stated that symlinks should be as short as possible
+ .
+ If you use debhelper, running dh_link after creating the package structure
+ will fix this problem for you.
+Ref: policy 10.5
+
+Tag: symlink-should-be-relative
+Type: warning
+Info: Symlinks to files which are in the same top-level directory should be
+ relative according to policy.  (In other words, a link in /usr to another
+ file in /usr should be relative, while a link in /usr to a file in /etc
+ should be absolute.)
+ .
+ If you use debhelper, running dh_link after creating the package structure
+ will fix this problem for you.
+Ref: policy 10.5
+
+Tag: symlink-should-be-absolute
+Type: error
+Info: Symbolic links between different top-level directories should be
+ absolute.
+ .
+ If you use debhelper, running dh_link after creating the package structure
+ will fix this problem for you.
+Ref: policy 10.5
+
+Tag: udeb-contains-documentation-file
+Type: error
+Info: udeb packages should not contain any documentation.
+
+Tag: executable-in-usr-share-doc
+Type: error
+Info: Usually, documentation files in <tt>/usr/share/doc</tt> should have mode
+ 0644.  If the executable is an example, it should go in
+ <tt>/usr/share/doc/<i>pkg</i>/examples</tt>.
+
+Tag: script-in-usr-share-doc
+Type: info
+Info: Scripts are usually not documentation files, unless they are
+ examples, in which case they should be in the
+ <tt>/usr/share/doc/<i>pkg</i>/examples</tt> directory.
+
+Tag: symlink-has-too-many-up-segments
+Type: error
+Info: The symlink references a directory beyond the root directory `/'.
+
+Tag: lengthy-symlink
+Type: error
+Info: This link goes up, and then back down into the same subdirectory.
+ Making it shorter will improve its chances of finding the right file
+ if the user's system has lots of symlinked directories.
+ .
+ If you use debhelper, running dh_link after creating the package structure
+ will fix this problem for you.
+Ref: policy 10.5
+
+Tag: symlink-is-self-recursive
+Type: warning
+Info: The symbolic link is recursive to a higher directory of the symlink
+ itself. This means, that you can infinitely chdir with this symlink. This is
+ usually not okay, but sometimes wanted behaviour.
+
+Tag: symlink-contains-spurious-segments
+Type: error
+Info: The symbolic link has needless segments like '..' and '.' in the middle.
+ These are unneeded, and make the link longer than it could be, which is in
+ violation of policy.
+ .
+ If you use debhelper, running dh_link after creating the package structure
+ will fix this problem for you.
+Ref: policy 10.5
+
+Tag: run-parts-cron-filename-contains-full-stop
+Type: warning
+Info: The script in /etc/cron.&lt;time-interval&gt; will not be executed by
+ run-parts(8) because the filename contains a "." (full stop).
+
+Tag: bad-permissions-for-etc-cron.d-script
+Type: error
+Info: Files in <tt>/etc/cron.d</tt> are configuration files for cron and not
+ scripts. Thus, they should not be marked executable.
+
+Tag: bad-permissions-for-etc-emacs-script
+Type: error
+Info: Files in the <tt>/etc/emacs*</tt> directories should not be marked
+ executable.
+
+Tag: image-file-in-usr-lib
+Type: warning
+Info: This package installs a pixmap or a bitmap within <tt>/usr/lib</tt>.
+ According to the Filesystem Hierarchy Standard, architecture-independent
+ files need to be placed within <tt>/usr/share</tt> instead.
+
+Tag: file-directly-in-usr-share-doc
+Type: error
+Info: Documentation files have to be installed in
+ <tt>/usr/share/doc/<i>pkg</i></tt>.
+Ref: policy 12.3
+
+Tag: bad-owner-for-doc-file
+Type: error
+Info: Documentation files should be owned by <tt>root/root</tt>.
+
+Tag: dir-or-file-in-var-www
+Type: error
+Ref: fhs 5
+Info: Debian packages should not install files under <tt>/var/www</tt>.
+ This is not one of the <tt>/var</tt> directories in the File Hierarchy
+ Standard and is under the control of the local administrator.  Packages
+ should not assume that it is the document root for a web server; it is
+ very common for users to change the default document root and packages
+ should not assume that users will keep any particular setting.
+ .
+ Packages that want to make files available via an installed web server
+ should instead put instructions for the local administrator in a
+ README.Debian file and ideally include configuration fragments for common
+ web servers such as Apache.
+ .
+ As an exception, packages are permitted to create the <tt>/var/www</tt>
+ directory due to its past history as the default document root, but
+ should at most copy over a default file in postinst for a new install.
+
+Tag: dir-or-file-in-tmp
+Type: error
+Info: Packages should not install into <tt>/tmp</tt> or <tt>/var/tmp</tt>.
+
+Tag: dir-or-file-in-mnt
+Type: error
+Info: Packages should not install into <tt>/mnt</tt>.  The FHS states that
+ the contents of this directory is a local issue.
+
+Tag: dir-or-file-in-opt
+Type: error
+Info: Debian packages should not install into <tt>/opt</tt>, because it
+ is reserved for add-on software.
+
+Tag: dir-or-file-in-srv
+Type: error
+Ref: fhs 3
+Info: Debian packages should not install into <tt>/srv</tt>.  The
+ specification of <tt>/srv</tt> states that its structure is at the
+ discretion of the local administrator and no package should rely on any
+ particular structure.  Debian packages that install files directly into
+ <tt>/srv</tt> can't adjust for local policy about its structure and in
+ essence force a particular structure.
+ .
+ If a package wishes to put its data in <tt>/srv</tt>, it must do this in
+ a way that allows the local administrator to specify and preserve their
+ chosen directory structure (such as through post-install configuration,
+ setup scripts, debconf prompting, etc.).
+
+Tag: third-party-package-in-python-dir
+Type: warning
+Info: According to <a href="http://www.python.org/doc/essays/packages.html">
+ <tt>http://www.python.org/doc/essays/packages.html</tt></a>, third-party
+ python packages should install their files in
+ <tt>/usr/lib/python1.5/site-packages</tt>.  All other directories in
+ <tt>/usr/lib/python1.5</tt> are for use by the core python packages.
+Tag: perl-module-in-core-directory
+Type: error
+Info: Packaged modules must not be installed into the core perl
+ directories as those directories change with each upstream perl
+ revision.  The vendor directories are provided for this purpose.
+Ref: perl-policy 3.1
+
+Tag: backup-file-in-package
+Type: warning
+Info: There is a file in the package whose name matches the format emacs
+ or vim uses for backup and autosave files.  It may have been installed by
+ accident.
+
+Tag: nfs-temporary-file-in-package
+Type: warning
+Info: There is a file in the package whose name matches the format NFS
+ uses to temporarily save files that were deleted while another process
+ had them open.  It may have been included in the package by accident
+ while building the package in an NFS filesystem.
+
+Tag: windows-thumbnail-database-in-package
+Type: warning
+Info: There is a file in the package named <tt>Thumbs.db</tt> or
+ <tt>Thumbs.db.gz</tt>, which is normally a Windows image thumbnail
+ database.  Such databases are generally useless in Debian packages and
+ were usually accidentally included by copying complete directories from
+ the source tarball.
+
+Tag: macos-ds-store-file-in-package
+Type: warning
+Info: There is a file in the package named <tt>.DS_Store</tt> or
+ <tt>.DS_Store.gz</tt>, the file name used by Mac OS X to store folder
+ attributes.  Such files are generally useless in Debian packages and were
+ usually accidentally included by copying complete directories from the
+ source tarball.
+
+Tag: macos-resource-fork-file-in-package
+Type: warning
+Info: There is a file in the package with a name starting with
+ <tt>._</tt>, the file name pattern used by Mac OS X to store resource
+ forks in non-native file systems.  Such files are generally useless in
+ Debian packages and were usually accidentally included by copying
+ complete directories from the source tarball.
+
+Tag: package-installs-perllocal-pod
+Type: warning
+Info: This package installs a file <tt>perllocal.pod</tt>.  Since that
+ file is intended for local documentation, it is not likely that it is
+ a good place for documentation supplied by a Debian package.  In fact,
+ installing this package will wipe out whatever local documentation
+ existed there.
+
+Tag: extra-license-file
+Type: warning
+Ref: policy 12.5
+Info: All license information should be collected in the
+ <tt>debian/copyright</tt> file.  This usually makes it unnecessary
+ for the package to install this information in other places as well.
+
+Tag: non-standard-toplevel-dir
+Type: error
+Info: The Filesystem Hierarchy Standard forbids the installation of new
+ files or directories in the root directory, in section 3.
+
+Tag: subdir-in-bin
+Type: error
+Info: The Filesystem Hierarchy Standard forbids the installation of new
+ directories in <tt>/bin</tt>.
+
+Tag: subdir-in-usr-bin
+Type: error
+Info: The Filesystem Hierarchy Standard forbids the installation of new
+ directories in <tt>/usr/bin</tt> other than <tt>/usr/bin/mh</tt>.
+
+Tag: non-standard-dir-in-usr
+Type: warning
+Info: The FHS says "No large software packages should use a direct
+ subdirectory under the <tt>/usr</tt> hierarchy".  This package contains
+ a directory in <tt>/usr</tt> that is not mentioned in the Filesystem
+ Hierarchy Standard.
+
+Tag: non-standard-dir-in-var
+Type: error
+Info: The FHS says "Applications should generally not add directories to
+ the top level of <tt>/var</tt>.  Such directories should only be added
+ if they have some system-wide implication, and in consultation with the
+ FHS mailing list."
+
+Tag: use-of-compat-symlink
+Type: error
+Info: This package uses a directory that, according to the Filesystem
+ Hierarchy Standard, should exist only as a compatibility symlink.
+ Packages should not traverse such symlinks when installing files, they
+ should use the standard directories instead.
+
+Tag: file-in-unusual-dir
+Type: warning
+Info: This file or symbolic link is in a directory where files are not
+ normally installed by Debian packages.
+
+Tag: package-installs-packlist
+Type: error
+Info: Packages built using the perl MakeMaker package will have a file
+ named .packlist in them.  Those files are useless, and (in some cases)
+ have the additional problem of creating an architecture-specific
+ directory name in an architecture-independent package.
+ .
+ They can be suppressed by adding the following to <tt>debian/rules</tt>:
+ .
+   find debian/<i>pkg</i> -type f -name .packlist | xargs rm -f
+ .
+ or by telling MakeMaker to use vendor install dirs; consult a recent
+ version of Perl policy. Perl 5.6.0-12 or higher supports this.
+
+Tag: zero-byte-file-in-doc-directory
+Type: warning
+Info: Package contains a file which is empty.
+
+Tag: override-file-in-wrong-location
+Type: error
+Info: Location of per package overrides the file
+ /usr/share/lintian/overrides/package.  See the lintian documentation for more
+ info on proper naming and format.
+
+Tag: package-contains-upstream-install-documentation
+Type: warning
+Ref: policy 12.3
+Info: Binary packages do not need to contain the instructions for building
+ and installing the package as this info is not needed by package users.
+ If the info contained is important for configuration perhaps it could be
+ summarized in README.Debian, otherwise an override may be added.
+
+Tag: package-contains-hardlink
+Type: warning
+Info: The package contains a hardlink in <tt>/etc</tt> or across different
+ directories. This might not work at all if directories are on different
+ filesystems (which can happen anytime as the system administrator sees fit),
+ certain filesystems such as AFS don't even support cross-directory hardlinks
+ at all.
+ .
+ For configuration files, certain editors might break hardlinks, and so
+ does dpkg in certain cases.
+ .
+ A better solution might be using symlinks here.
+
+Tag: package-contains-bts-control-dir
+Type: warning
+Info: The package contains a control directory for a bug tracking system.
+ It was most likely installed by accident, since bug tracking directories
+ usually don't belong in packages.
+
+Tag: package-contains-vcs-control-dir
+Type: warning
+Info: The package contains a control directory for a version control system.
+ It was most likely installed by accident, since version control directories
+ usually don't belong in packages.
+
+Tag: package-contains-xvpics-dir
+Type: error
+Info: Package contains a .xvpics directory. It was most likely installed by
+ accident, since thumbnails usually don't belong in packages.
+
+Tag: package-contains-vcs-control-file
+Type: warning
+Info: The package contains a VCS control file such as .(cvs|git|hg)ignore.
+ Files such as these are used by revision control systems to, for example,
+ specify untracked files it should ignore or inventory files.  This file
+ is generally useless in an installed package and was probably installed
+ by accident.
+
+Tag: svn-commit-file-in-package
+Type: warning
+Info: The package contains an svn-commit(.NNN).tmp file.  This file is
+ almost certainly a left-over from a failed Subversion commit, and does
+ not belong in a Debian package.
+
+Tag: svk-commit-file-in-package
+Type: warning
+Info: The package contains an svk-commitNNN.tmp file.  This file is almost
+ certainly a left-over from a failed Subversion commit, and does not
+ belong in a Debian package.
+
+Tag: nested-examples-directory
+Type: error
+Info: Package contains a <tt>usr/share/doc/something/examples/examples</tt>
+ directory. It was most likely installed by accident, since one examples/
+ directory should be enough for everybody(tm).
+
+Tag: package-installs-nonbinary-perl-in-usr-lib-perl5
+Type: warning
+Info: Architecture-independent Perl code should be placed in
+ <tt>/usr/share/perl5</tt>, not <tt>/usr/lib/perl5</tt>
+ unless there is at least one architecture-dependent file
+ in the module.
+
+Tag: file-in-usr-lib-site-python
+Type: error
+Ref: Python policy 1.4
+Info: The directory /usr/lib/site-python has been deprecated as a
+ location for installing Python modules and may be dropped from Python's
+ module search path in a future version.  Most likely this module is a
+ private module and should be packaged in a directory outside of Python's
+ default search path.
+
+Tag: package-installs-python-pyc
+Type: warning
+Info: Compiled python source files should not be included in the package.
+ These files should be removed from the package and created at package
+ installation time in the postinst. 
+
+Tag: bad-permissions-for-ali-file
+Type: warning
+Info: Ada Library Information (*.ali) files are required to be read-only
+ (mode 0444) by GNAT. 
+ .
+ If at least one user can write the *.ali file, GNAT considers whether
+ or not to recompile the corresponding source file.  Such recompilation
+ would fail because normal users don't have write permission on the
+ files.  Moreover, such recompilation would defeat the purpose of
+ library packages, which provide *.a and *.so libraries to link against).
+
+Tag: package-contains-readme-for-other-platform-or-distro
+Type: warning
+Info: package contains a README.(platform) file that contains instructions
+ specific to a platform or distribution other than Debian and thus can
+ most likely be removed.  If it contains information that pertains to 
+ Debian, please consider renaming it, or including it in an already 
+ existing README file.
+
+Tag: desktop-file-in-wrong-dir
+Type: warning
+Info: The package contains a .desktop file in an obsolete directory.
+ According to the menu-spec draft on freedesktop.org, those .desktop files
+ that are intended to create a menu should be placed in
+ <tt>/usr/share/applications</tt>, not <tt>/usr/share/gnome/apps</tt>.
+
+Tag: file-in-usr-lib-cgi-bin
+Type: warning
+Info: Packages shipping web server CGI files should install them in
+ <tt>/usr/lib/cgi-lib</tt>, not in <tt>/usr/lib/cgi-bin</tt>.  This is
+ done to avoid conflicts with the cgi-bin script alias, which is reserved
+ for the local use of webmasters.  Web servers should include /cgi-lib/ as
+ a standard ScriptAlias pointing to that directory.
+Ref: policy 11.5
+
+Tag: script-with-language-extension
+Type: warning
+Info: When scripts are installed into a directory in the system PATH, the
+ script name should not include an extension such as <tt>.sh</tt> or
+ <tt>.pl</tt> that denotes the scripting language currently used to
+ implement it.  The implementation language may change; if it does,
+ leaving the name the same would be confusing and changing it would be
+ disruptive.
+Ref: policy 10.4
+
+Tag: file-in-usr-lib-sgml
+Type: warning
+Ref: fhs 4
+Info: This package installs a file in <tt>/usr/lib/sgml</tt>.  This was
+ the old location for SGML catalogs and similar flies.  All those files
+ should now go into <tt>/usr/share/sgml</tt>.
+
+Tag: file-name-ends-in-whitespace
+Type: warning
+Info: This package installs a file or directory whose name ends in
+ whitespace.  This might be intentional but it's normally a mistake.  If
+ it is intentional, add a lintian override.
+ .
+ One possible cause is using debhelper 5.0.57 or earlier to install a
+ doc-base file with a Document field that ends in whitespace.
+
+Tag: package-contains-empty-directory
+Type: warning
+Info: This package installs an empty directory.  This might be intentional
+ but it's normally a mistake.  If it is intentional, add a lintian override.
+
+Tag: package-section-games-but-contains-no-game
+Type: error
+Ref: policy 11.11
+Info: This package is marked as part of the section games, but doesn't
+ contain files in <tt>/usr/games</tt>.  Binaries of games must be installed
+ in <tt>/usr/games</tt>.
+
+Tag: package-section-games-but-has-usr-bin
+Type: warning
+Ref: policy 11.11
+Info: This package is marked as part of the section games, but contains
+ exectuables in <tt>/bin</tt> or <tt>/usr/bin/</tt>.  This can be intentional,
+ but is usually a mistake.
+
+Tag: package-contains-devhelp-file-without-symlink
+Type: warning
+Info: This package contains a *.devhelp or *.devhelp2 file which is not in
+ the devhelp search path (<tt>/usr/share/devhelp/books</tt> and
+ <tt>/usr/share/gtk-doc/html</tt>) and is apparently not in a directory
+ linked into the devhelp search path.  This will prevent devhelp from
+ finding the documentation.
+ .
+ If the devhelp documentation is installed in a path outside the devhelp
+ search path (such as <tt>/usr/share/doc</tt>), create a symlink in
+ <tt>/usr/share/gtk-doc/html</tt> pointing to the documentation directory.
+
+Tag: debug-package-should-be-named-dbg
+Type: warning
+Info: This package provides at least one file in <tt>/usr/lib/debug</tt>,
+ which is intended for detached debugging symbols, but the package name
+ does not end in "-dbg".  Detached debugging symbols should be put into a
+ separate package, Priority: extra, with a package name ending in "-dbg".
+
+Tag: package-contains-linda-override
+Type: warning
+Info: This package contains a linda override file in
+ <tt>/usr/share/linda/overrides</tt>.  Linda is obsolete and has been
+ removed from the archive as of 2008-03-04.  Linda overrides should
+ probably be dropped from packages.
+
+Tag: wrong-file-owner-uid-or-gid
+Type: error
+Info: The user or group ID of the owner of the file is invalid. The
+ owner user and group IDs must be in the set of globally allocated
+ IDs, because other IDs are dynamically allocated and might be used
+ for varying purposes on different systems, or are reserved. The set
+ of the allowed, globally allocated IDs consists of the ranges 0-99,
+ 64000-64999 and 65534.
+Ref: policy 9.2
+
+Tag: embedded-javascript-library
+Type: warning
+Info: This package contains an embedded copy of the JQuery, Prototype,
+ Mochikit or "Cropper" JavaScript libraries that are now available in their
+ own packages. Please depend on the appropriate package and symlink the
+ library into the appropriate location.
+Ref: policy 4.13
diff --git a/nokia-lintian/checks/huge-usr-share b/nokia-lintian/checks/huge-usr-share
new file mode 100644 (file)
index 0000000..71c4782
--- /dev/null
@@ -0,0 +1,68 @@
+# huge-usr-share -- lintian check script -*- perl -*-
+
+# Copyright (C) 2004 Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::huge_usr_share;
+use strict;
+use Tags;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+# Threshold in kB of /usr/share to trigger this warning
+# Consider that the changelog alone can be quite big, and cannot be moved away
+my $THRESHOLD_SIZE_SOFT = 1024;
+my $THRESHOLD_SIZE_HARD = 2048;
+my $THRESHOLD_PERC = 50;
+
+my $arch;
+
+# read architecture file
+if (open(IN, '<', "fields/architecture")) {
+    chop($arch = <IN>);
+    close(IN);
+}
+
+# If this is a arch-independent package, this test doesn't apply
+return 0 if $arch eq 'all';
+# usr/share missing. other checks will moan about it
+# so just ignore this package
+return 0 if !-d 'unpacked/usr/share';
+
+my $size = `du -ks unpacked`;
+$size =~ s/\t.*//;
+$size = int $size;
+
+my $size_usrshare = `du -ks unpacked/usr/share`;
+$size_usrshare =~ s/\t.*//;
+$size_usrshare = int $size_usrshare;
+
+if ($size_usrshare > $THRESHOLD_SIZE_SOFT) {
+    my $perc = int (100 * $size_usrshare / $size);
+    if (($size_usrshare > $THRESHOLD_SIZE_HARD)
+       || ($perc > $THRESHOLD_PERC)) { 
+       tag "arch-dep-package-has-big-usr-share", "${size_usrshare}kB $perc%";
+    }
+}
+
+}
+
+1;
diff --git a/nokia-lintian/checks/huge-usr-share.desc b/nokia-lintian/checks/huge-usr-share.desc
new file mode 100644 (file)
index 0000000..9674ade
--- /dev/null
@@ -0,0 +1,21 @@
+Check-Script: huge-usr-share
+Author: Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+Abbrev: hus
+Type: binary
+Unpack-Level: 2
+Info: This script checks whether an architecture-dependent package doesn't
+ have a significantly big /usr/share
+
+Tag: arch-dep-package-has-big-usr-share
+Type: info
+Info: The package has a significant amount of architecture-independent data in
+ /usr/share, while it is an architecture-dependent package.
+ This is wasteful of mirror space and bandwidth, as we then end up with
+ multiple copies of this data, one for each architecture.
+ .
+ If the data in /usr/share is not architecture-independent, it is a policy
+ violation, and in this case, you should move that data elsewhere.
+ .
+ See also: http://www.debian.org/doc/developers-reference/ch-best-pkging-practices#s-bpp-archindepdata
+
+
diff --git a/nokia-lintian/checks/infofiles b/nokia-lintian/checks/infofiles
new file mode 100644 (file)
index 0000000..2be4b22
--- /dev/null
@@ -0,0 +1,231 @@
+# infofiles -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz
+# Copyright (C) 2001 Josip Rodin
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::infofiles;
+use strict;
+use Tags;
+use Util;
+use File::Basename;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my %file_info;
+
+my %preinst;
+my %postinst;
+my %prerm;
+my %postrm;
+
+my %missing_section;
+
+# check maintainer scripts (for install-info invocation)
+check_script("preinst", \%preinst) if (-f "control/preinst");
+check_script("postinst", \%postinst) if (-f "control/postinst");
+check_script("prerm", \%prerm) if (-f "control/prerm");
+check_script("postrm", \%postrm) if (-f "control/postrm");
+
+# Read file info...
+open (IN, '<', "file-info")
+    or fail("cannot find file-info for $type package $pkg");
+while (<IN>) {
+    chop;
+
+    m/^(.*?):\s+(.*)$/o or fail("an error in the file pkg is preventing lintian from checking this package: $_");
+    my ($file,$info) = ($1,$2);
+
+    next unless $file =~ m,/info/,o;
+    $file =~ s,^(\./)?,,;
+
+    $file_info{$file} = $info;
+}
+close IN;
+
+# Read package contents...
+open (IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chop;
+
+    my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
+    my $link;
+
+    $file =~ s,^(\./),,;
+    $file =~ s/ link to .*//;
+
+    if ($perm =~ m/^l/) {
+       ($file, $link) = split(' -> ', $file);
+    }
+
+    my ($fname, $path, $suffix) = fileparse($file);
+
+    next unless ($perm =~ m,^[\-l],o)
+           and ($path =~ m,^usr/share/info/, or $path =~ m,^usr/info/,);
+
+    # Analyze the file names making sure the documents are named properly.
+    # Note that Emacs 22 added support for images in info files, so we have to
+    # accept those and ignore them.  Just ignore .png files for now.
+    my @fname_pieces = split /\./, $fname;
+    my $ext = pop @fname_pieces;
+    if ($ext eq "gz") { # ok!
+       if ($perm =~ m,^-,o) { # compressed with maximum compression rate?
+           my $info = $file_info{$file};
+           if ($info !~ m/gzip compressed data/o) {
+               tag "info-document-not-compressed-with-gzip", "$file";
+           } else {
+               if ($info !~ m/max compression/o) {
+                   tag "info-document-not-compressed-with-max-compression", "$file";
+               }
+           }
+       }
+    } elsif ($ext eq 'png') {
+        next;
+    } else {
+       push (@fname_pieces, $ext);
+       tag "info-document-not-compressed", "$file";
+    }
+    my $infoext = pop @fname_pieces;
+    unless ($infoext && $infoext =~ /info(-\d)?/) { # it's not foo.info
+       unless (!@fname_pieces) { # it's not foo{,-{1,2,3,...}}
+           tag "info-document-has-wrong-extension", "$file";
+       }
+    }
+
+    # If this is the main info file (no numeric extension). make sure it has
+    # appropriate dir entry information.
+    if ($fname !~ /-\d+\.gz/ && $file_info{$file} =~ /gzip compressed data/) {
+       my $pid = open INFO, '-|';
+       if (not defined $pid) {
+           fail("cannot fork: $!");
+       } elsif ($pid == 0) {
+           my %newenv = (LANG => 'C', PATH => $ENV{PATH});
+           undef %ENV;
+           %ENV = %newenv;
+           exec "zcat \Qunpacked/$file\E 2>&1"
+               or fail("cannot run zcat: $!");
+       }
+       local $_;
+       my ($section, $start, $end);
+       while (<INFO>) {
+           $section = 1 if /INFO-DIR-SECTION\s+\S/;
+       }
+       close INFO;
+       $missing_section{$file} = 1 unless $section;
+    }
+}
+close IN;
+
+# policy 13.2 says prerm and postinst
+if ($postrm{'calls-install-info'}) {
+    tag "postrm-calls-install-info", "";
+}
+if ($preinst{'calls-install-info'}) {
+    tag "preinst-calls-install-info", "";
+}
+
+if ($postinst{'calls-install-info'}) {
+    tag "install-info-not-called-with-quiet-option", ""
+       unless $postinst{'calls-install-info-quiet'};
+}
+if ($prerm{'calls-install-info'}) {
+    # it must use the --quiet option
+    tag "install-info-not-called-with-quiet-option", ""
+       unless $prerm{'calls-install-info-quiet'};
+}
+
+# Currently we assume all the info pages are fine if any of them are installed
+# with an explicit --section option.  It would be nice to be stricter.
+for my $file (keys %missing_section) {
+    tag "info-document-missing-dir-section", "$file"
+       unless ($postinst{'calls-install-info-section'});
+}
+
+# Ideally we'd check whether all documents installed are removed,
+# but for now we assume that if any are removed then they all are
+if ($postinst{'calls-install-info'}) {
+    tag "info-documents-not-removed", ""
+       unless ($prerm{'calls-install-info-remove'});
+}
+
+}
+
+# -----------------------------------
+
+sub check_script {
+    my ($script,$pres) = @_;
+    my ($no_check_menu,$no_check_installdocs);
+    my $interp;
+
+    open(IN, '<', "control/$script") or
+       fail("cannot open maintainer script control/$script for reading: $!");
+    $interp = <IN>;
+    $interp = '' unless defined $interp;
+    if ($interp =~ m,^\#\!\s*/bin/(a|ba|k|pdk)?sh,) {
+       $interp = 'sh';
+    } elsif ($interp =~ m,^\#\!\s*/usr/bin/perl,) {
+       $interp = 'perl';
+    } else {
+       if ($interp =~ m,^\#\!\s*(.+),) {
+           $interp = $1;
+       }
+       else { # hmm, doesn't seem to start with #!
+           # is it a binary? look for ELF header
+           if ($interp =~ m/^\177ELF/) {
+               return; # nothing to do here
+           }
+           $interp = 'unknown';
+       }
+    }
+
+    my $hold;
+    while (<IN>) {
+       s/\s+#.*$//;
+       # this wraps a previous line continuation into the current line
+       if (defined $hold) {
+           $_ = "$hold $_";
+           $hold = undef;
+       }
+       # check if install-info is called and if so, is it called properly
+       if (m/install-info/o) {
+           if (m,\\$,) {
+               $hold = substr($_, 0, -1);
+               next;
+           }
+           $pres->{'calls-install-info'} = 1;
+           my @pieces = split(/\s+/);
+           for my $piece (@pieces) {
+               if ($piece eq '--quiet') {
+                   $pres->{'calls-install-info-quiet'} = 1;
+               } elsif ($piece eq '--section') {
+                   $pres->{'calls-install-info-section'} = 1;
+               } elsif ($piece eq '--remove' or $piece eq '--remove-exactly') {
+                   $pres->{'calls-install-info-remove'} = 1;
+               }
+           }
+       }
+    }
+    close IN;
+}
+
+1;
+
+# vim: syntax=perl
diff --git a/nokia-lintian/checks/infofiles.desc b/nokia-lintian/checks/infofiles.desc
new file mode 100644 (file)
index 0000000..07f16c1
--- /dev/null
@@ -0,0 +1,73 @@
+Check-Script: infofiles
+Author: Josip Rodin <jrodin@jagor.srce.hr>
+Abbrev: info
+Type: binary
+Unpack-Level: 2
+Needs-Info: file-info
+Info: This script checks if a binary package conforms to info document policy.
+
+Tag: info-document-not-compressed
+Type: error
+Info: Info documents have to be installed compressed (using <tt>gzip -9</tt>).
+Ref: policy 12.2
+
+Tag: info-document-not-compressed-with-gzip
+Type: error
+Info: Info documents should be compressed with <tt>gzip -9</tt>.
+Ref: policy 12.2
+
+Tag: info-document-not-compressed-with-max-compression
+Type: error
+Info: Info documents should be compressed with <tt>gzip -9</tt>.
+Ref: policy 12.2
+
+Tag: info-document-has-wrong-extension
+Type: warning
+Info: The info document has an extension other than info*.gz.
+Ref: policy 12.2
+
+Tag: info-document-missing-dir-section
+Type: warning
+Info: This info document has no INFO-DIR-SECTION line and no
+ <tt>--section</tt> option is passed to <tt>install-info</tt> in the
+ package <tt>postinst</tt> maintainer script.  <tt>install-info</tt> will
+ be unable to determine the section into which this info page should be
+ put.  The best solution is to add a line like:
+ .
+   @dircategory Development
+ .
+ to the texinfo source so that the generated info file will contain a
+ section.  See /usr/share/info/dir for sections to choose from.
+ .
+ Another alternative that doesn't require modifying the source is to
+ explicitly pass a <tt>--section</tt> option to <tt>install-info</tt> in
+ the <tt>postinst</tt> maintainer script, although in this case you will
+ need to write the <tt>postinst</tt> yourself and not use tools like
+ debhelper to do it for you.
+Ref: policy 12.2
+
+Tag: postrm-calls-install-info
+Type: warning
+Ref: policy 12.2
+Info: The postrm script calls the <tt>install-info</tt> command. Usually,
+ this command should be called from the <tt>prerm</tt> maintainer script.
+
+Tag: preinst-calls-install-info
+Type: error
+Ref: policy 12.2
+Info: The preinst script calls the <tt>install-info</tt> command. Usually,
+ this command should be called from the <tt>postinst</tt> maintainer script.
+
+Tag: install-info-not-called-with-quiet-option
+Type: warning
+Ref: policy 3.10
+Info: The package installation scripts should avoid producing output which it
+ is unnecessary for the user to see.  Policy specifically mentions install-info
+ output as unnecessary.
+
+Tag: info-documents-not-removed
+Type: warning
+Ref: policy 12.2
+Info: The postinst script calls the <tt>install-info</tt> command, but the
+ documents installed are not then removed by the <tt>prerm</tt>  maintainer
+ script.
diff --git a/nokia-lintian/checks/init.d b/nokia-lintian/checks/init.d
new file mode 100644 (file)
index 0000000..c1e9798
--- /dev/null
@@ -0,0 +1,269 @@
+# init.d -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::init_d;
+use strict;
+use Tags;
+use Util;
+
+# A list of valid LSB keywords.         The value is 0 if optional and 1 if required.
+my %lsb_keywords = (provides           => 1,
+                   'required-start'    => 1,
+                   'required-stop'     => 1,
+                   'should-start'      => 0,
+                   'should-stop'       => 0,
+                   'default-start'     => 1,
+                   'default-stop'      => 1,
+                   'short-description' => 1,
+                   'description'       => 0);
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my $postinst = "control/postinst";
+my $preinst = "control/preinst";
+my $postrm = "control/postrm";
+my $prerm = "control/prerm";
+my $conffiles = "control/conffiles";
+
+my %initd_postinst;
+my %initd_postrm;
+my %conffiles;
+
+my $opts_r = qr/-\S+\s*/;
+my $name_r = qr/[\w.-]+/;
+my $action_r = qr/\w+/;
+my $exclude_r = qr/if\s+\[\s+-x\s+\S*update-rc\.d/;
+
+# read postinst control file
+if (open(IN, '<', $postinst)) {
+    while (<IN>) {
+       next if /$exclude_r/o;
+       s/\#.*$//o;
+       next unless /^(?:.+;|^\s*system[\s\(\']+)?\s*update-rc\.d\s+
+           (?:$opts_r)*($name_r)\s+($action_r)/xo;
+       my ($name,$opt) = ($1,$2);
+       next if $opt eq 'remove';
+       if ($initd_postinst{$name}++ == 1) {
+           tag "duplicate-updaterc.d-calls-in-postinst", "$name";
+           next;
+       }
+       unless (m,>\s*/dev/null,o) {
+           tag "output-of-updaterc.d-not-redirected-to-dev-null", "$name postinst";
+       }
+    }
+}
+close(IN);
+
+# read preinst control file
+if (open(IN, '<', $preinst)) {
+    while (<IN>) {
+       next if /$exclude_r/o;
+       s/\#.*$//o;
+       next unless m/update-rc\.d\s+(?:$opts_r)*($name_r)\s+($action_r)/o;
+       my ($name,$opt) = ($1,$2);
+       next if $opt eq 'remove';
+       tag "preinst-calls-updaterc.d", "$name";
+    }
+    close(IN);
+}
+
+# read postrm control file
+if (open(IN, '<', $postrm)) {
+    while (<IN>) {
+       next if /$exclude_r/o;
+       s/\#.*$//o;
+       next unless m/update-rc\.d\s+($opts_r)*($name_r)/o;
+       if ($initd_postrm{$2}++ == 1) {
+           tag "duplicate-updaterc.d-calls-in-postrm", "$2";
+           next;
+       }
+       unless (m,>\s*/dev/null,o) {
+           tag "output-of-updaterc.d-not-redirected-to-dev-null", "$2 postrm";
+       }
+    }
+    close(IN);
+}
+
+# read prerm control file
+if (open(IN, '<', $prerm)) {
+    while (<IN>) {
+       next if /$exclude_r/o;
+       s/\#.*$//o;
+       next unless m/update-rc\.d\s+($opts_r)*($name_r)/o;
+       tag "prerm-calls-updaterc.d", "$2";
+    }
+    close(IN);
+}
+
+# init.d scripts have to be removed in postrm
+for (keys %initd_postinst) {
+    if ($initd_postrm{$_}) {
+       delete $initd_postrm{$_};
+    } else {
+       tag "postrm-does-not-call-updaterc.d-for-init.d-script", "/etc/init.d/$_";
+    }
+}
+for (keys %initd_postrm) {
+    tag "postrm-contains-additional-updaterc.d-calls", "/etc/init.d/$_";
+}
+
+# load conffiles
+if (open(IN, '<', $conffiles)) {
+    while (<IN>) {
+       chop;
+       next if m/^\s*$/o;
+       $conffiles{$_} = 1;
+
+       if (m,^/?etc/rc.\.d,o) {
+           tag "file-in-etc-rc.d-marked-as-conffile", "$_";
+       }
+    }
+    close(IN);
+}
+
+for (keys %initd_postinst) {
+    next if /^\$/;
+    # init.d scripts have to be marked as conffiles
+    unless ($conffiles{"/etc/init.d/$_"} or $conffiles{"etc/init.d/$_"}) {
+       tag "init.d-script-not-marked-as-conffile", "/etc/init.d/$_";
+    }
+
+    # check if file exists in package
+    my $initd_file = "init.d/$_";
+    if (-f $initd_file) {
+       # yes! check it...
+       open(IN, '<', $initd_file)
+           or fail("cannot open init.d file $initd_file: $!");
+       my (%tag, %lsb);
+       while (defined(my $l = <IN>)) {
+           if ($l =~ m/^\#\#\# BEGIN INIT INFO/) {
+               if ($lsb{BEGIN}) {
+                   tag "init.d-script-has-duplicate-lsb-section", "/etc/init.d/$_";
+                   next;
+               }
+               $lsb{BEGIN} = 1;
+               my $last;
+
+               # We have an LSB keyword section.  Parse it and save the data
+               # in %lsb for analysis.
+               while (defined(my $l = <IN>)) {
+                   if ($l =~ /^\#\#\# END INIT INFO/) {
+                       $lsb{END} = 1;
+                       last;
+                   } elsif ($l !~ /^\#/) {
+                       tag "init.d-script-has-unterminated-lsb-section", "/etc/init.d/$_:$.";
+                       last;
+                   } elsif ($l =~ /^\# ([a-zA-Z-]+):\s*(.*?)\s*$/) {
+                       my $keyword = lc $1;
+                       my $value = $2;
+                       tag "init.d-script-has-duplicate-lsb-keyword", "/etc/init.d/$_:$. $keyword"
+                           if (defined $lsb{$keyword});
+                       tag "init.d-script-has-unknown-lsb-keyword", "/etc/init.d/$_:$. $keyword"
+                           unless (defined ($lsb_keywords{$keyword}) || $keyword =~ /^x-/);
+                       $lsb{$keyword} = $value || '';
+                       $last = $keyword;
+                   } elsif ($l =~ /^\#(\t|  )/ && $last eq 'description') {
+                       my $value = $l;
+                       $value =~ s/^\#\s*//;
+                       $lsb{description} .= ' ' . $value;
+                   } else {
+                       tag "init.d-script-has-bad-lsb-line", "/etc/init.d/$_:$.";
+                   }
+               }
+           }
+
+           while ($l =~ s/(start|stop|restart|force-reload)//o) {
+               $tag{$1} = 1;
+           }
+        }
+       close(IN);
+
+       # Make sure all of the required keywords are present.
+       if (not $lsb{BEGIN}) {
+           tag "init.d-script-missing-lsb-section", "/etc/init.d/$_";
+       } else {
+           for my $keyword (keys %lsb_keywords) {
+               if ($lsb_keywords{$keyword} && !defined $lsb{$keyword}) {
+                   if ($keyword eq 'short-description') {
+                       tag "init.d-script-missing-lsb-short-description", "/etc/init.d/$_";
+                   } else {
+                       tag "init.d-script-missing-lsb-keyword", "/etc/init.d/$_ $keyword";
+                   }
+               }
+           }
+       }
+
+       # Check the runlevels.
+       my %start;
+       if ($lsb{'default-start'}) {
+           for my $runlevel (split (/\s+/, $lsb{'default-start'})) {
+               if ($runlevel =~ /^[sS0-6]$/) {
+                   $start{lc $runlevel} = 1;
+               } else {
+                   tag "init.d-script-has-bad-start-runlevel", "/etc/init.d/$_ $runlevel";
+               }
+           }
+       }
+       if ($lsb{'default-stop'}) {
+           for my $runlevel (split (/\s+/, $lsb{'default-stop'})) {
+               if ($runlevel =~ /^[sS0-6]$/) {
+                   if ($start{$runlevel}) {
+                       tag "init.d-script-has-conflicting-start-stop", "/etc/init.d/$_ $runlevel";
+                   }
+                   if ($runlevel =~ /[sS]/) {
+                       tag "init-d-script-stops-in-s-runlevel", "/etc/init.d/$_";
+                   }
+               } else {
+                   tag "init.d-script-has-bad-stop-runlevel", "/etc/init.d/$_ $runlevel";
+               }
+           }
+       }
+
+       # all tags included in file?
+       $tag{'start'} or tag "init.d-script-does-not-implement-required-option", "/etc/init.d/$_ start";
+       $tag{'stop'} or tag "init.d-script-does-not-implement-required-option", "/etc/init.d/$_ stop";
+       $tag{'restart'} or tag "init.d-script-does-not-implement-required-option", "/etc/init.d/$_ restart";
+       $tag{'force-reload'} or tag "init.d-script-does-not-implement-required-option", "/etc/init.d/$_ force-reload";
+    } else {
+       tag "init.d-script-not-included-in-package", "/etc/init.d/$_";
+    }
+}
+
+# files actually installed in /etc/init.d should match our list :-)
+opendir(INITD, "init.d") or fail("cannot read init.d directory: $!");
+for (readdir(INITD)) {
+    next if $_ eq '.' || $_ eq '..';
+    tag "script-in-etc-init.d-not-registered-via-update-rc.d", "/etc/init.d/$_"
+       unless $initd_postinst{$_};
+}
+closedir(INITD);
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl ts=8
diff --git a/nokia-lintian/checks/init.d.desc b/nokia-lintian/checks/init.d.desc
new file mode 100644 (file)
index 0000000..a9400ab
--- /dev/null
@@ -0,0 +1,175 @@
+Check-Script: init.d
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: ini
+Type: binary
+Needs-Info: init.d
+Unpack-Level: 1
+
+Tag: duplicate-updaterc.d-calls-in-postinst
+Type: error
+Info: The <tt>postinst</tt> script calls <tt>update-rc.d</tt> several
+ times for the same <tt>/etc/init.d</tt> script.
+
+Tag: output-of-updaterc.d-not-redirected-to-dev-null
+Type: info
+Info: The output messages of the <tt>update-rc.d</tt> command should be
+ redirected to <tt>/dev/null</tt> because it is currently very chatty
+ per default.
+
+Tag: preinst-calls-updaterc.d
+Type: error
+Info: The <tt>preinst</tt> package calls <tt>update-rc.d</tt>. Instead,
+ you should call it in the <tt>postinst</tt> script.
+Ref: policy 9.3.3.1
+
+Tag: duplicate-updaterc.d-calls-in-postrm
+Type: error
+Info: The <tt>postrm</tt> script calls <tt>update-rc.d</tt> several
+ times for the same <tt>/etc/init.d</tt> script.
+
+Tag: prerm-calls-updaterc.d
+Type: error
+Info: The <tt>prerm</tt> package calls <tt>update-rc.d</tt>. Instead,
+ you should call it in the <tt>postrm</tt> script.
+Ref: policy 9.3.3.1
+
+Tag: postrm-does-not-call-updaterc.d-for-init.d-script
+Type: error
+Info: An <tt>/etc/init.d</tt> script which has been registered in the
+ <tt>postinst</tt> script is not de-registered in the
+ <tt>postrm</tt> script.
+
+Tag: postrm-contains-additional-updaterc.d-calls
+Type: error
+Info: The <tt>postrm</tt> de-registers an <tt>/etc/init.d</tt> script which
+ has not been registered in the <tt>postinst</tt> script before.
+
+Tag: file-in-etc-rc.d-marked-as-conffile
+Type: error
+Ref: policy 9.3.3
+Info: The symbolic links in <tt>/etc/rc?.d</tt> may not be marked as conffiles.
+
+Tag: init.d-script-not-marked-as-conffile
+Type: warning
+Ref: policy 9.3.2
+Info: <tt>/etc/init.d</tt> scripts should be marked as conffiles.
+ .
+ This is usually an error, but the Policy allows for managing these files
+ manually in maintainer scripts and Lintian cannot reliably detect that.
+
+Tag: init.d-script-does-not-implement-required-option
+Type: error
+Info: The <tt>/etc/init.d</tt> scripts have to support the following
+ command line arguments: start, stop, restart, force-reload.
+
+Tag: init.d-script-not-included-in-package
+Type: error
+Info: The <tt>/etc/init.d</tt> script is registered in the
+ <tt>postinst</tt> script, but is not included in the package.
+
+Tag: script-in-etc-init.d-not-registered-via-update-rc.d
+Type: warning
+Info: The package installs an <tt>/etc/init.d</tt> script which is
+ not registered in the <tt>postinst</tt> script. This is usually a bug,
+ unless you omit the links intentionally for some reason or create the
+ links some other way.
+
+Tag: init.d-script-has-duplicate-lsb-section
+Type: error
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: This <tt>/etc/init.d</tt> script has more than one LSB keyword
+ section.  These sections start with <tt>### BEGIN INIT INFO</tt> and end
+ with <tt>### END INIT INFO</tt>.  There should be only one such section
+ per init script.
+
+Tag: init.d-script-has-unterminated-lsb-section
+Type: error
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: This <tt>/etc/init.d</tt> script has an LSB keyword section starting
+ with <tt>### BEGIN INIT INFO</tt> but either has no matching <tt>### END
+ INIT INFO</tt> or has lines between those two markers that are not
+ comments.  The line number given is the first line that doesn't look like
+ part of an LSB keyword section.  There must be an end marker after all
+ the keyword settings and there must not be any lines between those
+ markers that do not begin with <tt>#</tt>.
+
+Tag: init.d-script-has-duplicate-lsb-keyword
+Type: warning
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: The given keyword was set twice in the LSB keyword section in this
+ <tt>/etc/init.d</tt> script.  This is probably a mistake; the behavior of
+ setting the same keyword twice is undefined.
+
+Tag: init.d-script-has-unknown-lsb-keyword
+Type: warning
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: The given keyword was set in the LSB keyword section in this
+ <tt>/etc/init.d</tt> script but isn't one of the known LSB keywords and
+ doesn't begin with <tt>X-</tt>.  One of the standard keywords may have
+ been misspelled.
+
+Tag: init.d-script-has-bad-lsb-line
+Type: warning
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: This line in the LSB keyword section of an <tt>/etc/init.d</tt>
+ script doesn't match the required formatting of that section.  Note that
+ keyword settings must start with <tt>#</tt>, a single space, the keyword,
+ a colon, and some whitespace, followed by the value (if any).  Only the
+ Description keyword allows continuation lines, and continuation lines
+ must begin with <tt>#</tt> and either a tab or two or more spaces.
+
+Tag: init.d-script-missing-lsb-section
+Type: warning
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: This <tt>/etc/init.d</tt> script does not have an LSB keyword
+ section (or the <tt>### BEGIN INIT INFO</tt> tag is incorrect).  This
+ section provides description and runlevel information in a standard
+ format and provides dependency information that can be used to
+ parallelize the boot process.  Please consider adding it.
+
+Tag: init.d-script-missing-lsb-keyword
+Type: warning
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: This <tt>/etc/init.d</tt> script has an LSB keyword section, but it
+ is missing the given required LSB keyword.  If the value of this keyword
+ should be empty, please still include it in the LSB keyword section with
+ an empty value.
+
+Tag: init.d-script-missing-lsb-short-description
+Type: info
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: This <tt>/etc/init.d</tt> script has an LSB keyword section, but it
+ is missing a Short-Description LSB keyword.  This field isn't directly
+ used currently, but adding it is still a good idea for documentation
+ purposes.
+
+Tag: init.d-script-has-bad-start-runlevel
+Type: warning
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: The given runlevel specified in the Default-Start keyword of the LSB
+ keyword section of this <tt>/etc/init.d</tt> script isn't one of the
+ recognized standard runlevels (S, 0, 1, 2, 3, 4, 5, and 6).
+
+Tag: init.d-script-has-bad-stop-runlevel
+Type: warning
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: The given runlevel specified in the Default-Stop keyword of the LSB
+ keyword section of this <tt>/etc/init.d</tt> script isn't one of the
+ recognized standard runlevels (0, 1, 2, 3, 4, 5, and 6).
+
+Tag: init.d-script-has-conflicting-start-stop
+Type: warning
+Ref: http://wiki.debian.org/LSBInitScripts
+Info: The given runlevel was included in both the Default-Start and
+ Default-Stop keywords of the LSB keyword section of this
+ <tt>/etc/init.d</tt> script.  Since it doesn't make sense to both start
+ and stop a service in the same runlevel, there is probably an error in
+ one or the other of these keywords.
+
+Tag: init-d-script-stops-in-s-runlevel
+Type: warning
+Info: This <tt>/etc/init.d</tt> script specifies the S runlevel in
+ Default-Stop in its LSB keyword section.  The S runlevel is not a real
+ runlevel and is only used during boot.  There is no way to switch to it
+ and hence no use for stop scripts for it, so S should be removed from
+ Default-Stop.
diff --git a/nokia-lintian/checks/lintian.desc b/nokia-lintian/checks/lintian.desc
new file mode 100644 (file)
index 0000000..3038f03
--- /dev/null
@@ -0,0 +1,76 @@
+Check-Script: lintian
+Info: this description file is a special case: it contains the tag info
+ for the tags produced by the lintian frontend itself
+
+Tag: no-description-in-changes-file
+Type: error
+Info: There is no "Description" field in your .changes file.  A
+ description is mandatory and is usually constructed from the descriptions
+ in the control file of the package by the package build tools.
+Ref: policy 5.5
+
+Tag: bad-distribution-in-changes-file
+Type: error
+Info: You've specified an unknown target distribution for your upload in
+ the <tt>debian/changelog</tt> file.
+ .
+ Note that the distributions <tt>non-free</tt> and <tt>contrib</tt> are no
+ longer valid. You'll have to use distribution <tt>unstable</tt> and
+ <tt>Section: non-free/xxx</tt> or <tt>Section: contrib/xxx</tt> instead.
+
+Tag: bad-ubuntu-distribution-in-changes-file
+Type: error
+Info: You've specified an unknown target distribution for your upload in
+ the <tt>debian/changelog</tt> file.
+ .
+ Your version string suggests this package is for Ubuntu, so your
+ distribution should be one of intrepid, hardy, gutsy, feisty, edgy or dapper.
+
+Tag: no-urgency-in-changes-file
+Type: warning
+Info: There is no "Urgency" field in the .changes file.  This field is
+ recommended by policy and is usually derived from the first line of the
+ most recent changelog entry by the package build tools.
+Ref: policy 5.5
+
+Tag: bad-urgency-in-changes-file
+Type: error
+Info: The keyword value of the "Urgency" field in the .changes file is not
+ one of the allowed values of low, medium, high, critical, and emergency
+ (case-insensitive).  This value normally taken from the first line of the
+ most recent entry in <tt>debian/changelog</tt>, which is probably where
+ the error is.
+Ref: policy 5.6.17
+
+Tag: file-size-mismatch-in-changes-file
+Type: error
+Info: The actual file size does not match what's listed in the
+ <tt>.changes</tt> file.
+
+Tag: checksum-mismatch-in-changes-file
+Type: error
+Info: The actual checksum does not match what's listed in the
+ <tt>.changes</tt> file.
+
+Tag: bad-section-in-changes-file
+Type: error
+Info: The sections <tt>non-free</tt> and <tt>contrib</tt> are no longer
+ valid. Please use section <tt>non-free/xxx</tt> or
+ <tt>contrib/xxx</tt> instead.
+
+Tag: unused-override
+Type: info
+Info: Lintian discovered an unused override entry in its database.
+ Please remove it from the overrides file if it is not needed anymore.
+
+Tag: malformed-override
+Type: error
+Info: Lintian discovered an override entry with an invalid format.  An
+ override entry should have the format:
+ .
+   &lt;package&gt;[ &lt;type&gt;]: &lt;tag&gt;[ &lt;extra&gt; ...]
+ .
+ where &lt;package&gt; is the package name, the optional &lt;type&gt;
+ parameter specifies the package type (binary is the default), &lt;tag&gt;
+ is the tag to suppress, and &lt;extra&gt; is any specific information for
+ the particular tag to suppress.
diff --git a/nokia-lintian/checks/manpages b/nokia-lintian/checks/manpages
new file mode 100644 (file)
index 0000000..ce0d4d0
--- /dev/null
@@ -0,0 +1,404 @@
+# manpages -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::manpages;
+use strict;
+use Dep;
+use Tags;
+use Util;
+
+# Set to true if the man program supports --warnings based on its version
+# number.  This is probed if this variable is undefined and set to 0 or 1.
+our $MAN_WARNINGS;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+use File::Basename;
+
+my %file_info;
+my %binary;
+my %link;
+# my %sect_by_binary;
+# my %sect_by_manpage;
+my %manpage;
+
+# Read file info...
+open(IN, '<', "file-info")
+    or fail("cannot find file-info for $type package $pkg");
+while (<IN>) {
+    chop;
+
+    m/^(.*?):\s+(.*)$/o or fail("an error in the file pkg is preventing lintian from checking this package: $_");
+    my ($file,$info) = ($1,$2);
+
+    next unless $file =~ m/man/o;
+    $file =~ s,^(\./)?,,;
+
+    $file_info{$file} = $info;
+}
+close(IN);
+
+# Read package contents...
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chop;
+
+    my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
+    my $link;
+
+    $file =~ s,^(\./),,;
+    $file =~ s/ link to .*//;
+
+    if ($perm =~ m/^l/) {
+       ($file, $link) = split(' -> ', $file);
+    }
+
+    my ($fname,$path,$suffix) = fileparse($file);
+
+    # Binary that wants a manual page?
+    #
+    # It's tempting to check the section of the man page depending on the
+    # location of the binary, but there are too many mismatches between
+    # bin/sbin and 1/8 that it's not clear it's the right thing to do.
+    if (($perm =~ m,^[\-l],o) and
+       (($path =~ m,^bin/$,o) or
+        ($path =~ m,^sbin/$,o) or
+        ($path =~ m,^usr/bin/$,o) or
+        ($path =~ m,^usr/bin/X11/$,o) or
+        ($path =~ m,^usr/bin/mh/$,o) or
+        ($path =~ m,^usr/sbin/$,o) or
+        ($path =~ m,^usr/games/$,o) or
+        ($path =~ m,^usr/X11R6/bin/$,o) )) {
+
+       my $bin = $fname;
+       
+       $binary{$bin} = $file;
+       $link{$bin} = $link if $link;
+
+       next;
+    }
+
+    if (($path =~ m,usr/(share|X11R6)/man/$,) and ($fname ne "")) {
+       tag "manpage-in-wrong-directory", "$file";
+       next;
+    }
+
+    # manual page?
+    next unless ($perm =~ m,^[\-l],o) and
+       (($path =~ m,^usr/man(/\S+),o)
+        or ($path =~ m,^usr/X11R6/man(/\S+),o)
+        or ($path =~ m,^usr/share/man(/\S+),o) );
+
+    my $t = $1;
+    if (not $t =~ m,^.*man(\d)/$,o) {
+       tag "manpage-in-wrong-directory", "$file";
+       next;
+    }
+    my ($section,$name) = ($1,$fname);
+    my $lang = "";
+       $lang = $1 if $t =~ m,^/([^/]+)/man\d/$,o;
+
+    # The country should not be part of the man page locale directory unless
+    # it's one of the known cases where the language is significantly
+    # different between countries.
+    if ($lang =~ /_/ && $lang !~ /^(pt_BR|zh_[A-Z][A-Z])$/) {
+       tag "manpage-locale-dir-country-specific", "$file";
+    }
+
+    my @pieces = split(/\./, $name);
+    my $ext = pop @pieces;
+    if ($ext ne 'gz') {
+        push @pieces, $ext;
+       tag "manpage-not-compressed", "$file";
+    } elsif ($perm =~ m,^-,o) { # so it's .gz... files first; links later
+       my $info = $file_info{$file};
+       if ($info !~ m/gzip compressed data/o) {
+           tag "manpage-not-compressed-with-gzip", "$file";
+       } elsif ($info !~ m/max compression/o) {
+           tag "manpage-not-compressed-with-max-compression", "$file";
+       }
+    }
+    my $fn_section = pop @pieces;
+    my $section_num = $fn_section;
+    if (scalar @pieces && $section_num =~ s/^(\d).*$/$1/) {
+       my $bin = join(".", @pieces);
+              $manpage{$bin} = [] unless $manpage{$bin};
+       push @{$manpage{$bin}}, { file => $file, lang => $lang };
+
+       # number of directory and manpage extension equal?
+       if ($section_num != $section) {
+           tag "manpage-in-wrong-directory", "$file";
+       }
+    } else {
+       tag "manpage-has-wrong-extension", "$file";
+    }
+
+    # special check for manual pages for X11 games
+    if ($path =~ m,^usr/X11R6/man/man6/,o) {
+       tag "x11-games-should-be-in-usr-games", "$file";
+    }
+
+    # check symbolic links to other manual pages
+    if ($perm =~ m,^l,o) {
+       if ($link =~ m,(^|/)undocumented,o) {
+           if ($path =~ m,^usr/share/man,o) {
+               # undocumented link in /usr/share/man -- possibilities
+                #    undocumented... (if in the appropriate section)
+               #    ../man?/undocumented...
+               #    ../../man/man?/undocumented...
+               #    ../../../share/man/man?/undocumented...
+               #    ../../../../usr/share/man/man?/undocumented...
+                if ((($link =~ m,^undocumented\.([237])\.gz,o) and
+                    ($path =~ m,^usr/share/man/man$1,)) or
+                    ($link =~ m,^\.\./man[237]/undocumented\.[237]\.gz$,o) or
+                    ($link =~ m,^\.\./\.\./man/man[237]/undocumented\.[237]\.gz$,o) or
+                    ($link =~ m,^\.\./\.\./\.\./share/man/man[237]/undocumented\.[237]\.gz$,o) or
+                    ($link =~ m,^\.\./\.\./\.\./\.\./usr/share/man/man[237]/undocumented\.[237]\.gz$,o)) {
+                   tag "link-to-undocumented-manpage", "$file";
+                } else {
+                   tag "bad-link-to-undocumented-manpage", "$file";
+               }
+           } else {
+               # undocumented link in /usr/X11R6/man -- possibilities:
+               #    ../../../share/man/man?/undocumented...
+               #    ../../../../usr/share/man/man?/undocumented...
+               if (($link =~ m,^\.\./\.\./\.\./share/man/man[237]/undocumented\.[237]\.gz$,o) or
+                   ($link =~ m,^\.\./\.\./\.\./\.\./usr/share/man/man[237]/undocumented\.[237]\.gz$,o)) {
+                   tag "link-to-undocumented-manpage", "$file";
+               } else {
+                   tag "bad-link-to-undocumented-manpage", "$file";
+               }
+           }
+       }
+    } else { # not a symlink
+       open (MANFILE, '-|', "zcat unpacked/\Q$file\E 2>/dev/null")
+           or fail("cannot open $file: $!");
+       my @manfile = ();
+       while (<MANFILE>) { push @manfile, $_; }
+       close MANFILE;
+       # Is it a .so link?
+       if ($size < 256) {
+           my ($i, $first) = (0, "");
+           do {
+               $first = $manfile[$i++] || ""; 
+           } while ($first =~ /^\.\\"/ && $manfile[$i]); #");
+
+           unless ($first) {
+               tag "empty-manual-page", "$file";
+           } elsif ($first =~ /^\.so\s+(.+)?$/) {
+               my $dest = $1;
+               if ($dest =~ m,^([^/]+)/(.+)$,) {
+                   my ($manxorlang, $rest) = ($1, $2);
+                   if ($manxorlang !~ /^man\d+$/) {
+                       # then it's likely a language subdir, so let's run
+                       # the other component through the same check
+                       if ($rest =~ m,^([^/]+)/(.+)$,) {
+                           my ($lang, $rest) = ($1, $2);
+                           if ($rest !~ m,^[^/]+\.\d(?:\S+)?(?:\.gz)?$,) {
+                               tag "bad-so-link-within-manual-page", "$file";
+                           }
+                       } else {
+                           tag "bad-so-link-within-manual-page", "$file";
+                       }
+                   }
+               } else {
+                   tag "bad-so-link-within-manual-page", "$file";
+               }
+               next;
+           }
+       }
+
+       # If it's not a .so link, use lexgrog to find out if the man page
+       # parses correctly and make sure the short description is reasonable.
+       #
+       # This check is currently not applied to pages in language-specific
+       # hierarchies, because those pages are not currently scanned by
+       # mandb (bug #29448), and because lexgrog can't handle pages in all
+       # languages at the moment, leading to huge numbers of false
+       # negatives. When man-db is fixed, this limitation should be
+       # removed.
+       if ($path =~ m,/man/man\d/,) {
+           my $pid = open LEXGROG, '-|';
+           if (not defined $pid) {
+               fail("cannot run lexgrog: $!");
+           } elsif ($pid == 0) {
+               my %newenv = (LANG => 'C', PATH => $ENV{PATH});
+               undef %ENV;
+               %ENV = %newenv;
+               exec "lexgrog unpacked/\Q$file\E 2>&1"
+                   or fail("cannot run lexgrog: $!");
+           }
+           my $desc = <LEXGROG>;
+           $desc =~ s/^[^:]+: \"(.*)\"$/$1/;
+           if ($desc =~ /(\S+)\s+-\s+manual page for \1/i) {
+               tag "manpage-has-useless-whatis-entry", "$file";
+           } elsif ($desc =~ /(\S+)\s+-\s+programs? to do something/i) {
+               tag "manpage-is-dh_make-template", "$file";
+           }
+           1 while <LEXGROG>;
+           close LEXGROG;
+           tag "manpage-has-bad-whatis-entry", "$file" if $? != 0;
+       }
+
+       # If we've not probed yet, determine if man supports --warnings.
+       # This can be removed once man 2.5.1 makes it to testing.
+       unless (defined $MAN_WARNINGS) {
+           my $version = `man -V 2>&1`;
+           if ($? == 0 && $version =~ / (\d+\.[\d.]+)(,|\Z)/) {
+               $MAN_WARNINGS = Dep::versions_gte($1, '2.5.1');
+           } else {
+               $MAN_WARNINGS = 0;
+           }
+       }
+
+       # If it's not a .so link, run it through "man" to check for errors.
+       # If it is in a directory with the standard man layout, cd to the
+       # parent directory before running man so that .so directives are
+       # processed properly.  (Yes, there are man pages that include other
+       # pages with .so but aren't simple links; rbash, for instance.)
+       my $cmd;
+       my $warnings = $MAN_WARNINGS ? ' --warnings' : '';
+       if ($file =~ m,^(.*)/(man\d/.*)$,) {
+           $cmd = "cd unpacked/\Q$1\E && man$warnings -l \Q$2\E";
+       } else {
+           $cmd = "man$warnings -l unpacked/\Q$file\E";
+       }
+       my $pid = open MANERRS, '-|';
+       if (not defined $pid) {
+           fail("cannot run man -l: $!");
+       } elsif ($pid == 0) {
+           my %newenv = (LANG => 'C', PATH => $ENV{PATH});
+           undef %ENV;
+           %ENV = %newenv;
+           exec "($cmd >/dev/null) 2>&1"
+               or fail("cannot run man -l: $!");
+       }
+       while (<MANERRS>) {
+           # ignore progress information from man
+           next if /^Reformatting/;
+           next if /^\s*$/;
+           # ignore errors from gzip, will be dealt with at other places
+           next if /^(man|gzip)/;
+           # ignore wrapping failures for Asian man pages (groff problem)
+           if ($lang =~ /^(?:ja|ko|zh)/) {
+               next if /warning \[.*\]: cannot adjust line/;
+               next if /warning \[.*\]: can\'t break line/;
+           }
+           # ignore charset issues with old versions of man for all man pages
+           # since we can't know, with old versions, whether that was just a
+           # Unicode issue
+           if (!$MAN_WARNINGS and
+               (m/warning: can\'t find numbered character/
+                or m/a magic token is not allowed in a name/
+                or m/name expected \(got a magic token\)/)) {
+               next;
+           }
+           # ignore common undefined macros from pod2man << Perl 5.10
+           next if /warning: \`(Tr|IX)\' not defined/;
+           chomp;
+           s/^[^:]+://o;
+           tag "manpage-has-errors-from-man", "$file", "$_";
+           last;
+       }
+       close(MANERRS);
+       # Now we search through the whole man page for some common errors
+       my $lc = 0;
+       my $hc = 0;
+       foreach my $line (@manfile) {
+           $lc++;
+           chomp $line;
+           next if $line =~ /^\.\\\"/o; # comments .\"
+           if ($line =~ /^\.TH\s/) { # header
+               require Text::ParseWords;
+               my ($th_command, $th_title, $th_section, $th_date ) =
+                   Text::ParseWords::parse_line( '\s+', 0, $line);
+               if ($th_section && (lc($fn_section) ne lc($th_section))) {
+                   tag "manpage-section-mismatch", "$file:$lc $fn_section != $th_section";
+               }
+           }
+           # Catch hyphens used as minus signs by looking for ones at the
+           # beginning of a word, but don't generate false positives on \s-1
+           # (small font), \*(-- (pod2man long dash), or things like \h'-1'.
+           if ($line =~ /^(
+                           ([^\.].*)?
+                           [\s\'\"\`\(\[]
+                           (?<! \\s | \*\( | \(- | \w\' )
+                          )?
+                          (--?\w+)/ox) {
+               $hc++;
+               tag "hyphen-used-as-minus-sign", "$file:$lc" if $hc <= 10 or $ENV{'LINTIAN_DEBUG'};
+           }
+           if (($line =~ m,(/usr/(dict|doc|etc|info|man|adm|preserve)/),o)
+               || ($line =~ m,(/var/(adm|catman|named|nis|preserve)/),o)) {
+               # FSSTND dirs in man pages
+               # regexes taken from checks/files
+               tag "FSSTND-dir-in-manual-page", "$file:$lc $1";
+           }
+       }
+       tag "hyphen-used-as-minus-sign", $file, ($hc-10), "more occurrences not shown" if $hc > 10 and ! $ENV{'LINTIAN_DEBUG'};
+    }
+}
+close(IN);
+
+for my $f (sort keys %binary) {
+    if (exists $manpage{$f}) {
+       # X11 binary?  This shouldn't happen any more; these are no longer
+       # allowed.
+       if ($binary{$f} =~ m,usr/X11R6, or
+            ($link{$f} && $link{$f} =~ m,(\.\.|usr)/X11R6,)) {
+           # yes. manpage in X11 too?
+           for my $manp_info (@{$manpage{$f}}) {
+               if ($manp_info->{file} =~ m/X11R6/) {
+                   # ok.
+               } else {
+                   tag "manpage-for-x11-binary-in-wrong-directory", "$binary{$f} $manp_info->{file}";
+               }
+           }
+       } else {
+           for my $manp_info (@{$manpage{$f}}) {
+               # no. manpage in X11?
+               if ($manp_info->{file} =~ m/X11R6/) {
+                   tag "manpage-for-non-x11-binary-in-wrong-directory", "$binary{$f} $manp_info->{file}";
+               } else {
+                   # ok.
+               }
+           }
+       }
+
+       if (not grep { $_->{lang} eq "" } @{$manpage{$f}}) {
+           tag "binary-without-english-manpage", "$binary{$f}";
+       }
+    } else {
+       tag "binary-without-manpage", "$binary{$f}";
+    }
+}
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 ts=8
diff --git a/nokia-lintian/checks/manpages.desc b/nokia-lintian/checks/manpages.desc
new file mode 100644 (file)
index 0000000..57bd2ac
--- /dev/null
@@ -0,0 +1,256 @@
+Check-Script: manpages
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: man
+Type: binary
+Unpack-Level: 2
+Needs-Info: file-info
+Info: This script checks if a binary package conforms to manual page policy.
+
+Tag: bad-link-to-undocumented-manpage
+Type: error
+Info: The symbolic link should reference
+ `<tt>../man[237]/undocumented.[237].gz</tt>' for manual pages in
+ <tt>/usr/share/man</tt> or
+ `<tt>../../../share/man/man[237]/undocumented.[237].gz</tt>' for manual
+ pages in <tt>/usr/X11R6/man</tt>.
+
+Tag: link-to-undocumented-manpage
+Type: warning
+Info: Symbolic links to the undocumented(7) manual page may be provided
+ if no manual page is available, but that is deprecated.
+ .
+ The lack of a manual page is still a bug, and if at all possible you
+ should write one yourself.
+ .
+ For help with writing manual pages, refer to the Man-Page-HOWTO at
+ http://www.schweikhardt.net/man_page_howto.html, the examples created
+ by <tt>debmake</tt> or <tt>dh_make</tt>, or the
+ <tt>/usr/share/doc/man-db/examples</tt> directory.
+ If the package provides <tt>--help</tt> output, you might want to use
+ the <tt>help2man</tt> utility to generate a simple manual page.
+Ref: policy 12.1
+
+Tag: binary-without-manpage
+Type: warning
+Info: Each binary in <tt>/usr/bin</tt>, <tt>/usr/sbin</tt>, <tt>/bin</tt>,
+ <tt>/sbin</tt> or <tt>/usr/games</tt> should have a manual page
+ .
+ Note that though the man program has the capability to check for
+ several program names in the NAMES section, each of these programs
+ should have its own manual page (a symbolic link to the appropriate
+ manual page is sufficient) because other manual page viewers such as
+ xman or tkman don't support this.
+ .
+ If the name of the man page differs from the binary by case, man may
+ be able to find it anyway; however, it is still best practice to make the
+ case of the man page match the case of the binary.
+ .
+ If the man pages are provided by another package on which this package
+ depends, lintian may not be able to determine that man pages are
+ available.  In this case, after confirming that all binaries do have
+ man pages after this package and its dependencies are installed, please
+ add a lintian override.
+Ref: policy 12.1
+
+Tag: manpage-in-wrong-directory
+Type: error
+Info: The manual page should be installed in the correct directory below
+ <tt>/usr/share/man/</tt> or <tt>/usr/share/man/<i>locale</i></tt>.
+ Only sections 1 through 9 should be used.
+ .
+ The section number in the filename should correspond with the section
+ number in the directory name.
+Ref: policy 12.1
+
+Tag: manpage-has-wrong-extension
+Type: error
+Info: The manual page has an extension other than
+ `<i>section</i>[<i>program</i>].gz'.
+Ref: policy 13.1
+
+Tag: manpage-not-compressed
+Type: error
+Info: Manual pages have to be installed compressed (using `<tt>gzip -9</tt>').
+Ref: policy 12.1
+
+Tag: x11-games-should-be-in-usr-games
+Type: error
+Info: Since X11 games should be installed in <tt>/usr/games</tt> (and
+ not in <tt>/usr/X11R6/bin</tt>) and the game's manual pages should be
+ installed in <tt>/usr/share/man/man6</tt>, the directory
+ <tt>/usr/X11R6/man/man6</tt> should be empty.
+Ref: policy 11.11
+
+Tag: manpage-not-compressed-with-gzip
+Type: error
+Info: Manual pages should be compressed with <tt>gzip -9</tt>.
+Ref: policy 12.1
+
+Tag: manpage-not-compressed-with-max-compression
+Type: error
+Info: Manual pages should be compressed with <tt>gzip -9</tt>.
+Ref: policy 12.1
+
+Tag: manpage-has-bad-whatis-entry
+Type: warning
+Info: Each manual page should start with a `NAME' section, which lists the
+ name and a brief description of the page seperated by '\-'. These sections
+ are parsed by `mandb' and stored in a database for the use of `apropos' and
+ `whatis', so they must be in a certain format. This manual page apparently
+ uses the wrong format and cannot be parsed by `mandb'.
+ .
+ For information on how `NAME' sections should be written see lexgrog(1).
+ See also groff_man(7) and groff_mdoc(7) for general information on writing
+ manual pages.
+
+Tag: manpage-has-useless-whatis-entry
+Type: warning
+Info: The whatis entry for this manual page (the brief description found
+ in the NAME section) is of the form:
+ .
+  program - manual page for program
+ .
+ This conveys no information about what the program is for and is
+ repetitive.  The short description should contain brief information about
+ what the program is for to aid in searching with apropos and similar
+ programs.
+ .
+ If this manpage was generated by help2man, use the -n option to provide a
+ more meaningful description.
+
+Tag: manpage-is-dh_make-template
+Type: error
+Info: This manual page appears to be an unmodified or insufficiently
+ modified copy of the dh_make manual page template.  It has a whatis entry
+ (the brief description found in the NAME section) of the form:
+ .
+  package - program to do something
+ .
+ Please double-check the manual page and replace the template language
+ with specific information about this program.
+
+Tag: manpage-has-errors-from-man
+Type: warning
+Info: This man page provokes warnings or errors from man.
+ .
+ "cannot adjust" or "can't break" are trouble with paragraph filling,
+ usually related to long lines.  Adjustment can be helped by left
+ justifying, breaks can be helped with hyphenation, see "Manipulating
+ Filling and Adjusting" and "Manipulating Hyphenation" in the manual.
+ .
+ "can't find numbered character" usually means latin1 etc in the input, and
+ this warning indicates characters will be missing from the output.  You can
+ change to escapes like \[:a] described on the groff_char man page.
+ .
+ Other warnings are often formatting typos, like missing quotes around a
+ string argument to .IP.  These are likely to result in lost or malformed
+ output.  See the groff_man (or groff_mdoc if using mdoc) man page for
+ information on macros.
+ .
+ This test uses <tt>man</tt>'s <tt>--warnings</tt> option to enable groff
+ warnings that catch common mistakes, such as putting <tt>.</tt> or
+ <tt>'</tt> characters at the start of a line when they are intended as
+ literal text rather than groff commands.  This can be fixed either by
+ reformatting the paragraph so that these characters are not at the start of
+ a line, or by adding a zero-width space (<tt>\&</tt>) immediately before
+ them.
+ .
+ At worst, warning messages can be disabled with the .warn directive, see
+ "Debugging" in the groff manual.
+
+Tag: manpage-for-x11-binary-in-wrong-directory
+Type: error
+Info: Manual pages for binaries which are located in <tt>/usr/X11R6/bin</tt>
+ should be installed below <tt>/usr/X11R6/man</tt>.
+ .
+ Note that normally only packages that are part of X itself and those that
+ are using some arcane Imakefiles should actually install binaries into
+ <tt>/usr/X11R6/bin</tt>.
+
+Tag: manpage-for-non-x11-binary-in-wrong-directory
+Type: error
+Info: Manual pages for binaries that are not located in <tt>/usr/X11R6/bin</tt>
+ should not be installed below <tt>/usr/X11R6/man</tt>, but below
+ <tt>/usr/share/man</tt>.
+ .
+ Note that moving a binary into <tt>/usr/X11R6/bin</tt> is almost never the
+ proper solution for this problem; move the manual page instead.
+
+Tag: no-manpage-in-correct-directory
+Type: warning
+Info: Manpages for executables in /sbin and /usr/sbin should be placed in
+ section 8; manpages for executables in /bin and /usr/bin in section 1;
+ manpages for executables in /usr/games in section 6. For the noted
+ executable some probable manpages were found but none in the right section.
+ .
+ This could either mean there is no manpage for the executable or that its
+ manpage is placed in the wrong section.
+
+Tag: bad-so-link-within-manual-page
+Type: error
+Info: Manual files that use the .so links to include other pages should
+ only point to a path relative to the top-level manual hierarchy, e.g.
+ .
+ <tt>.so man3/boo.1.gz</tt>
+
+Tag: empty-manual-page
+Type: error
+Info: The referenced manual page is empty.
+
+Tag: manpage-section-mismatch
+Type: warning
+Info: A man page usually should contain a <tt>.TH</tt> header, specifying the
+ section.  The section in this manpage doesn't match with the section in the
+ filename.  Please consult groff_man(7) for more information about
+ <tt>.TH</tt> syntax (amongst others).
+
+Tag: hyphen-used-as-minus-sign
+Type: info
+Info: Manual page seems to contain a hyphen where a minus sign was intended.
+ '-' chars are interpreted as hyphens (U+2010) by groff, not as minus signs
+ (U+002D). Since options to programs use minus signs (U+002D), this means for
+ example in UTF-8 locales that you cannot cut&amp;paste options, nor search for
+ them easily.
+ .
+ '-' must be escaped ('\-') to be interpreted as minus. If you really intend a
+ hyphen, write it as '\(hy' to emphasise that fact. See groff(7) and
+ especially groff_char(7) for details, and also the thread starting with
+ http://lists.debian.org/debian-devel/2003/debian-devel-200303/msg01481.html
+ .
+ If you use some tool that converts your documentation to groff format, it
+ might be possible that this tool converts dashes of any kind to groff
+ hyphens, while the safe way of converting dashes is usually to convert them
+ to '\-'.
+ .
+ Because this error can occur <em>very</em> often we show only the
+ first 10 occurrences for each man page and give the number of
+ suppressed occurrences. If you want to see all warnings, run
+ lintian with the -d/--debug option.
+
+Tag: FSSTND-dir-in-manual-page
+Type: info
+Info: The manual page references a directory that is specified
+ in the FSSTND but not in the FHS which is used by Debian.
+ This can be an indicator of a mismatch of the location of
+ files as installed for Debian and as described by the man page.
+ .
+ If you have to change file locations to abide by Debian Policy
+ please also patch the man page to mention these new locations.
+
+Tag: binary-without-english-manpage
+Type: warning
+Info: Each binary in <tt>/usr/bin</tt>, <tt>/usr/sbin</tt>, <tt>/bin</tt>,
+ <tt>/sbin</tt> or <tt>/usr/games</tt> should have a manual page. You don't
+ provide an english, only a translated manpage. Since english is fallback,
+ shipping only a non-english man page leaves most users without a man page
+ at all.
+
+Tag: manpage-locale-dir-country-specific
+Type: warning
+Ref: policy 12.1
+Info: This package installs a manual page in a locale directory that
+ includes the country name.  A country name should not be included in the
+ directory name unless it indicates a significant difference in the
+ language.  The known cases where country names are appropriate are pt_BR
+ and zh_*.  Please file a bug against Lintian if this is another case
+ where a country name is appropriate.
diff --git a/nokia-lintian/checks/md5sums b/nokia-lintian/checks/md5sums
new file mode 100644 (file)
index 0000000..1c00cc2
--- /dev/null
@@ -0,0 +1,122 @@
+# md5sums -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::md5sums;
+use strict;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my $control = "control/md5sums";
+
+my %control_entry;
+my %info_entry;
+my %conffile;
+
+# read in md5sums info file
+open(C, '<', "md5sums") or fail("cannot open md5sums info file: $!");
+while (<C>) {
+    chop;
+    next if m/^\s*$/;
+    m/^(\S+)\s*(\S.*)$/ or fail("syntax error in md5sums info file: $_");
+    my $zzsum = $1;
+    my $zzfile = $2;
+    $zzfile =~ s,^(\./)?,,;
+    $info_entry{$zzfile} = $zzsum;
+}
+close(C);
+
+# read in conffiles
+if (-f "control/conffiles") {
+    open(C, '<', "control/conffiles")
+       or fail("cannot open control file conffiles: $!");
+    while (<C>) {
+       chop;
+       next if m/^\s*$/;
+       s,^/,,;
+       $conffile{$_} = 1;
+    }
+    close(C);
+}
+
+# Is there a md5sums control file?
+unless (-f $control) {
+    # ignore if package contains no files
+    return 0 if -z "md5sums";
+
+    # check if package contains non-conffiles
+    # debhelper doesn't create entries in md5sums
+    # for conffiles since this information would
+    # be redundant
+    my $only_conffiles = 1;
+    foreach my $file (keys %info_entry) {
+       unless ($conffile{$file}) {
+           $only_conffiles = 0;
+           last;
+       }
+    }
+
+    tag "no-md5sums-control-file", "" unless $only_conffiles;
+    return 0;
+}
+
+# Is it empty? Then skip it. Tag will be issued by control-files
+if (-z $control) {
+    return 0;
+}
+
+# read in md5sums control file
+open(C, '<', $control)
+    or fail("cannot open md5sums control file $control: $!");
+while (<C>) {
+    chop;
+    next if m/^\s*$/;
+    if (m{^([a-f0-9]+)\s*(?:\./)?(\S.*)$} && length($1) == 32) {
+       $control_entry{$2} = $1;
+    } else {
+       tag "malformed-md5sums-control-file", "line $.";
+    }
+}
+close(C);
+
+for my $file (keys %control_entry) {
+
+    if (not exists $info_entry{$file}) {
+       tag "md5sums-lists-nonexisting-file", "$file";
+    } elsif ($info_entry{$file} ne $control_entry{$file}) {
+       tag "md5sum-mismatch", "$file";
+    }
+
+    delete $info_entry{$file};
+}
+for my $file (keys %info_entry) {
+    tag "file-missing-in-md5sums", "$file"
+       unless ($conffile{$file} || $file =~ m%^var/lib/[ai]spell/.%);
+}
+
+}
+
+1;
+
+# vim: syntax=perl
diff --git a/nokia-lintian/checks/md5sums.desc b/nokia-lintian/checks/md5sums.desc
new file mode 100644 (file)
index 0000000..a1db1fe
--- /dev/null
@@ -0,0 +1,59 @@
+Check-Script: md5sums
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: md5
+Type: binary
+Unpack-Level: 1
+Needs-Info: md5sums
+Info: This script checks if md5sum control files are valid, if they are
+ provided by a binary package.
+
+Tag: no-md5sums-control-file
+Type: info
+Info: This package does not contain an md5sums control file.  This control
+ file listing the MD5 checksums of the contents of the package is not
+ required, but if present debsums can use it to verify that no files
+ shipped with your package have been modified.  Providing it is
+ recommended.
+ .
+ If you are using debhelper to create your package, just add a call to
+ <tt>dh_md5sums</tt> at the end of your binary-indep or binary-arch
+ target, right before <tt>dh_builddeb</tt>.
+
+Tag: malformed-md5sums-control-file
+Type: error
+Info: The indicated line of the md5sums control file for this package was
+ malformed.  Each line of an md5sums control file should contain an MD5
+ checksum, some whitespace, and then the path to the file corresponding to
+ that checksum.
+
+Tag: md5sum-mismatch
+Type: error
+Info: The md5sum listed for the file does not match the actual file
+ contents.
+ .
+ Usually, this error occurs during the package build process, if the
+ <tt>debian/tmp/</tt> directory is touched after <tt>dh_md5sums</tt> or
+ <tt>debstd</tt> is run.
+
+Tag: md5sums-lists-nonexisting-file
+Type: error
+Info: The md5sums control file lists a file which is not included in the
+ package.
+ .
+ Usually, this error occurs during the package build process, if the
+ <tt>debian/tmp/</tt> directory is touched after <tt>dh_md5sums</tt> or
+ <tt>debstd</tt> is run.
+ .
+ If all the files in the <tt>DEBIAN/</tt> subdirectory are listed
+ above, the problem was probably caused by building the package using a
+ buggy debstd/debmake. In this case, rebuilding the package with an
+ updated debstd should fix the problem.
+
+Tag: file-missing-in-md5sums
+Type: warning
+Info: The package contains a file which isn't listed in the md5sums control
+ file.
+ .
+ Usually, this error occurs during the package build process, if the
+ <tt>debian/tmp/</tt> directory is touched after <tt>dh_md5sums</tt> or
+ <tt>debstd</tt> is run.
diff --git a/nokia-lintian/checks/menu-format b/nokia-lintian/checks/menu-format
new file mode 100644 (file)
index 0000000..ecd2d7b
--- /dev/null
@@ -0,0 +1,908 @@
+# menu format -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 by Joey Hess
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# This script also checks desktop entries, since they share quite a bit of
+# code.  At some point, it would make sense to try to refactor this so that
+# shared code is in libraries.
+#
+# Further things that the desktop file validation should be checking:
+#
+#  - Encoding of the file should be UTF-8.
+#  - Additional Categories should be associated with Main Categories.
+#  - List entries (MimeType, Categories) should end with a semicolon.
+#  - Check for GNOME/GTK/X11/etc. dependencies and require the relevant
+#    Additional Category to be present.
+#  - Check all the escape characters supported by Exec.
+#  - Review desktop-file-validate to see what else we're missing.
+
+package Lintian::menu_format;
+use strict;
+use Tags;
+use Util;
+use File::Basename;
+
+# This is a list of all tags that should be in every menu item.
+my @req_tags=qw(needs section title command);
+
+# This is a list of all known tags.
+my @known_tags=qw(
+       needs
+       section
+       title
+       sort
+       command
+       longtitle
+       icon
+       icon16x16
+       icon32x32
+       description
+       hotkey
+       hints
+    );
+
+# These 'needs' tags are always valid, no matter the context, and no other
+# values are valid outside the Window Managers context (don't include wm here,
+# in other words).  It's case insensitive, use lower case here.
+my @needs_tag_vals=qw(x11 text vc);
+
+# Authorative source of menu sections:
+# http://www.debian.org/doc/packaging-manuals/menu-policy/ch2#s2.1
+
+# This is a list of all valid section on the root menu.
+my @root_sections = ('Applications', 'Games', 'Help', 'Screen',
+                     'Window Managers', 'FVWM Modules', 'Window Maker');
+
+# This is a list of all valid sections a menu item or submenu can go in.
+my @sections = ('Applications/Accessibility',
+               'Applications/Amateur Radio',
+               'Applications/Data Management',
+               'Applications/Editors',
+               'Applications/Education',
+               'Applications/Emulators',
+               'Applications/File Management',
+               'Applications/Graphics',
+               'Applications/Mobile Devices',
+               'Applications/Network/Communication',
+               'Applications/Network/File Transfer',
+               'Applications/Network/Monitoring',
+               'Applications/Network/Web Browsing',
+               'Applications/Network/Web News',
+               'Applications/Office',
+               'Applications/Programming',
+               'Applications/Project Management',
+               'Applications/Science/Astronomy',
+               'Applications/Science/Biology',
+               'Applications/Science/Chemistry',
+               'Applications/Science/Data Analysis',
+               'Applications/Science/Electronics',
+               'Applications/Science/Engineering',
+               'Applications/Science/Geoscience',
+               'Applications/Science/Mathematics',
+               'Applications/Science/Medicine',
+               'Applications/Science/Physics',
+               'Applications/Science/Social',
+               'Applications/Shells',
+               'Applications/Sound',
+               'Applications/System/Administration',
+               'Applications/System/Hardware',
+               'Applications/System/Language Environment',
+               'Applications/System/Monitoring',
+               'Applications/System/Package Management',
+               'Applications/System/Security',
+               'Applications/Terminal Emulators',
+               'Applications/Text',
+               'Applications/TV and Radio',
+               'Applications/Video',
+               'Applications/Viewers',
+               'Applications/Web Development',
+               'Games/Action',
+               'Games/Adventure',
+               'Games/Blocks',
+               'Games/Board',
+               'Games/Card',
+               'Games/Puzzles',
+               'Games/Simulation',
+               'Games/Strategy',
+               'Games/Tools',
+               'Games/Toys',
+               'Help',
+               'Screen/Saving',
+               'Screen/Locking',
+               'Window Managers',
+               'FVWM Modules',
+               'Window Maker'
+              );
+
+# Authorative source of desktop keys:
+# http://standards.freedesktop.org/desktop-entry-spec/1.0/
+#
+# This is a list of all keys that should be in every desktop entry.
+my @req_desktop_keys = qw(Type Name);
+
+# This is a list of all known keys.
+my %known_desktop_keys = map { $_ => 1 }
+    qw(
+       Type
+       Version
+       Name
+       GenericName
+       NoDisplay
+       Comment
+       Icon
+       Hidden
+       OnlyShowIn
+       NotShowIn
+       TryExec
+       Exec
+       Path
+       Terminal
+       MimeType
+       Categories
+       MimeType
+       Categories
+       StartupNotify
+       StartupWMClass
+       URL
+      );
+
+my %deprecated_desktop_keys = map { $_ => 1 }
+    qw(
+       Encoding
+       MiniIcon
+       TerminalOptions
+       Protocols
+       Extensions
+       BinaryPattern
+       MapNotify
+       SwallowTitle
+       SwallowExec
+       SortOrder
+       FilePattern
+      );
+
+# KDE uses some additional keys that should start with X-KDE but don't for
+# historical reasons.  Actions will in theory be in a later version of the
+# standard (it's not mentioned in the current standard, but is implemented by
+# KDE and widely used).
+my %kde_desktop_keys = map { $_ => 1 }
+    qw(
+       ServiceTypes
+       DocPath
+       Keywords
+       InitialPreference
+       Dev
+       FSType
+       MountPoint
+       ReadOnly
+       UnmountIcon
+       Actions
+      );
+
+# Known types of desktop entries.
+# http://standards.freedesktop.org/desktop-entry-spec/1.0/ar01s05.html
+my %known_desktop_types = map { $_ => 1 }
+    qw(
+       Application
+       Link
+       Directory
+      );
+
+# Authorative source of desktop categories:
+# http://standards.freedesktop.org/menu-spec/1.0/apa.html
+
+# This is a list of all Main Categories for .desktop files.  Application is
+# added as an exception; it's not listed in the standard, but it's widely used
+# and used as an example in the GNOME documentation.  GNUstep is added as an
+# exception since it's used by GNUstep packages.
+my %main_categories = map { $_ => 1 }
+    qw(
+       AudioVideo
+       Audio
+       Video
+       Development
+       Education
+       Game
+       Graphics
+       Network
+       Office
+       Settings
+       System
+       Utility
+       Application
+       GNUstep
+      );
+
+# This is a list of all Additional Categories for .desktop files.  Ideally we
+# should be checking to be sure the associated Main Categories are present,
+# but we don't have support for that yet.
+my %categories = map { $_ => 1 }
+    qw(
+       Building
+       Debugger
+       IDE
+       GUIDesigner
+       Profiling
+       RevisionControl
+       Translation
+       Calendar
+       ContactManagement
+       Database
+       Dictionary
+       Chart
+       Email
+       Finance
+       FlowChart
+       PDA
+       ProjectManagement
+       Presentation
+       Spreadsheet
+       WordProcessor
+       2DGraphics
+       VectorGraphics
+       RasterGraphics
+       3DGraphics
+       Scanning
+       OCR
+       Photography
+       Publishing
+       Viewer
+       TextTools
+       DesktopSettings
+       HardwareSettings
+       Printing
+       PackageManager
+       Dialup
+       InstantMessaging
+       Chat
+       IRCClient
+       FileTransfer
+       HamRadio
+       News
+       P2P
+       RemoteAccess
+       Telephony
+       TelephonyTools
+       VideoConference
+       WebBrowser
+       WebDevelopment
+       Midi
+       Mixer
+       Sequencer
+       Tuner
+       TV
+       AudioVideoEditing
+       Player
+       Recorder
+       DiscBurning
+       ActionGame
+       AdventureGame
+       ArcadeGame
+       BoardGame
+       BlocksGame
+       CardGame
+       KidsGame
+       LogicGame
+       RolePlaying
+       Simulation
+       SportsGame
+       StrategyGame
+       Art
+       Construction
+       Music
+       Languages
+       Science
+       ArtificialIntelligence
+       Astronomy
+       Biology
+       Chemistry
+       ComputerScience
+       DataVisualization
+       Economy
+       Electricity
+       Geography
+       Geology
+       Geoscience
+       History
+       ImageProcessing
+       Literature
+       Math
+       NumericalAnalysis
+       MedicalSoftware
+       Physics
+       Robotics
+       Sports
+       ParallelComputing
+       Amusement
+       Archiving
+       Compression
+       Electronics
+       Emulator
+       Engineering
+       FileTools
+       FileManager
+       TerminalEmulator
+       Filesystem
+       Monitor
+       Security
+       Accessibility
+       Calculator
+       Clock
+       TextEditor
+       Documentation
+       Core
+       KDE
+       GNOME
+       GTK
+       Qt
+       Motif
+       Java
+       ConsoleOnly
+      );
+
+# This is a list of Reserved Categories for .desktop files.  To use one of
+# these, the desktop entry must also have an OnlyShowIn key limiting the
+# environment to one that supports this category.
+my %reserved_categories = map { $_ => 1 }
+    qw(
+       Screensaver
+       TrayIcon
+       Applet
+       Shell
+      );
+
+# Path in which to search for binaries referenced in menu entries.
+my @path = qw(/usr/local/bin/ /usr/bin/ /bin/ /usr/X11R6/bin/ /usr/games/);
+
+my %known_tags_hash = map { $_ => 1 } @known_tags;
+my %needs_tag_vals_hash = map { $_ => 1 } @needs_tag_vals;
+my %root_sections_hash = map { $_ => 1 } @root_sections;
+my %sections_hash = map { $_ => 1 } @sections;
+
+# Holds a hash of all files in the package, used for checking for executables.
+my %file_index;
+
+# -----------------------------------
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my @menufiles;
+opendir (MENUDIR, "menu/lib") or fail("cannot read menu/lib file directory.");
+push @menufiles, map { "menu/lib/$_" } readdir(MENUDIR);
+closedir MENUDIR;
+opendir (MENUDIR, "menu/share") or fail("cannot read menu/share file directory.");
+push @menufiles, map { "menu/share/$_" } readdir(MENUDIR);
+closedir MENUDIR;
+
+# Find the desktop files in the package for verification and also build a hash
+# of every file in the package to use to verify that the command referenced by
+# a menu item or desktop entry is there.
+my @desktop_files;
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chomp;
+    my ($perm, $owner, $size, $date, $time, $file) = split(' ', $_, 6);
+    $file =~ s,^\./,/,;
+    $file =~ s/ link to .*//;
+    $file =~ s/ -> .*//;
+    my $operm = perm2oct($perm);
+    $file_index{$file} = 1;
+
+    if ($perm =~ m,^-, && $file =~ m,/usr/share/applications/.*\.desktop$,) {
+        if ($perm =~ m,x,o) {
+            tag "executable-desktop-file", sprintf("$file %04o",$operm);
+        }
+        unless (m,template,) {
+            push (@desktop_files, $file);
+        }
+    }
+}
+close IN;
+
+# Verify all the desktop files.
+for my $desktop_file (@desktop_files) {
+    VerifyDesktopFile ($desktop_file, $desktop_file, $pkg);
+}
+
+# Now all the menu files.
+foreach my $menufile (@menufiles) {
+    next if -x $menufile; # don't try to parse executables
+
+    my $basename = basename $menufile;
+    my $fullname = "/usr/share/menu/$basename";
+    $fullname = "/usr/lib/menu/$basename" if $menufile =~ m,^menu/lib/,o;
+
+    next if $basename eq "README"; # README is a special case
+
+    my $menufile_line ="";
+    open (IN, '<', $menufile) or
+       fail("cannot open menu file $menufile for reading.");
+    # line below is commented out in favour of the while loop
+    # do { $_=<IN>; } while defined && (m/^\s* \#/ || m/^\s*$/);
+    while (<IN>) {
+       if (m/^\s*\#/ || m/^\s*$/) {
+           next;
+       } else {
+           $menufile_line = $_;
+           last;
+       }
+    }
+
+    # Check first line of file to see if it matches the old menu file format.
+    if ($menufile_line =~ m/^(?!\?package\(.*\)).* .* .* .* "?.*"? .*$/o) {
+       tag "old-format-menu-file", $fullname;
+       close IN;
+       next;
+    } elsif ($menufile_line =~ m/^!C\s*menu-2/o) {
+       # we can't parse that yet
+       close IN;
+       next;
+    }
+
+    # Parse entire file as a new format menu file.
+    my $line="";
+    my $lc=0;
+    do {
+       $lc++;
+
+       # Ignore lines that are comments.
+       if ($menufile_line =~ m/^\s*\#/o) {
+           next;
+       }
+       $line .= $menufile_line;
+       # Note that I allow whitespace after the continuation character.
+       # This is caught by VerifyLine().
+       if (! ($menufile_line =~ m/\\\s*?$/)) {
+           VerifyLine($pkg,$type,$menufile,$fullname,$line,$lc);
+           $line="";
+       }
+    } while ($menufile_line = <IN>);
+    VerifyLine($pkg,$type,$menufile,$fullname,$line,$lc);
+
+    close IN;
+}
+
+}
+
+# -----------------------------------
+
+# Pass this a line of a menu file, it sanitizes it and
+# verifies that it is correct.
+sub VerifyLine {
+    my ( $pkg, $type, $menufile, $fullname, $line, $linecount ) = @_;
+
+    my %vals;
+
+    chomp $line;
+
+    # Replace all line continuation characters with whitespace.
+    # (do not remove them completely, because update-menus doesn't)
+    $line =~ s/\\\n/ /mgo;
+
+    # This is in here to fix a common mistake: whitespace after a '\'
+    # character.
+    if ($line =~ s/\\\s+\n/ /mgo) {
+       tag "whitespace-after-continuation-character", "$fullname:$linecount";
+    }
+
+    # Ignore lines that are all whitespace or empty.
+    return if $line =~ m/^\s+$/o or ! $line;
+
+    # Ignore lines that are comments.
+    return if $line =~ m/^\s*\#/o;
+
+    # Start by testing the package check.
+    if (not $line =~ m/^\?package\((.*?)\):/o) {
+       tag "bad-test-in-menu-item", "$fullname:$linecount";
+       return;
+    }
+    my $pkg_test = $1;
+    my %tested_packages = map { $_ => 1 } split( /\s*,\s*/, $pkg_test);
+    my $tested_packages = scalar keys %tested_packages;
+    unless (exists $tested_packages{$pkg}) {
+       tag "pkg-not-in-package-test", "$pkg_test $fullname";
+    }
+    $line =~ s/^\?package\(.*?\)://;
+
+    # Now collect all the tag=value pairs. I've heavily commented
+    # the killer regexp that's responsible.
+    #
+    # The basic idea here is we start at the beginning of the line.
+    # Each loop pulls off one tag=value pair and advances to the next
+    # when we have no more matches, there should be no text left on
+    # the line - if there is, it's a parse error.
+    while ($line =~ m/
+          \s*?                 # allow whitespace between pairs
+          (                    # capture what follows in $1, it's our tag
+           [^\"\s=]            # a non-quote, non-whitespace, character
+           *                   # match as many as we can
+          )
+          =
+          (                    # capture what follows in $2, it's our value
+           (?:
+            \"                 # this is a quoted string
+            (?:
+             \\.               # any quoted character
+             |                 # or
+             [^\"]             # a non-quote character
+            )
+            *                  # repeat as many times as possible
+            \"                 # end of the quoted value string
+           )
+           |                   # the other possibility is a non-quoted string
+           (?:
+            [^\"\s]            # a non-quote, non-whitespace character
+            *                  # match as many times as we can
+           )
+          )
+          /ogcx) {
+       my $tag = $1;
+       my $value = $2;
+
+       if (exists $vals{$tag}) {
+           tag "duplicated-tag-in-menu-item", "$fullname $1:$linecount";
+       }
+
+       # If the value was quoted, remove those quotes.
+       if ($value =~ m/^\"(.*)\"$/) {
+           $value = $1;
+       } else {
+           tag "unquoted-string-in-menu-item", "$fullname $1:$linecount";
+       }
+
+       # If the value has escaped characters, remove the
+       # escapes.
+       $value =~ s/\\(.)/$1/g;
+
+       $vals{$tag} = $value;
+    }
+
+    # This is not really a no-op. Note the use of the /c
+    # switch - this makes perl keep track of the current
+    # search position. Notice, we did it above in the loop,
+    # too. (I have a /g here just so the /c takes affect.)
+    # We use this below when we look at how far along in the
+    # string we matched. So the point of this line is to allow
+    # trailing whitespace on the end of a line.
+    $line =~ m/\s*/ogc;
+
+    # If that loop didn't match up to end of line, we have a
+    # problem..
+    if (pos($line) < length($line)) {
+       tag "unparsable-menu-item", "$fullname:$linecount";
+       # Give up now, before things just blow up in our face.
+       return;
+    }
+
+    # Now validate the data in the menu file.
+
+    # Test for important tags.
+    foreach my $tag (@req_tags) {
+       unless ( exists($vals{$tag}) && defined($vals{$tag}) ) {
+           tag "menu-item-missing-required-tag", "$tag $fullname:$linecount";
+           # Just give up right away, if such an essential tag is missing,
+           # chance is high the rest doesn't make sense either. And now all
+           # following checks can assume those tags to be there
+           return;
+       }
+    }
+
+    # Make sure all tags are known.
+    foreach my $tag (keys %vals) {
+       if (! $known_tags_hash{$tag}) {
+           tag "menu-item-contains-unknown-tag", "$tag $fullname:$linecount";
+       }
+    }
+
+    # Sanitize the section tag
+    my $section = $vals{'section'};
+    $section =~ tr:/:/:s;      # eliminate duplicate slashes.
+    $section =~ s:/$::;                # remove trailing slash.
+
+    # Be sure the command is provided by the package.
+    my ($okay, $command) = VerifyCmd ($fullname, $linecount, $vals{'command'}, $pkg);
+    tag "menu-command-not-in-package", "$fullname:$linecount $command"
+        unless ($okay
+                or not $command
+                or ($tested_packages >= 2)
+                or ($section =~ m:^(WindowManagers/Modules|FVWM Modules|Window Maker):));
+
+    if (exists($vals{'icon'})) {
+       VerifyIcon($menufile, $fullname, $linecount, $vals{'icon'}, 32);
+    }
+    if (exists($vals{'icon32x32'})) {
+       VerifyIcon($menufile, $fullname, $linecount, $vals{'icon32x32'}, 32);
+    }
+    if (exists($vals{'icon16x16'})) {
+       VerifyIcon($menufile, $fullname, $linecount, $vals{'icon16x16'}, 16);
+    }
+
+    # Check the needs tag.
+    my $needs = lc($vals{'needs'}); # needs is case insensitive.
+
+    if ($section =~ m:^(WindowManagers/Modules|FVWM Modules|Window Maker):) {
+       # WM/Modules: needs must not be the regular ones nor wm
+       if ($needs_tag_vals_hash{$needs} or $needs eq "wm") {
+           tag "non-wm-module-in-wm-modules-menu-section", "$needs $fullname:$linecount";
+       }
+    } elsif ($section =~ m:^Window ?Managers:) {
+       # Other WM sections: needs must be wm
+        if ($needs ne 'wm') {
+           tag "non-wm-in-windowmanager-menu-section", "$needs $fullname:$linecount";
+       }
+    } else {
+       # Any other section: just only the general ones
+       if ($needs eq "dwww") {
+           tag "menu-item-needs-dwww", "$fullname:$linecount";
+       } elsif (not $needs_tag_vals_hash{$needs}) {
+           tag "menu-item-needs-tag-has-unknown-value", "$needs $fullname:$linecount";
+       }
+    }
+
+    # Check the section tag
+    # Check for historical changes in the section tree.
+    if ($section =~ m:^Apps/Games:) {
+        tag "menu-item-uses-apps-games-section", "$fullname:$linecount";
+        $section =~ s:^Apps/::;
+    }
+    if ($section =~ m:^Apps/:) {
+        tag "menu-item-uses-apps-section", "$fullname:$linecount";
+        $section =~ s:^Apps/:Applications/:;
+    }
+    if ($section =~ m:^WindowManagers:) {
+        tag "menu-item-uses-windowmanagers-section", "$fullname:$linecount";
+        $section =~ s:^WindowManagers:Window Managers:;
+    }
+
+    # Check for Evil new root sections.
+    my ($rootsection) = $section =~ m:([^/]*):;
+    if (not $root_sections_hash{$rootsection}) {
+        if (not $rootsection =~ m/$pkg/i) {
+            tag "menu-item-creates-new-root-section", "$rootsection $fullname:$linecount";
+        }
+    } else {
+        if (not $sections_hash{$section}) {
+            tag "menu-item-creates-new-section", "$vals{section} $fullname:$linecount";
+        }
+    }
+}
+
+
+sub VerifyIcon {
+    my ($menufile, $fullname, $linecount, $icon, $size) = @_;
+    local *IN;
+
+    if ($icon eq 'none') {
+       tag "menu-item-uses-icon-none", "$fullname:$linecount";
+       return;
+    }
+
+    if (not ($icon =~ m/\.xpm$/i)) {
+       tag "menu-icon-not-in-xpm-format", "$icon";
+       return;
+    }
+
+    # Try the explicit location, and if that fails, try the standard path.
+    my $iconfile = "unpacked/$icon";
+    if (! -f $iconfile) {
+       $iconfile = "unpacked/usr/share/pixmaps/$icon";
+    }
+
+    if (! open (IN, '<', $iconfile)) {
+       tag "menu-icon-missing", "$icon";
+       return;
+    }
+
+    my $parse = "XPM header";
+    my $line;
+    do { defined ($line = <IN>) or goto parse_error; }
+    until ($line =~ /\/\*\s*XPM\s*\*\//);
+
+    $parse = "size line";
+    do { defined ($line = <IN>) or goto parse_error; }
+    until ($line =~ /"\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)\s*"/);
+    my $width = $1 + 0;
+    my $height = $2 + 0;
+    my $numcolours = $3 + 0;
+    my $cpp = $4 + 0;
+
+    if ($width > $size || $height > $size) {
+       tag "menu-icon-too-big", "$icon: ${width}x${height} > ${size}x${size}";
+    }
+
+    close IN or die;
+    return;
+
+parse_error:
+    close IN or die;
+    tag "menu-icon-cannot-be-parsed", "$icon: looking for $parse";
+    return;
+}
+
+
+# Syntax-checks a .desktop file.
+sub VerifyDesktopFile {
+    my ($desktopfile, $file, $pkg) = @_;
+    my %vals;
+    open (DESKTOP, '<', "unpacked/$file")
+       or fail("cannot open desktop file $file: $!");
+    my ($line, $saw_first, $warned_cr);
+    my @pending;
+    while (defined ($line = <DESKTOP>)) {
+        chomp $line;
+        next if ($line =~ m/^\s*\#/ or $line =~ m/^\s*$/);
+        if ($line =~ s/\r//) {
+            tag 'desktop-entry-file-has-crs', "$file:$." unless $warned_cr;
+            $warned_cr = 1;
+        }
+
+        # Err on the side of caution for now.  If the first non-comment line
+        # is not the required [Desktop Entry] group, ignore this file.  Also
+        # ignore any keys in other groups.
+        last if ($saw_first and $line =~ /^\[(.*)\]\s*$/);
+        unless ($saw_first) {
+            return unless $line =~ /^\[Desktop Entry\]\s*$/;
+            $saw_first = 1;
+        }
+
+       # Tag = Value.  For most errors, just add the error to pending rather
+       # than warning on it immediately since we want to not warn on tag
+       # errors if we didn't know the file type.
+       #
+       # TODO: We do not check for properly formatted localised values for
+       # keys but might be worth checking if they are properly formatted (not
+       # their value)
+       if ($line =~ /^(.*?)\s*=\s*(.*)$/) {
+           my ($tag, $value) = ($1, $2);
+           my $basetag = $tag;
+           my ($encoding) = ($basetag =~ s/\[([^\]]+)\]$//);
+           if (exists $vals{$tag}) {
+               tag "duplicated-key-in-desktop-entry", "$file:$. $tag";
+           } elsif ($deprecated_desktop_keys{$basetag}) {
+               if ($basetag eq 'Encoding') {
+                   push (@pending, [ "desktop-entry-contains-encoding-key", "$file:$. $tag" ]);
+               } else {
+                   push (@pending, [ "desktop-entry-contains-deprecated-key", "$file:$. $tag" ]);
+               }
+           } elsif (    not $known_desktop_keys{$basetag}
+                    and not $kde_desktop_keys{$basetag}
+                    and not $basetag =~ /^X-/) {
+               push (@pending, [ "desktop-entry-contains-unknown-key", "$file:$. $tag" ]);
+           }
+           $vals{$tag} = $value;
+       }
+    }
+    close DESKTOP;
+
+    # Now validate the data in the desktop file, but only if it's a known type.
+    return unless ($vals{'Type'} and $known_desktop_types{$vals{'Type'}});
+
+    # Now we can issue any pending tags.
+    for my $pending (@pending) {
+       tag @$pending;
+    }
+
+    # Test for important keys.
+    for my $tag (@req_desktop_keys) {
+        unless (defined $vals{$tag}) {
+            tag "desktop-entry-missing-required-key", "$file $tag";
+        }
+    }
+
+    # Only test whether the binary is in the package if the desktop file is
+    # directly under /usr/share/applications.  Too many applications use
+    # desktop files for other purposes with custom paths.
+    #
+    # TODO:  Should check quoting and the check special field
+    # codes in Exec for desktop files.
+    if ($file =~ m,^/usr/share/applications/, and $vals{'Exec'} and $vals{'Exec'} =~ /\S/) {
+        my ($okay, $command) = VerifyCmd ($file, undef, $vals{'Exec'}, $pkg);
+        tag "desktop-command-not-in-package", "$file $command"
+            unless $okay or $command eq 'kcmshell';
+    }
+
+    # Check the Category tag.
+    if (defined $vals{'Categories'}) {
+        my @cats = split (';', $vals{'Categories'});
+        my $saw_main;
+        for my $cat (@cats) {
+            next if $cat =~ /^X-/;
+            if ($reserved_categories{$cat}) {
+                tag "desktop-entry-uses-reserved-category", "$cat $file"
+                    unless $vals{'OnlyShowIn'};
+                $saw_main = 1;
+            } elsif (not $categories{$cat} and not $main_categories{$cat}) {
+                tag "desktop-entry-invalid-category", "$cat $file";
+            } elsif ($main_categories{$cat}) {
+                $saw_main = 1;
+            }
+        }
+        unless ($saw_main) {
+            tag "desktop-entry-lacks-main-category", "$file";
+        }
+    }
+}
+
+# Verify whether a command is shipped as part of the package.  Takes the full
+# path to the file being checked (for error reporting) and the binary.
+# Returns a list whose first member is true if the command is present and
+# false otherwise, and whose second member is the command (minus any leading
+# su-to-root wrapper).  Shared between the desktop and menu code.
+sub VerifyCmd {
+    my ($file, $line, $exec, $pkg) = @_;
+    my $location = ($line ? "$file:$line" : $file);
+
+    # This routine handles su wrappers.  The option parsing here is ugly and
+    # dead-simple, but it's hopefully good enough for what will show up in
+    # desktop files.  su-to-root and sux require -c options, kdesu optionally
+    # allows one, and gksu has the command at the end of its arguments.
+    my @com = split (' ', $exec);
+    my $cmd;
+    if ($com[0] and $com[0] eq "/usr/sbin/su-to-root") {
+        tag 'su-to-root-with-usr-sbin', $location;
+    }
+    if ($com[0] and $com[0] =~ m,^(?:/usr/s?bin/)?(su-to-root|gksu|kdesu|sux)$,) {
+        my $wrapper = $1;
+        shift @com;
+        while (@com) {
+            unless ($com[0]) {
+                shift @com;
+                next;
+            }
+            if ($com[0] eq '-c') {
+                $cmd = $com[1];
+                last;
+            } elsif ($com[0] =~ /^-[Dfmupi]|^--(user|description|message)/) {
+                shift @com;
+                shift @com;
+            } elsif ($com[0] =~ /^-/) {
+                shift @com;
+            } else {
+                last;
+            }
+        }
+        if (!$cmd && $wrapper =~ /^(gk|kde)su$/) {
+            if (@com) {
+                $cmd = $com[0];
+            } else {
+                $cmd = $wrapper;
+               undef $wrapper;
+            }
+        }
+        tag 'su-wrapper-without--c', "$location $wrapper" unless $cmd;
+       if ($wrapper && $wrapper !~ /su-to-root/ && $wrapper ne $pkg) {
+           tag 'su-wrapper-not-su-to-root', "$location $wrapper";
+       }
+    } else {
+        $cmd = $com[0];
+    }
+    my $okay = $cmd && ($cmd =~ /^[\'\"]/ || $file_index{$cmd} || grep { $file_index{$_ . $cmd} } @path);
+    return ($okay, $cmd);
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl ts=8 sw=4
diff --git a/nokia-lintian/checks/menu-format.desc b/nokia-lintian/checks/menu-format.desc
new file mode 100644 (file)
index 0000000..d1f6d65
--- /dev/null
@@ -0,0 +1,272 @@
+Check-Script: menu-format
+Author: Joey Hess <joeyh@master.debian.org>
+Abbrev: mnf
+Needs-Info: menu-files
+Type: binary
+Unpack-Level: 1
+Info: This script validates the format of menu files.
+
+Tag: old-format-menu-file
+Type: error
+Info: The package contains a menu file that is in the old menu file format.
+ This format is deprecated. Convert the menu file to the new menu format.
+ Note that lintian will not test this file for any other problems.
+
+Tag: whitespace-after-continuation-character
+Type: error
+Info: The menu item is split up over 2 or more lines using '\' at the end of
+ the line to join them together. However, there is some whitespace after
+ the '\' character, which is not guaranteed to be handled correctly.
+ The '\' should be at the end of the line.
+
+Tag: bad-test-in-menu-item
+Type: error
+Info: The menu file contains an item that does not start with the text
+ "?package(somepackage):". All menu file lines must test for the existence
+ of a package in this way.
+
+Tag: unparsable-menu-item
+Type: error
+Info: An item of the menu file cannot be parsed as a series of tag=value
+ pairs. This could be because you didn't close a set of double quotes.
+
+Tag: pkg-not-in-package-test
+Type: warning
+Info: This menu item doesn't test to see if the package containing it is
+ installed.  The start of any menu item is a conditional testing whether
+ the required packages are installed.  Normally this conditional should
+ always check at least the package containing it, since menu items should
+ be included in the package that provides the application the menu refers
+ to.
+ .
+ This error usually indicates a misspelling of the package name in the
+ menu entry or a copied menu entry from another package that doesn't apply
+ to this one.
+Ref: menu manual 3.2
+
+Tag: duplicated-tag-in-menu-item
+Type: warning
+Info: The menu item contains two instances of the same tag. This is just a
+ waste of space, as menu will only use one of them.
+
+Tag: menu-item-missing-required-tag
+Type: error
+Info: The menu item has a line that is missing a required tag. It's likely
+ that the line will have no effect without this tag. <tt>install-menu</tt> may
+ report this as an error during package installation.
+
+Tag: menu-item-contains-unknown-tag
+Type: warning
+Info: The menu item has a line that has a tag in it that is not one
+ of the standard tags (needs=, section=, title=, longtitle=, command=, etc).
+ While other tags can be used for specialized purposes, this is rare and
+ it's more likely the tag's name is misspelled.
+
+Tag: menu-item-uses-icon-none
+Type: warning
+Info: The menu item has a line that uses icon=none. This is redundant and
+ deprecated -- if there is no icon, just leave off the icon tag.
+
+Tag: menu-item-needs-tag-has-unknown-value
+Type: warning
+Info: The menu item has a line that has a needs= field with a strange value.
+ This may be intentional, but it's probably a typo that will make menu
+ ignore the line.
+
+Tag: menu-item-adds-to-root-menu
+Type: error
+Info: The menu item has a line that specifies a section that will put a menu
+ item right in the root menu. Packages should never add items directly to the
+ root menu. Note that if you specify an empty section, this error will
+ pop up, as it will if you specify a section of "/".
+
+Tag: menu-item-uses-apps-games-section
+Type: warning
+Info: The menu item has a line that specifies a section under "Apps/Games".
+ This section has been moved to just "Games".
+
+Tag: menu-item-uses-apps-section
+Type: warning
+Info: The menu item has a line that specifies a section under "Apps".
+ This section has been moved to "Applications".
+
+Tag: menu-item-uses-windowmanagers-section
+Type: warning
+Info: The menu item has a line that specifies a section under
+ "WindowManagers".  This section has been moved to "Window Managers".
+
+Tag: menu-item-creates-new-section
+Type: warning
+Info: The menu item has a line that specifies an unknown section or uses a
+ section that is intended only as a menu root, not as a section that
+ applications should use directly.  Check the spelling of the section and
+ check the section against the list in the menu policy.  (The menu
+ sections changed as of June of 2007.)
+Ref: Debian Menu sub-policy 2.1
+
+Tag: menu-item-creates-new-root-section
+Type: error
+Info: The menu item has a line that specifies a new section to put a menu
+ entry in, and this section appears right in the root menu.  This is
+ almost certainly an error.  No new sections should be added to the root
+ menu without discussion with the author of menu.
+
+Tag: menu-icon-not-in-xpm-format
+Type: error
+Info: Icons in the Debian menu system should be in XPM format.
+Ref: menu manual 3.7
+
+Tag: menu-icon-missing
+Type: warning
+Info: This icon file couldn't be found.  If the path to the icon in the
+ menu file is an absolute path, make sure that icon exists at that path in
+ the package.  If the path is relative or a simple filename, make sure the
+ icon is installed in <tt>/usr/share/pixmaps</tt>, the default location.
+ .
+ If the icon is in a package this package depends on, add a lintian
+ override for this warning.  lintian cannot check icons in other packages.
+Ref: menu manual 3.7
+
+Tag: menu-icon-too-big
+Type: error
+Info: Icons in the Debian menu system should be at most 32x32 pixels
+ (icon16x16 icons should of course be at most 16x16 pixels)
+Ref: menu manual 3.7
+
+Tag: menu-icon-cannot-be-parsed
+Type: warning
+Info: The icon file could not be parsed.  Perhaps this means a bad XPM file,
+ or perhaps it means the lintian parsing needs to be improved.  If the
+ window managers and standard tools accept the file then probably it's the
+ latter; please file a bug on lintian then.
+
+Tag: su-wrapper-without--c
+Type: error
+Info: The menu item command or desktop file uses an su wrapper such as
+ su-to-root without the -c flag. This is a syntax error.
+Ref: su-to-root(1)
+
+Tag: su-to-root-with-usr-sbin
+Type: warning
+Info: The menu item or desktop file command uses su-to-root as
+ /usr/sbin/su-to-root. Since sarge su-to-root is located in /usr/bin and
+ /usr/sbin/su-to-root is only a compatibility symlink that may get dropped
+ in the future.
+ .
+ Since su-to-root is now located in /usr/bin you can use it without
+ absolute path now.
+
+Tag: su-wrapper-not-su-to-root
+Type: warning
+Info: The menu item or desktop file command uses an su wrapper other than
+ su-to-root.  On Debian systems, please use <tt>su-to-root -X</tt>, which
+ will pick the correct wrapper based on what's installed on the system and
+ the current desktop environment.  Using su-to-root is also important for
+ Live CD systems which need to use sudo rather than su.  su-to-root
+ permits global configuration to use sudo.
+
+Tag: menu-item-needs-dwww
+Type: warning
+Info: The menu item has needs=dwww. This is deprecated. Instead, you should
+ register your documentation with doc-base, and dwww entries will be 
+ automatically generated.
+
+Tag: non-wm-in-windowmanager-menu-section
+Type: error
+Info: The menu item is in the Window Manager section but does not needs=wm.
+ Either it is a window manager and it should needs=wm, either it isn't and
+ then it must be moved in another section.
+
+Tag: non-wm-module-in-wm-modules-menu-section
+Type: error
+Info: The menu item is in the FVWM Modules or Window Maker section but
+ does not declare that it needs a specific window manager (using the needs
+ key in the menu file).  Modules for Fvwm should have needs="fvwmmodule".
+ Modules for WindowMaker should have needs="wmmaker".
+
+Tag: unquoted-string-in-menu-item
+Type: warning
+Info: The menu item includes a tag with an unquoted string like section=Games
+ instead of section="Games". This is deprecated. Use a quoted string instead.
+Ref: menu manual 3.2
+
+Tag: menu-command-not-in-package
+Type: warning
+Info: The menu item specifies a command which is not available in the package.
+ In most cases this is a typo or after you moved a binary around, but forgot
+ to update the menu file.
+
+Tag: executable-desktop-file
+Type: error
+Info: The desktop entry file is marked executable.  Desktop entries are
+ regular files and should be installed mode 0644.
+
+Tag: desktop-entry-file-has-crs
+Type: warning
+Info: The desktop entry file has lines ending in CRLF instead of just LF.
+ The Desktop Entry Specification is explicit that lines should end with
+ only LF.  The CR may be taken by some software as part of the field.
+Ref: http://standards.freedesktop.org/desktop-entry-spec/1.0/ar01s02.html
+
+Tag: duplicated-key-in-desktop-entry
+Type: warning
+Info: The desktop entry contains two instances of the same key.  The
+ behavior of such desktop entries is not well-defined by the standard.
+
+Tag: desktop-entry-missing-required-key
+Type: error
+Info: Desktop entries must contain, at a minimum, the keys Type and Name.
+Ref: http://standards.freedesktop.org/desktop-entry-spec/1.0/ar01s05.html
+
+Tag: desktop-entry-contains-unknown-key
+Type: warning
+Info: The key on this line of the desktop entry is not one of the standard
+ keys defined in the FreeDesktop specification, not one of the legacy KDE
+ keywords, and one that does not begin with <tt>X-</tt>.  It's most likely
+ that the key was misspelled.
+Ref: http://standards.freedesktop.org/desktop-entry-spec/1.0/ar01s05.html
+
+Tag: desktop-entry-contains-deprecated-key
+Type: warning
+Info: The key on this line of the desktop entry has been deprecated in the
+ FreeDesktop specification.
+Ref: http://standards.freedesktop.org/desktop-entry-spec/1.0/apc.html
+
+Tag: desktop-entry-contains-encoding-key
+Type: info
+Info: The Encoding key is now deprecated by the FreeDesktop standard and
+ all strings are required to be encoded in UTF-8.  This desktop entry
+ explicitly specifies an Encoding of UTF-8, which is harmless but no
+ longer necessary.
+Ref: http://standards.freedesktop.org/desktop-entry-spec/1.0/apc.html
+
+Tag: desktop-entry-lacks-main-category
+Type: warning
+Info: The categories for this desktop entry do not contain any Main
+ Categories, only Additional Categories.  Additional Categories should
+ only be used on conjunction with one or more Main Categories.
+Ref: http://standards.freedesktop.org/menu-spec/1.0/apa.html
+
+Tag: desktop-entry-uses-reserved-category
+Type: warning
+Info: This desktop entry includes a Reserved Category, one which has a
+ desktop-specific meaning that has not yet been standardized, but does not
+ include an OnlyShowIn key.  Desktop entries using a Reserved Category
+ must include an OnlyShowIn key limiting the entry to those environments
+ that support the category.
+Ref: http://standards.freedesktop.org/menu-spec/1.0/apa.html
+
+Tag: desktop-entry-invalid-category
+Type: warning
+Info: This desktop entry lists a category that is not one of the
+ registered Main or Additional Categories in the FreeDesktop
+ specification.
+Ref: http://standards.freedesktop.org/menu-spec/1.0/apa.html
+
+Tag: desktop-command-not-in-package
+Type: warning
+Info: The desktop entry specifies a command that is not available in the
+ package.  In most cases, this is a typo or a forgotten update of the
+ desktop file after the install location of the binary was changed.  A
+ desktop file for a command should be included in the same package as that
+ command.
diff --git a/nokia-lintian/checks/menus b/nokia-lintian/checks/menus
new file mode 100644 (file)
index 0000000..6674d33
--- /dev/null
@@ -0,0 +1,688 @@
+# menus -- lintian check script -*- perl -*-
+
+# somewhat of a misnomer -- it doesn't only check menus
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::menus;
+use strict;
+use lib "$ENV{'LINTIAN_ROOT'}/checks/";
+use common_data;
+
+use Lintian::Data;
+use Spelling;
+use Tags;
+use Util;
+
+my $pkg;
+my %all_files = ();
+my %all_links = ();
+
+# Known fields for doc-base files.  The value is 1 for required fields and 0
+# for optional fields.
+my %known_docbase_main_fields = (
+       'document' => 1,
+       'title'    => 1,
+       'section'  => 1,
+       'abstract' => 0,
+       'author'   => 0
+);
+my %known_docbase_format_fields = (
+       'format'  => 1,
+       'files'   => 1,
+       'index'   => 0
+);
+
+sub run {
+
+$pkg = shift;
+my $type = shift;
+
+my %preinst;
+my %postinst;
+my %prerm;
+my %postrm;
+
+my $docbase_file;
+my $menu_file;
+my $menumethod_file;
+my $anymenu_file;
+
+# check preinst script
+if ( -f "control/preinst" ) {
+    # parse script...
+    check_script("preinst",\%preinst);
+}
+
+# check postinst script
+if ( -f "control/postinst" ) {
+    # parse script...
+    check_script("postinst",\%postinst);
+}
+
+# check prerm script
+if ( -f "control/prerm" ) {
+    # parse script...
+    check_script("prerm",\%prerm);
+}
+
+# check postrm script
+if ( -f "control/postrm" ) {
+    # parse script...
+    check_script("postrm",\%postrm);
+}
+
+# read package contents
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chomp;
+    my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
+    $file =~ s,^(\./),,;
+    add_file_link_info ($file);
+    $file =~ s/ link to .*//;
+    $file =~ s/ -> .*//;
+
+    my $operm = perm2oct($perm);
+
+    if ($perm =~ m,^-,o) { # file checks
+       # menu file?
+       if ($file =~ m,^usr/(lib|share)/menu/\S,o) { # correct permissions?
+           if ($perm =~ m,x,o) {
+               tag "executable-menu-file", sprintf("$file %04o",$operm);
+           }
+
+           next if $file =~ m,^usr/(lib|share)/menu/README$,;
+
+           if ($file =~ m,^usr/lib/,o) {
+               tag "menu-file-in-usr-lib", $file;
+           }
+
+           $menu_file = $file;
+
+           if ($file =~ m,usr/(lib|share)/menu/menu$,o and $pkg ne 'menu') {
+               tag "bad-menu-file-name", $file;
+           }
+       }
+       # doc-base file?
+       elsif ($file =~ m,^usr/share/doc-base/\S,o) { # correct permissions?
+           if ($perm =~ m,x,o) {
+               tag "executable-in-usr-share-docbase", $file, sprintf("%04o",$operm);
+           }
+           $docbase_file = $file;
+       }
+       #menu-methods file?
+       elsif ( $file =~ m,^etc/menu-methods/\S,o ) {
+           #TODO: we should test if the menu-methods file
+           # is made executable in the postinst as recommended by
+           # the menu manual
+
+           my $menumethod_includes_menu_h = 0;
+           $menumethod_file = $file;
+
+           open(MM, '<', "unpacked/$file") or fail("cannot open menu-method file $file: $!");
+           while (<MM>) {
+               chomp;
+               if (m,^!include menu.h,o) {
+                   $menumethod_includes_menu_h = 1;
+                   last;
+               }
+           }
+           close MM;
+           tag "menu-method-should-include-menu-h", "$file"
+               unless $menumethod_includes_menu_h or $pkg eq 'menu';
+       }
+    }
+}
+close IN;
+
+# prerm scripts should not call update-menus
+if ($prerm{'calls-updatemenus'}) {
+    tag "prerm-calls-updatemenus", "";
+}
+
+# postrm scripts should not call install-docs
+if ($postrm{'calls-installdocs'} or $postrm{'calls-installdocs-r'}) {
+    tag "postrm-calls-installdocs", "";
+}
+
+# preinst scripts should not call either update-menus nor installdocs
+if ($preinst{'calls-updatemenus'}) {
+    tag "preinst-calls-updatemenus", "";
+}
+
+if ($preinst{'calls-installdocs'}) {
+    tag "preinst-calls-installdocs", "";
+}
+
+# don't set the /usr/doc link, the FHS transition is over (2002-10-08)
+if (defined $postinst{'sets-link'} && $postinst{'sets-link'} == 1) {
+    tag "postinst-should-not-set-usr-doc-link", "";
+}
+
+$anymenu_file = $menu_file || $menumethod_file;
+
+# check consistency
+# docbase file?
+if ($docbase_file) {           # postinst has to call install-docs
+    if (not $postinst{'calls-installdocs'}) {
+       tag "postinst-does-not-call-installdocs", "$docbase_file";
+    }
+    # prerm has to call install-docs -r
+    if (not $prerm{'calls-installdocs-r'}) {
+       tag "prerm-does-not-call-installdocs", "$docbase_file";
+    }
+
+    # check the contents of the doc-base file(s)
+    opendir DOCBASEDIR, "doc-base" or fail("cannot read doc-base directory.");
+    my $dbfile;
+    while (defined ($dbfile = readdir DOCBASEDIR)) {
+       # don't try to parse executables, plus we already warned about it
+       next if -x "doc-base/$dbfile";
+       check_doc_base_file($dbfile, $pkg, $type);
+    }
+    closedir DOCBASEDIR;
+} else {
+    # postinst and postrm should not need to call install-docs
+    if ($postinst{'calls-installdocs'} or $postinst{'calls-installdocs-r'}) {
+       tag "postinst-has-useless-call-to-install-docs", "";
+    }
+    if ($prerm{'calls-installdocs'} or $prerm{'calls-installdocs-r'}) {
+       tag "prerm-has-useless-call-to-install-docs", "";
+    }
+}
+
+if ($anymenu_file) {
+    # postinst has to call update-menus
+    if (not $postinst{'calls-updatemenus'}) {
+       tag "postinst-does-not-call-updatemenus", "$anymenu_file";
+    }
+    # postrm has to call update-menus
+    if (not $postrm{'calls-updatemenus'}) {
+       tag "postrm-does-not-call-updatemenus", "$anymenu_file" unless $pkg eq 'menu';
+    }
+} else {
+    # postinst and postrm should not need to call update-menus
+    if ($postinst{'calls-updatemenus'}) {
+       tag "postinst-has-useless-call-to-update-menus", "";
+    }
+    if ($postrm{'calls-updatemenus'}) {
+       tag "postrm-has-useless-call-to-update-menus", "";
+    }
+}
+
+}
+
+# -----------------------------------
+
+sub check_doc_base_file {
+    my ($dbfile, $pkg, $type) = @_;
+
+    my $line = file_is_encoded_in_non_utf8("doc-base/$dbfile", $type, $pkg);
+    if ($line) {
+       tag 'doc-base-file-uses-obsolete-national-encoding', "$dbfile:$line";
+    }
+
+    open (IN, '<', "doc-base/$dbfile")
+        or fail("cannot open doc-base file $dbfile for reading.");
+
+    my (@files, $field, @vals);
+    my $knownfields = \%known_docbase_main_fields;
+    $line           = 0;  # global
+    my %sawfields   = (); # local for each section of control file
+    my %sawformats  = (); # global for control file
+
+    while (<IN>) {
+        chomp;
+
+        # New field.  check previous field, if we have any.
+        if (/^(\S+)\s*:\s*(.*)$/) {
+            my (@new) = ($1, $2);
+            if ($field) {
+                check_doc_base_field($dbfile, $line, $field, \@vals,
+                                     \%sawfields, \%sawformats, $knownfields);
+            }
+            $field = lc $new[0];
+            @vals  = ($new[1]);
+            $line  = $.;
+
+        # Continuation of previously defined field.
+        } elsif ($field && /^\s+\S/) {
+            push (@vals, $_);
+
+            # All tags will be reported on the last continuation line of the
+            # doc-base field.
+            $line  = $.;
+
+        # Sections' separator.
+        } elsif (/^(\s*)$/) {
+            tag "doc-base-file-separator-extra-whitespaces", "$dbfile:$."
+                if $1;
+            next unless $field; # skip successive empty lines
+
+            # Check previously defined field and section.
+            check_doc_base_field($dbfile, $line, $field, \@vals, \%sawfields,
+                                 \%sawformats, $knownfields);
+            check_doc_base_file_section($dbfile, $line + 1, \%sawfields,
+                                        \%sawformats, $knownfields);
+
+            # Intialize variables for new section.
+            undef $field;
+            undef $line;
+            @vals      = ();
+            %sawfields = ();
+
+            # Each section except the first one is format section.
+            $knownfields = \%known_docbase_format_fields;
+
+        # Everything else is a syntax error.
+        } else {
+            tag "doc-base-file-syntax-error", "$dbfile:$.";
+        }
+    }
+
+    # Check the last field/section of the control file.
+    if ($field) {
+        check_doc_base_field($dbfile, $line, $field, \@vals, \%sawfields,
+                             \%sawformats, $knownfields);
+        check_doc_base_file_section($dbfile, $line, \%sawfields, \%sawformats,
+                                    $knownfields);
+    }
+
+    # Make sure we saw at least one format.
+    tag "doc-base-file-no-format-section", "$dbfile:$." unless %sawformats;
+
+    close IN;
+}
+
+# Checks one field of a doc-base control file.  $vals is array ref containing
+# all lines of the field.  Modifies $sawfields and $sawformats.
+sub check_doc_base_field {
+    my ($dbfile, $line, $field, $vals, $sawfields, $sawformats,
+        $knownfields) = @_;
+
+    tag "doc-base-file-unknown-field", "$dbfile:$line", "$field"
+        unless defined $knownfields->{$field};
+    tag "doc-base-file-duplicated-field", "$dbfile:$line", "$field"
+        if $sawfields->{$field};
+    $sawfields->{$field} = 1;
+
+    # Index/Files field.
+    #
+    # Check if files referenced by doc-base are included in the package.  The
+    # Index field should refer to only one file without wildcards.  The Files
+    # field is a whitespace-separated list of files and may contain wildcards.
+    # We skip without validating wildcard patterns containing character
+    # classes since otherwise we'd need to deal with wildcards inside
+    # character classes and aren't there yet.
+    if ($field eq 'index' or $field eq 'files') {
+        my @files = map { split ('\s+', $_) } @$vals;
+
+        if ($field eq 'index' && @files > 1) {
+            tag "doc-base-index-references-multiple-files", "$dbfile:$line";
+        }
+        for my $file (@files) {
+            if ($file =~ m%^/usr/doc%) {
+                tag "doc-base-file-references-usr-doc", "$dbfile:$line";
+            }
+            my $realfile = delink ($file);
+
+            # openoffice.org-dev-doc has thousands of files listed so try to
+            # use the hash if possible.
+            my $found;
+            if ($realfile =~ /[*?]/) {
+                my $regex = quotemeta ($realfile);
+                unless ($field eq 'index') {
+                    next if $regex =~ /\[/;
+                    $regex =~ s%\\\*%[^/]*%g;
+                    $regex =~ s%\\\?%[^/]%g;
+                    $regex .= '/?';
+                }
+                $found = grep { /^$regex\z/ } keys %all_files;
+            } else {
+                $found = $all_files{$realfile} || $all_files{"$realfile/"};
+            }
+            unless ($found) {
+                tag "doc-base-file-references-missing-file", "$dbfile:$line",
+                    $file;
+            }
+        }
+        undef @files;
+
+    # Format field.
+    } elsif ($field eq 'format') {
+        my $format = join (' ', @$vals);
+        $format =~ s/^\s+//o;
+        $format =~ s/\s+$//o;
+        $format = lc $format;
+        tag "doc-base-file-unknown-format", "$dbfile:$line", $format
+            unless $known_doc_base_formats{$format};
+        tag "doc-base-file-duplicated-format", "$dbfile:$line", $format
+            if $sawformats->{$format};
+        $sawformats->{$format} = 1;
+
+        # Save the current format for the later section check.
+        $sawformats->{' *current* '} = $format;
+
+    # Document field.
+    } elsif ($field eq 'document') {
+        $_ = join (' ', @$vals);
+
+        tag "doc-base-invalid-document-field", "$dbfile:$line", "$_"
+            unless /^[a-z0-9+.-]+$/;
+        tag "doc-base-document-field-ends-in-whitespace", "$dbfile:$line"
+            if /[ \t]$/;
+        tag "doc-base-document-field-not-in-first-line", "$dbfile:$line"
+            unless $line == 1;
+
+    # Title field.
+    } elsif ($field eq 'title') {
+        if (@$vals) {
+            spelling_check("spelling-error-in-doc-base-title-field",
+                           join (' ', @$vals), "$dbfile:$line");
+            spelling_check_picky("spelling-error-in-doc-base-title-field",
+                                 join (' ', @$vals), "$dbfile:$line");
+        }
+
+    # Section field.
+    } elsif ($field eq 'section') {
+       my $sections = Lintian::Data->new('doc-base/sections');
+       $_ = join (' ', @$vals);
+       tag "doc-base-unknown-section", "$dbfile:$line", $_
+           unless $sections->known($_);
+
+    # Abstract field.
+    } elsif ($field eq 'abstract') {
+        # The three following variables are used for checking if the field is
+        # correctly phrased.  We detect if each line (except for the first
+        # line and lines containing single dot) of the field starts with the
+        # same number of spaces, not followed by the same non-space character,
+        # and the number of spaces is > 1.
+        #
+        # We try to match fields like this:
+        #  ||Abstract: The Boost web site provides free peer-reviewed portable
+        #  ||  C++ source libraries.  The emphasis is on libraries which work
+        #  ||  well with the C++ Standard Library.  One goal is to establish
+        #
+        # but not like this:
+        #  ||Abstract:  This is "Ding"
+        #  ||  * a dictionary lookup program for Unix,
+        #  ||  * DIctionary Nice Grep,
+        my $leadsp    = undef; # string with leading spaces from second line
+        my $charafter = undef; # first non-whitespace char of second line
+        my $leadsp_ok = 1;     # are spaces OK?
+
+        # Intentionally skipping the first line.
+        for my $idx (1 .. $#{$vals}) {
+            $_ = $vals->[$idx];
+            if (/manage\s+online\s+manuals\s.*Debian/o) {
+                tag "doc-base-abstract-field-is-template", "$dbfile:$line"
+                    unless $pkg eq "doc-base";
+            } elsif (/^(\s+)\.(\s*)$/o and ($1 ne " " or $2)) {
+                tag "doc-base-abstract-field-separator-extra-whitespaces",
+                    "$dbfile:" . ($line - $#{$vals} + $idx);
+            } elsif (!$leadsp && /^(\s+)(\S)/o) {
+                # The regexp should always match.
+                ($leadsp, $charafter) = ($1, $2);
+                $leadsp_ok = $leadsp eq " ";
+            } elsif (!$leadsp_ok && /^(\s+)(\S)/o) {
+                # The regexp should always match.
+                undef $charafter if $charafter && $charafter ne $2;
+                $leadsp_ok = 1
+                    if ($1 ne $leadsp) || ($1 eq $leadsp && $charafter);
+            }
+        }
+        unless ($leadsp_ok) {
+            tag "doc-base-abstract-might-contain-extra-leading-whitespaces",
+                "$dbfile:$line";
+        }
+
+        # Check spelling.
+        if (@$vals) {
+            spelling_check("spelling-error-in-doc-base-abstract-field",
+                           join (' ', @$vals), "$dbfile:$line");
+            spelling_check_picky("spelling-error-in-doc-base-abstract-field",
+                                 join (' ', @$vals), "$dbfile:$line");
+        }
+    }
+}
+
+# Checks the section of the doc-base control file.  Tries to find required
+# fields missing in the section.
+sub check_doc_base_file_section {
+    my ($dbfile, $line, $sawfields, $sawformats, $knownfields) = @_;
+
+    tag "doc-base-file-no-format", "$dbfile:$line"
+        if ((defined $sawfields->{'files'} || defined $sawfields->{'index'})
+            && !(defined $sawfields->{'format'}));
+
+    # The current format is set by check_doc_base_field.
+    if ($sawfields->{'format'}) {
+        my $format =  $sawformats->{' *current* '};
+        tag "doc-base-file-no-index", "$dbfile:$line"
+            if ($format && ($format eq 'html' || $format eq 'info')
+                && !$sawfields->{'index'});
+    }
+    for my $field (sort keys %$knownfields) {
+        tag "doc-base-file-lacks-required-field", "$dbfile:$line", "$field"
+            if ($knownfields->{$field} == 1 && !$sawfields->{$field});
+    }
+}
+
+# Add file and link to %all_files and %all_links.  Note that both files and
+# links have to include a leading /.
+sub add_file_link_info {
+    my $file = shift;
+    my $link = undef;
+
+    $file = "/" . $file if (not $file =~ m%^/%); # make file absolute
+    $file =~ s%/+%/%g;                          # remove duplicated `/'
+    my $ishard = ($file =~ / link to /);
+    ($file, $link) = split(/ (?:->|link to) /, $file);
+
+    $all_files{$file} = 1;
+
+    if (defined $link) {
+       if ($ishard) {
+           $link =~ s,^\./,/,;
+       } elsif (not $link =~ m,^/,) {            # not absolute link
+           $link = "/" . $link;                  # make sure link starts with '/'
+           $link =~ s,/+\./+,/,g;                # remove all /./ parts
+           my $dcount = 1;
+           while ($link =~ s,^/+\.\./+,/,) {     #\ count & remove
+              $dcount++;                         #/ any leading /../ parts
+           }
+           my $f = $file;
+           while ($dcount--) {                   #\ remove last $dcount
+               $f =~ s,/[^/]*$,,;                #/ path components from $file
+           }
+           $link = $f . $link;                   # now we should have absolute link
+       }
+       $all_links{$file} = $link unless ($link eq $file);
+    }
+}
+
+
+# Dereference all symlinks in file.  Uses %all_links.
+sub delink {
+    my $file = shift;
+
+    $file =~ s%/+%/%g;                           # remove duplicated '/'
+    return $file unless %all_links;              # package doesn't symlinks
+
+    my $p1 = "";
+    my $p2 = $file;
+    my %used_links = ();
+
+    # In the loop below we split $file into two parts on each '/' until
+    # there's no remaining slashes.  We try substituting the first part with
+    # corresponding symlink and if it succeedes, we start the procedure from
+    # beginning.
+    #
+    # Example:
+    #   Let $all_links{"/a/b"} == "/d", and $file == "/a/b/c"
+    #   Then 0) $p1 == "",     $p2 == "/a/b/c"
+    #        1) $p1 == "/a",   $p2 == "/b/c"
+    #        2) $p1 == "/a/b", $p2 == "/c"      ; substitute "/d" for "/a/b"
+    #        3) $p1 == "",     $p2 == "/d/c"
+    #        4) $p1 == "/d",   $p2 == "/c"
+    #        5) $p1 == "/d/c", $p2 == ""
+    #
+    # Note that the algorithm supposes, that
+    #   i) $all_links{$X} != $X for each $X
+    #  ii) both keys and values of %all_links start with '/'
+
+    while (($p2 =~ s%^(/[^/]*)%%g) > 0) {
+       $p1 .= $1;
+       if (defined $all_links{$p1}) {
+           return '!!! SYMLINK LOOP !!!' if defined $used_links{$p1};
+           $p2 = $all_links{$p1} . $p2;
+           $p1 = "";
+           $used_links{$p1} = 1;
+       }
+    }
+
+    # After the loop $p2 should be empty and $p1 should contain the target
+    # file.  In some rare cases when $file contains no slashes, $p1 will be
+    # empty and $p2 will contain the result (which will be equal to $file).
+    return $p1 ne "" ? $p1 : $p2;
+}
+
+sub check_script {
+    my ($script,$pres) = @_;
+    my ($no_check_menu,$no_check_installdocs,$no_check_wmmenu,$calls_wmmenu);
+    my $interp;
+
+    open(IN, '<', "control/$script") or
+       fail("cannot open maintainer script control/$script for reading: $!");
+    $interp = <IN>;
+    $interp = '' unless defined $interp;
+    if ($interp =~ m,^\#\!\s*/bin/(a|ba|k|pdk)?sh,) {
+        $interp = 'sh';
+    } elsif ($interp =~ m,^\#\!\s*/usr/bin/perl,) {
+        $interp = 'perl';
+    } else {
+       if ($interp =~ m,^\#\!\s*(.+),) {
+            $interp = $1;
+       }
+       else { # hmm, doesn't seem to start with #!
+           # is it a binary? look for ELF header
+           if ($interp =~ m/^\177ELF/) {
+               return; # nothing to do here
+           }
+           $interp = 'unknown';
+       }
+    }
+
+    while (<IN>) {
+       # skip comments
+       s/\#.*$//o;
+
+       ##
+       # either update-menus or wm-menu-config will satisfy
+       # the checks that the menu file installed is properly used
+       ##
+
+       # does the script check whether update-menus exists?
+       if (/-x\s+\S*update-menus/o or /(which|command)(\s+\S+)?\s+update-menus/o) {
+           # yes, it does.
+           $pres->{'checks-for-updatemenus'} = 1;
+       }
+
+       # does the script call update-menus?
+       # TODO this regex-magic should be moved to some lib for checking
+       # whether a certain word is likely called as command... --Jeroen
+       if (/(?:^\s*|[;&|]\s*|(?:then|do)\s+)(?:\/usr\/bin\/)?update-menus(?:\s|[;&|<>]|$)/) {
+           # yes, it does.
+           $pres->{'calls-updatemenus'} = 1;
+
+           # checked first?
+           if (not $pres->{'checks-for-updatemenus'} and $pkg ne 'menu') {
+               tag "maintainer-script-does-not-check-for-existence-of-updatemenus", "$script:$." unless $no_check_menu++;
+           }
+       }
+
+       # does the script check whether wm-menu-config exists?
+       if (s/-x\s+\S*wm-menu-config//o or /which\s+wm-menu-config/o
+           or s/command\s+.*?wm-menu-config//o) {
+           # yes, it does.
+           $pres->{'checks-for-wmmenuconfig'} = 1;
+       }
+
+       # does the script call wm-menu-config?
+       if (m/(?:^\s*|[;&|]\s*|(?:then|do)\s+)(?:\/usr\/sbin\/)?wm-menu-config(?:\s|[;&|<>]|$)/) {
+           # yes, it does.
+           $pres->{'calls-wmmenuconfig'} = 1;
+           tag "maintainer-script-calls-deprecated-wm-menu-config", "$script:$." unless $calls_wmmenu++;
+
+           # checked first?
+           if (not $pres->{'checks-for-wmmenuconfig'} and $pkg ne 'menu') {
+               tag "maintainer-script-does-not-check-for-existence-of-wm-menu-config", "$script:$." unless $no_check_wmmenu++;
+           }
+       }
+
+       # does the script set a link in /usr/doc?
+       # does the script remove a link in /usr/doc?
+       if ($interp eq 'sh') {
+           if (m,ln\s+(-\w+)?\s+\"?\.\./share/doc/\S+, ) {
+               $pres->{'sets-link'} = 1;
+           }
+           if (m,rm\s+(-\w+\s+)?\"?/usr/doc/\S+, ) {
+               $pres->{'removes-link'} = 1;
+           }
+       } elsif ($interp eq 'perl') {
+           if (m|symlink\s*\(?\s*[\"\']\.\./share/doc/\.+?[\"\']\s*,|) {
+               $pres->{'sets-link'} = 1;
+           } elsif (m,ln\s+(-\w+)?\s+\"?\.\./share/doc/\S+, ) {
+               $pres->{'sets-link'} = 1;
+           }
+       } else {
+           # just fall through for now
+       }
+
+       # does the script check whether install-docs exists?
+       if (s/-x\s+\S*install-docs//o or /which\s+install-docs/o
+           or s/command\s+.*?install-docs//o) {
+           # yes, it does.
+           $pres->{'checks-for-installdocs'} = 1;
+       }
+
+       # does the script call install-docs?
+       if (m/(?:^\s*|[;&|]\s*|(?:then|do)\s+)(?:\/usr\/sbin\/)?install-docs(?:\s|[;&|<>]|$)/) {
+           # yes, it does.  Does it remove or add a doc?
+           if (m/install-docs\s+(-r|--remove)\s/) {
+               $pres->{'calls-installdocs-r'} = 1;
+           } else {
+               $pres->{'calls-installdocs'} = 1;
+           }
+           # checked first?
+           if (not $pres->{'checks-for-installdocs'}) {
+               tag "maintainer-script-does-not-check-for-existence-of-installdocs", "$script" unless $no_check_installdocs++;
+           }
+       }
+    }
+    close IN;
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl
diff --git a/nokia-lintian/checks/menus.desc b/nokia-lintian/checks/menus.desc
new file mode 100644 (file)
index 0000000..c030fe2
--- /dev/null
@@ -0,0 +1,315 @@
+Check-Script: menus
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: men
+Type: binary
+Unpack-Level: 1
+Needs-Info: doc-base-files
+
+Tag: postinst-should-not-set-usr-doc-link
+Type: warning
+Info: The technical committee chose the symlink transition method to move
+ from FSSTND to FHS.  That transition has been completed with woody and thus
+ this link is no longer required.
+
+Tag: maintainer-script-does-not-check-for-existence-of-updatemenus
+Type: error
+Info: The maintainer script calls the <tt>update-menus</tt> command without
+ checking for existence first. (The <tt>menu</tt> package which provides the
+ command is not marked as `essential' package.)
+ .
+ For example, use the following code in your maintainer script:
+  if [ -x /usr/bin/update-menus ] ; then update-menus ; fi
+
+Tag: maintainer-script-does-not-check-for-existence-of-wm-menu-config
+Type: error
+Info: The maintainer script calls the <tt>wm-menu-config</tt> command without
+ checking for existence first. (The <tt>menu</tt> package which provides
+ the command is not marked as `essential' package.)
+ .
+ For example, use the following code in your maintainer script:
+  if [ -x /usr/sbin/wm-menu ]; then /usr/sbin/wm-menu-config; fi
+
+Tag: maintainer-script-does-not-check-for-existence-of-installdocs
+Type: error
+Info: The maintainer script calls the <tt>install-docs</tt> command without
+ checking for existence first. (The <tt>doc-base</tt> package which provides
+ the command is not marked as `essential' package.)
+ .
+ For example, use the following code in your maintainer script:
+  if [ -x /usr/sbin/install-docs ]; then
+    /usr/sbin/install-docs -i /usr/share/doc-base/&lt;your-package&gt;
+  fi
+
+Tag: maintainer-script-calls-deprecated-wm-menu-config
+Type: warning
+Info: The use of the wm-menu-config script is deprecated because it's
+ design had some serious flaws. Please see the menu documentation,
+ chapter 5 for more information.
+
+Tag: preinst-calls-updatemenus
+Type: error
+Info: The preinst script calls the <tt>update-menus</tt> command. Usually,
+ this command should be called from the <tt>postinst</tt> maintainer script.
+
+Tag: preinst-calls-installdocs
+Type: error
+Info: The preinst script calls the <tt>install-docs</tt> command. Usually,
+ this command should be called from the <tt>postinst</tt> maintainer script.
+
+Tag: prerm-calls-updatemenus
+Type: error
+Info: The prerm script calls the <tt>update-menus</tt> command. Usually,
+ this command should be called from the <tt>postrm</tt> maintainer script.
+
+Tag: postrm-calls-installdocs
+Type: error
+Info: The postrm script calls the <tt>install-docs</tt> command. Usually,
+ this command should be called from the <tt>prerm</tt> maintainer script.
+
+Tag: executable-menu-file
+Type: warning
+Info: Menu files should normally not be marked as executables. You only
+ need to do this if your package has to generate menu entries dynamically.
+
+Tag: menu-file-in-usr-lib
+Type: warning
+Info: As of menu, version 2.1.25, /usr/lib/menu as location for menu
+ files is deprecated (but still works perfectly). Menu files should
+ now be placed in /usr/share/menu instead. Only menu files that are
+ actually binary executables still need to go to /usr/lib/menu.
+
+Tag: executable-in-usr-share-docbase
+Type: error
+Info: Files in <tt>/usr/share/doc-base</tt> may not be marked as executables.
+
+Tag: postinst-does-not-call-installdocs
+Type: error
+Info: Since the package installs a file in <tt>/usr/share/doc-base</tt>, the
+ package should probably call the <tt>install-docs</tt> command in its
+ <tt>postinst</tt> script.
+ .
+ For example, use the following code in your maintainer script:
+  if [ -x /usr/sbin/install-docs ]; then
+    /usr/sbin/install-docs -i /usr/share/doc-base/&lt;your-package&gt;
+  fi
+
+Tag: prerm-does-not-call-installdocs
+Type: error
+Info: Since the package installs a file in <tt>/usr/share/doc-base</tt>, the
+ package should probably call the <tt>install-docs</tt> command in its
+ <tt>prerm</tt> script.
+ .
+ For example, use the following code in your maintainer script:
+  if [ -x /usr/sbin/install-docs ]; then
+    /usr/sbin/install-docs -r &lt;your-package&gt; || true
+  fi
+
+Tag: postinst-does-not-call-updatemenus
+Type: error
+Info: Since the package installs a file in either <tt>/usr/lib/menu</tt> or
+ <tt>/etc/menu-methods</tt>, the package should probably call the
+ <tt>update-menus</tt> command in it's <tt>postinst</tt> script.
+ .
+ For example, use the following code in your maintainer script:
+  if [ -x /usr/bin/update-menus ] ; then update-menus ; fi
+
+Tag: postrm-does-not-call-updatemenus
+Type: error
+Info: Since the package installs a file in either <tt>/usr/lib/menu</tt> or
+ <tt>/etc/menu-methods</tt>, the package should probably call the
+ <tt>update-menus</tt> command in it's <tt>postrm</tt> script.
+ .
+ For example, use the following code in your maintainer script:
+  if [ -x /usr/bin/update-menus ] ; then update-menus ; fi
+
+Tag: postinst-has-useless-call-to-update-menus
+Type: warning
+Info: The <tt>postinst</tt> script calls the <tt>update-menus</tt> program
+ though no file is installed in <tt>/usr/lib/menu</tt> or
+ <tt>/etc/menu-methods</tt>.
+
+Tag: postrm-has-useless-call-to-update-menus
+Type: warning
+Info: The <tt>postrm</tt> script calls the <tt>update-menus</tt> program
+ though no file is installed in <tt>/usr/lib/menu</tt> or
+ <tt>/etc/menu-methods</tt>
+
+Tag: postinst-has-useless-call-to-install-docs
+Type: error
+Info: The <tt>postinst</tt> script calls the <tt>install-docs</tt> program
+ though no file is installed in <tt>/usr/share/doc-base</tt>.
+
+Tag: prerm-has-useless-call-to-install-docs
+Type: error
+Info: The <tt>prerm</tt> script calls the <tt>install-docs</tt> program
+ though no file is installed in <tt>/usr/share/doc-base</tt>.
+
+Tag: bad-menu-file-name
+Severity: 4
+Significance: 3
+Info: The package installs a file <tt>/usr/lib/menu/menu</tt>, which is
+ already in use by the <tt>menu</tt> package itself.  The menu file should
+ be named after the package that installs it.
+
+Tag: doc-base-file-references-usr-doc
+Type: warning
+Info: Files in <tt>/usr/share/doc-base</tt> should only contain links to
+ files in the <tt>/usr/share/doc</tt> directory.
+
+Tag: doc-base-index-references-multiple-files
+Type: error
+Info: The Index field in a doc-base file should reference the single index
+ file for that document.  Any other files belonging to the same document
+ should be listed in the Files field.
+Ref: Debian doc-base Manual section 2.3.2.2
+
+Tag: doc-base-file-references-missing-file
+Type: error
+Info: One of the files referenced in an Index or Files field in this
+ doc-base control file does not exist in the package.  The doc-base
+ control files should be installed by the package that provides the
+ documents they are registering.
+
+Tag: doc-base-file-unknown-format
+Type: warning
+Info: The Format field in this doc-base control file declares a format
+ that is not supported.  Recognized formats are "HTML", "Text", "PDF",
+ "PostScript", "Info", "DVI", and "DebianDoc-SGML" (case-insensitive).
+Ref: Debian doc-base Manual section 2.3.2.2
+
+Tag: doc-base-file-no-format
+Type: error
+Info: A format section of this doc-base control file didn't specify a
+ format.  Each section after the first must specify a format.
+Ref: Debian doc-base Manual section 2.3.2.2
+
+Tag: doc-base-file-no-format-section
+Type: error
+Info: This doc-base control file didn't specify any format
+ section.
+Ref: Debian doc-base Manual section 2.3.2.2
+
+Tag: doc-base-file-no-index
+Type: error
+Info: Format sections in doc-base control files for HTML or Info documents
+ must contain an Index field specifying the starting document for the
+ documentation.  Even if the documentation is a single file, this field
+ must be present.
+Ref: Debian doc-base Manual section 2.3.2.2
+
+Tag: doc-base-document-field-ends-in-whitespace
+Type: error
+Info: The Document field in a doc-base file should not end in whitespace.
+ doc-base (at least as of 0.8.5) cannot cope with such fields and
+ debhelper 5.0.57 or earlier may create files ending in whitespace when
+ installing such files.
+
+Tag: doc-base-document-field-not-in-first-line
+Type: error
+Info: The Document field in doc-base control file must be located at
+ first line of the file.  While unregistering documents, doc-base 0.8
+ and later parses only the first line of the control file for performance
+ reasons.
+Ref: Debian doc-base Manual section 2.3.2.1
+
+Tag: doc-base-file-unknown-field
+Type: error
+Info: The doc-base control file contains field which is either unknown
+ or not valid for the section where was found.  Possible reasons for this
+ error are: a typo in field name, missing empty line between control file
+ sections, or an extra empty line separating sections.
+Ref: Debian doc-base Manual sections 2.3.2.1 and 2.3.2.2
+
+Tag: doc-base-file-duplicated-field
+Type: error
+Info: The doc-base control file contains duplicated field.
+
+Tag: doc-base-file-duplicated-format
+Type: error
+Info: The doc-base control file contains a duplicated format.  Doc-base
+ files must not register different documents in one control file.
+Ref: Debian doc-base Manual section 2.3.2.2
+
+Tag: doc-base-file-lacks-required-field
+Type: error
+Info: The doc-base control file does not contain a required field for the
+ appropriate section.
+Ref: Debian doc-base Manual sections 2.3.2.1 and 2.3.2.2
+
+Tag: doc-base-invalid-document-field
+Type: error
+Info: The Document field should consists only of letters (a-z), digits
+ (0-9), plus (+) or minus (-) signs, and dots (.).  In particular,
+ uppercase letters are not allowed.
+Ref: Debian doc-base Manual section 2.2
+
+Tag: doc-base-abstract-field-is-template
+Type: warning
+Info: The Abstract field of doc-base contains a "manage online manuals"
+ phrase, which was copied verbatim from an example control file found in
+ section 2.3.1 of the Debian doc-base Manual.
+
+Tag: doc-base-abstract-might-contain-extra-leading-whitespaces
+Type: warning
+Info: Continuation lines of the Abstract field of doc-base control file
+ should start with only one space unless they are meant to be displayed
+ verbatim by fontends.
+Ref: Debian doc-base Manual section 2.3.2
+
+Tag: doc-base-abstract-field-separator-extra-whitespaces
+Type: warning
+Info: Unnecessary spaces were found in the paragraph separator line of the
+ doc-base's Abstract field.  The separator line should consist of a single
+ space followed by a single dot.
+Ref: Debian doc-base Manual section 2.3.2
+
+Tag: spelling-error-in-doc-base-title-field
+Type: warning
+Info: Lintian found a spelling or capitalization error in the Title field
+ of this doc-base control file.  Lintian has a list of common misspellings
+ that it looks for.  It does not have a dictionary like a spelling checker
+ does.
+
+Tag: spelling-error-in-doc-base-abstract-field
+Type: warning
+Info: Lintian found a spelling or capitalization error in the Abstract
+ field of this doc-base control file.  Lintian has a list of common
+ misspellings that looks for.  It does not have a dictionary like a
+ spelling checker does.
+
+Tag: doc-base-file-syntax-error
+Type: error
+Info: Lintian found a syntax error in the doc-base control file.
+Ref: Debian doc-base Manual section 2.3.2.2
+
+Tag: doc-base-file-separator-extra-whitespaces
+Type: warning
+Info: Unnecessary spaces were found in the doc-base file sections'
+ separator.  The section separator is an empty line and should not contain
+ any whitespace.
+Ref: Debian doc-base Manual section 2.3.2
+
+Tag: doc-base-file-uses-obsolete-national-encoding
+Type: error
+Info: doc-base files must be valid UTF-8, an encoding of the Unicode
+ character set.
+ .
+ There are many ways to convert a doc-base file from an obsolete encoding
+ like ISO-8859-1.  You may, for example, use "iconv" like:
+ .
+  $ iconv -f ISO-8859-1 -t UTF-8 doc-base &gt; doc-base.new
+  $ mv doc-base.new doc-base
+Ref: Debian doc-base Manual section 2.3.2
+
+Tag: doc-base-unknown-section
+Type: warning
+Info: The section indicated in this doc-base control file is not one of
+ the standard doc-base sections.  The doc-base sections are based on the
+ menu sections but are not exactly the same.
+Ref: Debian doc-base Manual section 2.3.3
+
+Tag: menu-method-should-include-menu-h
+Type: error
+Info: A menu-method file must include the menu.h configuration file
+ (using "!include menu.h").
+Ref: Debian Menu System manual section 5
diff --git a/nokia-lintian/checks/nmu b/nokia-lintian/checks/nmu
new file mode 100644 (file)
index 0000000..0f4b032
--- /dev/null
@@ -0,0 +1,131 @@
+# nmu -- lintian check script -*- perl -*-
+
+# Copyright (C) 2004 Jeroen van Wolffelaar
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::nmu;
+use strict;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+my $changelog_mentions_nmu = 0;
+my $changelog_mentions_qa = 0;
+my $uploader = undef;
+
+# This isn't really an NMU check, but right now no other check looks at
+# debian/changelog in source packages.  Catch a debian/changelog file that's a
+# symlink.  If it was a symlink to a file we didn't unpack, bail rather than
+# abort.
+if (-l "debfiles/changelog") {
+    tag "changelog-is-symlink", "";
+    return 0 unless -f "debfiles/changelog";
+}
+
+open (CHANGELOG, '<', "debfiles/changelog")
+    or fail("Failed opening changelog");
+<CHANGELOG>;
+my $firstline = 1;
+while (<CHANGELOG>) {
+       if ($firstline) {
+               $changelog_mentions_nmu = 1
+                       if (/\bnmu\b/i or /non-maintainer upload/i) and not /(ackno|\back\b|confir|incorporat)/i;
+               $changelog_mentions_qa = 1 if /orphan/i or /qa (?:group )?upload/i;
+               $firstline = 0 if /^\s+\S/;
+       }
+       if (/^ -- ([^>]+>)/) {
+               $uploader = canonicalize($1);
+               last;
+       }
+}
+close CHANGELOG;
+
+my $version = getfield("version");
+my $maintainer = canonicalize(getfield("maintainer"));
+my $uploaders = getfield("uploaders");
+
+my $version_nmuness = 0;
+if ($version =~ /-[^.-]+(\.[^.-]+)?(\.[^.-]+)?$/) {
+       $version_nmuness = 1 if defined $1;
+       $version_nmuness = 2 if defined $2;
+}
+if ($version =~ /\+nmu\d+$/) {
+       $version_nmuness = 1;
+}
+if ($version =~ /\+b\d+$/) {
+       $version_nmuness = 2;
+}
+
+my $upload_is_nmu = $uploader ne $maintainer;
+if (defined $uploaders) {
+       my @uploaders = map { canonicalize($_) } split /,/, $uploaders;
+       $upload_is_nmu = 0 if grep /^\s*\Q$uploader\E\s*$/, @uploaders;
+}
+
+# No such thing as NMUs in Ubuntu-land.
+if ($version =~ /ubuntu/) {
+    $upload_is_nmu = 0;
+    $version_nmuness = 0;
+}
+
+if ($maintainer =~ /packages\@qa.debian.org/) {
+       tag "orphaned-package-should-not-have-uploaders", ""
+               if defined $uploaders;
+       tag "qa-upload-has-incorrect-version-number", "$version"
+               if $version_nmuness == 1;
+       tag "changelog-should-mention-qa", ""
+               if !$changelog_mentions_qa;
+} else {
+       tag "changelog-should-mention-nmu", ""
+               if !$changelog_mentions_nmu && $upload_is_nmu;
+       tag "changelog-should-not-mention-nmu", ""
+               if $changelog_mentions_nmu && !$upload_is_nmu;
+       tag "source-nmu-has-incorrect-version-number", "$version"
+               if $upload_is_nmu && $version_nmuness != 1;
+       tag "maintainer-upload-has-incorrect-version-number", "$version"
+               if !$upload_is_nmu && $version_nmuness;
+}
+
+}
+
+sub getfield {
+       return undef if not open (FIELD, '<', "fields/" . shift);
+       my $field = <FIELD>;
+       close FIELD;
+       $field =~ s/\n$//;
+       return $field;
+}
+
+# Canonicalize a maintainer address with respect to case.  E-mail addresses
+# are case-insensitive in the right-hand side.
+sub canonicalize {
+       my ($maintainer) = @_;
+       $maintainer =~ s/(<[^>\@]+\@)([\w.-]+)>/$1 . lc ($2)/e;
+       return $maintainer;
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 8
+# End:
+# vim: ts=4 sw=4
diff --git a/nokia-lintian/checks/nmu.desc b/nokia-lintian/checks/nmu.desc
new file mode 100644 (file)
index 0000000..d5a4cc7
--- /dev/null
@@ -0,0 +1,74 @@
+Check-Script: nmu
+Author: Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+Abbrev: nmu
+Type: source
+Unpack-Level: 1
+Needs-Info: debfiles
+Info: This script checks if a source package is consistent about its NMU-ness.
+
+Tag: orphaned-package-should-not-have-uploaders
+Type: error
+Info: Packages with their maintainer set to packages@qa.debian.org, i.e.
+ orphaned packages, should not have uploaders. Adopt the package properly if
+ you want to resume its maintenance.
+
+Tag: qa-upload-has-incorrect-version-number
+Type: warning
+Info: A QA upload (uploading an orphaned package without adopting it) is
+ always a maintainer upload: it should not get a NMU revision number.
+
+Tag: source-nmu-has-incorrect-version-number
+Type: warning
+Info: A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
+ native package). This is to prevent stealing version numbers from the
+ maintainer.
+ .
+ Maybe you didn't intend this upload to be a NMU, in that case, please
+ doublecheck that the most recent entry in the changelog is byte-for-byte
+ identical to the maintainer or one of the uploaders.
+
+Tag: maintainer-upload-has-incorrect-version-number
+Type: warning
+Info: A maintainer upload should have a Debian revision without dots.
+ Revisions with dots are reserved for Non-Maintainer Uploads (NMU's), if you
+ do a maintainer-upload with dots, a potential NMU'er has problems choosing a
+ correct version number.
+
+Tag: changelog-should-mention-qa
+Type: warning
+Info: If this upload is to orphan this package, please mention this fact on
+ the first line of the changelog. If this is a QA upload, please mention "QA
+ (group) upload" there.
+
+Tag: changelog-should-mention-nmu
+Type: warning
+Info: When you NMU a package, that fact should be mentioned on the first line
+ in the changelog entry.  Use the words "NMU" or "Non-maintainer upload"
+ (case insensitive).
+ .
+ Maybe you didn't intend this upload to be a NMU, in that case, please
+ doublecheck that the most recent entry in the changelog is byte-for-byte
+ identical to the maintainer or one of the uploaders.
+
+Tag: changelog-should-not-mention-nmu
+Type: warning
+Info: The first line of the changelog entry for this package appears to
+ indicate it is a non-maintainer upload (by including either that string
+ or the string "NMU" and not saying that it's an acknowledgement), but the
+ changelog indicates the person making this release is one of the
+ maintainers.
+ .
+ If this was intended to be an NMU, do not add yourself as a maintainer or
+ uploader.  Otherwise, please rephrase your changelog entry to not cause
+ confusion.
+
+Tag: changelog-is-symlink
+Type: warning
+Info: The file <tt>debian/changelog</tt> is a symlink instead of a regular
+ file. This is unnecessary and makes package checking and manipulation
+ more difficult. If the changelog should be available in the source
+ package under multiple names, make <tt>debian/changelog</tt> the real
+ file and the other names symlinks to it.
+ .
+ This problem may have prevented lintian from performing other checks,
+ leading to undetected changelog errors.
diff --git a/nokia-lintian/checks/patch-systems b/nokia-lintian/checks/patch-systems
new file mode 100644 (file)
index 0000000..511a15d
--- /dev/null
@@ -0,0 +1,210 @@
+# patch-systems -- lintian check script -*- perl -*-
+#
+# Copyright (C) 2007 Marc Brockschmidt
+# Copyright (C) 2008 Raphael Hertzog
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::patch_systems;
+use strict;
+use lib "$ENV{'LINTIAN_ROOT'}/checks/";
+use common_data;
+use Dep;
+use Tags;
+use Util;
+
+sub run {
+       my ($pkg, $type) = @_;
+
+       unless (-d "fields") {
+       fail("directory in lintian laboratory for $type package $pkg missing: fields");
+       }
+
+       #Some (cruft) checks are valid for every patch system, so we need to record that:
+       my $uses_patch_system = 0;
+
+       #Get build deps so we can decide which build system the maintainer
+       #meant to use:
+       my $build_deps = "";
+    if (open(IN, '<', "fields/build-depends")) {
+               local $/ = undef;
+        chomp($build_deps .= <IN>);
+               close(IN);
+    }
+       if (open(IN, '<', "fields/build-depends-indep")) {
+               local $/ = undef;
+               $build_deps .= ", " if $build_deps;
+               chomp($build_deps .= <IN>);
+               close(IN);
+       }
+       $build_deps = Dep::parse($build_deps);
+       # Get source package format
+       my $format = "";
+       if (open(IN, '<', "fields/format")) {
+               local $/ = undef;
+               chomp($format .= <IN>);
+               close(IN);
+       }
+       my $quilt_format = ($format =~ /3\.\d+ \(quilt\)/) ? 1 : 0;
+
+       #----- dpatch
+       if (Dep::implies($build_deps, Dep::parse("dpatch"))) {
+               $uses_patch_system++;
+               #check for a debian/patches file:
+               if (! -r "debfiles/patches/00list") {
+                       tag "dpatch-build-dep-but-no-patch-list", $pkg;
+               } else {
+                       my $list_uses_cpp = 0;
+                       if (open(OPTS, '<', "debfiles/patches/00options")) {
+                               while(<OPTS>) {
+                                       if (/DPATCH_OPTION_CPP=1/) {
+                                               $list_uses_cpp = 1;
+                                               last;
+                                       }
+                               }
+                               close(OPTS);
+                       }
+                       foreach my $listfile (glob("debfiles/patches/00list*")) {
+                               my @patches;
+                               if (open(IN, '<', "$listfile")) {
+                                       while(<IN>) {
+                                               chomp;
+                                               next if (/^\#/); #ignore comments or CPP directive
+                                               s%//.*%% if $list_uses_cpp; # remove C++ style comments
+                                               if ($list_uses_cpp && m%/\*%) {
+                                                       # remove C style comments
+                                                       $_ .= <IN> while($_ !~ m%\*/%);
+                                                       s%/\*[^*]*\*/%%g;
+                                               }
+                                               next if (/^\s*$/); #ignore blank lines
+                                               push @patches, split(' ', $_);
+                                       }
+                                       close(IN);
+                               }
+
+                               # Check each patch.
+                               foreach my $patch_file (@patches) {
+                                       $patch_file .= ".dpatch" if -e "debfiles/patches/$patch_file.dpatch"
+                                               and not -e "debfiles/patches/$patch_file";
+                                       if (! -r "debfiles/patches/$patch_file") {
+                                               tag "dpatch-index-references-non-existent-patch", $patch_file;
+                                               next;
+                                       }
+                                       if (open(PATCH_FILE, '<', "debfiles/patches/$patch_file")) {
+                                               my $has_comment = 0;
+                                               while (<PATCH_FILE>) {
+                                                       #stop if something looking like a patch starts:
+                                                       last if /^---/;
+                                                       #note comment if we find a proper one
+                                                       $has_comment = 1 if (/^\#+\s*DP:\s*(.*)$/ && $1 !~ /^no description\.?$/i)
+                                               }
+                                               close(PATCH_FILE);
+                                               unless ($has_comment) {
+                                                       tag "dpatch-missing-description", $patch_file;
+                                               }
+                                       }
+                                       check_patch($patch_file);
+                               }
+                       }
+               }
+       }
+
+       #----- quilt
+       if (Dep::implies($build_deps, Dep::parse("quilt")) or $quilt_format) {
+               $uses_patch_system++;
+               #check for a debian/patches file:
+               if (! -r "debfiles/patches/series") {
+                       tag "quilt-build-dep-but-no-series-file", $pkg unless $quilt_format;
+               } else {
+                       if (open(IN, '<', "debfiles/patches/series")) {
+                               my @patches;
+                               my @badopts;
+                               while(<IN>) {
+                                       chomp; s/^\s+//; s/\s+$//; # Strip leading/trailing spaces
+                                       s/(^|\s+)#.*$//; # Strip comment
+                                       next unless $_;
+                                       if (/^(\S+)\s+(\S.*)$/) {
+                                               $_ = $1;
+                                               if ($2 ne '-p1') {
+                                                       push @badopts, $_;
+                                               }
+                                       }
+                                       push @patches, $_;
+                               }
+                               close(IN);
+                               if (scalar(@badopts)) {
+                                       tag "quilt-patch-with-non-standard-options", @badopts;
+                               }
+
+                               # Check each patch.
+                               foreach my $patch_file (@patches) {
+                                       if (! -r "debfiles/patches/$patch_file") {
+                                               tag "quilt-series-references-non-existent-patch", $patch_file;
+                                               next;
+                                       }
+                                       check_patch($patch_file);
+                               }
+                       }
+               }
+       } else {
+               if (-r "debfiles/patches/series") {
+                       # 3.0 (quilt) sources don't need quilt as dpkg-source will do the work
+                       tag "quilt-series-but-no-build-dep" unless $quilt_format;
+               }
+       }
+
+
+       #----- general cruft checking:
+       if ($uses_patch_system) {
+               if ($uses_patch_system > 1) {
+                       tag "more-than-one-patch-system";
+               }
+
+               open(STAT, '<', "diffstat") or fail("cannot open diffstat file: $!");
+               while (<STAT>) {
+                       my ($file) = (m,^\s+(.*?)\s+\|,)
+                            or fail("syntax error in diffstat file: $_");
+
+                       if ($file !~ /^debian/) {
+                               tag "patch-system-but-direct-changes-in-diff", $file;
+                       }
+               }
+               close (STAT) or fail("error reading diffstat file: $!");
+       }
+}
+
+# Checks on patches common to all build systems
+sub check_patch($) {
+       my $patch_file = shift;
+       open(DIFFSTAT, "-|", "diffstat -p0 -l debfiles/patches/$patch_file")
+         or fail("can't fork diffstat");
+       while (<DIFFSTAT>) {
+               chomp;
+               if (m|^(\./)?debian/| or m|^(\./)?[^/]+/debian/|) {
+                       tag "patch-modifying-debian-files", $patch_file, $_;
+               }
+       }
+       close(DIFFSTAT) or fail("cannot close pipe to diffstat on $patch_file: $!");
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 8
+# End:
+# vim: syntax=perl sw=4 ts=4 noet shiftround
diff --git a/nokia-lintian/checks/patch-systems.desc b/nokia-lintian/checks/patch-systems.desc
new file mode 100644 (file)
index 0000000..25a9e80
--- /dev/null
@@ -0,0 +1,88 @@
+Check-Script: patch-systems
+Author: Marc Brockschmidt <he@debian.org>
+Abbrev: pat
+Type: source
+Unpack-Level: 1
+Info: This script checks for various possible problems when using patch systems
+Needs-Info: debfiles
+
+Tag: dpatch-build-dep-but-no-patch-list
+Type: warning
+Info: Using dpatch requires you to explicitly list all patches you want
+ to apply in debian/patches/00list. This package build-depends on dpatch,
+ but does not provide a patch list.
+ .
+ You should either remove the dpatch build dependency or add a patch
+ list.
+
+Tag: dpatch-index-references-non-existent-patch
+Type: error
+Info: In the 00list file listing all your dpatches, you referenced a file
+ that does not exist. This will lead to a fatal error when calling dpatch.
+
+Tag: dpatch-missing-description
+Type: warning
+Info: dpatch files should carry a description of the function of the included
+ patch. Description lines start with "## DP:".
+
+Tag: quilt-build-dep-but-no-series-file
+Type: warning
+Info: Using quilt requires you to explicitly list all patches you want
+ to apply in debian/patches/series. This package build-depends on quilt,
+ but does not provide a patch list.
+ .
+ You should either remove the quilt build dependency or add a series
+ file.
+
+Tag: quilt-series-but-no-build-dep
+Type: warning
+Info: The package contains a debian/patches/series file usually used by
+ quilt to apply patches at build time, but quilt is not listed in the
+ build dependencies.
+ .
+ You should either remove the series file if it's effectively not useful
+ or add quilt to the build-dependencies if quilt is used during the build
+ process.
+ .
+ If you don't need quilt during build but only during maintenance work,
+ then you can override this warning.
+
+Tag: quilt-patch-with-non-standard-options
+Type: warning
+Info: The quilt series file contains non-standard options to apply some of
+ the listed patches. Quilt uses '-p1' by default if nothing is specified
+ after the name of the patch and the current series file specify something
+ else for some of the patches listed.
+ .
+ For compatibility with the source "3.0 (quilt)" source package format,
+ you should avoid using any option at all and make sure that your patches
+ apply with "-p1". This can be done by refreshing all patches like this:
+ quilt pop -a; while quilt push; do quilt refresh -pab; done
+
+Tag: quilt-series-references-non-existent-patch
+Type: error
+Info: In the series file listing all your quilt patches, you referenced a
+ file that does not exist. This will lead to a fatal error when calling quilt.
+
+Tag: patch-modifying-debian-files
+Type: error
+Info: A patch stored in debian/patches/ should never modify files
+ in the debian directory (even when it's only creating new files) because
+ the debian directory is always directly provided by the Debian packaging.
+ And you shouldn't have to modify what you choose to provide in the first
+ place.
+ .
+ If the patch provides a new file (say a manual page), place that file
+ in the upstream directory hierarchy as if it was ready to be submitted.
+
+Tag: patch-system-but-direct-changes-in-diff
+Type: warning
+Info: The package uses a patch-system, but the Debian diff.gz contains changes
+ made on files without being separated out in a patch.
+
+Tag: more-than-one-patch-system
+Type: warning
+Info: The build-dependencies list more than one patch system and it's
+ unlikely that you need both at the same time.
+ .
+ Currently lintian knows only dpatch and quilt.
diff --git a/nokia-lintian/checks/po-debconf b/nokia-lintian/checks/po-debconf
new file mode 100644 (file)
index 0000000..fd97f61
--- /dev/null
@@ -0,0 +1,168 @@
+# po-debconf -- lintian check script -*- perl -*-
+
+# Copyright (C) 2002-2004 by Denis Barbier <barbier@linuxfr.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::po_debconf;
+use strict;
+use Tags;
+use Util;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+# First, check wether this package seems to use debconf but not po-debconf.
+# Read the templates file and look at the template names it provides, since
+# some shared templates aren't translated.
+opendir(DEB, 'debfiles')
+       or fail("Can't open debfiles directory.");
+my $has_template = my $has_depends = my $has_config = 0;
+my @lang_templates;
+for my $file (readdir(DEB)) {
+       next if -d "debfiles/$file";
+       if ($file =~ m/^(.+\.)?templates(\..+)?$/) {
+               if ($file =~ m/templates\.\w\w(_\w\w)?$/) {
+                       push (@lang_templates, $file);
+               } else {
+                       open(PO, '<', "debfiles/$file")
+                               or fail("Can't open debfiles/$file file.");
+                       while (<PO>) {
+                               tag "translated-default-field", "$file: $."
+                                       if (m/^_Default(Choice)?: [^\[]*$/);
+                               if (/^Template: (\S+)/i) {
+                                       my $template = $1;
+                                       next if $template =~ m,^shared/packages-(wordlist|ispell)$,;
+                                       next if $template =~ m,/languages$,;
+                                       $has_template = 1;
+                               }
+                       }
+                       close PO;
+               }
+       }
+}
+closedir(DEB);
+
+#TODO: check whether all templates are named in TEMPLATES.pot
+if ( $has_template ) {
+    if ( ! -d "debfiles/po" ) {
+       tag "not-using-po-debconf", "";
+       return 0;
+    }
+} else {
+    return 0;
+}
+
+# If we got here, we're using po-debconf, so there shouldn't be any stray
+# language templates left over from debconf-mergetemplate.
+for (@lang_templates) {
+    tag "stray-translated-debconf-templates", $_ unless /templates\.in$/;
+}
+
+# yada builds its template and po/POTFILES.in dynamically at build time, so
+# excuse yada from some of these checks (including the out of date templates
+# check).
+my $missing_files = 0;
+my $yada = 0;
+if (open (RULES, '<', 'debfiles/rules')) {
+    local $_;
+    while (<RULES>) {
+       if (m%^\t\s*(?:perl debian/)?yada\s%) {
+           $yada = 1;
+           $missing_files = 1;
+       }
+    }
+}
+
+if (!$yada && -f "debfiles/po/POTFILES.in") {
+       open(POTFILES, '<', "debfiles/po/POTFILES.in")
+               or fail("Can't open debfiles/po/POTFILES.in.");
+       while (<POTFILES>) {
+               chomp;
+               s/.*\]\s*//;
+               #  Cannot check files which are not under debian/
+               next if m,^\.\./, or $_ eq '';
+               unless (-f "debfiles/$_") {
+                       tag "missing-file-from-potfiles-in", "$_";
+                       $missing_files = 1;
+               } 
+       }
+       close(POTFILES);
+} elsif (!$yada) {
+       tag "missing-potfiles-in", "";
+       $missing_files = 1;
+}
+if (! -f "debfiles/po/templates.pot") {
+       tag "missing-templates-pot", "";
+       $missing_files = 1;
+}
+
+if (-x "/usr/bin/msgcmp" && -x "/usr/share/intltool-debian/intltool-update" ) {
+       if ($missing_files == 0) {
+               $ENV{"INTLTOOL_EXTRACT"} ||= "/usr/share/intltool-debian/intltool-extract";
+               system_env("cd debfiles/po && /usr/share/intltool-debian/intltool-update --gettext-package=test --pot");
+               system_env("/usr/bin/msgcmp --use-untranslated debfiles/po/test.pot debfiles/po/templates.pot >/dev/null 2>&1"
+                           . "&& /usr/bin/msgcmp --use-untranslated debfiles/po/templates.pot debfiles/po/test.pot >/dev/null 2>&1") == 0
+                       or tag "newer-debconf-templates";
+       }
+} else {
+       fail("either msgcmp or intltool-update not found");
+}
+
+if (! -x "/usr/bin/msgfmt" ) {
+       fail("msgfmt not found");
+}
+opendir(DEBIAN, 'debfiles/po')
+        or fail("Can't open debfiles/po directory.");
+while (defined(my $file=readdir(DEBIAN))) {
+        next unless $file =~ m/\.po$/;
+        tag "misnamed-po-file", "debian/po/$file"
+                unless ($file =~ /^[a-z]{2,3}(_[A-Z]{2})?\.po$/);
+        local ($/) = "\n\n";
+        $_ = '';
+        open(PO, '<', "debfiles/po/$file")
+                or fail("Can't open debfiles/po/$file file.");
+        while (<PO>) {
+                last if m/^msgstr/m;
+        }
+        close(PO);
+       unless ($_) {
+               tag "invalid-po-file", "debian/po/$file";
+               next;
+       }
+        s/"\n"//g;
+        my $charset = '';
+        if (m/charset=(.*?)\\n/) {
+                $charset = ($1 eq 'CHARSET' ? '' : $1);
+        }
+        tag "unknown-encoding-in-po-file", "debian/po/$file"
+                unless length($charset);
+       system_env("msgfmt -o /dev/null debfiles/po/$file 2>/dev/null") == 0
+               or tag "invalid-po-file", "debian/po/$file";
+}
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 8
+# End:
+# vim: syntax=perl
diff --git a/nokia-lintian/checks/po-debconf.desc b/nokia-lintian/checks/po-debconf.desc
new file mode 100644 (file)
index 0000000..bd14598
--- /dev/null
@@ -0,0 +1,91 @@
+Check-Script: po-debconf
+Author: Denis Barbier <barbier@linuxfr.org>
+Abbrev: pd
+Type: source
+Unpack-Level: 2
+Info: This looks for common mistakes in packages using po-debconf.
+Needs-Info: debfiles
+
+Tag: not-using-po-debconf
+Type: error
+Info: This package seems to be using debconf templates, but it does not
+ use po-debconf to make translations possible (<tt>debian/po</tt> doesn't
+ exist).  Debian Policy requires that all packages using debconf use a
+ gettext-based translation system.  If this package uses one other than
+ po-debconf, please report this as a lintian bug along with how to detect
+ that system.
+Ref: 3.9.1
+
+Tag: stray-translated-debconf-templates
+Type: warning
+Info: This package contains a file named *templates.XX or
+ *templates.XX_XX.  This was the naming convention for the translated
+ templates merged using debconf-mergetemplate.  Since the package is using
+ po-debconf, these files should be replaced by language-specific files in
+ the <tt>debian/po</tt> directory and should no longer be needed.
+
+Tag: missing-potfiles-in
+Type: warning
+Info: The required file <tt>POTFILES.in</tt> is missing from
+ <tt>debian/po</tt>.
+Ref: po-debconf(7)
+
+Tag: missing-file-from-potfiles-in
+Type: warning
+Info: A file listed in <tt>debian/po/POTFILES.in</tt> could not be found
+ in the source package.
+Ref: po-debconf(7)
+
+Tag: missing-templates-pot
+Type: warning
+Info: The required file <tt>templates.pot</tt> is missing from
+ <tt>debian/po</tt>.
+Ref: po-debconf(7)
+
+Tag: unknown-encoding-in-po-file
+Type: warning
+Info: Encoding must be declared in PO files. Otherwise, charset
+ conversions cannot be performed.
+
+Tag: invalid-po-file
+Type: warning
+Info: Errors were found in the listed PO file that will cause its content
+ to be discarded. Run <tt>msgfmt</tt> on the file to see the error
+ messages.
+
+Tag: misnamed-po-file
+Type: warning
+Info: The name of this PO file doesn't appear to be a valid language
+ code.  Any files in <tt>debian/po</tt> ending in <tt>.po</tt> will be
+ processed as translations by po2debconf for the language code equal to
+ the file name without the trailing <tt>.po</tt>.  If the file name does
+ not correct reflect the language of the translation, the translation will
+ not be accessible to users of that language.
+ .
+ If this file isn't actually a PO file, rename it to something that
+ doesn't end in <tt>.po</tt> or move it to another directory so that
+ translation merging programs will not be confused.
+
+Tag: newer-debconf-templates
+Type: warning
+Info: debconf-updatepo has not been run since the last change to your
+ debconf templates.
+ .
+ You should run debconf-updatepo whenever debconf templates files are
+ changed so that translators can be warned that their files are
+ outdated.
+ .
+ This can be ensured by running debconf-updatepo in the 'clean' target
+ of <tt>debian/rules</tt>. PO files will then always be up-to-date when
+ building the source package.
+
+Tag: translated-default-field
+Type: warning
+Info: You should not mark as translatable "Default:" or "DefaultChoice:"
+ fields, unless explicitly needed (e.g. default country, default language,
+ etc.).  If this Default field really should be translated, you should
+ explain translators how they should translate it by using brackets.  For
+ example:
+ .
+   _Default: English[ Default language name, but not translated]
+Ref: po-debconf(7)
diff --git a/nokia-lintian/checks/rules b/nokia-lintian/checks/rules
new file mode 100644 (file)
index 0000000..300d0b9
--- /dev/null
@@ -0,0 +1,192 @@
+# rules -- lintian check script -*- perl -*-
+
+# Copyright (C) 2006 Russ Allbery <rra@debian.org>
+# Copyright (C) 2005 René van Bevern <rvb@pro-linux.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+package Lintian::rules;
+use strict;
+use Tags;
+use Util;
+use Dep;
+
+# The following targets are required per Policy.
+my %required = map { $_ => 1 }
+    qw(build binary binary-arch binary-indep clean);
+
+# Rules about required debhelper command ordering.  Each command is put into a
+# class and the tag is issued if they're called in the wrong order for the
+# classes.  Unknown commands won't trigger this flag.
+my %debhelper_order =
+    (dh_makeshlibs => 1,
+     dh_shlibdeps  => 2,
+     dh_installdeb => 2,
+     dh_gencontrol => 2,
+     dh_builddeb   => 3);
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+# Policy could be read as allowing debian/rules to be a symlink to some other
+# file, and in a native Debian package it could be a symlink to a file that we
+# didn't unpack.  Warn if it's a symlink (dpkg-source does as well) and skip
+# all the tests if we then can't read it.
+if (-l "debfiles/rules") {
+    tag "debian-rules-is-symlink", "";
+    return 0 unless -f "debfiles/rules";
+}
+
+#get architecture field:
+unless (-d "fields") {
+    fail("directory in lintian laboratory for $type package $pkg missing: fields");
+}
+
+my $architecture = "";
+if(open (IN, '<', "fields/architecture")) {
+    chomp($architecture = <IN>)
+}
+close(IN);
+
+#get build-depends:
+my $build_deps = "";
+if (open(IN, '<', "fields/build-depends")) {
+    local $/ = undef;
+    chomp($build_deps .= <IN>);
+    close(IN);
+}
+if (open(IN, '<', "fields/build-depends-indep")) {
+    local $/ = undef;
+    chomp($build_deps .= <IN>);
+    close(IN);
+}
+$build_deps = Dep::parse($build_deps);
+
+
+open(RULES, '<', 'debfiles/rules') or fail("Failed opening rules: $!");
+
+# Check for required #!/usr/bin/make -f opening line.  Allow -r or -e; a
+# strict reading of Policy doesn't allow either, but they seem harmless.
+my $start = <RULES>;
+tag "debian-rules-not-a-makefile", ""
+    unless $start =~ m%^\#!\s*/usr/bin/make\s+-[re]?f[re]?\s*$%;
+
+# Scan debian/rules.  We would really like to let make do this for us, but
+# unfortunately there doesn't seem to be a way to get make to syntax-check and
+# analyze a makefile without running at least $(shell) commands.
+#
+# We skip some of the rule analysis if debian/rules includes any other files,
+# since to chase all includes we'd have to have all of its build dependencies
+# installed.
+my $includes = 0;
+my %seen;
+local $_;
+my @current_targets;
+my %rules_per_target;
+my $debhelper_group;
+while (<RULES>) {
+    next if /^\s*\#/;
+    $includes = 1 if /^ *[s-]?include\s+/;
+
+    # Check for DH_COMPAT settings outside of any rule, which are now
+    # deprecated.  It's a bit easier structurally to do this here than in
+    # debhelper.
+    if (/^\s*(export\s+)?DH_COMPAT\s*:?=/ && keys(%seen) == 0) {
+        tag "debian-rules-sets-DH_COMPAT", "line $.";
+    }
+
+    # Check for problems that can occur anywhere in debian/rules.
+    if (/\$[\(\{]PWD[\)\}]/) {
+        tag "debian-rules-uses-pwd", "line $.";
+    }
+    if (/^\t\s*-(?:\$[\(\{]MAKE[\}\)]|make)\s.*(?:dist)?clean/ ||
+       /^\t\s*(?:\$[\(\{]MAKE[\}\)]|make)\s(?:.*\s)?-\w*i.*(?:dist)?clean/) {
+        tag "debian-rules-ignores-make-clean-error", "line $.";
+    }
+    if (/$[\(\{]DEB_BUILD_OPTS[\)\}]/) {
+        tag "debian-rules-uses-DEB_BUILD_OPTS", "line $.";
+    }
+
+    # Listing a rule as a dependency of .PHONY is sufficient to make it
+    # present for the purposes of GNU make and therefore the Policy
+    # requirement.
+    if (/^(?:[^:]+\s)?\.PHONY(?:\s[^:]+)?:(.+)/) {
+        my @targets = split (' ', $1);
+        for (@targets) {
+            $seen{$_}++ if $required{$_};
+        }
+    }
+
+    if (/^([^\s:][^:]*):/) {
+       @current_targets = split (' ', $1);
+       for (@current_targets) {
+            if (m/%/) {
+                my $pattern = quotemeta $_;
+                $pattern =~ s/\\%/.*/g;
+                for my $target (keys %required) {
+                    $seen{$target}++ if $target =~ m/$pattern/;
+                }
+            } else {
+                $seen{$_}++ if $required{$_};
+            }
+       }
+        $debhelper_group = 0;
+    } else {
+       # If we have non-empty, non-comment lines, store them for all current
+       # targets and check whether debhelper programs are called in a
+       # reasonable order.
+       if (m/^\s+[^\#]/) {
+           foreach my $target (@current_targets) {
+               $rules_per_target{$target} ||= [];
+               push @{$rules_per_target{$target}}, $_;
+           }
+            if (m/^\s+(dh_\S+)\b/ and $debhelper_order{$1}) {
+                my $command = $1;
+                my $group = $debhelper_order{$command};
+                if ($group < $debhelper_group) {
+                    tag "debian-rules-calls-debhelper-in-odd-order",
+                        $command, "(line $.)";
+                } else {
+                    $debhelper_group = $group;
+                }
+            }
+       }
+    }
+}
+close RULES;
+
+unless ($includes) {
+    # Make sure all the required rules were seen.
+    for my $target (sort keys %required) {
+       tag "debian-rules-missing-required-target", $target
+           unless $seen{$target};
+    }
+
+    #check if we should have seen some dh_ calls:
+    if (Dep::implies($build_deps, Dep::parse("debhelper"))) {
+        #.desktop files usually imply dh_desktop:
+       if (scalar @{[glob("debfiles/*.desktop")]} &&
+           ! grep { /^\s*dh_desktop/ } map { @$_ } values %rules_per_target) {
+           tag "desktop-file-but-no-dh_desktop-call";
+       }
+    }
+}
+
+# Make sure we have no content for binary-arch if we are arch-indep:
+if ($architecture eq "all" && scalar @{$rules_per_target{'binary-arch'} || []}) {
+    tag "binary-arch-rules-but-pkg-is-arch-indep";
+}
+}
+1;
+
+# vim: syntax=perl ts=8 sw=4
diff --git a/nokia-lintian/checks/rules.desc b/nokia-lintian/checks/rules.desc
new file mode 100644 (file)
index 0000000..f2fd28d
--- /dev/null
@@ -0,0 +1,100 @@
+Check-Script: rules
+Author: Russ Allbery <rra@debian.org>
+Type: source
+Unpack-Level: 1
+Needs-Info: debfiles
+Info: Check targets and actions in debian/rules.
+Abbrev: rul
+
+Tag: debian-rules-is-symlink
+Type: warning
+Info: The file <tt>debian/rules</tt> is a symlink instead of a regular
+ file. This is unnecessary and makes package checking and manipulation
+ more difficult. If the rules file should be available in the source
+ package under multiple names, make <tt>debian/rules</tt> the real
+ file and the other names symlinks to it.
+ .
+ This problem may have prevented lintian from performing other checks,
+ leading to undetected changelog errors.
+
+Tag: debian-rules-not-a-makefile
+Type: error
+Ref: policy 4.9
+Info: The <tt>debian/rules</tt> file for this package does not appear to
+ be a makefile or does not start with the required line.
+ <tt>debian/rules</tt> must be a valid makefile and must have
+ "<tt>#!/usr/bin/make -f</tt>" as its first line.
+
+Tag: debian-rules-missing-required-target
+Type: error
+Ref: policy 4.9
+Info: The <tt>debian/rules</tt> file for this package does not provide one
+ of the required targets.  All of build, binary, binary-arch,
+ binary-indep, and clean must be provided, even if they don't do anything
+ for this package.
+
+Tag: debian-rules-uses-pwd
+Type: warning
+Info: The <tt>debian/rules</tt> file for this package appears to use the
+ variable $(PWD) to refer to the current directory.  This variable is not
+ set by GNU make and therefore will have whatever value it has in the
+ environment, which may not be the actual current directory.  Some ways of
+ building Debian packages (such as through sudo) will clear the PWD
+ environment variable.
+ .
+ Instead of $(PWD), use $(CURDIR), which is set by GNU make, ignores the
+ environment, and is guaranteed to always be set.
+
+Tag: debian-rules-ignores-make-clean-error
+Type: warning
+Info: A rule in the <tt>debian/rules</tt> file for this package calls the
+ package's clean or distclean target with a line like:
+ .
+  -$(MAKE) distclean
+ or
+  $(MAKE) -i distclean
+ .
+ The leading "-" or the option -i tells make to ignore all errors.
+ Normally this is done for packages using Autoconf since Makefile may not
+ exist.  However, this line ignores all other error messages, not just
+ the missing Makefile error.  It's better to use:
+ .
+  [ ! -f Makefile ] || $(MAKE) distclean
+ .
+ so that other error messages from the clean or distclean rule will still
+ be caught (or just remove the "-" if the package uses a static makefile).
+
+Tag: debian-rules-uses-DEB_BUILD_OPTS
+Type: warning
+Info: The standard environment variable for build options is
+ DEB_BUILD_OPTIONS.  Usually, referring to DEB_BUILD_OPTS is a mistake and
+ DEB_BUILD_OPTIONS was intended instead.
+
+Tag: debian-rules-sets-DH_COMPAT
+Type: warning
+Ref: debhelper(7)
+Info: As of debhelper version 4, the DH_COMPAT environment variable is
+ only to be used for temporarily overriding <tt>debian/compat</tt>.  Any
+ line in <tt>debian/rules</tt> that sets it globally should be deleted and
+ a separate <tt>debian/compat</tt> file created if needed.
+
+Tag: binary-arch-rules-but-pkg-is-arch-indep
+Type: warning
+Info: It looks like you try to run code in the binary-arch target of 
+ <tt>debian/rules</tt>, even though your package is architecture-
+ independent.
+
+Tag: desktop-file-but-no-dh_desktop-call
+Type: warning
+Info: It looks like your package includes a .desktop file and you use
+ debhelper to build it, but you don't call dh_desktop in your rules
+ file.
+
+Tag: debian-rules-calls-debhelper-in-odd-order
+Type: warning
+Info: One of the targets in the <tt>debian/rules</tt> file for this
+ package calls debhelper programs in an odd order.  Normally,
+ dh_makeshlibs should be called before dh_shlibdeps or dh_installdeb,
+ dh_shlibdeps should be called before dh_gencontrol, and all should be
+ called before dh_builddeb.  Calling them in the wrong order may cause
+ incorrect or missing package files and metadata.
diff --git a/nokia-lintian/checks/scripts b/nokia-lintian/checks/scripts
new file mode 100644 (file)
index 0000000..946cdb2
--- /dev/null
@@ -0,0 +1,909 @@
+# scripts -- lintian check script -*- perl -*-
+#
+# This is probably the right file to add a check for the use of
+# set -e in bash and sh scripts.
+#
+# Copyright (C) 1998 Richard Braakman
+# Copyright (C) 2002 Josip Rodin
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::scripts;
+use strict;
+use Dep;
+use Tags;
+use Util;
+
+# This is a map of all known interpreters.  The key is the interpreter name
+# (the binary invoked on the #! line).  The value is an anonymous array of one
+# or two elements.  The first, mandatory argument is the path on a Debian
+# system where that interpreter would be installed.  The second, optional
+# argument is the dependency that provides that interpreter.  If the second
+# argument isn't given, the package name is assumed to be the same as the
+# interpreter name.  (Saves some typing.)
+#
+# Some interpreters list empty dependencies (as opposed to undefined ones).
+# Those interpreters should not have any dependency for one reason or another
+# (usually because they're essential packages or aren't used in a normal way).
+#
+# Do not list versioned patterns here (such as pythonX.Y, rubyX.Y, etc.).  For
+# those, see %versioned_interpreters below.
+our %interpreters =
+    (ash           => [ '/bin' ],
+     awk           => [ '/usr/bin', '' ],
+     bash          => [ '/bin', '' ],
+     bltwish       => [ '/usr/bin', 'blt' ],
+     clisp         => [ '/usr/bin' ],
+     csh           => [ '/bin', 'tcsh | csh | c-shell' ],
+     dash          => [ '/bin' ],
+     expect        => [ '/usr/bin' ],
+     expectk       => [ '/usr/bin' ],
+     fish          => [ '/usr/bin' ],
+     gawk          => [ '/usr/bin' ],
+     gbr2          => [ '/usr/bin', 'gambas2-runtime' ],
+     gbx           => [ '/usr/bin', 'gambas-runtime' ],
+     gbx2          => [ '/usr/bin', 'gambas2-runtime' ],
+     gforth        => [ '/usr/bin' ],
+     gnuplot       => [ '/usr/bin' ],
+     gosh          => [ '/usr/bin', 'gauche' ],
+     'install-menu' => [ '/usr/bin', '' ],
+     jed           => [ '/usr/bin' ],
+     'jed-script'   => [ '/usr/bin', 'jed | xjed' ],
+     kaptain        => [ '/usr/bin' ],
+     ksh           => [ '/bin', 'mksh | pdksh' ],
+     lefty         => [ '/usr/bin', 'graphviz' ],
+     magicfilter    => [ '/usr/sbin' ],
+     make          => [ '/usr/bin', 'make | build-essential' ],
+     mawk          => [ '/usr/bin' ],
+     ocamlrun      => [ '/usr/bin',
+                        'ocaml-base-nox | ocaml-base | ocaml-nox | ocaml' ],
+     pagsh         => [ '/usr/bin', 'openafs-client | heimdal-clients' ],
+     parrot        => [ '/usr/bin' ],
+     perl          => [ '/usr/bin', '' ],
+     procmail      => [ '/usr/bin' ],
+     python        => [ '/usr/bin', 'python | python-minimal' ],
+     pforth        => [ '/usr/bin' ],
+     rc                    => [ '/usr/bin' ],
+     regina        => [ '/usr/bin', 'regina-rexx' ],
+     rexx          => [ '/usr/bin', 'regina-rexx' ],
+     rrdcgi        => [ '/usr/bin', 'rrdtool' ],
+     ruby          => [ '/usr/bin' ],
+     runhugs       => [ '/usr/bin', 'hugs | hugs98' ],
+     sed           => [ '/bin', '' ],
+     sh                    => [ '/bin', '' ],
+     slsh          => [ '/usr/bin' ],
+     speedy        => [ '/usr/bin', 'speedy-cgi-perl' ],
+     tcsh          => [ '/usr/bin' ],
+     tixwish       => [ '/usr/bin', 'tix' ],
+     trs           => [ '/usr/bin', 'konwert' ],
+     xjed          => [ '/usr/bin', 'xjed' ],
+     yforth        => [ '/usr/bin', 'yforth' ],
+     yorick        => [ '/usr/bin' ],
+     zsh           => [ '/bin', 'zsh | zsh-beta' ],
+    );
+
+# The more complex case of interpreters that may have a version number.
+#
+# This is a hash from the base interpreter name to a list.  The base
+# interpreter name may appear by itself or followed by some combination of
+# dashes, digits, and periods.  The values are the directory in which the
+# interpreter is found, the dependency to add for a version-less interpreter,
+# a regular expression to match versioned interpreters and extract the version
+# number, the package dependency for a versioned interpreter, and the list of
+# known versions.
+#
+# An interpreter with a version must have a dependency on the specific package
+# formed by taking the fourth element of the list and replacing $1 with the
+# version number.  An interpreter without a version is rejected if the second
+# element is undef; otherwise, the package must depend on the disjunction of
+# the second argument (if non-empty) and all the packages formed by taking the
+# list of known versions (the fifth element and on) and replacing $1 in the
+# fourth argument with them.
+#
+# For example:
+#
+#    lua => [ '/usr/bin', 'lua', qr/^lua([\d.]+)$/, 'lua$1', qw(40 50 5.1) ]
+#
+# says that any lua interpreter must be in /usr/bin, a package using
+# /usr/bin/lua50 must depend on lua50, and a package using just /usr/bin/lua
+# must satisfy lua | lua40 | lusa50 | lua5.1.
+#
+# The list of known versions is the largest maintenance headache here, but
+# it's only used for the unversioned dependency handling, and then only when
+# someone uses the unversioned script but depends on a specific version for
+# some reason.  So it's not a huge problem if it's a little out of date.
+our %versioned_interpreters =
+    (guile   => [ '/usr/bin', 'guile',
+                 qr/^guile-([\d.]+)$/, 'guile-$1', qw(1.6 1.8)
+               ],
+     jruby   => [ '/usr/bin', undef,
+                 qr/^jruby([\d.]+)$/, 'jruby$1', qw(0.9 1.0)
+               ],
+     lua     => [ '/usr/bin', 'lua',
+                 qr/^lua([\d.]+)$/, 'lua$1', qw(40 50 5.1)
+               ],
+     octave  => [ '/usr/bin', 'octave',
+                 qr/^octave([\d.]+)$/, 'octave$1', qw(2.1 2.9 3.0)
+               ],
+     php     => [ '/usr/bin', '',
+                 qr/^php(\d+)$/, 'php$1-cli', qw(4 5)
+               ],
+     pike    => [ '/usr/bin', '',
+                 qr/^pike([\d.]+)$/, 'pike$1 | pike$1-core', qw(7.6 7.7)
+               ],
+     python  => [ '/usr/bin', undef,
+                 qr/^python([\d.]+)$/, 'python$1 | python$1-minimal',
+                 qw(2.4 2.5)
+               ],
+     ruby    => [ '/usr/bin', undef,
+                 qr/^ruby([\d.]+)$/, 'ruby$1', qw(1.8 1.9)
+               ],
+     scsh    => [ '/usr/bin', 'scsh',
+                 qr/^scsh-([\d.]+)$/, 'scsh-$1', qw(0.6)
+               ],
+     tclsh   => [ '/usr/bin', 'tclsh | tcl',
+                 qr/^tclsh([\d.]+)$/, 'tcl$1', qw(8.3 8.4 8.5)
+               ],
+     wish    => [ '/usr/bin', 'wish | tk',
+                 qr/^wish([\d.]+)$/, 'tk$1', qw(8.3 8.4 8.5)
+               ],
+    );
+
+# Any of the following packages can satisfy an update-inetd dependency.
+our $update_inetd
+    = join (' | ', qw(update-inetd inet-superserver openbsd-inetd
+                      inetutils-inetd rlinetd xinetd));
+
+# Appearance of one of these regexes in a maintainer script means that there
+# must be a dependency (or pre-dependency) on the given package.  The tag
+# reported is maintainer-script-needs-depends-on-%s, so be sure to update
+# scripts.desc when adding a new rule.
+our @depends_needed = (
+       [ adduser       => '\badduser\b'           ],
+       [ gconf2        => '\bgconf-schemas\b'     ],
+       [ $update_inetd => '\bupdate-inetd\b'      ],
+       [ ucf           => '\bucf\s'               ],
+       [ 'xml-core'    => '\bupdate-xmlcatalog\b' ],
+);
+
+sub run {
+
+my %executable = ();
+my %suid = ();
+my %ELF = ();
+my %scripts = ();
+my %deps = ();
+
+# no dependency for install-menu, because the menu package specifically
+# says not to depend on it.
+
+my $pkg = shift;
+my $type = shift;
+
+open(INDEX, '<', "index") or fail("cannot open lintian index file: $!");
+while (<INDEX>) {
+    next unless (m/^-[rw-]*[xs]/);
+    chop;
+    s/ link to .*//;
+    my $is_suid = m/^-[rw-]*s/;
+    $executable{(split(' ', $_, 6))[5]} = 1;
+    $suid{(split(' ', $_, 6))[5]} = $is_suid;
+}
+close(INDEX);
+
+# Urgle... this is ambiguous, since the sequence ": " can occur in
+# the output of file and also in the filename.
+# Fortunately no filenames containing ": " currently occur in Debian packages.
+open(FILEINFO, '<', "file-info")
+    or fail("cannot open lintian file-info file: $!");
+while (<FILEINFO>) {
+    m/^(.*?): (.*)/ or fail("bad line in file-info: $_");
+    my $file = $1;
+    $ELF{$file} = 1 if $2 =~ /^[^,]*\bELF\b/o;
+}
+close(FILEINFO);
+
+my $all_deps = '';
+for my $field (qw/suggests recommends depends pre-depends provides/) {
+    $deps{$field} = '';
+    if (open(IN, '<', "fields/$field")) {
+       $_ = join('', <IN>);
+       close(IN);
+        chomp;
+        $deps{$field} = $_;
+        $all_deps .= ', ' if $all_deps;
+        $all_deps .= $_;
+    }
+    $deps{$field} = Dep::parse($deps{$field});
+}
+$all_deps .= ', ' if $all_deps;
+$all_deps .= $pkg;
+$deps{all} = Dep::parse($all_deps);
+
+open(SCRIPTS, '<', "scripts") or fail("cannot open lintian scripts file: $!");
+while (<SCRIPTS>) {
+    chop;
+
+    # This used to be split(' ', $_, 2), but that didn't handle empty
+    # interpreter lines correctly.
+    my ($calls_env, $interpreter, $filename) = m/^(env )?(\S*) (.*)$/ or
+        fail("bad line in scripts file: $_");
+
+    $scripts{$filename} = 1;
+
+    # no checks necessary at all for scripts in /usr/share/doc/
+    next if $filename =~ m,usr/share/doc/,;
+
+    my ($base) = $interpreter =~ m,([^/]*)$,;
+
+    # allow exception for .in files that have stuff like #!@PERL@
+    next if ($filename =~ m,\.in$, and $interpreter =~ m,^(\@|<\<)[A-Z_]+(\@|>\>)$,);
+
+    my $is_absolute = ($interpreter =~ m,^/, or defined $calls_env);
+
+    # Skip files that have the #! line, but are not executable and do not have
+    # an absolute path and are not in a bin/ directory (/usr/bin, /bin etc)
+    # They are probably not scripts after all.
+    next if ($filename !~ m,(bin/|etc/init.d/), and !$executable{$filename}
+             and !$is_absolute);
+
+    if ($interpreter eq "") {
+       tag("script-without-interpreter", $filename);
+       next;
+    }
+
+    # Either they use an absolute path or they use '/usr/bin/env interp'.
+    tag("interpreter-not-absolute", $filename, "#!$interpreter")
+       unless $is_absolute;
+    tag("script-not-executable", $filename)
+       unless ($executable{$filename}
+               or $filename =~ m,^\./usr/(lib|share)/.*\.pm,
+               or $filename =~ m,^\./usr/(lib|share)/.*\.py,
+               or $filename =~ m,^\./usr/(lib|share)/ruby/.*\.rb,
+               or $filename =~ m,\.in$,
+               or $filename =~ m,\.ex$,
+               or $filename eq './etc/init.d/skeleton'
+               or $filename =~ m,^\./etc/menu-methods,
+               or $filename =~ m,^\./etc/X11/Xsession.d,);
+
+    # Warn about csh scripts.
+    tag("csh-considered-harmful", $filename)
+        if (($base eq 'csh' or $base eq 'tcsh')
+           and $executable{$filename}
+           and $filename !~ m,^./etc/csh/login.d/,);
+
+    # Syntax-check most shell scripts, but don't syntax-check scripts that end
+    # in .dpatch.  bash -n doesn't stop checking at exit 0 and goes on to blow
+    # up on the patch itself.
+    # zsh -n is broken, see #485885
+    if ($base =~ /^(?:(?:b|d)?a|k)?sh$/) {
+       if (-x "$interpreter" && ! script_is_evil_and_wrong("unpacked/$filename")) {
+           if ($filename !~ m,\.dpatch$,) {
+               if (check_script_syntax($interpreter, "unpacked/$filename")) {
+                   tag("shell-script-fails-syntax-check", $filename);
+               }
+           }
+       }
+    }
+
+    # Try to find the expected path of the script to check.  First check
+    # %interpreters and %versioned_interpreters.  If not found there, see if
+    # it ends in a version number and the base is found in
+    # %versioned_interpreters.
+    my $data = $interpreters{$base};
+    my $versioned = 0;
+    if (not defined $data) {
+       $data = $versioned_interpreters{$base};
+       undef $data if ($data and not defined ($data->[1]));
+       if (not defined ($data) and $base =~ /^(.*[^\d.-])-?[\d.]+$/) {
+           $data = $versioned_interpreters{$1};
+           undef $data unless ($data and $base =~ /$data->[2]/);
+       }
+       $versioned = 1 if $data;
+    }
+    if ($data) {
+       my $expected = $data->[0] . '/' . $base;
+       unless ($interpreter eq $expected or defined $calls_env) {
+           tag("wrong-path-for-interpreter",
+               "#!$interpreter != $expected", "($filename)");
+       }
+    } elsif ($interpreter =~ m,/usr/local/,) {
+       tag("interpreter-in-usr-local", $filename, "#!$interpreter");
+    } elsif ($executable{'.' . $interpreter}) {
+       # Package installs the interpreter itself, so it's probably ok.  Don't
+       # emit any tag for this.
+    } elsif ($base eq 'suidperl') {
+       tag("calls-suidperl-directly", $filename);
+    } elsif ($interpreter eq '/bin/env') {
+       tag("script-uses-bin-env", $filename);
+    } else {
+       tag("unusual-interpreter", $filename, "#!$interpreter");
+    }
+
+    # If we found the interpreter and the script is executable, check
+    # dependencies.  This should be the last thing we do in the loop so that
+    # we can use next for an early exit and reduce the nesting.
+    next unless ($data && $executable{$filename});
+    if (!$versioned) {
+       my $depends = $data->[1];
+       if (not defined $depends) {
+           $depends = $base;
+       }
+       if ($depends && !Dep::implies($deps{all}, Dep::parse($depends))) {
+           if ($base =~ /^(python|ruby|(m|g)awk)$/) {
+               tag("$base-script-but-no-$base-dep", $filename);
+           } elsif ($base eq 'csh' && $filename =~ m,^\./etc/csh/login.d/,) {
+               # Initialization files for csh.
+           } elsif ($base eq 'fish' && $filename =~ m,^./etc/fish.d/,) {
+               # Initialization files for fish.
+           } else {
+               tag('missing-dep-for-interpreter', "$base => $depends",
+                   "($filename)");
+           }
+       }
+       if ($base eq 'perl' && $suid{$filename}) {
+           tag("suid-perl-script-but-no-perl-suid-dep", $filename)
+               unless Dep::implies($deps{all}, Dep::parse('perl-suid'));
+       }
+    } elsif ($versioned_interpreters{$base}) {
+       my @versions = @$data[4 .. @$data - 1];
+       my @depends = map {
+           my $d = $data->[3];
+           $d =~ s/\$1/$_/g;
+           $d;
+       } @versions;
+       my $depends = join (' | ', $data->[1], @depends);
+       unless (Dep::implies($deps{all}, Dep::parse($depends))) {
+           if ($base eq 'php') {
+               tag('php-script-but-no-phpX-cli-dep', $filename);
+           } elsif ($base =~ /^(wish|tclsh)/) {
+               tag("$1-script-but-no-$1-dep", $filename);
+           } else {
+               tag("missing-dep-for-interpreter", "$base => $depends",
+                   "($filename)");
+           }
+       }
+    } else {
+       my ($version) = ($base =~ /$data->[2]/);
+       my $depends = $data->[3];
+       $depends =~ s/\$1/$version/g;
+       unless (Dep::implies($deps{all}, Dep::parse($depends))) {
+           if ($base =~ /^php/) {
+               tag('php-script-but-no-phpX-cli-dep', $filename);
+           } elsif ($base =~ /^(python|ruby)/) {
+               tag("$1-script-but-no-$1-dep", $filename);
+           } else {
+               tag("missing-dep-for-interpreter", "$base => $depends",
+                   "($filename)");
+           }
+       }
+    }
+}
+close(SCRIPTS);
+
+foreach (keys %executable) {
+    tag("executable-not-elf-or-script", $_)
+       unless ( $ELF{$_}
+                or $scripts{$_}
+                or $_ =~ m,^usr(/X11R6)?/man/,
+                or $_ =~ m/\.exe$/ # mono convention
+                );
+}
+
+open(SCRIPTS, '<', "control-scripts")
+    or fail("cannot open lintian control-scripts file: $!");
+
+# Handle control scripts.  This is an edited version of the code for
+# normal scripts above, because there were just enough differences to
+# make a shared function awkward.
+
+while (<SCRIPTS>) {
+    chop;
+
+    m/^(\S*) (.*)$/ or fail("bad line in control-scripts file: $_");
+    my $interpreter = $1;
+    my $file = $2;
+    my $filename = "control/$file";
+
+    $interpreter =~ m|([^/]*)$|;
+    my $base = $1;
+
+    if ($interpreter eq "") {
+       tag("script-without-interpreter", $filename);
+       next;
+    }
+
+    tag("interpreter-not-absolute", $filename, "#!$interpreter")
+       unless ($interpreter =~ m|^/|);
+
+    if (exists $interpreters{$base}) {
+       my $data = $interpreters{$base};
+       my $expected = $data->[0] . '/' . $base;
+       tag("wrong-path-for-interpreter", "#!$interpreter != $expected",
+           "($filename)")
+           unless ($interpreter eq $expected);
+       unless ($base eq 'sh' or $base eq 'bash' or $base eq 'perl') {
+           my $tag;
+           if ($file eq 'config') {
+               $tag = 'forbidden-config-interpreter';
+           } else {
+               $tag = 'unusual-control-interpreter';
+           }
+           tag($tag, "#!$interpreter");
+       }
+       unless (defined ($data->[1]) and not $data->[1]) {
+           my $depends = $data->[1] || $base;
+           unless (Dep::implies($deps{'pre-depends'}, Dep::parse($depends))) {
+               tag("interpreter-without-predep", $filename, "#!$interpreter");
+           }
+       }
+    } elsif ($interpreter =~ m|/usr/local/|) {
+       tag("interpreter-in-usr-local", $filename, "#!$interpreter");
+    } else {
+       tag("unusual-interpreter", $filename, "#!$interpreter");
+       next; # no use doing further checks if it's not a known interpreter
+    }
+
+    # perhaps we should warn about *csh even if they're somehow screwed,
+    # but that's not really important...
+    tag("csh-considered-harmful", $filename)
+       if ($base eq 'csh' or $base eq 'tcsh');
+
+    my $shellscript = $base =~ /^((b|d)?a|t?c|(pd)?k)?sh$/ ? 1 : 0;
+
+    # Only syntax-check scripts we can check with bash.
+    my $checkbashisms;
+    if ($shellscript) {
+       $checkbashisms = $base eq "sh" ? 1 : 0;
+       if ($base eq 'sh' or $base eq 'bash') {
+           if (check_script_syntax("/bin/bash", $filename)) {
+               tag("maintainer-shell-script-fails-syntax-check", $file);
+           }
+       }
+    }
+
+    # now scan the file contents themselves
+    open (C, '<', "$filename")
+       or fail("cannot open maintainer script $filename for reading: $!");
+
+    my %warned;
+    my ($saw_init, $saw_invoke, $saw_debconf, $has_code);
+    my $cat_string = "";
+
+    while (<C>) {
+       next if m,^\s*$,;  # skip empty lines
+       next if m,^\s*\#,; # skip comment lines
+       s/\#.*$//;         # eat comments
+       chomp();
+
+       # Don't consider the standard dh-make boilerplate to be code.  This
+       # means ignoring the framework of a case statement, the labels, the
+       # echo complaining about unknown arguments, and an exit.
+       unless ($has_code
+               || m/^\s*set\s+-\w+\s*$/
+               || m/^\s*case\s+\"?\$1\"?\s+in\s*$/
+               || m/^\s*(?:[a-z|-]+|\*)\)\s*$/
+               || m/^\s*[:;]+\s*$/
+               || m/^\s*echo\s+\"[^\"]+\"(?:\s*>&2)?\s*$/
+               || m/^\s*esac\s*$/
+               || m/^\s*exit\s+\d+\s*$/) {
+           $has_code = 1;
+       }
+
+       if (m,[^\w=](/var)?/tmp\b, and not m/\bmktemp\b/ and not m/\btempfile\b/ and not m/\bmkdir\b/ and not m/\bmkstemp\b/) {
+           tag "possibly-insecure-handling-of-tmp-files-in-maintainer-script", "$file:$."
+               unless $warned{tmp};
+           $warned{tmp} = 1;
+       }
+       if (m/^\s*killall(?:\s|\z)/) {
+           tag "killall-is-dangerous", "$file:$." unless $warned{killall};
+           $warned{killall} = 1;
+       }
+       if (m/^\s*mknod(?:\s|\z)/ and not m/\sp\s/) {
+           tag "mknod-in-maintainer-script", "$file:$.";
+       }
+
+       # Collect information about init script invocations to catch running
+       # init scripts directory rather than through invoke-rc.d.  Since the
+       # script is allowed to run the init script directly if invoke-rc.d
+       # doesn't exist, only tag direct invocations where invoke-rc.d is
+       # never used in the same script.  Lots of false negatives, but
+       # hopefully not many false positives.
+       if (m%^\s*/etc/init.d/(\S+)\s+[\"\']?(\S+)[\"\']?%) {
+           $saw_init = $.;
+       }
+       if (m%^\s*invoke-rc.d\s+%) {
+           $saw_invoke = $.;
+       }
+
+       if ($shellscript) {
+           if ($cat_string ne "" and m/^\Q$cat_string\E$/) {
+               $cat_string = "";
+           }
+           my $within_another_shell = 0;
+           if (m,(^|\s+)((/usr)?/bin/)?((b|d)?a|k|z|t?c)sh\s+-c\s*.+,) {
+               $within_another_shell = 1;
+           }
+           # if cat_string is set, we are in a HERE document and need not
+           # check for things
+           if ($cat_string eq "" and $checkbashisms and !$within_another_shell) {
+               my $found = 0;
+               my $match = '';
+               my $LEADIN = qr'(?:(^|[`&;(|{])\s*|(if|then|do|while)\s+)';
+               my @bashism_single_quote_regexs = (
+                 $LEADIN . qr'echo\s+(?:-[^e\s]+\s+)?\'[^\']*(\\[\\abcEfnrtv0])+.*?[\']',
+                       # unsafe echo with backslashes
+               );
+               my @bashism_string_regexs = (
+                 qr'\$\[\w+\]',                 # arith not allowed
+                 qr'\$\{\w+\:\d+(?::\d+)?\}',   # ${foo:3[:1]}
+                 qr'\$\{\w+(/.+?){1,2}\}',      # ${parm/?/pat[/str]}
+                 qr'\$\{\#?\w+\[[0-9\*\@]+\]\}',# bash arrays, ${name[0|*|@]}
+                 qr'\$\{!\w+[\@*]\}',           # ${!prefix[*|@]}
+                 qr'\$\{!\w+\}',                # ${!name}
+                 qr'(\$\(|\`)\s*\<\s*\S+\s*(\)|\`)', # $(\< foo) should be $(cat foo)
+                 qr'\$\{?RANDOM\}?\b',          # $RANDOM
+                 qr'\$\{?(OS|MACH)TYPE\}?\b',   # $(OS|MACH)TYPE
+                 qr'\$\{?HOST(TYPE|NAME)\}?\b', # $HOST(TYPE|NAME)
+                 qr'\$\{?DIRSTACK\}?\b',        # $DIRSTACK
+                 qr'\$\{?EUID\}?\b',            # $EUID should be "id -u"
+                 qr'\$\{?UID\}?\b',             # $UID should be "id -ru"
+                 qr'\$\{?SECONDS\}?\b',         # $SECONDS
+                 qr'\$\{?BASH_[A-Z]+\}?\b',     # $BASH_SOMETHING
+                 qr'\$\{?SHELLOPTS\}?\b',       # $SHELLOPTS
+                 qr'\$\{?PIPESTATUS\}?\b',      # $PIPESTATUS
+                 qr'\$\{?SHLVL\}?\b',           # $SHLVL
+                 qr'<<<',                       # <<< here string
+                 $LEADIN . qr'echo\s+(?:-[^e\s]+\s+)?\"[^\"]*(\\[\\abcEfnrtv0])+.*?[\"]',
+                       # unsafe echo with backslashes
+               );
+               my @bashism_regexs = (
+                 qr'(?:^|\s+)function \w+(\s|\(|\Z)',  # function is useless
+                                                # should be '.', not 'source'
+                 $LEADIN . qr'source\s+(?:\.\/|\/|\$)[^\s]+',
+                 qr'(test|-o|-a)\s*[^\s]+\s+==\s', # should be 'b = a'
+                 qr'\[\s+[^\]]+\s+==\s',        # should be 'b = a'
+                 qr'\s(\|\&)',                  # pipelining is not POSIX
+                 qr'[^\\\$]\{(?:[^\s\\\}]+?,)+[^\\\}\s]+\}', # brace expansion
+                 qr'(?:^|\s+)\w+\[\d+\]=',      # bash arrays, H[0]
+                 $LEADIN . qr'(read\s*(-[^r]+)*(?:;|$))',
+                       # read without variable or with option other than -r
+                 $LEADIN . qr'kill\s+-[^sl]\w*',# kill -[0-9] or -[A-Z]
+                 $LEADIN . qr'trap\s+["\']?.*["\']?\s+.*[1-9]', # trap with signal numbers
+                 qr'\&>',                       # cshism
+                 qr'(<\&|>\&)\s*((-|\d+)[^\s;|)`&\\\\]|[^-\d\s]+)', # should be >word 2>&1
+                 qr'\[\[(?!:)',                 # alternative test command
+                 $LEADIN . qr'select\s+\w+',    # 'select' is not POSIX
+                 $LEADIN . qr'echo\s+(-n\s+)?-n?en?',  # echo -e
+                 $LEADIN . qr'exec\s+-[acl]',   # exec -c/-l/-a name
+                 qr'(?:^|\s+)let\s',            # let ...
+                 qr'(?<![\$\(])\(\(.*\)\)',     # '((' should be '$(('
+                 qr'\$\[[^][]+\]',              # '$[' should be '$(('
+                 qr'(\[|test)\s+-a',            # test with unary -a (should be -e)
+                 qr'/dev/(tcp|udp)',            # /dev/(tcp|udp)
+                 $LEADIN . qr'\w+\+=',          # should be "VAR="${VAR}foo"
+                 $LEADIN . qr'suspend\s',
+                 $LEADIN . qr'caller\s',
+                 $LEADIN . qr'complete\s',
+                 $LEADIN . qr'compgen\s',
+                 $LEADIN . qr'declare\s',
+                 $LEADIN . qr'typeset\s',
+                 $LEADIN . qr'disown\s',
+                 $LEADIN . qr'builtin\s',
+                 $LEADIN . qr'set\s+-[BHT]+',   # set -[BHT]
+                 $LEADIN . qr'alias\s+-p',      # alias -p
+                 $LEADIN . qr'unalias\s+-a',    # unalias -a
+                 $LEADIN . qr'local\s+-[a-zA-Z]+', # local -opt
+                 $LEADIN . qr'local\s+\w+=',    # local foo=bar
+                 qr'(?:^|\s+)\s*\(?\w*[^\(\w\s]+\S*?\s*\(\)\s*([\{|\(]|\Z)',
+                       # function names should only contain [a-z0-9_]
+                 $LEADIN . qr'(push|pop)d(\s|\Z)',   # (push|pod)d
+                 $LEADIN . qr'export\s+-[^p]',  # export only takes -p as an option
+                 $LEADIN . qr'ulimit(\s|\Z)',
+                 $LEADIN . qr'shopt(\s|\Z)',
+                 $LEADIN . qr'type\s',
+                 $LEADIN . qr'time\s',
+                 $LEADIN . qr'dirs(\s|\Z)',
+                 qr'(?:^|\s+)[<>]\(.*?\)',      # <() process substituion
+                 qr'(?:^|\s+)readonly\s+-[af]', # readonly -[af]
+                 $LEADIN . qr'(sh|\$\{?SHELL\}?) -[rD]', # sh -[rD]
+                 $LEADIN . qr'(sh|\$\{?SHELL\}?) --\w+', # sh --long-option
+                 $LEADIN . qr'(sh|\$\{?SHELL\}?) [-+]O', # sh [-+]O
+               );
+
+               # since this test is ugly, I have to do it by itself
+               # detect source (.) trying to pass args to the command it runs
+               # The first expression weeds out '. "foo bar"'
+               if (not $found and
+                   not m/^\s*\.\s+(\"[^\"]+\"|\'[^\']+\')\s*(\&|\||\d?>|<|;|\Z)/
+                   and m/^\s*(\.\s+[^\s;\`:]+\s+([^\s;]+))/) {
+
+                   my $extra;
+                   ($match, $extra) = ($1, $2);
+                   if ($extra =~ /^(\&|\||\d?>|<)/) {
+                       # everything is ok
+                       ;
+                   } else {
+                       $found = 1;
+                   }
+               }
+
+               my $line = $_;
+
+               unless ($found) {
+                   for my $re (@bashism_single_quote_regexs) {
+                       if ($line =~ m/($re)/) {
+                           $found = 1;
+                           ($match) = m/($re)/;
+                           last;
+                       }
+                   }
+               }
+               
+               # Ignore anything inside single quotes; it could be an
+               # argument to grep or the like.
+
+               # $cat_line contains the version of the line we'll check
+               # for heredoc delimiters later. Initially, remove any
+               # spaces between << and the delimiter to make the following
+               # updates to $cat_line easier.
+               my $cat_line = $line;
+               $cat_line =~ s/(<\<-?)\s+/$1/g;
+
+               # Remove single quoted strings, with the exception that we
+               # don't remove the string
+               # if the quote is immediately preceeded by a < or a -, so we
+               # can match "foo <<-?'xyz'" as a heredoc later
+               # The check is a little more greedy than we'd like, but the
+               # heredoc test itself will weed out any false positives
+               $cat_line =~ s/(^|[^<\\\"-](?:\\\\)*)\'(?:\\.|[^\\\'])+\'/$1''/g;
+
+               unless ($found) {
+                   # Remove "quoted quotes". They're likely to be inside
+                   # another pair of quotes; we're not interested in
+                   # them for their own sake and removing them makes finding
+                   # the limits of the outer pair far easier.
+                   $line =~ s/(^|[^\\\'\"])\"\'\"/$1/g;
+                   $line =~ s/(^|[^\\\'\"])\'\"\'/$1/g;
+
+                   $line =~ s/(^|[^\\\"](?:\\\\)*)\'(?:\\.|[^\\\'])+\'/$1''/g;
+                   for my $re (@bashism_string_regexs) {
+                       if ($line =~ m/($re)/) {
+                           $found = 1;
+                           ($match) = m/($re)/;
+                           last;
+                       }
+                   }
+               }
+
+               # We've checked for all the things we still want to notice in
+               # double-quoted strings, so now remove those strings as well.
+               $cat_line =~ s/(^|[^<\\\'-](?:\\\\)*)\"(?:\\.|[^\\\"])+\"/$1""/g;
+               unless ($found) {
+                   $line =~ s/(^|[^\\\'](?:\\\\)*)\"(?:\\.|[^\\\"])+\"/$1""/g;
+                   for my $re (@bashism_regexs) {
+                       if ($line =~ m/($re)/) {
+                           $found = 1;
+                           ($match) = m/($re)/;
+                           last;
+                       }
+                   }
+               }
+
+               if ($found) {
+                   tag "possible-bashism-in-maintainer-script", "$file:$. \'$match\'";
+               }
+
+               # Only look for the beginning of a heredoc here, after we've
+               # stripped out quoted material, to avoid false positives.
+               if ($cat_line =~ m/(?:^|[^<])\<\<\-?\s*(?:[\\]?(\w+)|[\'\"](.*?)[\'\"])/) {
+                   $cat_string = $1;
+                   $cat_string = $2 if not defined $cat_string;
+               }
+           }
+           if (!$cat_string) {
+               if (/^\s*start-stop-daemon\s+/ && !/\s--stop\b/) {
+                   tag 'start-stop-daemon-in-maintainer-script', "$file:$.";
+               }
+               # Don't use chown foo.bar
+               if (/(chown(\s+--?[A-Za-z-]+)*\s+[-_A-Za-z0-9]+\.[-_A-Za-z0-9]+)\s+/) {
+                   tag "deprecated-chown-usage", "$file:$. \'$1\'";
+               }
+               if (/invoke-rc.d.*\|\| exit 0/) {
+                   tag "maintainer-script-hides-init-failure", "$file:$.";
+               }
+               if (m,/usr/share/debconf/confmodule,) {
+                   $saw_debconf = 1;
+               }
+               if (m/^\s*read(?:\s|\z)/ && !$saw_debconf) {
+                   tag "read-in-maintainer-script", "$file:$.";
+               }
+               if (m,^\s*rm\s+([^>]*\s)?/dev/,) {
+                   tag "maintainer-script-removes-device-files", "$file:$.";
+               }
+               if (m,>\s*(/etc/(?:services|protocols|rpc))(\s|\Z),) {
+                   tag "maintainer-script-modifies-netbase-managed-file", "$file:$. $1";
+               }
+               if (m,^\s*(?:cp|mv)\s.*(/etc/(?:services|protocols|rpc))\s*$,) {
+                   tag "maintainer-script-modifies-netbase-managed-file", "$file:$. $1";
+               }
+               if (m,>\s*/etc/inetd\.conf(\s|\Z),) {
+                   tag "maintainer-script-modifies-inetd-conf", "$file:$."
+                       unless Dep::implies($deps{provides}, Dep::parse('inet-superserver'));
+               }
+               if (m,^\s*(?:cp|mv)\s+(?:.*\s)?/etc/inetd\.conf\s*$,) {
+                   tag "maintainer-script-modifies-inetd-conf", "$file:$."
+                       unless Dep::implies($deps{provides}, Dep::parse('inet-superserver'));
+               }
+
+               # Ancient dpkg feature tests.
+               if (m/^\s*dpkg\s+--assert-support-predepends\b/) {
+                   tag "ancient-dpkg-predepends-check", "$file:$.";
+               }
+               if (m/^\s*dpkg\s+--assert-working-epoch\b/) {
+                   tag "ancient-dpkg-epoch-check", "$file:$.";
+               }
+               if (m/^dpkg\s+--assert-long-filenames\b/) {
+                   tag "ancient-dpkg-long-filenames-check", "$file:$.";
+               }
+               if (m/^dpkg\s+--assert-multi-conrep\b/) {
+                   tag "ancient-dpkg-multi-conrep-check", "$file:$.";
+               }
+           }
+       }
+       if (m,\bsuidregister\b,) {
+           tag "suidregister-used-in-maintainer-script", "$file";
+       }
+       if ($file eq 'postrm') {
+           if (m,update\-alternatives \-\-remove,) {
+               tag "update-alternatives-remove-called-in-postrm", "";
+           }
+       } else {
+           for my $rule (@depends_needed) {
+               my ($package, $regex) = @$rule;
+               if ($pkg ne $package and /$regex/ and ! $warned{$package}) {
+                   if (m,-x\s+\S*$regex, or m,which\s+$regex, or m,command\s+.*?$regex,) {
+                       $warned{$package} = 1;
+                   } else {
+                       my $needed = Dep::parse($package);
+                       unless (Dep::implies($deps{depends}, $needed) || Dep::implies($deps{'pre-depends'}, $needed)) {
+                           my $shortpackage = $package;
+                           $shortpackage =~ s/[ \(].*//;
+                           tag "maintainer-script-needs-depends-on-$shortpackage", "$file";
+                           $warned{$package} = 1;
+                       }
+                   }
+               }
+           }
+       }
+       if (m,\bgconftool(-2)?(\s|\Z),) {
+           tag "gconftool-used-in-maintainer-script", "$file:$.";
+       }
+       if (m,\binstall-sgmlcatalog\b, && !(m,--remove, && ($file eq 'prerm' || $file eq 'postinst'))) {
+           tag "install-sgmlcatalog-deprecated", "$file:$.";
+       }
+        if (m,/var/lib/dpkg/status\b, && $pkg ne 'base-files' && $pkg ne 'dpkg') {
+            tag "maintainer-script-uses-dpkg-status-directly", "$file";
+        }
+    }
+
+    if ($saw_init && ! $saw_invoke) {
+       tag "maintainer-script-calls-init-script-directly", "$file:$saw_init";
+    }
+    unless ($has_code) {
+       tag "maintainer-script-empty", $file;
+    }
+
+    close C;
+
+}
+close(SCRIPTS);
+
+}
+
+# -----------------------------------
+
+# Returns non-zero if the given file is not actually a shell script,
+# just looks like one.
+sub script_is_evil_and_wrong {
+    my ($filename) = @_;
+    my $ret = 0;
+    open (IN, '<', $filename) or fail("cannot open $filename: $!");
+    my $i = 0;
+    my $var = "0";
+    my $backgrounded = 0;
+    local $_;
+    while (<IN>) {
+       chomp;
+       next if m/^#/o;
+       next if m/^$/o;
+       last if (++$i > 55);
+       if (m~
+            # the exec should either be "eval"ed or a new statement
+            (^\s*|\beval\s*[\'\"]|(;|&&)\s*)
+
+            # eat anything between the exec and $0
+            exec\s*.+\s*
+
+            # optionally quoted executable name (via $0)
+            .?\$$var.?\s*
+
+            # optional "end of options" indicator
+            (--\s*)?
+
+            # Match expressions of the form '${1+$@}', '${1:+"$@"',
+            # '"${1+$@', "$@", etc where the quotes (before the dollar
+            # sign(s)) are optional and the second (or only if the $1
+            # clause is omitted) parameter may be $@ or $*.
+            #
+            # Finally the whole subexpression may be omitted for scripts
+            # which do not pass on their parameters (i.e. after re-execing
+            # they take their parameters (and potentially data) from stdin
+            .?(\${1:?\+.?)?(\$(\@|\*))?~x) {
+           $ret = 1;
+           last;
+       } elsif (/^\s*(\w+)=\$0;/) {
+           $var = $1;
+       } elsif (m~
+           # Match scripts which use "foo $0 $@ &\nexec true\n"
+           # Program name
+           \S+\s+
+
+           # As above
+           .?\$$var.?\s*
+           (--\s*)?
+           .?(\${1:?\+.?)?(\$(\@|\*))?.?\s*\&~x) {
+
+           $backgrounded = 1;
+       } elsif ($backgrounded and m~
+           # the exec should either be "eval"ed or a new statement
+           (^\s*|\beval\s*[\'\"]|(;|&&)\s*)
+           exec\s+true(\s|\Z)~x) {
+
+           $ret = $1;
+           last;
+       }
+    }
+    close IN;
+    return $ret;
+}
+
+# Given an interpretor and a file, run the interpretor on that file with the
+# -n option to check syntax, discarding output and returning the exit status.
+sub check_script_syntax {
+    my ($interpreter, $script) = @_;
+    my $pid = fork;
+    if (!defined $pid) {
+       fail("cannot fork: $!");
+    } elsif ($pid == 0) {
+       open STDOUT, '>/dev/null' or fail("cannot reopen stdout: $!");
+       open STDERR, '>&STDOUT' or fail("cannot reopen stderr: $!");
+       exec $interpreter, '-n', $script
+           or fail("cannot exec $interpreter: $!");
+    } else {
+       waitpid $pid, 0;
+    }
+    return $?;
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl ts=8 sw=4
diff --git a/nokia-lintian/checks/scripts.desc b/nokia-lintian/checks/scripts.desc
new file mode 100644 (file)
index 0000000..384bbee
--- /dev/null
@@ -0,0 +1,426 @@
+Check-Script: scripts
+Author: Richard Braakman <dark@xs4all.nl>
+Abbrev: scr
+Type: binary
+Unpack-Level: 2
+Info: This script checks the #! lines of scripts in a package.
+Needs-Info: file-info, scripts
+
+Tag: script-without-interpreter
+Type: error
+Info: This file starts with the #! sequence that identifies scripts, but
+ it does not name an interpreter.
+
+Tag: executable-not-elf-or-script
+Type: warning
+Info: This executable file is not an ELF format binary, and does not start
+ with the #! sequence that marks interpreted scripts.  It might be a sh script
+ that fails to name /bin/sh as its shell.
+Ref: policy 10.4
+
+Tag: script-not-executable
+Type: warning
+Info: This file starts with the #! sequence that marks interpreted scripts,
+ but it is not executable.
+
+Tag: interpreter-not-absolute
+Type: warning
+Info: This script uses a relative path to locate its interpreter.
+ This path will be taken relative to the caller's current directory, not
+ the script's, so it is not likely to be what was intended.
+
+Tag: unusual-interpreter
+Type: warning
+Info: This package contains a script for an interpreter that the Lintian
+ maintainers have not heard of.  It could be a typo for a common
+ interpreter.  If not, please file a wishlist bug on lintian so that the
+ Lintian maintainers can add this interpreter to their list.
+
+Tag: script-uses-bin-env
+Type: warning
+Info: This script uses /bin/env as its interpreter (used to find the
+ actual interpreter on the user's path).  There is no /bin/env on Debian
+ systems; env is instead installed as /usr/bin/env.  Usually, the path to
+ env in the script should be changed.
+
+Tag: forbidden-config-interpreter
+Type: error
+Info: This package contains a <tt>config</tt> script for pre-configuring
+ the package.  During pre-configuration, however, only essential packages
+ are guaranteed to be installed, so you cannot use a non-essential
+ interpreter.
+
+Tag: unusual-control-interpreter
+Type: info
+Info: This package contains a control script for an interpreter that is
+ not normally used for control scripts.
+
+Tag: interpreter-in-usr-local
+Type: error
+Info: This package contains a script that looks for an interpreter in a
+ directory in /usr/local.  Since Debian does not install anything in
+ /usr/local, this is the wrong place to look.
+
+Tag: interpreter-without-predep
+Type: error
+Info: The package contains a control script that uses an unusual
+ interpreter, but does not declare a pre-dependency on the package that
+ provides this interpreter.
+ .
+ A perusal of &packaging; section 6.2 shows that any of the control
+ scripts can be called while the package is not configured.  Therefore, a
+ pre-dependency is required to ensure that the interpreter is always
+ available when the script is invoked.
+ .
+ Please do not add a pre-dependency without following the policy for doing
+ so. (Policy section 3.5).
+
+Tag: missing-dep-for-interpreter
+Type: error
+Info: You used an interpreter for a script that is not in an essential
+ package.  In most cases, you will need to add a Dependency on the
+ package that contains the interpreter.  If the dependency is already
+ present, please file a bug against Lintian with the details of your
+ package so that its database can be updated.
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
+Tag: csh-considered-harmful
+Type: warning
+Info: The Debian policy for scripts explicitly warns against using csh
+ and tcsh as scripting languages.
+Ref: policy 10.4
+
+Tag: suid-perl-script-but-no-perl-suid-dep
+Type: error
+Info: Packages that use perl scripts that are suid must depend on the
+ perl-suid package.
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
+Tag: wrong-path-for-interpreter
+Type: error
+Info: The interpreter you used is installed at another location on Debian
+ systems.
+
+Tag: gawk-script-but-no-gawk-dep
+Type: error
+Info: Packages that use gawk scripts must depend on the gawk package.
+ If they don't need gawk-specific features, and can just as easily work
+ with mawk, then they should be awk scripts instead.
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
+Tag: mawk-script-but-no-mawk-dep
+Type: error
+Info: Packages that use mawk scripts must depend on the mawk package.
+ If they don't need mawk-specific features, and can just as easily work
+ with gawk, then they should be awk scripts instead.
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
+Tag: php-script-but-no-phpX-cli-dep
+Type: error
+Info: Packages with PHP scripts must depend on a phpX-cli package such as
+ php5-cli.  Note that a dependency on a php-cgi package (such as php5-cgi)
+ is needlessly strict and forces the user to install a package that isn't
+ needed.
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+ .
+ Lintian can only recognize phpX-cli dependencies for values of X that it
+ knows are available in the archive.  If this package depends on a php-cli
+ package that Lintian doesn't know about, please file a bug against
+ Lintian so that it can be updated.
+
+Tag: python-script-but-no-python-dep
+Type: error
+Info: Packages with Python scripts must depend on the package python.
+ Those that have scripts executed with a versioned python package need a
+ dependency on the equivalent version of python. 
+ .
+ For example, if a script in the package uses <tt>#!/usr/bin/python</tt>,
+ the package needs a dependency on "python".  If a script uses
+ <tt>#!/usr/bin/python2.5</tt>, the package need a dependency on
+ "python2.5".
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
+Tag: ruby-script-but-no-ruby-dep
+Type: error
+Info: Packages with Ruby scripts must depend on the package ruby. Those
+ that have Ruby scripts that run under a specific version of Ruby need a
+ dependency on the equivalent version of Ruby.
+ .
+ For example, if a script in the package uses <tt>#!/usr/bin/ruby</tt>,
+ the package needs a dependency on "ruby".  If a script uses
+ <tt>#!/usr/bin/ruby1.9</tt>, then the package need a dependency on
+ "ruby1.9".
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
+Tag: wish-script-but-no-wish-dep
+Type: error
+Info: Packages that include wish scripts must depend on the virtual
+ package wish or, if they require a specific version of wish or tk, that
+ version of tk.
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
+Tag: tclsh-script-but-no-tclsh-dep
+Type: error
+Info: Packages that include tclsh scripts must depend on the virtual
+ package tclsh or, if they require a specific version of tcl, that
+ version of tcl.
+ .
+ In some cases a weaker relationship, such as Suggests or Recommends, will
+ be more appropriate.
+
+Tag: calls-suidperl-directly
+Type: error
+Info: Since perl version 5.8.3-3, /usr/bin/suidperl shouldn't be called
+ directly anymore (and doing so will lead to errors in most cases) but the
+ script should just use /usr/bin/perl as interpreter which will call
+ suidperl automatically if the script has the suid permission bit set.
+
+Tag: shell-script-fails-syntax-check
+Type: error
+Info: Running this shell script with the shell's -n option set fails,
+ which means that the script has syntax errors.
+ .
+ Run e.g. <tt>sh -n yourscript</tt> to see the errors yourself.
+
+Tag: maintainer-shell-script-fails-syntax-check
+Type: error
+Info: Running this shell script with the shell's -n option set fails,
+ which means that the script has syntax errors. This will likely make
+ the package uninstallable.
+ .
+ Run e.g. <tt>sh -n yourscript</tt> to see the errors yourself.
+
+Tag: possibly-insecure-handling-of-tmp-files-in-maintainer-script
+Type: warning
+Info: The maintainer script seems to access a file in <tt>/tmp</tt> or
+ some other temporary directory. Since creating temporary files in a
+ world-writable directory is very dangerous, this is likely to be a
+ security bug. Use the <tt>tempfile</tt> or <tt>mktemp</tt> utilities to
+ create temporary files in these directories.
+Ref: policy 10.4
+
+Tag: killall-is-dangerous
+Type: warning
+Info: The maintainer script seems to call <tt>killall</tt>.  Since this
+ utility kills processes by name, it may well end up killing unrelated
+ processes.  Most uses of <tt>killall</tt> should use <tt>invoke-rc.d</tt>
+ instead.
+
+Tag: mknod-in-maintainer-script
+Type: error
+Ref: policy 10.6
+Info: Maintainer scripts must not create device files directly.  They
+ should call MAKEDEV instead.
+
+Tag: start-stop-daemon-in-maintainer-script
+Type: warning
+Info: The maintainer script seems to calll <tt>start-stop-daemon</tt>
+ directly.  Long-running daemons should be started and stopped via init
+ scripts using <tt>invoke-rc.d</tt> rather than directly in maintainer
+ scripts.
+
+Tag: maintainer-script-removes-device-files
+Type: error
+Ref: policy 10.6
+Info: Maintainer scripts must not remove device files.  This is left to
+ the system administrator.
+
+Tag: read-in-maintainer-script
+Type: warning
+Ref: policy 3.9.1 
+Info: This maintainer script appears to use read to get information from
+ the user.  Prompting in maintainer scripts should be done by
+ communicating through a program such as debconf which conforms to the
+ Debian Configuration management specification, version 2 or higher.
+
+Tag: possible-bashism-in-maintainer-script
+Type: warning
+Ref: policy 10.4
+Info: This script is marked as running under <tt>/bin/sh</tt>, but it seems
+ to use a feature found in bash but not in the SUSv3 or POSIX shell
+ specification.
+ .
+ Examples:
+  '==' in a test, it should use '=' instead
+  'read' without a variable in the argument
+  'function' to define a function
+  'source' instead of '.'
+  '. command args', passing arguments to commands via 'source' is not supported
+  '{foo,bar}' instead of 'foo bar'
+  '[[ test ]]' instead of '[ test ]' (requires a Korn shell)
+
+Tag: suidregister-used-in-maintainer-script
+Type: error
+Info: This script calls suidregister, a long-obsolete program that has
+ been replaced by dpkg-statoverride.
+
+Tag: maintainer-script-needs-depends-on-update-inetd
+Type: warning
+Info: This script calls update-inetd, but the package does not depend or
+ pre-depend on inet-superserver, any of the providers of inet-superserver
+ which provide it, or update-inetd.
+ .
+ update-inetd has been moved from netbase into a separate package, so a
+ dependency on netbase should be updated to depend on "openbsd-inetd |
+ inet-superserver".
+
+Tag: maintainer-script-needs-depends-on-adduser
+Type: warning
+Info: This script calls adduser, but the package does not depend or
+ pre-depend on the adduser package.
+
+Tag: maintainer-script-needs-depends-on-gconf2
+Type: warning
+Info: This script calls gconf-schemas, which comes from the gconf2 package,
+ but does not depend or pre-depend on gconf2.  If you are using dh_gconf,
+ add a dependency on ${misc:Depends} and dh_gconf will take care of this
+ for you.
+
+Tag: maintainer-script-needs-depends-on-ucf
+Type: warning
+Info: This script calls ucf, but the package does not depend or pre-depend
+ on the ucf package.
+
+Tag: maintainer-script-needs-depends-on-xml-core
+Type: warning
+Info: This script calls update-xmlcatalog, which comes from the xml-core
+ package, but does not depend or pre-depend on xml-core.  Packages that call
+ update-xmlcatalog need to depend on xml-core.  If you are using
+ dh_installxmlcatalogs, add a dependency on ${misc:Depends} and
+ dh_installxmlcatalogs will take care of this for you.
+
+Tag: update-alternatives-remove-called-in-postrm
+Type: warning
+Info: <tt>update-alternatives --remove &lt;alternative&gt; foo</tt> is
+ called in the postrm.  This can be dangerous because at the time the
+ postrm is executed foo has already been deleted and update-alternatives
+ will ignore it while constructing its list of available alternatives.
+ Then, if the /etc/alternatives symlink points at foo, update-alternatives
+ won't recognize it and will mark the symlink as something site-specific.
+ As such, the symlink will no longer be updated automatically and will be
+ left dangling until <tt>update-alternatives --auto
+ &lt;alternative&gt;</tt> is run by hand.
+ .
+ <tt>update-alternatives --remove</tt> should be called in the prerm
+ instead.
+
+Tag: deprecated-chown-usage
+Type: warning
+Info: <tt>chown user.group</tt> is called in one of the maintainer
+ scripts.  The correct syntax is <tt>chown user:group</tt>. Using "." as a
+ separator is still supported by the GNU tools, but it will fail as soon
+ as a system uses the "." in user or group names.
+
+Tag: maintainer-script-hides-init-failure
+Type: warning
+Info: This script calls invoke-rc.d to run an init script but then, if the
+ init script fails, exits successfully (using || exit 0).  If the init
+ script fails, the maintainer script should probably fail.
+ .
+ The most likely cause of this problem is that the package was built with
+ a debhelper version suffering from Bug#337664 that inserted incorrect
+ invoke-rc.d code in the generated maintainer script. The package needs to
+ be reuploaded (could be bin-NMUd, no source changes needed).
+
+Tag: maintainer-script-calls-init-script-directly
+Type: error
+Info: This script apparently runs an init script directly rather than
+ using invoke-rc.d.  The use of invoke-rc.d to invoke the /etc/init.d/*
+ initscripts instead of calling them directly is required.  Maintainer
+ scripts may call the init script directly only if invoke-rc.d is not
+ available.
+Ref: policy 9.3.3.2
+
+Tag: gconftool-used-in-maintainer-script
+Type: warning
+Info: This script apparently runs gconftool or gconftool-2.  It should
+ probably be calling gconf-schemas or update-gconf-defaults instead.
+
+Tag: maintainer-script-uses-dpkg-status-directly
+Type: error
+Info: The file /var/lib/dpkg/status is internal to dpkg, may disappear or
+ change formats, and is not always a correct and complete record of
+ installed packages while dpkg is running.  Maintainer scripts should use
+ dpkg-query instead.  For the most common case of retrieving conffile
+ information, use:
+ .
+  dpkg-query -W -f='${Conffiles}' &lt;package&gt;
+ .
+ instead.
+Ref: http://wiki.debian.org/DpkgConffileHandling
+
+Tag: maintainer-script-modifies-netbase-managed-file
+Type: error
+Info: The maintainer script modifies at least one of the files
+ <tt>/etc/services</tt>, <tt>/etc/protocols</tt>, and <tt>/etc/rpc</tt>,
+ which are managed by the netbase package. Instead of doing this, please
+ file a wishlist bug against netbase to have an appropriate entry added.
+Ref: policy 10.7.4
+
+Tag: maintainer-script-modifies-inetd-conf
+Type: error
+Info: The maintainer script modifies <tt>/etc/inetd.conf</tt> directly.
+ This file must not be modified directly; instead, use the
+ <tt>update-inetd</tt> script or the <tt>DebianNet.pm</tt> Perl module.
+Ref: policy 10.7.4
+
+Tag: install-sgmlcatalog-deprecated
+Type: error
+Info: The maintainer script apparently runs install-sgmlcatalog with flags
+ other than <tt>--quiet</tt> and <tt>--remove</tt> or in a maintainer
+ script other than postinst or prerm.  install-sgmlcatalog is deprecated
+ and should only be used in postinst or prerm to remove the entries from
+ earlier packages.  Given how long ago this transition was, consider
+ removing it entirely.
+
+Tag: maintainer-script-empty
+Type: warning
+Info: The maintainer script doesn't seem to contain any code other than
+ comments and boilerplate (set -e, exit statements, and the case statement
+ to parse options).  While this is harmless in most cases, it is probably
+ not what you wanted, may mean the package will leave unnecessary files
+ behind until purged, and may even lead to problems in rare situations
+ where dpkg would fail if no maintainer script was present.
+ .
+ If the package currently doesn't need to do anything in this maintainer
+ script, it shouldn't be included in the package.
+
+Tag: ancient-dpkg-predepends-check
+Type: warning
+Info: The package calls dpkg --assert-support-predepends in a maintainer
+ script.  This check is obsolete and has always returned true since dpkg
+ 1.1.0, released 1996-02-11.
+
+Tag: ancient-dpkg-epoch-check
+Type: warning
+Info: The package calls dpkg --assert-working-epoch in a maintainer
+ script.  This check is obsolete and has always returned true since dpkg
+ 1.4.0.7, released 1997-01-25.
+
+Tag: ancient-dpkg-long-filenames-check
+Type: warning
+Info: The package calls dpkg --assert-long-filenames in a maintainer
+ script.  This check is obsolete and has always returned true since dpkg
+ 1.4.1.17, released 1999-10-21.
+
+Tag: ancient-dpkg-multi-conrep-check
+Type: warning
+Info: The package calls dpkg --assert-multi-conrep in a maintainer
+ script.  This check is obsolete and has always returned true since dpkg
+ 1.4.1.19, released 1999-10-30.
diff --git a/nokia-lintian/checks/shared-libs b/nokia-lintian/checks/shared-libs
new file mode 100644 (file)
index 0000000..9ee576a
--- /dev/null
@@ -0,0 +1,629 @@
+# shared-libs -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::shared_libs;
+use strict;
+
+use File::Basename;
+
+use Lintian::Data;
+use Dep;
+use Tags;
+use Util;
+
+sub run {
+
+# Libraries that should only be used in the presence of certain capabilities
+# may be located in subdirectories of the standard ldconfig search path with
+# one of the following names.
+my %hwcap_dir = map { $_ => 1 }
+    qw( i486 i586 i686 cmov tls );
+
+# The following architectures should always have a STACK setting in shared
+# libraries to disable executable stack.  Other architectures don't always add
+# this section and therefore can't be checked.
+my %stack_arches = map { $_ => 1 }
+    qw( alpha
+       amd64
+       i386
+       m68k
+       powerpc
+       s390
+       sparc
+      );
+
+my $ldconfig_dirs = Lintian::Data->new('shared-libs/ldconfig-dirs');
+my $file;
+my $must_call_ldconfig;
+my $postrm = "control/postrm";
+my $postinst = "control/postinst";
+my $preinst = "control/preinst";
+my $prerm = "control/prerm";
+my $shlibs_control_file = "control/shlibs";
+my $symbols_control_file = "control/symbols";
+my %SONAME;
+my %INTERP;
+my %STACK;
+my %TEXTREL;
+my %objsomething;
+my %sharedobject;
+my %index_info;
+my %link_info;
+my @shlibs;
+my @words;
+
+# ---end-of-configuration-part---
+
+my $pkg = shift;
+my $type = shift;
+
+# 1st step: get info about shared libraries installed by this package
+open(IN, '<', "objdump-info")
+    or fail("cannot find objdump-info for $type package $pkg");
+while (<IN>) {
+    chop;
+
+    #skip blank lines
+    next if m/^\s*$/o;
+
+    if (m/^-- (\S+)\s*$/o) {
+       $file = $1;
+       $file =~ s,^(\./)?,,;
+    } elsif (m/^\s*SONAME\s+(\S+)/o) {
+       $SONAME{$file} = $1;
+    } elsif (m/^\s*TEXTREL\s/o) {
+        $TEXTREL{$file} = 1;
+    } elsif (m/^\s*INTERP\s/) {
+       $INTERP{$file} = 1;
+    } elsif (m/^\s*STACK\s/) {
+       $STACK{$file} = 0;
+    } else {
+        if (defined $STACK{$file} and $STACK{$file} eq 0) {
+           m/\sflags\s+(\S+)/o;
+           $STACK{$file} = $1;
+       }
+       else {
+           $objsomething{$file} = 1;
+       }
+    }
+}
+close(IN);
+
+open (IN, '<', "file-info")
+    or fail("cannot find file-info for $type package $pkg");
+while (<IN>) {
+    chomp;
+    # with file names containing colons and spaces, we're fucked.
+    m/^(?:\.\/)?(.+?):\s+(.*)$/o or fail("unrecognized file(1) output: $_");
+    my ($file,$info) = ($1,$2);
+    if ($info =~ m/^[^,]*\bELF\b/ && $info =~ m/shared object/) {
+       $sharedobject{$file} = 1;
+    }
+}
+close(IN);
+
+# 2nd step: read package contents
+my %files;
+open(IN, '<', "index") or fail("cannot open index file index: $!");
+while (<IN>) {
+    chop;
+    @words = split(/\s+/o, $_, 6);
+    my $perm = $words[0];
+    my $cur_file = $words[5];
+    $cur_file =~ s,^(\./),,;
+    $cur_file =~ s/ link to .*//;
+
+    if ($perm =~ m/^l/) {
+       my $link;
+       ($cur_file, $link) = split(' -> ', $cur_file);
+       $link_info{$cur_file} = $link;
+    }
+    $index_info{$cur_file} = 1;
+    $files{$cur_file} = $perm;
+}
+
+for (keys %files) {
+    my ($cur_file, $perm) = ($_, $files{$_});
+
+    # shared library?
+    if (exists $SONAME{$cur_file} or 
+       ($link_info{$cur_file} and exists $SONAME{abs_path(dirname($cur_file)."/".$link_info{$cur_file})})) {
+       # yes!!
+
+       my ($real_file, $real_perm);
+       if ($SONAME{$cur_file}) {
+           $real_file = $cur_file;
+           $real_perm = $perm;
+       } else {
+           $real_file = abs_path(dirname($cur_file)."/".$link_info{$cur_file});
+           $real_perm = $files{$real_file} || $perm;
+       }
+
+       # Now that we're sure this is really a shared library, report on
+       # non-PIC problems.
+        if ($cur_file eq $real_file and $TEXTREL{$cur_file}) {
+            tag "shlib-with-non-pic-code", "$cur_file";
+        }
+
+        # don't apply the permission checks to links
+        # since this only results in doubled messages
+        if ($cur_file eq $real_file) { 
+            # executable?
+            if ($real_perm =~ m/x/) {
+                # yes.  But if the library has an INTERP section, it's designed
+                # to do something useful when executed, so don't report an error.
+                tag "shlib-with-executable-bit", $cur_file, sprintf("%04o",perm2oct($real_perm))
+                    unless $INTERP{$real_file};
+            } elsif ($real_perm ne '-rw-r--r--') {
+                # bad permissions
+                tag "shlib-with-bad-permissions", $cur_file, sprintf("%04o",perm2oct($real_perm));
+            }
+        }
+
+       # Installed in a directory controlled by the dynamic linker?  We have
+       # to strip off directories named for hardware capabilities.
+       my $dirname = dirname($cur_file);
+       my $last;
+       do {
+           $dirname =~ s%/([^/]+)$%%;
+           $last = $1;
+       } while ($last && $hwcap_dir{$last});
+       $dirname .= "/$last" if $last;
+       if ($ldconfig_dirs->known($dirname)) {
+           # yes! so postinst must call ldconfig
+           $must_call_ldconfig = $real_file;
+       }
+
+       # executable stack.  We can only warn about a missing section on some
+       # architectures.  Only warn if there's an Architecture field; if
+       # that's missing, we'll already be complaining elsewhere.
+       if (exists $objsomething{$cur_file}) {
+           if (not defined $STACK{$cur_file}) {
+               if (open(FH, '<', "fields/architecture")) {
+                   my $arch = <FH>;
+                   close FH;
+                   chomp $arch;
+                   tag "shlib-without-PT_GNU_STACK-section", $cur_file
+                       if $stack_arches{$arch};
+               }
+           } elsif ($STACK{$cur_file} ne "rw-") {
+               tag "shlib-with-executable-stack", $cur_file;
+           }
+       }
+    } elsif (exists $objsomething{$cur_file}
+            && $ldconfig_dirs->known(dirname($cur_file))
+            && exists $sharedobject{$cur_file}) {
+       tag "sharedobject-in-library-directory-missing-soname", "$cur_file";
+    }
+}
+
+close(IN);
+
+# 3rd step: check if shlib symlinks are present and in correct order
+for my $shlib_file (keys %SONAME) {
+    # file found?
+    if (not exists $index_info{$shlib_file}) {
+       fail("shlib $shlib_file not found in package (should not happen!)");
+    }
+
+    my ($dir, $shlib_name) = $shlib_file =~ m,(.*)/([^/]+)$,;
+
+    # not a public shared library, skip it
+    next unless $ldconfig_dirs->known($dir);
+
+    # symlink found?
+    my $link_file = "$dir/$SONAME{$shlib_file}";
+    if (not exists $index_info{$link_file}) {
+       tag "ldconfig-symlink-missing-for-shlib", "$link_file $shlib_file $SONAME{$shlib_file}";
+    } else {
+       # $link_file really another file?
+       if ($link_file eq $shlib_file) {
+           # the library file uses its SONAME, this is ok...
+       } else {
+           # $link_file really a symlink?
+           if (exists $link_info{$link_file}) {
+               # yes.
+
+               # $link_file pointing to correct file?
+               if ($link_info{$link_file} eq $shlib_name) {
+                   # ok.
+               } else {
+                   tag "ldconfig-symlink-referencing-wrong-file", "$link_file -> $link_info{$link_file} instead of $shlib_name";
+               }
+           } else {
+               tag "ldconfig-symlink-is-not-a-symlink", "$shlib_file $link_file";
+           }
+
+           # symlink after shlib?
+           if ($index_info{$link_file} < $index_info{$shlib_file}) {
+               tag "ldconfig-symlink-before-shlib-in-deb", "$link_file";
+           }
+       }
+    }
+
+    # determine shlib link name (w/o version)
+    $link_file =~ s/\.so.*$/.so/o;
+
+    # -dev package?
+    if ($pkg =~ m/\-dev$/o) {
+       # yes!!
+
+       # need shlib symlink
+       if (not exists $index_info{$link_file}) {
+           tag "dev-pkg-without-shlib-symlink", "$shlib_file $link_file";
+       }
+    } else {
+       # no.
+
+       # shlib symlink may not exist.
+       # if shlib doesn't _have_ a version, then $link_file and $shlib_file will
+       # be equal, and it's not a development link, so don't complain.
+       if (exists $index_info{$link_file} and $link_file ne $shlib_file) {
+           tag "non-dev-pkg-with-shlib-symlink", "$shlib_file $link_file";
+       }
+    }
+}
+
+# 4th step: check shlibs control file
+my $version;
+if (open (VERSION, '<', 'fields/version')) {
+    $version = <VERSION>;
+    close VERSION;
+    chomp $version;
+}
+my $provides = $pkg . "( = $version)";
+if (open (PROVIDES, '<', 'fields/provides')) {
+    my $line = <PROVIDES>;
+    close PROVIDES;
+    chomp $line;
+    $provides .= ", $line";
+}
+$provides = Dep::parse($provides);
+
+my %shlibs_control;
+my %symbols_control;
+
+@shlibs = grep { !m,^lib/libnss_[^.]+\.so(\.[0-9]+)$, } keys %SONAME;
+if ($#shlibs == -1) {
+    # no shared libraries included in package, thus shlibs control file should
+    # not be present
+    if (-f $shlibs_control_file) {
+       tag "pkg-has-shlibs-control-file-but-no-actual-shared-libs", "";
+    }
+} else {
+    # shared libraries included, thus shlibs control file has to exist
+    if (not -f $shlibs_control_file) {
+       if ($type ne 'udeb') {
+           for my $shlib (@shlibs) {
+               # skip it if it's not a public shared library
+               next unless $ldconfig_dirs->known(dirname($shlib));
+               tag "no-shlibs-control-file", "$shlib";
+           }
+       }
+    } else {
+       my %shlibs_control_used;
+       my @shlibs_depends;
+       open(SHLIBS, '<', $shlibs_control_file)
+           or fail("cannot open shlibs control file $shlibs_control_file for reading: $!");
+       while (<SHLIBS>) {
+           chop;
+           next if m/^\s*$/ or /^#/;
+
+           # We exclude udebs from the checks for correct shared library
+           # dependencies, since packages may contain dependencies on
+           # other udeb packages.
+           my $udeb="";
+           $udeb = "udeb: " if s/^udeb:\s+//o;
+           @words = split(/\s+/o,$_);
+           my $shlibs_string = $udeb.$words[0].' '.$words[1];
+           if ($shlibs_control{$shlibs_string}) {
+               tag "duplicate-entry-in-shlibs-control-file", $shlibs_string;
+           } else {
+               $shlibs_control{$shlibs_string} = 1;
+               push (@shlibs_depends, join (' ', @words[2 .. $#words]))
+                   unless $udeb;
+           }
+       }
+       close(SHLIBS);
+       my $shlib_name;
+       for my $shlib (@shlibs) {
+           $shlib_name = $SONAME{$shlib};
+           $shlib_name = format_soname($shlib_name);
+           $shlibs_control_used{$shlib_name} = 1;
+           $shlibs_control_used{"udeb: ".$shlib_name} = 1;
+           unless (exists $shlibs_control{$shlib_name}) {
+               # skip it if it's not a public shared library
+               next unless $ldconfig_dirs->known(dirname($shlib));
+               # no!!
+               tag "shlib-missing-in-control-file", $shlib_name, 'for', $shlib;
+           }
+       }
+       for $shlib_name (keys %shlibs_control) {
+           tag "unused-shlib-entry-in-control-file", $shlib_name
+               unless $shlibs_control_used{$shlib_name};
+       }
+
+       # Check that all of the packages listed as dependencies in the shlibs
+       # file are satisfied by the current package or its Provides.
+       # Normally, packages should only declare dependencies in their shlibs
+       # that they themselves can satisfy.
+       #
+       # Deduplicate the list of dependencies before warning so that we don't
+       # dupliate warnings.
+       my %seen;
+       @shlibs_depends = grep { !$seen{$_}++ } @shlibs_depends;
+       for my $depend (@shlibs_depends) {
+           unless (Dep::implies($provides, Dep::parse($depend))) {
+               tag "shlibs-declares-dependency-on-other-package", $depend;
+           }
+       }
+    }
+}
+
+# 5th step: check symbols control file
+if ($#shlibs == -1) {
+    # no shared libraries included in package, thus symbols control file should
+    # not be present
+    if (-f $symbols_control_file) {
+        tag "pkg-has-symbols-control-file-but-no-shared-libs", "";
+    }
+} elsif (not -f $symbols_control_file) {
+    if ($type ne 'udeb') {
+       for my $shlib (@shlibs) {
+           # skip it if it's not a public shared library
+           next unless $ldconfig_dirs->known(dirname($shlib));
+           tag "no-symbols-control-file", "$shlib";
+       }
+    }
+} elsif (open(IN, '<', $symbols_control_file)) {
+    my $version_wo_rev = $version;
+    $version_wo_rev =~ s/^(.+)-([^-]+)$/$1/;
+    my ($full_version_count, $full_version_sym) = (0, undef);
+    my ($debian_revision_count, $debian_revision_sym) = (0, undef);
+    my ($soname, $dep_package, $dep);
+    my %symbols_control_used;
+    my @symbols_depends;
+    my $dep_templates = 0;
+    my $meta_info_seen = 0;
+
+    while (<IN>) {
+       chomp;
+       next if m/^\s*$/ or /^#/;
+
+       if (m/^([^\s|*]\S+)\s(\S+)(?:\s(\S+))?/) {
+           # soname, main dependency template
+
+           ($soname, $dep_package, $dep) = ($1, $2, $3);
+           $dep ||= '';
+           $soname = format_soname($soname);
+
+           if ($symbols_control{$soname}) {
+               tag "duplicate-entry-in-symbols-control-file", $soname;
+           } else {
+               $symbols_control{$soname} = 1;
+               push @symbols_depends, $dep_package . ' ' . $dep;
+           }
+
+           $dep_templates = 0;
+           $meta_info_seen = 0;
+       } elsif (m/^\|\s+(\S+)\s(\S+(\s\S+)?)$/) {
+           # alternative dependency template
+
+           if ($meta_info_seen or not defined $soname) {
+               tag "syntax-error-in-symbols-file", $.;
+           }
+
+           ($dep_package, $dep) = ($1, $2);
+           push @symbols_depends, $dep_package . ' ' . $dep;
+           $dep_templates++;
+       } elsif (m/^\*\s(\S+):\s(\S+)/) {
+           # meta-information
+
+           # This should probably be in a hash, but there's
+           # only one supported value currently
+           tag "unknown-meta-field-in-symbols-file", "$1, line $."
+               unless $1 eq 'Build-Depends-Package';
+           tag "syntax-error-in-symbols-file", $.
+               if $dep_templates > 0;
+
+           $meta_info_seen = 1;
+       } elsif (m/^\s+(\S+)\s(\S+)(?:\s(\S+(\s\S+)?))?$/) {
+           # Symbol definition
+
+           tag "syntax-error-in-symbols-file", $.
+               unless defined $soname;
+
+           my ($sym, $v, $dep_order) = ($1, $2, $3);
+           $dep_order ||= '';
+
+           if (($v eq $version) and ($version =~ /-/)) {
+               $full_version_sym ||= $sym;
+               $full_version_count++;
+           }
+           if (($v =~ /-/) and (not $v =~ /~$/) and ($v ne $version_wo_rev)) {
+               $debian_revision_sym ||= $sym;
+               $debian_revision_count++;
+           }
+
+           if (length $dep_order) {
+               if ($dep_order !~ /^\d+$/ or $dep_order > $dep_templates) {
+                   tag "invalid-template-id-in-symbols-file", $.;
+               }
+           }
+       } else {
+           # Unparseable line
+
+           tag "syntax-error-in-symbols-file", $.;
+       }
+    }
+    close IN;
+    if ($full_version_count) {
+       $full_version_count--;
+       my $others = '';
+       if ($full_version_count > 0) {
+           $others = " and $full_version_count others";
+       }
+       tag "symbols-file-contains-current-version-with-debian-revision",
+           "on symbol $full_version_sym$others";
+    }
+    if ($debian_revision_count) {
+       $debian_revision_count--;
+       my $others = '';
+       if ($debian_revision_count > 0) {
+           $others = " and $debian_revision_count others";
+       }
+       tag "symbols-file-contains-debian-revision",
+           "on symbol $debian_revision_sym$others";
+    }
+    my $shlib_name;
+    for my $shlib (@shlibs) {
+       $shlib_name = $SONAME{$shlib};
+       $shlib_name = format_soname($shlib_name);
+       $symbols_control_used{$shlib_name} = 1;
+       $symbols_control_used{"udeb: ".$shlib_name} = 1;
+       unless (exists $symbols_control{$shlib_name}) {
+           # skip it if it's not a public shared library
+           next unless $ldconfig_dirs->known(dirname($shlib));
+           tag "shlib-missing-in-symbols-control-file", $shlib_name, 'for', $shlib;
+       }
+    }
+    for $shlib_name (keys %symbols_control) {
+       tag "unused-shlib-entry-in-symbols-control-file", $shlib_name
+           unless $symbols_control_used{$shlib_name};
+    }
+
+    # Check that all of the packages listed as dependencies in the symbols
+    # file are satisfied by the current package or its Provides.
+    # Normally, packages should only declare dependencies in their symbols
+    # files that they themselves can satisfy.
+    #
+    # Deduplicate the list of dependencies before warning so that we don't
+    # dupliate warnings.
+    my %seen;
+    @symbols_depends = grep { !$seen{$_}++ } @symbols_depends;
+    for my $depend (@symbols_depends) {
+       unless (Dep::implies($provides, Dep::parse($depend))) {
+           tag "symbols-declares-dependency-on-other-package", $depend;
+       }
+    } 
+}
+
+# Compare the contents of the shlibs and symbols control files
+if (keys %shlibs_control and keys %symbols_control) {
+    for my $key (keys %symbols_control) {
+       unless (exists $shlibs_control{$key}) {
+           tag "symbols-declared-but-not-shlib", $key;
+       }
+    }
+}
+
+# 6th step: check pre- and post- control files
+if (-f $preinst) {
+    local $_ = slurp_entire_file($preinst);
+    if (/^[^\#]*\bldconfig\b/m) {
+       tag "preinst-calls-ldconfig", ""
+    }
+}
+
+my $we_call_postinst=0;
+if (-f $postinst) {
+    local $_ = slurp_entire_file($postinst);
+
+    # Decide if we call ldconfig
+    if (/^[^\#]*\bldconfig\b/m) {
+       $we_call_postinst=1;
+    }
+}
+
+if ($type eq 'udeb') {
+    tag "udeb-postinst-must-not-call-ldconfig"
+       if $we_call_postinst;
+} else {
+    tag "postinst-has-useless-call-to-ldconfig", ""
+       if $we_call_postinst and not $must_call_ldconfig;
+    tag "postinst-must-call-ldconfig", "$must_call_ldconfig"
+       if not $we_call_postinst and $must_call_ldconfig;
+}
+
+if (-f $prerm) {
+    local $_ = slurp_entire_file($prerm);
+    if (/^[^\#]*\bldconfig\b/m) {
+       tag "prerm-calls-ldconfig", "";
+    }
+}
+
+if (-f $postrm) {
+    local $_ = slurp_entire_file($postrm);
+
+    # Decide if we call ldconfig
+    if (/^[^\#]*\bldconfig\b/m) {
+       tag "postrm-has-useless-call-to-ldconfig", ""
+           unless $must_call_ldconfig;
+    } else {
+       tag "postrm-should-call-ldconfig", "$must_call_ldconfig"
+           if $must_call_ldconfig;
+    }
+
+    # Decide if we do it safely
+    s/\bldconfig\b/BldconfigB/g;
+    s/[ \t]//g;
+    # this one matches code from debhelper
+    s/^if\["\$1"=.?remove.?\];?\n*then\n*BldconfigB//gm;
+    # variations...
+    s/^if\[.?remove.?="\$1"\];?\n*then\n*BldconfigB//gm;
+    s/^\["\$1"=.?remove.?\]\&&BldconfigB//gm;
+    s/^\[.?remove.?="\$1"\]&&BldconfigB//gm;
+    s/remove(?:\|[^)]+)*\).*?BldconfigB.*?(;;|esac)//s;
+
+    if (/^[^\#]*BldconfigB/m) {
+        tag "postrm-unsafe-ldconfig", "";
+    }
+}
+
+}
+
+# make /tmp/baz/baz.txt from /tmp/foo/../bar/../baz/baz.txt
+sub abs_path {
+    my $path = shift;
+    while($path =~ s!/[^/]*/\.\./!/!g){1};
+    return $path;
+}
+
+sub format_soname {
+    my $soname = shift;
+
+    # libfoo.so.X.X
+    if ($soname =~ m/(.+)\.so\.(.*)$/) {
+       $soname = "$1 $2";
+    # libfoo-X.X.so
+    } elsif ($soname =~ m/(.+)\-(\w[\w\.]*)\.so$/) {
+       $soname = "$1 $2";
+    }
+
+    return $soname
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 ts=8
diff --git a/nokia-lintian/checks/shared-libs.desc b/nokia-lintian/checks/shared-libs.desc
new file mode 100644 (file)
index 0000000..df27cb7
--- /dev/null
@@ -0,0 +1,306 @@
+Check-Script: shared-libs
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: shl
+Type: binary, udeb
+Unpack-Level: 1
+Needs-Info: file-info, objdump-info
+Info: This script checks if a binary package conforms to shared library policy.
+
+Tag: shlib-with-executable-bit
+Type: error
+Info: Shared libraries should be mode 0644.
+Ref: policy 8.1
+
+Tag: shlib-with-bad-permissions
+Type: warning
+Info: Shared libraries should be mode 0644.
+Ref: policy 8.1
+
+Tag: shlib-with-non-pic-code
+Type: error
+Ref: policy 10.2
+Info: The listed shared libraries contain object code that was compiled 
+ without -fPIC. All object code in shared libraries should be recompiled
+ separately from the static libraries with the -fPIC option. 
+ .
+ Another common mistake that causes this problem is linking with 
+ <tt>gcc -Wl,-shared</tt> instead of <tt>gcc -shared</tt>.
+ .
+ In some cases, exceptions to this rule are warranted. If this is such a
+ case, follow the procedure outlined in Policy and then please document
+ the exception by adding a lintian override to this package.
+
+Tag: ldconfig-symlink-missing-for-shlib
+Type: error
+Info: The package should not only include the shared library itself, but also
+ the symbolic link which ldconfig would produce. (This is necessary, so 
+ that the link gets removed by dpkg automatically when the package
+ gets removed.)  If the symlink is in the package, check that the SONAME of the
+ library matches the info in the shlibs file.
+Ref: policy 8.1
+
+Tag: ldconfig-symlink-before-shlib-in-deb
+Type: error
+Info: In the package contents list, the shared library has to come before
+ any symbolic links referencing the shared library.
+Ref: policy 8.1
+
+Tag: dev-pkg-without-shlib-symlink
+Type: warning
+Info: A `-dev' package is supposed to install a `libsomething.so' symbolic
+ link referencing the corresponding shared library. Notice how the link name
+ doesn't include the version number -- this is because such a link is used
+ by the linker when other programs are built against this shared library.
+Ref: policy 8.4
+
+Tag: non-dev-pkg-with-shlib-symlink
+Type: warning
+Info: Although this package is not a `-dev' package, it installs a
+ `libsomething.so' symbolic link referencing the corresponding shared
+ library. When the link doesn't include the version number, it is used by
+ the linker when other programs are built against this shared library.
+ .
+ Shared libraries are supposed to place such symbolic links in their
+ respective `-dev' packages, so it is a bug to include it with the main
+ library package.
+ .
+ However, if this is a small package which includes the runtime and the
+ development libraries, this is not a bug. In the latter case, please
+ override this warning.
+Ref: policy 8.4
+
+Tag: preinst-calls-ldconfig
+Type: warning
+Info: The preinst script calls ldconfig.  Calls to ldconfig should only be
+ in postinst and postrm scripts.
+Ref: policy 8.1.1
+
+Tag: prerm-calls-ldconfig
+Type: warning
+Info: The prerm script calls ldconfig.  Calls to ldconfig should only
+ be in postinst and postrm scripts.
+Ref: policy 8.1.1
+
+Tag: postrm-unsafe-ldconfig
+Type: warning
+Info: The postrm script calls ldconfig unsafely.  The postrm
+ must only call ldconfig when given the argument "remove".
+Ref: policy 8.1.1
+
+Tag: no-shlibs-control-file
+Type: error
+Info: Although the package includes a shared library, the package does not
+ have a shlibs control file. If this is intentional, please override this
+ error.
+Ref: policy 8.6
+
+Tag: pkg-has-shlibs-control-file-but-no-actual-shared-libs
+Type: error
+Info: Although the package does not include any shared libraries, it does
+ have a shlibs control file. If you did include a shared library, check that
+ the SONAME of the library is set and that it matches the contents of the
+ shlibs file.
+ .
+ SONAMEs are set with something like <tt>gcc -Wl,-soname,libfoo.so.0</tt>,
+ where 0 is the major version of the library. If your package uses libtool,
+ then libtool invoked with the right options should be doing this.
+
+Tag: duplicate-entry-in-shlibs-control-file
+Type: error
+Info: The shlibs control file contains a duplicate entry.
+
+Tag: shlib-missing-in-control-file
+Type: error
+Info: The package contains a shared library that is not listed in the
+ shlibs control file. If this is intentional, please override this error.
+Ref: policy 8.6
+
+Tag: unused-shlib-entry-in-control-file
+Type: warning
+Info: The shlibs control file contains an entry for a shared library that
+ is not installed by this package.
+Ref: policy 8.6
+
+Tag: shlibs-declares-dependency-on-other-package
+Type: warning
+Info: This package declares in its shlibs control file a dependency on
+ some other package (and not one listed in the Provides of this package).
+ .
+ Packages should normally only list in their shlibs control file the
+ shared libraries included in that package, and therefore the dependencies
+ listed there should normally be satisfied by either the package itself or
+ one of its Provides.
+ .
+ In unusual circumstances where it's necessary to declare more complex
+ dependencies in the shlibs control file, please add a lintian override
+ for this warning.
+Ref: policy 8.6
+
+Tag: ldconfig-symlink-referencing-wrong-file
+Type: error
+Info: The symbolic link references the wrong file. (It should reference
+ the shared library.)
+Ref: policy 8.1
+
+Tag: ldconfig-symlink-is-not-a-symlink
+Type: error
+Info: The package installs a file with the name, ldconfig would use for
+ the symbolic link to reference the shared library.
+Ref: policy 8.1
+
+Tag: postinst-has-useless-call-to-ldconfig
+Type: warning
+Info: The postinst script calls ldconfig even though no shared libraries are
+ installed in a directory controlled by the dynamic library loader.
+Ref: policy 8.1.1
+
+Tag: udeb-postinst-must-not-call-ldconfig
+Type: error
+Info: The postinst script calls ldconfig, which is an error in udebs.
+ ldconfig is not available and not needed in debian-installer
+
+Tag: postrm-has-useless-call-to-ldconfig
+Type: warning
+Info: The postrm script calls ldconfig even though no shared libraries are
+ installed in a directory controlled by the dynamic library loader.
+Ref: policy 8.1.1
+
+Tag: postinst-must-call-ldconfig
+Type: error
+Info: The package installs shared libraries in a directory controlled by
+ the dynamic library loader. Therefore, the package must call `ldconfig' in
+ its postinst script.
+Ref: policy 8.1.1
+
+Tag: postrm-should-call-ldconfig
+Type: warning
+Info: The package installs shared libraries in a directory controlled by
+ the dynamic library loader. Therefore, the package should call `ldconfig'
+ in its postrm script.
+Ref: policy 8.1.1
+
+Tag: sharedobject-in-library-directory-missing-soname
+Type: error
+Info: A shared object was identified in a library directory (i.e. a
+ directory in the standard linker path) which doesn't have a SONAME.
+ This is usually an error.
+ .
+ SONAMEs are set with something like <tt>gcc -Wl,-soname,libfoo.so.0</tt>,
+ where 0 is the major version of the library. If your package uses libtool,
+ then libtool invoked with the right options should be doing this.
+
+Tag: shlib-without-PT_GNU_STACK-section
+Type: error
+Info: The listed shared libraries lacks a PT_GNU_STACK section. This forces
+ the dynamic linker to make the stack executable.
+ .
+ The shared lib is linked either with a non-GNU linker or a linker which is
+ older than two years. This problem can be fixed with a rebuild.
+
+Tag: shlib-with-executable-stack
+Type: warning
+Info: The listed shared libraries declares the stack as executable.
+ .
+ Executable stack is usualy an error as it is only needed if the code
+ contains GCC trampolines or similar constructs which uses code on the
+ stack. One possible source for false positives are object files built
+ from assembler files which don't define a proper .note.GNU-stack
+ section.
+
+Tag: symbols-file-contains-current-version-with-debian-revision
+Type: error
+Info: Debian revisions should be stripped from versions in symbols files.
+ Not doing so leads to dependencies unsatisfiable by backports (1.0-1~bpo
+ &lt;&lt; 1.0-1 while 1.0-1~bpo &gt;= 1.0).  If the debian revision can't
+ be stripped because the symbol really appearead between two specific
+ Debian revisions, you should postfix the version with a single "~"
+ (example: 1.0-3~ if the symbol appeared in 1.0-3).
+ .
+ This problem normally means that the symbols were added automatically by
+ dpkg-gensymbols.  dpkg-gensymbols uses the full version number for the
+ dependency associated to any new symbol that it detects.  The maintainer
+ must update the <tt>debian/&lt;package&gt;.symbols</tt> file by adding
+ the new symbols with the corresponding upstream version.
+
+Tag: symbols-file-contains-debian-revision
+Type: warning
+Info: Debian revisions should be stripped from versions in symbols files.
+ Not doing so leads to dependencies unsatisfiable by backports (1.0-1~bpo
+ &lt;&lt; 1.0-1 while 1.0-1~bpo &gt;= 1.0).  If the debian revision can't
+ be stripped because the symbol really appearead between two specific
+ Debian revisions, you should postfix the version with a single "~"
+ (example: 1.0-3~ if the symbol appeared in 1.0-3).
+
+Tag: syntax-error-in-symbols-file
+Type: error
+Info: The symbols file contains an entry that does not follow the syntax
+ rules for symbols files.
+ .
+ This may be due to the entry appearing out of sequence.
+Ref: deb-symbols(5)
+
+Tag: duplicate-entry-in-symbols-control-file
+Type: error
+Info: The symbols control file contains a duplicate entry.
+
+Tag: no-symbols-control-file
+Type: info
+Info: Although the package includes a shared library, the package does not
+ have a symbols control file.
+
+Tag: pkg-has-symbols-control-file-but-no-shared-libs
+Type: error
+Info: Although the package does not include any shared libraries, it does
+ have a symbols control file. If you did include a shared library, check that
+ the SONAME of the library is set and that it matches the contents of the
+ symbols file.
+ .
+ SONAMEs are set with something like <tt>gcc -Wl,-soname,libfoo.so.0</tt>,
+ where 0 is the major version of the library. If your package uses libtool,
+ then libtool invoked with the right options should be doing this.
+
+Tag: shlib-missing-in-symbols-control-file
+Type: warning
+Info: The package contains a shared library that is not listed in the
+ symbols control file. This may not be a problem if, for example,
+ the library is a C++ library.
+
+Tag: unused-shlib-entry-in-symbols-control-file
+Type: warning
+Info: The symbols control file contains an entry for a shared library that
+ is not installed by this package.
+
+Tag: symbols-declares-dependency-on-other-package
+Type: warning
+Info: This package declares in its symbols control file a dependency on
+ some other package (and not one listed in the Provides of this package).
+ .
+ Packages should normally only list in their symbols control file the
+ shared libraries included in that package, and therefore the dependencies
+ listed there should normally be satisfied by either the package itself or
+ one of its Provides.
+ .
+ In unusual circumstances where it's necessary to declare more complex
+ dependencies in the symbols control file, please add a lintian override
+ for this warning.
+Ref: policy 8.6
+
+Tag: invalid-template-id-in-symbols-file
+Type: error
+Info: The symbol definition refers to an alternative dependency template
+ which is not defined for the library containing the symbol.
+ .
+ The first alternative dependency template for a library the id number
+ of 1, with the ids of subsequent alternative templates increasing in
+ sequence.
+
+Tag: unknown-meta-field-in-symbols-file
+Type: error
+Info: The symbols control file contains an unknown meta-information field.
+ .
+ A list of currently supported fields may be found in deb-control(5).
+
+Tag: symbols-declared-but-not-shlib
+Type: error
+Info: The symbols control file contains dependency and symbol information
+ for a shared library which is not listed in the shlibs control file.
diff --git a/nokia-lintian/checks/standards-version b/nokia-lintian/checks/standards-version
new file mode 100644 (file)
index 0000000..56ab759
--- /dev/null
@@ -0,0 +1,180 @@
+# standards-version -- lintian check script -*- perl -*-
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::standards_version;
+use strict;
+
+use Date::Parse qw(str2time);
+use POSIX qw(strftime);
+use Parse::DebianChangelog;
+
+use Tags;
+use Util;
+
+# This is a list of all known standards versions, current and older, with
+# their dates of publication.
+my @standards =
+    ([ '3.8.0'  => '2008-06-04' ],
+     [ '3.7.3'  => '2007-12-03' ],
+     [ '3.7.2'  => '2006-05-03' ],
+     [ '3.7.1'  => '2006-05-03' ],
+     [ '3.7.0'  => '2006-04-26' ],
+     [ '3.6.2'  => '2005-06-17' ],
+     [ '3.6.1'  => '2003-08-19' ],
+     [ '3.6.0'  => '2003-07-09' ],
+     [ '3.5.10' => '2003-05-10' ],
+     [ '3.5.9'  => '2003-03-07' ],
+     [ '3.5.8'  => '2002-11-15' ],
+     [ '3.5.7'  => '2002-08-31' ],
+     [ '3.5.6'  => '2001-07-25' ],
+     [ '3.5.5'  => '2001-06-01' ],
+     [ '3.5.4'  => '2001-04-28' ],
+     [ '3.5.3'  => '2001-04-15' ],
+     [ '3.5.2'  => '2001-02-18' ],
+     [ '3.5.1'  => '2001-02-15' ],
+     [ '3.5.0'  => '2001-01-29' ],
+     [ '3.2.1'  => '2000-08-24' ],
+     [ '3.2.0'  => '2000-07-30' ],
+     [ '3.1.1'  => '1999-11-16' ],
+     [ '3.1.0'  => '1999-11-04' ],
+     [ '3.0.1'  => '1999-07-15' ],
+     [ '3.0.0'  => '1999-07-01' ],
+     [ '2.5.1'  => '1999-04-27' ],
+     [ '2.5.0'  => '1998-10-29' ],
+     [ '2.4.1'  => '1998-04-14' ],
+     [ '2.4.0'  => '1998-01-30' ],
+     [ '2.3.0'  => '1997-09-01' ],
+     [ '2.2.0'  => '1997-07-13' ],
+     [ '2.1.3'  => '1997-03-15' ],
+     [ '2.1.2'  => '1996-11-23' ],
+     [ '2.1.1'  => '1996-09-12' ],
+     [ '2.1.0'  => '1996-09-01' ],
+     [ '2.0.1'  => '1996-08-31' ],
+     [ '2.0.0'  => '1996-08-26' ],
+     [ '0.2.1'  => '1996-08-23' ],
+     [ '0.2.0'  => '1996-08-21' ]);
+my %standards = map { $$_[0] => $$_[1] } @standards;
+my $current = $standards[0][0];
+my @current = split (/\./, $current);
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+my $info = shift;
+
+# udebs aren't required to conform to policy, so they don't need
+# Standards-Version. (If they have it, though, it should be valid.)
+my $version = $info->field('standards-version');
+if (not defined $version) {
+    tag 'no-standards-version-field' unless $type eq 'udeb';
+    return 0;
+}
+
+# Check basic syntax and strip off the fourth digit.  People are allowed to
+# include the fourth digit if they want, but it indicates a non-normative
+# change in Policy and is therefore meaningless in the Standards-Version
+# field.
+unless ($version =~ m/^\s*(\d+\.\d+\.\d+)(?:\.\d+)?\s*$/) {
+    tag 'invalid-standards-version', $version;
+    return 0;
+}
+my $stdver = $1;
+my ($major, $minor, $patch) = $stdver =~ m/^(\d+)\.(\d+)\.(\d+)/;
+
+# To do some date checking, we have to get the package date from the changelog
+# file.  If we can't find the changelog file, assume that the package was
+# released today, since that activates the most tags.
+my $changes = $info->changelog;
+my $pkgdate;
+if (defined $changes) {
+    my ($entry) = $changes->data;
+    $pkgdate = $entry ? $entry->Timestamp : 0;
+} else {
+    $pkgdate = time;
+}
+
+# Check for packages dated prior to the date of release of the standards
+# version with which they claim to comply.
+if ($standards{$stdver} && str2time($standards{$stdver}, '+0000') > $pkgdate) {
+    my $pretty = strftime ('%Y-%m-%d', gmtime $pkgdate);
+    tag 'timewarp-standards-version', "($pretty < $standards{$stdver})";
+}
+
+my $tag = "$version (current is $current)";
+if (not exists $standards{$stdver}) {
+    # Unknown standards version.  Perhaps newer?
+    if (   ($major > $current[0])
+        or ($major == $current[0] and $minor > $current[1])
+        or ($major == $current[0] and $minor == $current[1]
+            and $patch > $current[2])) {
+        tag 'newer-standards-version', $tag;
+    } else {
+        tag 'invalid-standards-version', $version;
+    }
+} elsif ($stdver eq $current) {
+    # Current standard.  Nothing more to check.
+    return 0;
+} else {
+    # Otherwise, we need to see if the standard that this package declares is
+    # both new enough to not be ancient and was the current standard at the
+    # time the package was uploaded.
+    #
+    # A given standards version is considered obsolete if the version
+    # following it has been out for at least two years (so the current version
+    # is never obsolete).
+    my $obsdate = time;
+    for my $index (0 .. $#standards) {
+        if ($standards[$index][0] eq $stdver) {
+            $obsdate = $standards[$index - 1][1] if $index > 0;
+            last;
+        }
+    }
+    if (str2time($obsdate, '+0000') + (60 * 60 * 24 * 365 * 2) < time) {
+        tag 'ancient-standards-version', $tag;
+    } else {
+        # We have to get the package date from the changelog file.  If we
+        # can't find the changelog file, always issue the tag.
+        my $changes = $info->changelog;
+        if (not defined $changes) {
+            tag 'out-of-date-standards-version', $tag;
+            return 0;
+        }
+        my ($entry) = $changes->data;
+        my $timestamp = $entry ? $entry->Timestamp : 0;
+        for my $standard (@standards) {
+            last if $standard->[0] eq $stdver;
+            if (str2time($standard->[1], '+0000') < $timestamp) {
+                tag 'out-of-date-standards-version', $tag;
+                last;
+            }
+        }
+    }
+}
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/checks/standards-version.desc b/nokia-lintian/checks/standards-version.desc
new file mode 100644 (file)
index 0000000..9b259e9
--- /dev/null
@@ -0,0 +1,60 @@
+Check-Script: standards-version
+Author: Christian Schwarz <schwarz@debian.org>
+Abbrev: std
+Type: source
+Unpack-Level: 1
+Info: This script checks if a source package contains a valid
+ Standards-Version field.
+Needs-Info: debfiles
+
+Tag: no-standards-version-field
+Type: error
+Ref: policy 5.6.11
+Info: The source package does not have a Standards-Version control field.
+ Please update your package to latest Policy and set this control field
+ appropriately.
+
+Tag: invalid-standards-version
+Type: error
+Info: The source package refers to a Standards-Version which never
+ existed.  Please update your package to latest Policy and set this
+ control field appropriately.
+
+Tag: newer-standards-version
+Type: warning
+Info: The source package refers to a Standards-Version which is
+ newer than the highest one lintian is programmed to check.  If the source
+ package is correct, then please upgrade lintian to the newest version.
+ (If there is no newer lintian version, then please bug &maint; to make
+ one.)
+
+Tag: ancient-standards-version
+Type: warning
+Info: The source package refers to a Standards-Version that has been
+ obsolete for more than two years.  Please update your package to latest
+ Policy and set this control field appropriately.
+ .
+ If the package is already compliant with the current standards, you don't
+ have to re-upload the package just to adjust the Standards-Version
+ control field.  However, please remember to update this field next time
+ you upload the package.
+
+Tag: out-of-date-standards-version
+Type: warning
+Info: The source package refers to a Standards-Version older than the one
+ that was current at the time the package was created (according to the
+ timestamp of the latest <tt>debian/changelog</tt> entry).  Please
+ consider updating the package to current Policy and setting this control
+ field appropriately.
+ .
+ If the package is already compliant with the current standards, you don't
+ have to re-upload the package just to adjust the Standards-Version
+ control field.  However, please remember to update this field next time
+ you upload the package.
+
+Tag: timewarp-standards-version
+Type: warning
+Info: The source package refers to a Standards-Version that was released
+ after the date of the most recent <tt>debian/changelog</tt> entry.
+ Perhaps you forgot to update the timestamp in <tt>debian/changelog</tt>
+ before building the package?
diff --git a/nokia-lintian/checks/version-substvars b/nokia-lintian/checks/version-substvars
new file mode 100644 (file)
index 0000000..9103693
--- /dev/null
@@ -0,0 +1,96 @@
+# version-substvars -- lintian check script -*- perl -*-
+#
+# Copyright (C) 2006 Adeodato Simó
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# SUMMARY
+# =======
+#
+# What breaks
+# -----------
+#
+# (b1) any -> any (= ${source:Version})                 -> use b:V
+# (b2) any -> all (= ${Source-Version}) [or b:V] -> use s:V
+# (b3) all -> any (= ${either-of-them})                 -> use (>= ${s:V}),
+#                                                  optionally (<< ${s:V}.1~)
+#
+# Always warn on ${Source-Version} even if it doesn't break since the substvar
+# is now considered deprecated.
+
+package Lintian::version_substvars;
+use strict;
+
+use Util;
+use Tags;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+my @control_data = read_dpkg_control("debfiles/control");
+my @dep_fields = qw(depends pre-depends recommends suggests conflicts replaces);
+
+shift @control_data; # skip source info entry
+
+foreach (@control_data) {
+       my ($pkg1, $pkg1_is_any, $pkg2, $pkg2_is_any, $substvar_strips_binNMU);
+
+       $pkg1 = $_->{'package'};
+       $pkg1_is_any = ($_->{'architecture'} ne 'all');
+
+       foreach my $field (@dep_fields) {
+               next unless $_->{$field};
+               if ($_->{$field} =~ m/\${Source-Version}/) {
+                       tag "substvar-source-version-is-deprecated", $pkg1;
+               }
+       }
+
+       foreach (split(m/,/, ($_->{'pre-depends'} || "").", ".
+                      ($_->{'depends'} || ""))) {
+               next unless m/(\S+)\s*\(\s*=\s*\${((?:Source-|source:|binary:)Version)}/x;
+
+               $pkg2 = $1;
+               $substvar_strips_binNMU = ($2 eq 'source:Version');
+
+               if (not -f "control/$pkg2/architecture") {
+                       tag "version-substvar-for-external-package", "$pkg1 -> $pkg2";
+                       next;
+               }
+               $pkg2_is_any = (slurp_entire_file("control/$pkg2/architecture") !~ m/^all$/);
+
+               if ($pkg1_is_any) {
+                       if ($pkg2_is_any and $substvar_strips_binNMU) {
+                               # (b1) any -> any (= ${source:Version})
+                               tag "not-binnmuable-any-depends-any", "$pkg1 -> $pkg2";
+                       } elsif (not $pkg2_is_any and not $substvar_strips_binNMU) {
+                               # (b2) any -> all (= ${Source-Version}) [or b:V]
+                               tag "not-binnmuable-any-depends-all", "$pkg1 -> $pkg2";
+                       }
+               } elsif ($pkg2_is_any) {
+                       # (b3) all -> any (= ${either-of-them})
+                       tag "not-binnmuable-all-depends-any", "$pkg1 -> $pkg2";
+               }
+       }
+}
+
+}
+
+1;
+
+# vim: syntax=perl sw=4 ts=4 noet shiftround
diff --git a/nokia-lintian/checks/version-substvars.desc b/nokia-lintian/checks/version-substvars.desc
new file mode 100644 (file)
index 0000000..ecf2bc0
--- /dev/null
@@ -0,0 +1,50 @@
+Check-Script: version-substvars
+Author: Adeodato Simó <dato@net.com.org.es>
+Abbrev: v-s
+Type: source
+Unpack-Level: 1
+Needs-Info: debfiles, source-control-file
+Info: This script checks for correct use of the various *Version
+ substvars, e.g. deprecated substvars, or usage that can cause
+ un-binNMUability
+
+Tag: not-binnmuable-any-depends-any
+Type: error
+Info: The package is not safely binNMUable because an arch:any package
+ depends on another arch:any package with a (= ${source:Version})
+ relationship. Please use (= ${binary:Version}) instead.
+
+Tag: not-binnmuable-any-depends-all
+Type: warning
+Info: The package is not safely binNMUable because an arch:any package
+ depends on an arch:all package with a (= ${Source-Version}) or
+ (= ${binary:Version}) relationship. Please use (= ${source:Version})
+ instead.
+
+Tag: not-binnmuable-all-depends-any
+Type: warning
+Info: The package is not safely binNMUable because an arch:all package
+ depends on an arch:any package with a strict (= ${Source-Version}), or
+ similar, relationship.
+ .
+ It is not possible for arch:all packages to depend so strictly on
+ arch:any packages while having the package binNMUable, so please use
+ one of these, whichever is more appropriate:
+ .
+   Depends: arch_any (&gt;= ${source:Version})
+   Depends: arch_any (&gt;= ${source:Version}),
+    arch_any (&lt;&lt; ${source:Version}.1~)
+
+Tag: version-substvar-for-external-package
+Type: error
+Info: The first package has a dependency on the second package that uses
+ (= ${binary:Version}), (= ${source:Version}), or (= ${Source-Version}),
+ but the second package is not built from this source package.  Usually
+ this means there is a mistake in the package name in this dependency.
+
+Tag: substvar-source-version-is-deprecated
+Type: warning
+Info: The package uses the now deprecated ${Source-Version} substvar,
+ which has misleading semantics. Please switch to ${binary:Version} or
+ ${source:Version} as appropriate. Support for ${Source-Version} may be
+ removed from dpkg-dev in the future.
diff --git a/nokia-lintian/checks/watch-file b/nokia-lintian/checks/watch-file
new file mode 100644 (file)
index 0000000..37c1afe
--- /dev/null
@@ -0,0 +1,117 @@
+# watch-file -- lintian check script -*- perl -*-
+#
+# Copyright (C) 2008 Patrick Schoenfeld
+# Copyright (C) 2008 Russ Allbery
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::watch_file;
+use strict;
+
+use Lintian::Collect;
+use Tags;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+my $info = shift;
+
+if (! -f "debfiles/watch") {
+    tag 'debian-watch-file-is-missing' unless ($info->native);
+    return;
+}
+
+# Perform the other checks even if it is a native package
+tag 'debian-watch-file-in-native-package' if ($info->native);
+
+# Check if the Debian version contains anything that resembles a repackaged
+# source package sign, for fine grained version mangling check
+my $version = $info->field('version');
+my $repack;
+if ($version =~ /(dfsg|debian|ds)/) {
+    $repack = $1;
+}
+
+# Gather information from the watch file and look for problems we can
+# diagnose on the first time through.
+open(WATCH, '<', 'debfiles/watch') or fail("cannot open watch file: $!");
+local $_;
+my ($watchver, $mangle, $dmangle);
+while (<WATCH>) {
+    next if /^\s*\#/;
+    next if /^\s*$/;
+    s/^\s*//;
+    if (s/(?<!\\)\\$//) {
+        # This is caught by uscan.
+        last if eof(WATCH);
+        $_ .= <WATCH>;
+    }
+
+    if (/^version\s*=\s*(\d+)(\s|\Z)/) {
+        if (defined $watchver) {
+            tag 'debian-watch-file-declares-multiple-versions', "line $.";
+        }
+        $watchver = $1;
+        if ($watchver ne '2' and $watchver ne '3') {
+            tag 'debian-watch-file-unknown-version', $watchver;
+        }
+    } else {
+        unless (defined($watchver)) {
+            tag 'debian-watch-file-missing-version';
+            $watchver = 1;
+        }
+        while (s/\\\s*$//) {
+            $_ .= <WATCH>;
+        }
+        chomp;
+        my ($opts, @opts);
+        if (s/^opt(ion)?s=\"([^\"]+)\"\s+// || s/^opt(ion)?s=(\S+)\s+//) {
+            $opts = $2;
+            @opts = split(',', $opts);
+            if (defined $repack) {
+                for (@opts) {
+                    $mangle = 1 if /^[ud]versionmangle.*=.*($repack)/;
+                    $dmangle = 1 if /^dversionmangle.*=.*($repack)/;
+                }
+            }
+        }
+        if (m%qa\.debian\.org/watch/sf\.php\?%) {
+            tag 'debian-watch-file-uses-deprecated-sf-redirector-method';
+        }
+    }
+}
+close WATCH;
+
+# If the version of the package contains dfsg, assume that it needs to be
+# mangled to get reasonable matches with upstream.
+if ($repack and not $mangle) {
+    tag 'debian-watch-file-should-mangle-version';
+}
+if ($repack and $mangle and not $dmangle) {
+    tag 'debian-watch-file-should-dversionmangle-not-uversionmangle';
+}
+
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/checks/watch-file.desc b/nokia-lintian/checks/watch-file.desc
new file mode 100644 (file)
index 0000000..83e7874
--- /dev/null
@@ -0,0 +1,84 @@
+Check-Script: watch-file
+Author: Patrick Schoenfeld <schoenfeld@in-medisa-res.com>
+Abbrev: watch
+Type: source
+Unpack-Level: 1
+Needs-Info: debfiles
+Info: Check debian/watch files in source packages.
+
+Tag: debian-watch-file-is-missing
+Type: info
+Ref: policy 4.11, uscan(1)
+Info: This source package is not Debian-native but it does not have a
+ <tt>debian/watch</tt> file.  This file is used for automatic detection of
+ new upstream versions by the Debian External Health Status project and
+ other project infrastructure.  If this package is maintained upstream,
+ please consider adding a <tt>debian/watch</tt> file to detect new
+ releases.
+ .
+ If the package is not maintained upstream or if upstream uses a
+ distribution mechanism that cannot be meaningfully monitored by uscan
+ and the Debian External Health Status project, please consider adding a
+ <tt>debian/watch</tt> file containing only comments documenting the
+ situation.
+
+Tag: debian-watch-file-declares-multiple-versions
+Type: warning
+Ref: uscan(1)
+Info: The <tt>debian/watch</tt> file in this package contains multiple
+ lines starting with <tt>version=</tt>.  There should be only one version
+ declaration in a watch file, on the first non-comment line of the file.
+
+Tag: debian-watch-file-unknown-version
+Type: warning
+Ref: uscan(1)
+Info: The <tt>version=</tt> line in the <tt>debian/watch</tt> file in this
+ package declares an unknown version.  The currently known watch file
+ versions are 2 and 3.
+
+Tag: debian-watch-file-missing-version
+Type: warning
+Ref: uscan(1)
+Info: The <tt>debian/watch</tt> file in this package doesn't start a
+ <tt>version=</tt> line.  The first non-comment line of
+ <tt>debian/watch</tt> should be a <tt>version=</tt> declaration.  This
+ may mean that this is an old version one watch file that should be
+ updated to the current version.
+
+Tag: debian-watch-file-should-mangle-version
+Type: warning
+Ref: uscan(1), http://wiki.debian.org/DEHS
+Info: The version of this package contains <tt>dfsg</tt>, <tt>ds</tt>,
+ or <tt>debian</tt>, which normally indicates that the upstream source
+ has been repackaged to comply with the Debian Free Software Guidelines
+ (or similar reason), but there is no version mangling in the
+ <tt>debian/watch</tt> file.  Since the <tt>dfsg</tt> string is not
+ part of the upstream version, the <tt>debian/watch</tt> file should
+ use the dversionmangle option to remove the <tt>dfsg</tt> before
+ version number comparison.
+
+Tag: debian-watch-file-should-dversionmangle-not-uversionmangle
+Type: info
+Ref: http://wiki.debian.org/DEHS
+Info: The version of this package contains <tt>dfsg</tt>, <tt>ds</tt>,
+ or <tt>debian</tt>, but a misleading upstream version mangling occurs in
+ the <tt>debian/watch</tt> file.  Since the <tt>dfsg</tt> string is not
+ part of the upstream version and its addition is Debian-specific, the
+ the <tt>debian/watch</tt> file should use the dversionmangle option to
+ remove, instead of adding in uversionmangle, the <tt>dfsg</tt> before
+ comparing version numbers.
+
+Tag: debian-watch-file-in-native-package
+Type: warning
+Ref: http://wiki.debian.org/DEHS
+Info: The package ships a watch file although it is a Debian native
+ package.  DEHS does not process watch files in native packages based on
+ the reasoning that native packages do not have upstreams to check for new
+ releases.
+
+Tag: debian-watch-file-uses-deprecated-sf-redirector-method
+Type: warning
+Info: The watch file seems to be passing arguments to the redirector
+ other than a path. Calling the SourceForge redirector with parameters like
+ <tt>project</tt> prevents uscan from generating working uri's to the files
+ and thus has been deprecated and is no longer supported by the redirector.
diff --git a/nokia-lintian/collection/changelog-file b/nokia-lintian/collection/changelog-file
new file mode 100755 (executable)
index 0000000..71ff88e
--- /dev/null
@@ -0,0 +1,129 @@
+#!/usr/bin/perl -w
+# changelog-file -- lintian collector script
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: changelog-file <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "fields/package" or fail("changelog-file invoked in wrong directory");
+
+unlink("changelog");
+
+# Pick the first of these files that exists.
+my @changelogs = ("unpacked/usr/share/doc/$pkg/changelog.Debian.gz",
+              "unpacked/usr/share/doc/$pkg/changelog.Debian",
+              "unpacked/usr/share/doc/$pkg/changelog.debian.gz",
+              "unpacked/usr/share/doc/$pkg/changelog.debian",
+              "unpacked/usr/share/doc/$pkg/changelog.gz",
+              "unpacked/usr/share/doc/$pkg/changelog",
+              "unpacked/usr/doc/$pkg/changelog.Debian.gz",
+              "unpacked/usr/doc/$pkg/changelog.Debian",
+              "unpacked/usr/doc/$pkg/changelog.debian.gz",
+              "unpacked/usr/doc/$pkg/changelog.debian",
+              "unpacked/usr/doc/$pkg/changelog.gz",
+              "unpacked/usr/doc/$pkg/changelog");
+
+my $chl;
+
+for (@changelogs) {
+    if (-l $_ || -f $_) {
+       $chl = $_;
+       last;
+    }
+}
+
+# If the changelog file we found was a symlink, we have to be careful.  It
+# could be a symlink to some file outside of the laboratory and we don't want
+# to end up reading that file by mistake.  Relative links within the same
+# directory or to a subdirectory we accept; anything else is replaced by an
+# intentinally broken symlink so that checks can do the right thing.
+if (defined ($chl) && -l $chl) {
+    my $link = readlink $chl or fail("cannot readlink $chl: $!");
+    if ($link =~ /\.\./ || ($link =~ m%/% && $link !~ m%^[^/]+(/+[^/]+)*\z%)) {
+       symlink('file-is-in-another-package', 'changelog')
+           or fail("cannot create changelog symlink: $!");
+       undef $chl;
+    } elsif (! -f $chl) {
+        undef $chl;
+    }
+}
+
+# If the changelog was a broken symlink, it will be undefined and we'll now
+# treat it the same as if we didn't find a changelog and do nothing.  If it
+# was a symlink, copy the file, since otherwise the relative symlinks are
+# going to break things.
+if (not defined $chl) {
+    # no changelog found
+} elsif ($chl =~ /\.gz$/) {
+    use lib "$ENV{'LINTIAN_ROOT'}/lib";
+    use Pipeline;
+
+    pipeline((sub { exec 'gzip', '-dc', $chl }), "changelog") == 0
+       or fail("error in gzip");
+} elsif (-f $chl && -l $chl) {
+    local $_;
+    open (CHL, '<', $chl) or fail("cannot open $chl: $!");
+    open (COPY, '>', 'changelog') or fail("cannot create changelog: $!");
+    print COPY while <CHL>;
+    close CHL;
+    close COPY;
+} else {
+    link($chl, "changelog")
+       or fail("cannot link $chl to changelog: $!");
+}
+
+# Extract NEWS.Debian files as well, with similar precautious.  Ignore any
+# symlinks to other packages here; in that case, we just won't check the file.
+my $news = "unpacked/usr/share/doc/$pkg/NEWS.Debian.gz";
+if (-f $news) {
+    if (-l $news) {
+        my $link = readlink $news or fail("cannot readlink $chl: $!");
+        if ($link =~ /\.\./ || ($link =~ m%/% && $link !~ m%^[^/]+(/+[^/]+)*\z%)) {
+            undef $news;
+        } elsif (! -f $news) {
+            undef $news;
+        }
+    }
+    if ($news) {
+        use lib "$ENV{'LINTIAN_ROOT'}/lib";
+        use Pipeline;
+
+        pipeline((sub { exec 'gzip', '-dc', $news }), "NEWS.Debian") == 0
+            or fail("error in gzip");
+    }
+}
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/changelog-file.desc b/nokia-lintian/collection/changelog-file.desc
new file mode 100644 (file)
index 0000000..bdb47b6
--- /dev/null
@@ -0,0 +1,9 @@
+Collector-Script: changelog-file
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script copies the <tt>changelog</tt> file and
+ <tt>NEWS.Debian</tt> file (if any) of a package into the lintian
+ directory.
+Type: binary
+Unpack-Level: 2
+Output: changelog
+Order: 1
diff --git a/nokia-lintian/collection/copyright-file b/nokia-lintian/collection/copyright-file
new file mode 100755 (executable)
index 0000000..0146dad
--- /dev/null
@@ -0,0 +1,67 @@
+#!/usr/bin/perl -w
+# copyright-file -- lintian collector script
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: copyright-file <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "fields/package" or fail("copyright-file invoked in wrong directory");
+
+unlink("copyright");
+
+my $file1 = "unpacked/usr/share/doc/$pkg/copyright";
+my $file2 = "unpacked/usr/doc/$pkg/copyright";
+
+my $file;
+if (-f $file1 ) { $file = $file1; }
+else { $file = $file2; }
+
+if (-f $file) {
+    link($file, "copyright")
+       or fail("cannot link $file to copyright: $!");
+} elsif (-f "$file.gz") {
+    use lib "$ENV{'LINTIAN_ROOT'}/lib";
+    use Pipeline;
+
+    pipeline((sub { exec 'gzip', '-dc', $file }), "copyright") == 0
+       or fail("error in gzip");
+} else {
+    # no copyright file found
+    open(DUMMY, ">copyright");
+    close(DUMMY);
+}
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/copyright-file.desc b/nokia-lintian/collection/copyright-file.desc
new file mode 100644 (file)
index 0000000..53edd99
--- /dev/null
@@ -0,0 +1,7 @@
+Collector-Script: copyright-file
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script copies the `copyright' file of a package into the lintian directory.
+Type: binary
+Unpack-Level: 2
+Output: copyright
+Order: 1
diff --git a/nokia-lintian/collection/debfiles b/nokia-lintian/collection/debfiles
new file mode 100755 (executable)
index 0000000..b443caa
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/perl -w
+# debfiles -- lintian collector script
+
+# Copyright (C) 1999 by Joey Hess
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: debfiles <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-e "unpacked" or fail("debfiles invoked in wrong directory");
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+if (-e "debfiles") {
+    spawn('rm', '-rf', 'debfiles') == 0
+       or fail("cannot rm old debfiles directory");
+}
+
+mkdir('debfiles', 0777) or fail("cannot mkdir debfiles: $!");
+
+# Don't copy the whole directory, just all files in it.
+opendir(DEBIAN, 'unpacked/debian')
+       or fail("cannot open unpacked/debian/ directory: $!");
+while (my $file=readdir(DEBIAN)) {
+       next if -d $file;
+       spawn('cp', '-a', "unpacked/debian/$file", 'debfiles/') == 0
+               or fail("cannot copy unpacked/debian/$file: $!");
+}
+closedir(DEBIAN);
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/debfiles.desc b/nokia-lintian/collection/debfiles.desc
new file mode 100644 (file)
index 0000000..0caf69b
--- /dev/null
@@ -0,0 +1,8 @@
+Collector-Script: debfiles
+Author: Joey Hess <joeyh@debian.org>
+Info: This script collects files shipped in the source of the
+ package.
+Type: source
+Unpack-Level: 2
+Output: debfiles
+Order: 1
diff --git a/nokia-lintian/collection/debian-readme b/nokia-lintian/collection/debian-readme
new file mode 100755 (executable)
index 0000000..364d496
--- /dev/null
@@ -0,0 +1,78 @@
+#!/usr/bin/perl -w
+# debian-readme -- lintian collector script
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: debian-readme <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "fields/package" or fail("debian-readme invoked in wrong directory");
+
+unlink("README.Debian");
+
+# Pick the first of these files that exists.
+my @readmes = ("unpacked/usr/share/doc/$pkg/README.Debian.gz",
+           "unpacked/usr/share/doc/$pkg/README.Debian",
+           "unpacked/usr/share/doc/$pkg/README.debian.gz",
+           "unpacked/usr/share/doc/$pkg/README.debian",
+        "unpacked/usr/doc/$pkg/README.Debian.gz",
+           "unpacked/usr/doc/$pkg/README.Debian",
+           "unpacked/usr/doc/$pkg/README.debian.gz",
+           "unpacked/usr/doc/$pkg/README.debian");
+
+my $file;
+for (@readmes) {
+    if (-f $_) {
+       $file = $_;
+       last;
+    }
+}
+
+if (not defined $file) {
+    # no README found
+    open(DUMMY, '>', "README.Debian");
+    close(DUMMY);
+} elsif ($file =~ m/\.gz$/) {
+    use lib "$ENV{'LINTIAN_ROOT'}/lib";
+    use Pipeline;
+
+    pipeline((sub { exec 'gzip', '-dc', $file }), "README.Debian") == 0
+       or fail("error in gzip");
+} else {
+    link($file, "README.Debian")
+       or fail("cannot link $file to README.Debian: $!");
+}
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/debian-readme.desc b/nokia-lintian/collection/debian-readme.desc
new file mode 100644 (file)
index 0000000..6f0d766
--- /dev/null
@@ -0,0 +1,7 @@
+Collector-Script: debian-readme
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script copies the `README.Debian' file of a package into the lintian directory.
+Type: binary
+Unpack-Level: 2
+Output: README.Debian
+Order: 1
diff --git a/nokia-lintian/collection/diffstat b/nokia-lintian/collection/diffstat
new file mode 100755 (executable)
index 0000000..28f77e0
--- /dev/null
@@ -0,0 +1,84 @@
+#!/usr/bin/perl -w
+# diffstat -- lintian collection script for source packages
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# This could be written more easily in shell script, but I'm trying
+# to keep everything as perl to cut down on the number of processes
+# that need to be started in a lintian scan.  Eventually all the
+# perl code will be perl modules, so only one perl interpreter
+# need be started.
+
+use strict;
+
+my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'} || '/usr/share/lintian';
+
+($#ARGV == 1) or fail("syntax: diffstat <pkg>");
+my $pkg = shift;
+
+-f "fields/version" or fail("diffstat invoked in wrong directory");
+
+open (V, '<', "fields/version") or fail("cannot open fields/version: $!");
+my $ver = <V>; chomp $ver;
+close V;
+
+$ver =~ s/^\d://; #Remove epoch for this
+
+my $diff_file = "${pkg}_${ver}.diff.gz";
+unless (-f $diff_file) {
+# we have to write an empty file so that the checks don't crap out. <sigh>
+  open (D, '>', "diffstat"); close D;
+  exit 0;
+}
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+pipeline((sub { exec('gzip', '-dc', $diff_file); }),
+         "debian-patch"
+        );
+
+open (STAT, '>', "diffstat") or fail("cannot open scripts output file: $!");
+# diffstat is noisy on stderr if its stdout is not a tty.
+# Shut it up by redirecting stderr to /dev/null.
+open STDERR, ">/dev/null";
+open (DIFF, '-|', qw/diffstat -p1 debian-patch/)
+  or fail("cannot open pipe to diffstat on debian-patch: $!");
+# Copy all except last line to the STAT file
+my $previous;
+while (<DIFF>) {
+    print STAT $previous if $previous;
+    $previous = $_;
+}
+close DIFF or fail("cannot close pipe to diffstat on debian-patch: $!");
+close STAT or fail("error writing diffstat file: $!");
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/diffstat.desc b/nokia-lintian/collection/diffstat.desc
new file mode 100644 (file)
index 0000000..2a6ad70
--- /dev/null
@@ -0,0 +1,8 @@
+Collector-Script: diffstat
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script extracts the Debian diff of a source package, and runs
+ diffstat on it, leaving the result in the diffstat output file
+Type: source
+Unpack-Level: 1
+Output: diffstat
+Order: 1
diff --git a/nokia-lintian/collection/doc-base-files b/nokia-lintian/collection/doc-base-files
new file mode 100755 (executable)
index 0000000..b51f317
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/perl -w
+# doc-base-files -- lintian collector script
+
+# Copyright (C) 1998 Richard Braakman
+# Copyright (C) 2001 Josip Rodin
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: doc-base-files <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "fields/package" or fail("doc-base-files invoked in wrong directory");
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+if (-e "doc-base") {
+    spawn('rm', '-rf', 'doc-base') == 0
+       or fail("cannot rm old doc-base directory");
+}
+
+if (-d "unpacked/usr/share/doc-base") {
+    spawn('cp', '-a', 'unpacked/usr/share/doc-base', 'doc-base') == 0
+       or fail("cannot copy directory unpacked/usr/share/doc-base");
+} else {
+    # no doc-base directory
+    mkdir("doc-base", 0777) or fail("cannot mkdir doc-base: $!");
+}
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/doc-base-files.desc b/nokia-lintian/collection/doc-base-files.desc
new file mode 100644 (file)
index 0000000..fbe5d7e
--- /dev/null
@@ -0,0 +1,8 @@
+Collector-Script: doc-base-files
+Author: Josip Rodin <jrodin@jagor.srce.hr>
+Info: This script copies the contents of /usr/share/doc-base into the
+ lintian doc-base/ directory.
+Type: binary
+Unpack-Level: 2
+Output: doc-base
+Order: 1
diff --git a/nokia-lintian/collection/file-info b/nokia-lintian/collection/file-info
new file mode 100755 (executable)
index 0000000..df58bc4
--- /dev/null
@@ -0,0 +1,69 @@
+#!/usr/bin/perl -w
+# file-info -- lintian collection script
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: file-info <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "fields/package" or fail("file-info invoked in wrong directory");
+
+unlink("file-info");
+chdir("unpacked")
+    or fail("cannot chdir to unpacked directory: $!");
+
+use FileHandle;
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+my $XARGS=FileHandle->new;
+pipeline_open($XARGS, (sub { exec 'xargs', '-0r', 'file' }), "../file-info")
+    or fail("cannot fork: $!");
+open(INDEX, '<', "../index")
+    or fail("cannot open index file: $!");
+while (<INDEX>) {
+    chop;
+    $_ = (split(" ", $_, 6))[5];
+    s/ link to .*//;
+    s/ -> .*//;
+    s/(\G|[^\\](?:\\\\)*)\\(\d{3})/"$1" . chr(oct $2)/ge;
+    s/\\\\/\\/;
+    printf $XARGS "%s\0", $_;
+}
+close(INDEX);
+
+close($XARGS) or fail("xargs for file exited with code $?");
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/file-info.desc b/nokia-lintian/collection/file-info.desc
new file mode 100644 (file)
index 0000000..2e49543
--- /dev/null
@@ -0,0 +1,7 @@
+Collector-Script: file-info
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script runs the `file' command over all files of a binary package.
+Type: binary, udeb
+Unpack-Level: 2
+Output: file-info
+Order: 1
diff --git a/nokia-lintian/collection/init.d b/nokia-lintian/collection/init.d
new file mode 100755 (executable)
index 0000000..e8d33c8
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+# init.d -- lintian collector script
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: init.d <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "fields/package" or fail("init.d invoked in wrong directory");
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+if (-e "init.d") {
+    spawn('rm', '-rf', 'init.d') == 0
+       or fail("cannot rm old init.d directory");
+}
+
+if (-d "unpacked/etc/init.d") {
+    spawn('cp', '-a', 'unpacked/etc/init.d', 'init.d') == 0
+       or fail("cannot copy init.d directory");
+} else {
+    # no etc/init.d
+    mkdir("init.d", 0777) or fail("cannot mkdir init.d: $!");
+}
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/init.d.desc b/nokia-lintian/collection/init.d.desc
new file mode 100644 (file)
index 0000000..f75b6e4
--- /dev/null
@@ -0,0 +1,7 @@
+Collector-Script: init.d
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script copies the `etc/init.d' directory into the lintian directory.
+Type: binary
+Unpack-Level: 2
+Output: init.d
+Order: 1
diff --git a/nokia-lintian/collection/md5sums b/nokia-lintian/collection/md5sums
new file mode 100755 (executable)
index 0000000..7174bf2
--- /dev/null
@@ -0,0 +1,69 @@
+#!/usr/bin/perl -w
+# md5sums -- lintian collection script
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: md5sums <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "fields/package" or fail("md5sums invoked in wrong directory");
+
+unlink("md5sums");
+chdir("unpacked")
+    or fail("cannot chdir to unpacked directory: $!");
+
+use FileHandle;
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+my $XARGS=FileHandle->new;
+pipeline_open($XARGS, (sub { exec 'xargs', '-0r', 'md5sum' }), "../md5sums")
+    or fail("cannot fork: $!");
+open(INDEX, '<', "../index")
+    or fail("cannot open index file: $!");
+while (<INDEX>) {
+    next unless m/^-/;
+    chop;
+    $_ = (split(" ", $_, 6))[5];
+    s/ link to .*//;
+    s/\\(\d+)/chr(oct($1))/eg;
+    s/\\\\/\\/g;
+    printf $XARGS "%s\0", $_;
+}
+close(INDEX);
+
+close($XARGS) or fail("xargs for md5sum exited with code $?");
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/md5sums.desc b/nokia-lintian/collection/md5sums.desc
new file mode 100644 (file)
index 0000000..b7db525
--- /dev/null
@@ -0,0 +1,7 @@
+Collector-Script: md5sums
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script runs the `md5sums' over all files in a binary package.
+Type: binary, udeb
+Unpack-Level: 2
+Output: md5sums
+Order: 1
diff --git a/nokia-lintian/collection/menu-files b/nokia-lintian/collection/menu-files
new file mode 100755 (executable)
index 0000000..bf7390e
--- /dev/null
@@ -0,0 +1,70 @@
+#!/usr/bin/perl -w
+# menu-files -- lintian collector script
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: menu-files <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "fields/package" or fail("menu-files invoked in wrong directory");
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+if (-e "menu") {
+    spawn('rm', '-rf', 'menu') == 0
+       or fail("cannot rm old menu directory");
+}
+
+mkdir("menu", 0777) or fail("cannot mkdir menu: $!");
+
+if (-d "unpacked/usr/lib/menu") {    
+    spawn('cp', '-a', 'unpacked/usr/lib/menu', 'menu/lib') == 0
+       or fail("cannot copy unpacked/usr/lib/menu/ directory");
+} else {
+    # no menu directory
+    mkdir("menu/lib", 0777) or fail("cannot mkdir menu/lib: $!");
+}
+
+if (-d "unpacked/usr/share/menu") {    
+    spawn('cp', '-a', 'unpacked/usr/share/menu', 'menu/share') == 0
+       or fail("cannot copy unpacked/usr/share/menu directory");
+} else {
+    # no menu directory
+    mkdir("menu/share", 0777) or fail("cannot mkdir menu/share: $!");
+}
+
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/menu-files.desc b/nokia-lintian/collection/menu-files.desc
new file mode 100644 (file)
index 0000000..2f87589
--- /dev/null
@@ -0,0 +1,7 @@
+Collector-Script: menu-files
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script copies the contents of /usr/lib/menu into the lintian menu/ directory.
+Type: binary
+Unpack-Level: 2
+Output: menu
+Order: 1
diff --git a/nokia-lintian/collection/objdump-info b/nokia-lintian/collection/objdump-info
new file mode 100755 (executable)
index 0000000..0e00763
--- /dev/null
@@ -0,0 +1,220 @@
+#!/usr/bin/perl -w
+# objdump-info -- lintian collection script
+
+# The original shell script version of this script is
+# Copyright (C) 1998 Christian Schwarz
+# 
+# This version, including support for etch's binutils, is
+# Copyright (C) 2008 Adam D. Barratt
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+# Sanity check
+unless (-f "fields/package") {
+    print STDERR "error: collection script called in wrong directory!\n";
+    exit 2;
+}
+
+my $failed = 0;
+
+open (FILES, '<', "file-info")
+    or fail("cannot open file-info: $!");
+
+open (OUT, '>', "objdump-info")
+    or fail("cannot open objdump-info: $!");
+
+open(PIPE, '-|', "dpkg-query -W -f='\${Version}\n' binutils")
+    or fail("unable to run dpkg-query: $!");
+my $binutils_version = <PIPE>;
+chomp $binutils_version;
+close PIPE;
+
+chdir ("unpacked")
+    or fail ("unable to chdir to unpacked: $!\n");
+
+while (<FILES>) {
+    if (m/^(.+?):\s.*ELF/) {
+       my $bin = $1;
+
+       print OUT "-- $bin\n";
+
+       system("head $bin | grep -q 'packed.*with.*UPX'");
+       print OUT "objdump: $bin: Packed with UPX" if $? == 0;
+
+       if (open(PIPE, '-|', "readelf -l $bin 2>&1")) {
+           local $/;
+           local $_ = <PIPE>;
+           print OUT $_;
+           close PIPE;
+       }
+
+       system("objdump -T $bin >/dev/null 2>&1");
+       if ($? == 0) {
+           # Seems happy so slurp the full output
+           if (open(PIPE, '-|', "objdump --headers --private-headers -T $bin 2>&1")) {
+               local $/;
+               local $_ = <PIPE>;
+               print OUT $_;
+               close PIPE;
+           }
+       } elsif ($binutils_version !~ m/^2\.17/) {
+           # etch's binutils (2.17) can't read 64-bit binaries on 32-bit
+           # platforms so we special-case that below
+           #
+           # Otherwise we allow the two specific errors "Invalid operation" and
+           # "File format not recognized" as the checks scripts handle them
+
+           # From the original script:
+           # If the objdump error is "Invalid operation", we handle it later
+           # in the check script, since this is the expected output (for now)
+           # on detached debugging information in /usr/lib/debug.
+
+           $failed = 1;
+           if (open(PIPE, '-|', "objdump --headers --private-headers -T $bin 2>&1")) {
+               while(<PIPE>) {
+                   $failed = 0 if m/Invalid operation$/;
+                   $failed = 0 if m/File format not recognized$/;
+
+                   print OUT $_;
+               }
+               close PIPE;
+           }
+
+           last if $failed;
+       } else {
+           # We're using etch's binutils so attempt to build an output file
+           # in the expected format without using objcopy; we lose some
+           # data but none that our later checks actually use
+           my @sections;
+           my @symbol_versions;
+
+           if (system("readelf -l $bin 2>&1 | grep -q 'Error: Not an ELF file'") == 0) {
+               print OUT "objdump: $bin: File format not recognized\n";
+               next;
+           } elsif (open(PIPE, '-|', "readelf -W -l -t -d -V $bin")) {
+               my $section = '';
+               my %program_headers;
+
+               while(<PIPE>) {
+                   chomp;
+                   if (m/^Program Headers:/) {
+                       $section = 'PH';
+                       print OUT "$_\n";
+                   } elsif (m/^Section Headers:/) {
+                       $section = 'SH';
+                       print OUT "$_\n";
+                   } elsif (m/^Dynamic section at offset .*:/) {
+                       $section = 'DS';
+                       print OUT "$_\n";
+                   } elsif (m/^Version symbols section /) {
+                       $section = 'VS';
+                   } elsif (m/^\s*$/) {
+                       $section = '';
+                   } elsif (m/^\s*(\S+)\s*(?:(?:\S+\s+){4})\S+\s(...)/
+                            and $section eq 'PH') {
+                       my ($header, $flags) = ($1, $2);
+                       $header =~ s/^GNU_//g;
+                       next if $header eq 'Type';
+
+                       my $newflags = '';
+                       $newflags .= ($flags =~ m/R/) ? 'r' : '-';
+                       $newflags .= ($flags =~ m/W/) ? 'w' : '-';
+                       $newflags .= ($flags =~ m/E/) ? 'x' : '-';
+
+                       $program_headers{$header} = $newflags;
+
+                       print OUT "  $header off 0x0 X 0x0 X 0x0\n  flags $newflags\n";
+                   } elsif (m/^\s*\[(\d+)\]\s*(\S+)(?:\s|\Z)/
+                            and $section eq 'SH') {
+                       $sections[$1] = $2;
+                   } elsif (m/^\s*0x(?:[0-9A-F]+)\s+\((.*?)\)\s+(\S.*)\Z/i
+                            and $section eq 'DS') {
+                       my ($type, $value) = ($1, $2);
+
+                       $value =~ s/^(?:Shared library|Library soname): \[(.*)\]/$1/;
+                       print OUT "  $type   $value\n";
+                   } elsif (m/^\s*[0-9A-F]+:\s*(\S+)\s*\((\S+)\)\s/i
+                            and $section eq 'VS') {
+                       while (m/\s(\S+)\s*\((\S+)\)(\s|\Z)/gc) {
+                           my ($vernum, $verstring) = ($1, $2);
+                           push @symbol_versions, $verstring;
+                       }
+                   } elsif (m/^There is no dynamic section in this file/
+                            and exists $program_headers{DYNAMIC}) {
+                       # The headers declare a dynamic section but it's
+                       # empty. Generate the same error as objdump,
+                       # the checks scripts special-case the string.
+                       print OUT "\n\nobjdump: $bin: Invalid operation\n";
+                   }
+               }
+               close PIPE;
+           }
+
+           if (open(PIPE, '-|', "readelf -W -s -D $bin")) {
+               print OUT "DYNAMIC SYMBOL TABLE:\n";
+
+               while(<PIPE>) {
+                   last if m/^Symbol table of/;
+
+                   if (m/^\s*(\d+)\s+\d+:\s*[0-9a-f]+\s+\d+\s+(?:(?:\S+\s+){3})(\S+)\s+(.*)\Z/) {
+                       my ($symnum, $seg, $sym, $ver) = ($1, $2, $3, '');
+
+                       if ($sym =~ m/^(.*)@(.*)$/) {
+                           $sym = $1;
+                           $ver = $2;
+                       } else {
+                           $ver = $symbol_versions[$symnum];
+
+                           if ($ver eq '*local*' or $ver eq '*global*') {
+                               if ($seg eq 'UND') {
+                                   $ver = '   ';
+                               } else {
+                                   $ver = 'Base';
+                               }
+                           }
+                       }
+
+                       if ($seg =~ m/^\d+$/ and defined $sections[$seg]) {
+                           $seg = $sections[$seg];
+                       }
+
+                       print OUT "00      XX $seg  000000  $ver  $sym\n";
+                   }
+               }
+
+               close PIPE;
+           }
+       }
+    }
+}
+close FILES;
+close OUT;
+
+exit $failed;
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/objdump-info.desc b/nokia-lintian/collection/objdump-info.desc
new file mode 100644 (file)
index 0000000..1c2204d
--- /dev/null
@@ -0,0 +1,8 @@
+Collector-Script: objdump-info
+Author: Christian Schwarz <schwarz@debian.org>
+Info: This script runs `objdump' over all binaries and object files of a binary package.
+Type: binary, udeb
+Unpack-Level: 2
+Output: objdump-info
+Order: 2
+Needs-Info: file-info
diff --git a/nokia-lintian/collection/override-file b/nokia-lintian/collection/override-file
new file mode 100755 (executable)
index 0000000..86902f5
--- /dev/null
@@ -0,0 +1,72 @@
+#!/usr/bin/perl -w
+# override-file -- lintian collector script
+
+# Copyright (C) 1999 by Darren Benham
+# Derived from debian-readme by Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+($#ARGV == 1) or fail("syntax: override-file <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-d "unpacked" or fail("override-file invoked in wrong directory");
+
+unlink("override");
+
+# Pick the first of these files that exists.
+my $file;
+if ($type eq 'source') {
+    $file = "unpacked/debian/source.lintian-overrides";
+} else {
+    $file = "unpacked/usr/share/lintian/overrides/$pkg";
+}
+
+if ( ! -f $file ) 
+{      if ( -f $file . ".gz" ) { $file = $file . ".gz"; }
+       else { $file = ''; }
+}
+
+if ( $file eq '' ) {
+    # no override found
+} elsif ($file =~ /\.gz$/) {
+    use lib "$ENV{'LINTIAN_ROOT'}/lib";
+    use Pipeline;
+
+    pipeline((sub { exec 'gzip', '-dc', $file }), "override") == 0
+       or fail("error in gzip");
+} else {
+    link($file, "override")
+       or fail("cannot link $file to override: $!");
+}
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/override-file.desc b/nokia-lintian/collection/override-file.desc
new file mode 100644 (file)
index 0000000..0f581ea
--- /dev/null
@@ -0,0 +1,7 @@
+Collector-Script: override-file
+Author: Darren Benham <gecko@debian.org>
+Info: This script copies the `override' file of a package into the lintian directory.
+Type: binary, udeb, source
+Unpack-Level: 2
+Output: override
+Order: 1
diff --git a/nokia-lintian/collection/scripts b/nokia-lintian/collection/scripts
new file mode 100755 (executable)
index 0000000..6ae5796
--- /dev/null
@@ -0,0 +1,101 @@
+#!/usr/bin/perl -w
+# scripts -- lintian collection script
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+open(SCRIPTS, '>', "scripts") or fail("cannot open scripts output file: $!");
+open(INDEX, '<', "index") or fail("cannot open index file: $!");
+
+my $file;
+my $magic;
+my $scriptpath;
+
+while (<INDEX>) {
+    next unless /^-/;   # skip non-files
+    chop;
+
+    # Extract the filename field from the tar-like file index.
+    # Note that the split is done with an explicit limit so that filenames
+    # with embedded spaces are handled correctly.
+    $file = (split(' ', $_, 6))[5];
+    $file =~ s/ link to .*//;    # cut off info about hard links
+    # This used to call fail() instead of next.  However, the check to
+    # see if all files in the index can be opened should be done elsewhere.
+    open(FILE, '<', "unpacked/$file") or next;
+    if (read(FILE, $magic, 2) and $magic eq '#!' and not eof(FILE)) {
+       $scriptpath = <FILE>;
+       chomp($scriptpath);
+       next if ($scriptpath =~ m/^\#!/); # skip lincity data files
+                                         # #!#!#!
+       my $copy_path = $scriptpath;
+       $scriptpath =~ s/^\s+//; # remove leading whitespace
+       $scriptpath =~ s/^\#.*//; # remove comments
+       if ($scriptpath eq '') {
+           print SCRIPTS "$copy_path $file\n";
+       } else {
+       # This used to have (\S+) rather than (\S*), but that went wrong
+       # with scripts that start with an empty #! line.
+           my $env = '';
+           if ($scriptpath =~ s,^/usr/bin/env\s+,,) {
+               $env = 'env ';
+           }
+            $scriptpath =~ s/^(\S*).*/$1/s;
+           print SCRIPTS $env . "$scriptpath $file\n";
+       }
+    }
+    close(FILE);
+}
+close(INDEX);
+close(SCRIPTS);
+
+open(SCRIPTS, '>', "control-scripts")
+    or fail("cannot open control-scripts output file: $!");
+
+opendir(CONTROL, "control")
+    or fail("cannot read control directory: $!");
+
+for $file (readdir CONTROL) {
+    next unless -f "control/$file";
+    open(FILE, '<', "control/$file") or fail("cannot open control/$file: $!");
+    if (read(FILE, $magic, 2) and $magic eq '#!') {
+       $scriptpath = <FILE>;
+       $scriptpath =~ s/^\s*(\S*).*/$1/s;
+       print SCRIPTS "$scriptpath $file\n"
+    }
+    close(FILE);
+}
+closedir(CONTROL);
+close(SCRIPTS);
+
+exit 0;
+
+# -----------------------------------
+
+sub fail {
+    if ($_[0]) {
+        print STDERR "internal error: $_[0]\n";
+    } elsif ($!) {
+        print STDERR "internal error: $!\n";
+    } else {
+        print STDERR "internal error.\n";
+    }
+    exit 1;
+}
diff --git a/nokia-lintian/collection/scripts.desc b/nokia-lintian/collection/scripts.desc
new file mode 100644 (file)
index 0000000..e5771ec
--- /dev/null
@@ -0,0 +1,11 @@
+Collector-Script: scripts
+Author: Richard Braakman <dark@xs4all.nl>
+Info: This script scans a binary package for scripts that start with #! and
+ lists their filenames together with the interpreter named by their first line.
+  The format is: scriptpath filename
+ Note that the filename might contain spaces, but the scriptpath will not,
+ because linux only looks at the first word when executing a script.
+Type: binary, udeb
+Unpack-Level: 2
+Output: scripts
+Order: 1
diff --git a/nokia-lintian/collection/source-control-file b/nokia-lintian/collection/source-control-file
new file mode 100755 (executable)
index 0000000..42d36ab
--- /dev/null
@@ -0,0 +1,52 @@
+#!/usr/bin/perl -w
+# source-control-file -- lintian collector script
+
+# Copyright (C) 2004 Frank Lichtenheld
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use warnings;
+
+($#ARGV == 1) or fail("syntax: source-control-file <pkg> <type>");
+my $pkg = shift;
+my $type = shift;
+
+-f "debfiles/control" or fail("control invoked in wrong directory");
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Util;
+
+my @control_data = read_dpkg_control("debfiles/control");
+shift @control_data; # we don't need the source information
+
+mkdir "control", 0777  or fail( "can't create dir control: $!" );
+
+foreach (@control_data) {
+    my $pkg_name = $_->{'package'};
+    fail("no package line found in control file of $pkg $type")
+        if !$pkg_name;
+    mkdir "control/$pkg_name", 0777
+        or fail( "can't create dir control/$pkg_name: $!" );
+    for my $field (keys %$_) {
+        my $field_file = "control/$pkg_name/$field";
+        open (F, '>', "$field_file")
+            or fail("cannot open file $field_file for writing: $!");
+        print F $_->{$field},"\n";
+        close F;
+    }
+}
diff --git a/nokia-lintian/collection/source-control-file.desc b/nokia-lintian/collection/source-control-file.desc
new file mode 100644 (file)
index 0000000..f6c881d
--- /dev/null
@@ -0,0 +1,8 @@
+Collector-Script: source-control-file
+Author: Frank Lichtenheld <djpig@debian.org>
+Info: Collects information about binary packages from debian/control in source packages
+Type: source
+Unpack-Level: 1
+Output: control
+Order: 2
+Needs-Info: debfiles
diff --git a/nokia-lintian/data/README b/nokia-lintian/data/README
new file mode 100644 (file)
index 0000000..b1e7ba9
--- /dev/null
@@ -0,0 +1,12 @@
+This directory contains files loaded by the Lintian::Data module,
+specifically lists of keywords used in various Lintian checks.  For all
+files in this directory, blank lines are ignored, as are lines beginning
+with #.
+
+For each list of keywords, please include in a comment the origin of the
+list, any information about how to resynchronize the list with that
+origin, and any special exceptions or caveats.
+
+Files should generally be organized into subdirectory by check or by
+general class of lists (for example, all lists related to doc-base files
+should go into a doc-base subdirectory).
diff --git a/nokia-lintian/data/binaries/multiarch b/nokia-lintian/data/binaries/multiarch
new file mode 100644 (file)
index 0000000..0efa0fd
--- /dev/null
@@ -0,0 +1,18 @@
+# Known multiarch directories.  Binaries under one of these directories
+# under /lib or /usr/lib are permitted in Architecture: all packages since
+# the package may be for multiarch support in a related architecture.
+#
+# See Bug#469301 and Bug#464796 for more details.
+
+# Regular Debian ports.
+arm-linux-gnu
+arm-linux-gnueabi
+i486-linux-gnu
+hppa-linux-gnu
+m68k-linux-gnu
+mips-linux-gnu
+mipsel-linux-gnu
+powerpc-linux-gnu
+s390-linux-gnu
+sparc-linux-gnu
+x86_64-linux-gnu
diff --git a/nokia-lintian/data/doc-base/sections b/nokia-lintian/data/doc-base/sections
new file mode 100644 (file)
index 0000000..81db744
--- /dev/null
@@ -0,0 +1,73 @@
+# Taken from /usr/share/doc-base/data/sections.list.
+#
+# Last synchronized with doc-base 0.8.10 (2008-02-22).
+
+Accessibility
+Amateur Radio
+Data Management
+Debian
+Editors
+Education
+Emulators
+File Management
+Games/Action
+Games/Adventure
+Games/Blocks
+Games/Board
+Games/Card
+Games/Puzzles
+Games/Simulation
+Games/Strategy
+Games/Tools
+Games/Toys
+Graphics
+Help
+Help/Books
+Help/FAQ
+Help/HOWTO
+Help/RFC
+Help/Standards
+Mobile Devices
+Network/Communication
+Network/File Transfer
+Network/Monitoring
+Network/Web Browsing
+Network/Web News
+Office
+Programming
+Programming/C
+Programming/C++
+Programming/Java
+Programming/Perl
+Programming/Python
+Programming/Ruby
+Project Management
+Science/Astronomy
+Science/Biology
+Science/Chemistry
+Science/Data Analysis
+Science/Electronics
+Science/Engineering
+Science/Geoscience
+Science/Mathematics
+Science/Medicine
+Science/Physics
+Science/Social
+Screen
+Screen/Saving
+Screen/Locking
+Shells
+Sound
+System/Administration
+System/Hardware
+System/Language Environment
+System/Monitoring
+System/Package Management
+System/Security
+Terminal Emulators
+Text
+TV and Radio
+Viewers
+Video
+Web Development
+Window Managers
diff --git a/nokia-lintian/data/fields/obsolete-packages b/nokia-lintian/data/fields/obsolete-packages
new file mode 100644 (file)
index 0000000..5b287a1
--- /dev/null
@@ -0,0 +1,50 @@
+# Known obsolete packages.  Not all packages are added to this list, only
+# ones for which it's helpful for Lintian to warn about, such as
+# significant transitions or transitional packages that we're trying to
+# remove from the archive.
+#
+# Each list of packages should be tagged with the last Debian release in
+# which the package appeared so that we can remove long-obsolete entries
+# that are no longer worth checking for.
+
+# Last seen in sarge.
+xlibs-dev
+
+# Last seen in etch.
+debmake
+gcc-2.95
+
+# Last seen in lenny.
+cdrecord
+cupsys
+cupsys-bsd
+cupsys-client
+cupsys-common
+gaim
+gnomemeeting
+gs
+gs-aladdin
+gs-esp
+gs-gpl
+libcupsys2
+libcupsys2-dev
+libglu1-xorg
+libglu1-xorg-dev
+libmime-perl
+libungif4-dev
+libxerces28
+libxerces28-dev
+mkisofs
+netcdfg-dev
+pcmcia-cs
+python-pyopenssl
+ssh-krb5
+tetex-base
+tetex-bin
+tetex-extra
+x-dev
+xbase-clients
+xlibmesa-gl
+xlibmesa-gl-dev
+xlibmesa-glu
+xutils
diff --git a/nokia-lintian/data/shared-libs/ldconfig-dirs b/nokia-lintian/data/shared-libs/ldconfig-dirs
new file mode 100644 (file)
index 0000000..0b3dfbb
--- /dev/null
@@ -0,0 +1,53 @@
+# The list of directories searched by default by the dynamic linker.
+# Packages installing shared libraries into these directories must call
+# ldconfig, must have shlibs files, and must ensure those libraries have
+# proper SONAMEs.
+#
+# Directories listed here must not have leading slashes.
+
+# Standard library directories.
+lib
+usr/lib
+usr/local/lib
+
+# For 32-bit/64-bit multiarch support.
+lib32
+lib64
+usr/lib32
+usr/lib64
+
+# Used by the Debian amd64 port for 32-bit libraries.
+emul/ia32-linux/lib
+emul/ia32-linux/usr/lib
+
+# This is now obsolete, but is still in the standard ld.so.conf.
+usr/X11R6/lib
+
+# Multiarch directories.  Currently, these aren't used officially by the
+# project but ld.so looks in the ones native to the local platform.
+# Hopefully including the ones not native to the local platform won't
+# hurt.
+#
+# See Bug#469301 and Bug#464796 for more details.
+lib/arm-linux-gnu
+lib/arm-linux-gnueabi
+lib/i486-linux-gnu
+lib/hppa-linux-gnu
+lib/m68k-linux-gnu
+lib/mips-linux-gnu
+lib/mipsel-linux-gnu
+lib/powerpc-linux-gnu
+lib/s390-linux-gnu
+lib/sparc-linux-gnu
+lib/x86_64-linux-gnu
+usr/lib/arm-linux-gnu
+usr/lib/arm-linux-gnueabi
+usr/lib/i486-linux-gnu
+usr/lib/hppa-linux-gnu
+usr/lib/m68k-linux-gnu
+usr/lib/mips-linux-gnu
+usr/lib/mipsel-linux-gnu
+usr/lib/powerpc-linux-gnu
+usr/lib/s390-linux-gnu
+usr/lib/sparc-linux-gnu
+usr/lib/x86_64-linux-gnu
diff --git a/nokia-lintian/debian/changelog b/nokia-lintian/debian/changelog
new file mode 100644 (file)
index 0000000..862aa8c
--- /dev/null
@@ -0,0 +1,6746 @@
+lintian (1.24.2-1osso6) unstable; urgency=low
+
+  * removed kernel-headers and kernel-source from the list of
+    virtual packages
+
+ -- Ed Bartosh <eduard.bartosh@nokia.com>  Mon, 02 Mar 2009 14:48:36 +0200
+
+lintian (1.24.2-1osso5) unstable; urgency=low
+
+  * check for absence of doc packages for every dev package added
+
+ -- Dmitry Rozhkov <dmitry.rozhkov@nokia.com>  Fri, 24 Oct 2008 18:56:40 +0300
+
+lintian (1.24.2-1osso4) unstable; urgency=low
+
+  * lintian/checks/control-file:
+    accept ${source:Version} variable in Depends: field of -dbg packages
+
+ -- Dmitry Rozhkov <dmitry.rozhkov@nokia.com>  Wed, 10 Sep 2008 13:59:23 +0300
+
+lintian (1.24.2-1osso3) unstable; urgency=low
+
+  * Bug fixed in checks/binaries. Import Lintian::Data module as it's
+    needed for multi-arch binaries
+
+ -- Dmitry Rozhkov <dmitry.rozhkov@nokia.com>  Thu, 14 Aug 2008 15:31:31 +0300
+
+lintian (1.24.2-1osso2) unstable; urgency=low
+
+  * dpatch added to Build-Depends
+
+ -- Dmitry Rozhkov <dmitry.rozhkov@nokia.com>  Mon, 11 Aug 2008 11:58:06 +0300
+
+lintian (1.24.2-1osso1) unstable; urgency=low
+
+  * Disabled patches that add already implemented functionality in
+    upstream.
+  * Added patch 805-add-known-maemo-sections that adds additional known
+    sections in debian/control to conform Maemo policy
+
+ -- Dmitry Rozhkov <dmitry.rozhkov@nokia.com>  Fri, 01 Aug 2008 17:46:28 +0300
+
+lintian (1.24.2) unstable; urgency=low
+
+  The "welcome Adam D. Barratt!" release.
+  
+  * checks/binaries.desc:
+    + [ADB] Add some FHS references.  Thanks Jordà Polo.
+  * checks/changelog-file{,.desc}:
+    + [ADB] Add missing "use Dep". Thanks gregor herrmann (Closes: #488397)
+    + [RA] Ignore "CNRI OPEN SOURCE GPL-COMPATIBLE LICENSE AGREEMENT" when
+      looking for missing GPL references.  Thanks, Scott Kitterman.
+      (Closes: #490264)
+    + [ADB] Fix a typo in the description of syntax-error-in-debian-changelog.
+      Thanks Jordà Polo.
+  * checks/copyright-file{,.desc}:
+    + [ADB] Check for over-long lines in copyright files.  (Closes: #479651)
+  * checks/cruft{,.desc}:
+    + [ADB] Check for BTS control directories in source packages and diffs
+      in addition to the existing binary package checks.  (Closes: #481787)
+  * checks/debconf{,.desc}:
+    + [ADB] Warn about the use of "_Choices" in templates file and suggest
+      using "__Choices" instead (Closes: #481152)
+    + [ADB] Check all maintainer scripts for issues, rather than just config
+      and postinst.
+    + [ADB] Detect debconf templates which appear to be unused.
+    + [ADB] Replace the {config,postinst}-loads-obsolete-confmodule tags
+      with a new loads-obsolete-confmodule test which is used for all
+      maintainer scripts and outputs the script name as part of its extra data.
+  * checks/description{,.desc}:
+    + [RA] Warn about duplicated words in the description.  Patch from
+      Raphael Geissert.  (Closes: #424746)
+  * checks/fields{,.desc}:
+    + [FL] Do not complain about obsolete packages if there are
+      non-obsolete alternatives specified and if the obsolete
+      package is not listed first.  Issue an info tag for them
+      though.  Patch by Adam D. Barratt.  (Closes: #486145)
+    + [ADB] Update and add some Policy and DevRef references and fix some
+      typoes.  Thanks Jordà Polo.
+    + [RA] Recognize and do not warn about Ubuntu security update version
+      numbers for multiple releases.  (Closes: #489222)
+  * checks/files{,.desc}:
+    + [ADB] Warn if the package contains embedded copies of separately
+      packaged Javascript libraries.  Patch by Chris Lamb.  (Closes: #489191)
+    + [ADB] Fix a typo in the description of executable-is-not-world-readable
+  * checks/infofiles{,.desc}:
+    + [ADB] Warn if the package's postinst installs info directory entries
+      but the prerm doesn't remove them.  (Closes: #182512)
+    + [ADB] Treat --remove-exactly as indicating removal of an info directory
+      entry as well as --remove.
+  * checks/menus{,.desc}:
+    + [ADB] Check that menu-method files include menu.h (Closes: #184104)
+  * checks/nmu:
+    + [RA] When comparing maintainers, treat the right-hand side of the
+      e-mail address as case-insensitive.  (Closes: #486795)
+  * checks/patch-systems{,.desc}:
+    + [RA] Check quilt patches as well as dpatch patches, and also check
+      quilt patches when using the 3.0 (quilt) package format.  Fix build
+      dependency checking and check all dpatch files.  Patch from Raphaël
+      Hertzog.  (Closes: #484549)
+    + [ADB] Treat 00list* as dpatch series files rather than just 00list.
+      (Closes: #482040). Also rename dpatch-index-references-non-existant-patch
+      to dpatch-index-references-non-existent-patch.
+  * checks/rules{,.desc}:
+    + [RA] Warn about use of DEB_BUILD_OPTS.  Patch from Raphael Geissert.
+  * checks/scripts:
+    + [FL] Apply File::Spec->canonpath() to rpaths to improve
+      matching with directories.
+    + [FL] Do not check zsh scripts, since zsh -n gives false
+      positives.  Downgrades #485885 to wishlist.  Also see
+      #175467.  Patch by Raphael Geissert.
+    + [FL] Remove "quoted quotes". They're likely to be inside
+      another pair of quotes; we're not interested in
+      them for their own sake and removing them makes finding
+      the limits of the outer pair far easier.  Patch by
+      Adam D. Barratt.
+    + [FL] Improve heredoc detection.  Patch by Adam D. Barratt.
+    + [FL] Improve script_is_evil_and_wrong() to catch more scripts.
+      Patch by Adam D. Barratt.
+    + [ADB] Update bashism regexes to add new checks, improve performance
+      and reduce false positives. (Closes: #490227)
+  * checks/shared-libs{,.desc}:
+    + [ADB] Implement syntax and sanity checking for symbols files
+      (Closes: #452216)
+    + [ADB] Check symbols files for dependencies that are not satisfied by
+      the package itself (Closes: #461575)
+  * checks/standards-version{.desc,}:
+    + [RA] Only issue out-of-date-standards-version once.  Noticed by
+      Raphael Geissert.
+    + [RA] Base the two-year clock for ancient-standards-version on when
+      the Policy version was superseded, not when it was issued.  Thanks,
+      Scott Kitterman.  (Closes: #487780)
+    + [RA] Warn for packages declaring a standards version released after
+      the date of the most recent changelog entry.  Based on a patch by
+      Raphael Geissert.
+  * checks/watch-file{,.desc}:
+    + [FL] Check for more Debian specific strings in version
+      number.  Issue an info tag if the watch file uses
+      uversionsmangle to add the Debian specific string. Patch
+      by Raphael Geissert.  (Closes: #485879)
+    + [RA] Warn about watch files in native packages and check those watch
+      files for other problems anyway.  Allow whitespace around the
+      version declaration.  More correctly handle continuation lines.
+      Patch from Raphael Geissert.
+    + [RA] Check for using the Sourceforge QA redirector with deprecated
+      arguments.  Patch from Raphael Geissert.
+    + [RA] Be more explicit when warning about missing watch files that
+      Lintian recommends adding a watch file containing only comments for
+      any non-native package where it's not possible to write a meaningful
+      watch file, not only for packages unmaintained upstream.
+
+  * collection/objdump-info:
+    + [ADB] If objdump from binutils 2.17 fails to parse a file then
+      attempt to gather the required information using readelf instead.
+      This allows us to process 64-bit packages on etch/i386 again
+      (i.e. on lintian.d.o)  (Closes: #487746)
+
+  * data/fields/obsolete-packages:
+    + [RA] mailx is not obsolete.  It's a virtual package.  Thanks, martin
+      f krafft.  (Closes: #488114)
+    + [RA] Add the cupsys packages, all of which have been renamed to cups.
+      Patch from Raphael Geissert.
+  
+  * debian/control:
+    + [FL] Adapt VCS-* headers for move from SVN to git.
+  * debian/copyright:
+    + [FL] Add Patrick Schoenfeld (for checks/watch-file).
+    + [ADB] Update repository information and GPL2 URL.
+    + [RA] Add Adam D. Barratt to the maintainer list so that readers can
+      expand initials in the changelog.
+  * debian/{prerm,postrm}:
+    + [RA] Move prerm to postrm and remove the default /var/spool/lintian
+      lab using shell instead of lintian.  We only want to remove the lab
+      on purge, and purge is only passed to postrm, not prerm, by which
+      point the lintian frontend is gone.  (Closes: #489860)
+  
+  * doc/CREDITS:
+    + [FL] Add Raphael Geissert and Adam D. Barratt.
+  * doc/lintian.sgml:
+    + [ADB] Add reference to new option to display experimental tags.
+
+  * frontend/lintian:
+    + [ADB] Add a new --show-experimental / -E option which indicates
+      that experimental tags should be displayed.
+    + [RA] Exit with the correct exit status if no packages were found
+      because non-existent packages were specified on the command line.
+
+  * lib/Lintian/Collect/Binary.pm:
+    + [FL] Add support for file-info file.
+    + [FL] Add support for objdump-info file.
+  * lib/Spelling.pm:
+    + [RA] Add a couple more spelling corrections and capitalization
+      checks for LaTeX and TeX.  Thanks, Raphael Geissert.
+  * lib/Tags.pm:
+    + [ADB] (Re-)Add support for experimental tags.
+  
+  * man/lintian.1:
+    + [FL] Document watch-file check.
+    + [ADB] Document new option to display experimental tags.
+    + [RA] Refer to lintian-info(1) for printing tag descriptions.  Patch
+      from Chris Lamb.  (Closes: #490374)
+  
+  * reporting/harness:
+    + [ADB] Process packages using -E so that experimental tags are included.
+  * reporting/html_reports:
+    + [FL] Mark the tag pages with the correct code.
+  * reporting/lintian.css:
+    + [RA] New style for marking packages that override a tag on the tag
+      summary page.  Patch from Jordà Polo.
+  * reporting/templates/clean.tmpl:
+    + [ADB] Note that the full report includes experimental tags.
+  * reporting/templates/tag.tmpl:
+    + [FL] Mark overridden tags.
+    + [RA] Mark packages that override all instances of a given tag.
+      Patch from Jordà Polo.
+  * reporting/templates/maintainer.tmpl:
+    + [FL] Add useful links for each source package.
+      With layout help by Jordà Polo.
+    + [FL] Include Co-maintained packages in the summary
+      at the top of the page.  Also sort the list.  Patch
+      by Jordà Polo.
+    + [ADB] Note that the full report includes experimental tags.
+
+  * testset/runtests:
+    + [ADB] Support experimental tags
+
+ -- Russ Allbery <rra@debian.org>  Sun, 13 Jul 2008 17:28:08 -0700
+
+lintian (1.24.1) unstable; urgency=medium
+  
+  The "mostly for the benefit of lintian.debian.org only" release.
+
+  * frontend/lintian:
+    + [FL] Increase LAB_FORMAT to 8. This should have happened
+      in 1.23.47, since the unpack-binpkg-l1 then produced a
+      new file which checks depend upon.  Since this only
+      affects static labs and only if packages get rechecked
+      (i.e. not on harness -i runs) it only got noticed now.
+      Use urgency=medium for this fix.
+  
+  * checks/watch-file:
+    + [FL] Fix the order of two regular expression to use
+      the more specific one first.  Patch by Raphael Geissert.
+      (Closes: #485884)
+  
+  * unpack/unpack-binpkg-l1:
+    + [FL] Don't include version number from Source: field in
+      the source symlink.  Noted by RA.  (Closes: #485474)
+  
+  * lib/Lintian/Collect/Binary.pm:
+    + [FL] New module for retrieving binary package information.
+  
+  * reporting/checkout-release:
+    + [FL] New helper script for lintian.d.o maintenance.
+  * reporting/config:
+    + [FL] Generate files in $HOME/www directly instead
+      of $HOME/www/reports.
+  * reporting/html_reports:
+    + [FL] Allow inclusion of the new shared templates by
+      convenient functions. Remove some duplicated data
+      setting while I'm on it.
+    + [FL] Generate the manual and lintian.log symlinks
+      dynamically, so that we don't need the reports subdirectory
+      anymore.  Also generate a reports -> . symlink for
+      backwards compatibility.
+  * reporting/templates/{head,foot}.tmpl:
+    + [FL] New templates meant for inclusion by other templates
+      for common header and footer parts
+  * reporting/templates/index.tmpl:
+    + [FL] Remove obsolete reports/ subdirectory from the links.    
+  * reporting/templates/maintainer.tmpl:
+    + [RA] Redisplay the tag name for each separate binary package, also
+      fixing list nesting problems in some cases.  Patch from Jordà
+      Polo.
+  * reporting/templates/*.tmpl:
+    + [FL] Replace common headers/footers with calls to the
+      new head()/foot() functions.
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu, 12 Jun 2008 17:28:44 +0200
+
+lintian (1.24.0) unstable; urgency=low
+
+  The "Policy 3.8.0, infrastructure evolution, and real web design"
+  release.
+  
+  * checks/binaries:
+    + [RA] Fix code for filtering out NSS modules from SONAME checks.
+    + [RA] When checking SONAMEs against package names, convert all
+      underscores to dashes, not just the first one.  Thanks, Gonéri Le
+      Bouder.  (Closes: #482450)
+    + [RA] Remove several-sonames-in-same-package.  This is frequently not
+      an error and Lintian doesn't have enough information to know.
+  * checks/common_data.pm:
+    + [RA] armel is now a standard architecture.
+    + [RA] Remove %known_obsolete_packages, now handled via data.
+    + [RA] Merge %non_standard_archs into %known_archs.
+  * checks/control-file{.desc,}:
+    + [RA] Check for self-dependencies in the source package since the
+      current dpkg-gencontrol silently fixes them but they may indicate
+      other problems.  Thanks, Patrick Matthäi.  (Closes: #471740)
+  * checks/copyright-file{.desc,}:
+    + [RA] Check for copyright files containing the Apache 2.0 license,
+      which is now in common-licenses.
+  * checks/cruft:
+    + [RA] Format: 3.0 (quilt) packages are not native even though they
+      have no *.diff.gz.  Thanks, Raphael Hertzog.  (Closes: #483384)
+    + [RA] Use the new Lintian::Collect interface to check whether a
+      package is native.
+  * checks/debconf:
+    + [RA] Don't warn about using db_input in postinst if a config script
+      also exists and uses db_input.  The package maintainer probably
+      knows what they're doing.
+  * checks/fields:
+    + [RA] Syntax-check Breaks like other relationship fields.  Warn if
+      any packages use Breaks for right now.  Only check for duplicate
+      libraries and Tcl versions in dependency fields, not Breaks,
+      Conflicts, and other similar fields.  Warn if Breaks is used without
+      a version.  Check that Breaks is not inconsistent with other
+      dependency fields.
+    + [RA] Use Lintian::Data to load the obsolete package list.
+    + [RA] When checking whether a debug package has proper dependencies,
+      allow a dependency on any package name that starts the same as the
+      debug package up to the first dash.  This will hopefully produce
+      fewer false positives.  Thanks, Josselin Mouette.  (Closes: #476587)
+    + [RA] Remove non-standard-architecture-in-source-relation and
+      non-standard-architecture.  These aren't bugs.
+  * checks/filenames{.desc,}:
+    + [RA] Warn about BTS data directories in packages (.be and
+      .ditrack).  Patch by Ben Finney.  (Closes: #481787)
+  * checks/init.d:
+    + [RA] Try to allow for postinst scripts written in Perl and still
+      recognize the update-rc.d calls.
+  * checks/manpages{.desc,}:
+    + [RA] Only ignore errors about wrapping lines for Asian locale man
+      pages, since that's where the groff trouble lies.  Ignore character
+      set errors for all man pages with old versions of man and no man
+      pages with current versions of man since the new character set
+      handling should cope.  (Closes: #474052)
+    + [FL] Ignore more unicode issues with old man.
+    + [RA] Warn about inclusion of the country name in the localized man
+      page directory unless it's one of the known exceptions.
+    + [RA] Mention in binary-without-manpage that the case of the man page
+      should match the case of the binary even if man can find it anyway.
+      (Closes: #484028)
+  * checks/md5sums:
+    + [FL] Don't complain about missing md5sums file if the
+      package only contains conffiles.  (Closes: #482869)
+  * checks/nmu:
+    + [RA] Don't treat "Ack NMU" as an NMU declaration.  Thanks, Joe
+      Nahmias.  (Closes: #484600)
+    + [RA] Binary NMUs of QA-maintained packages are fine.
+  * checks/rules{.desc,}:
+    + [RA] Add some basic checks for whether debhelper programs are called
+      in a reasonable order.  (Closes: #471869)
+    + [RA] Support pattern rules.  (Closes: #483475)
+  * checks/scripts:
+    + [RA] Catch deprecated chown syntax even when options are given to
+      chown.  Patch by Raphael Geissert.  (Closes: #483775)
+    + [RA] $((var+1)) now works in dash and is in POSIX, so remove it from
+      bashisms.  Patch by Adam D. Barratt.  (Closes: #473156)
+  * checks/standards-version{.desc,}:
+    + [RA] Largely rewritten.  Now contains a list of standards versions
+      with the date when they were released, adding 3.8.0.  Only emit tag
+      out-of-date-standards-version if the newer version predates the date
+      of the package.  Base ancient-standards-version on whether the
+      standards version of the package is more than two years old.  Remove
+      package-declares-source-relation-but-has-older-standards-version;
+      policy 3.1.0 was a long time ago.  (Closes: #472513)
+  * checks/watch-file{.desc,}:
+    + [RA] New checks for watch files, based on work by Patrick
+      Schoenfeld.  (Closes: #234202, #409104, #456629, #472499)
+
+  * data/fields/obsolete-packages:
+    + [RA] Moved from common_data.pm.  Removed many very old packages that
+      nothing depends on and added many new packages identified by Riku
+      Voipio.  (Closes: #475400)
+
+  * debian/control:
+    + [RA] Update standards version to 3.8.0.
+    + [RA] Depend on libtimedate-perl for convenient date parsing.
+
+  * frontend/lintian:
+    + [RA] Create a new Lintian::Collect object for each package being
+      checked and pass it into Checker::runcheck.
+
+  * lib/Checker.pm:
+    + [RA] Pass a Lintian::Collect object as the third argument to the run
+      function of each check.
+  * lib/Lintian/Collect.pm:
+    + [RA] New module to retrieve package information.
+  * lib/Lintian/Collect/Source.pm:
+    + [RA] New module to retrieve source package information.
+
+  * reporting/html_reports:
+    + [RA] Copy over images.  Set the maintainer name to "Unknown
+      Maintainer" if not known.  Pass the code for a tag into the per-tag
+      page.  Based on a patch by Jordà Polo.
+  * reporting/images/*:
+    + [RA] New logo images from Jordà Polo.
+  * reporting/lintian.css:
+    + [RA] Significant overhaul of the lintian.d.o design by Jordà Polo.
+  * reporting/templates/*:
+    + [RA] Significant overhaul of the lintian.d.o design by Jordà Polo.
+  * reporting/templates/clean.tmpl:
+    + [FL] Include link to full maintainer report.  Suggested by
+      Kartik Mistry.
+
+ -- Russ Allbery <rra@debian.org>  Sat, 07 Jun 2008 21:09:54 -0700
+
+lintian (1.23.49) unstable; urgency=low
+
+  The "Business as usual" release.
+
+  * checks/binaries:
+    + [FL] Ignore rpaths to directories present in the same binary
+      package.  Also ignore $ORIGIN since that obviously fulfills
+      that criterion.  (Closes: #480636)
+  * checks/copyright-file{,.desc}:
+    + [FL] Implement new check for dh-make-perl boilerplate.
+    + [FL] New check for example URL from dh-make.  Based on
+      a patch by Michal Čihař.  (Closes: #481368)
+  * checks/debhelper:
+    + [FL] dh_lintian needs debhelper >= 6.0.7. Patch by David Paleino.
+      (Closes: #479088)
+    + [FL] Add basic support for debhelpers new dh utility.
+      (Closes: #477628)
+    + [FL] Suppress maintainer-script-lacks-debhelper-token for
+      single-udeb-only packages as well.  (Closes: #471853)
+  * checks/files:
+    + [FL] Drop xresources-file-in-etc-without-proper-conflicts, since
+      the last package that conflict applies to was released with hamm!
+      Reported by Julien Cristau.  (Closes: #480574)
+  * checks/menu-format:
+    + [FL] Don't issue false positives about menu files in format menu-2.
+      We don't check them for errors yet, though.  (Closes: #478578)
+  * checks/patch-systems:
+    + [FL] Add basic support for dpatch list files which use cpp for
+      preprocessing.  Patch by Jörg Sommer.  (Closes: #477057)
+  * checks/scripts:
+    + [FL] Always use /bin/bash for shell script syntax check to give
+      consistent errors on systems with changed /bin/sh.  Suggested
+      by Raphael Geissert.  (Closes: #478192)
+  
+  * frontend/lintian:
+    + [FL] Don't issue a warning about Distribution: UNRELEASED in
+      .changes files.  It can be annoying to have to ignore this error
+      during testing and dupload/dput/dak/etc... all will error out
+      on it anyway.  Suggested by martin f krafft.  (Closes: #382327)
+    + [FL] Add a --keep-lab option to make it easier to debug temporary
+      labs.  (Closes: #401046)
+  
+  * lib/Util.pm:
+    + [FL] Only require Digest::SHA if the code path is really used.
+      This makes it unnessesary to install libdigest-sha-perl on
+      lintian.debian.org for now.
+  
+  * man/lintian.1:
+    + [FL] Document --keep-lab option.
+    + [FL] Fix error in checkname: s/patch-system/patch-systems/.
+      Reported by Jörg Sommer.
+  
+  * reporting/html_reports:
+    + [FL] Escape $email variable for usage in URI query strings.  
+      Currently it is not used for anything else, so it is most simple
+      to do it in the actual code.  Reported by Sandro Tosi.
+      (Closes: #481256)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Tue, 20 May 2008 22:03:58 +0200
+
+lintian (1.23.48) unstable; urgency=low
+
+  The "Perl 5.10 compatibility" release.
+
+  * checks/common_data.pm:
+    + [FL] Add 8.5 versions to known_tcls and known_tks.
+  * checks/copyright-file:
+    + [FL] Also apply the "possible-gpl-code-linked-with-openssl" checks
+      to Pre-Depends.
+  * checks/menus:
+    + [RA] Stop using a deprecated Perl construct that Perl 5.10 no longer
+      supports.  Patch from Adam D. Barratt.  (Closes: #479318)
+  * checks/shared-libs:
+    + [RA] Fix an unescaped | in the regular expression parsing postinst
+      files for ldconfig invocation.  The regex had always been broken,
+      but in Perl 5.10 it causes a recursion error in the regex engine.
+  * checks/version-substvars:
+    + [FL] Also apply the "not-binnmuable-*" checks to Pre-Depends.
+      (Closes: #472247)
+
+  * frontend/lintian:
+    + [RA] Work around a Perl 5.10 bug with Getopt::Long and sub handlers.
+
+  * testset/runtests:
+    + [RA] dpkg-source now enables the -i and -I regexes by default.
+      Replace the defaults with ones that never match so that we can
+      continue testing for cruft left in source packages.
+
+ -- Russ Allbery <rra@debian.org>  Sun, 04 May 2008 12:57:48 -0700
+
+lintian (1.23.47) unstable; urgency=low
+
+  The "long time no upload" release.
+
+  * checks/binaries{.desc,}
+    + [RA] Permit architecture: all packages to have binaries in the
+      multiarch directories.  (Closes: #469301)
+    + [RA] Suggest an override for arch: all packages containing binaries
+      independent of the host architecture (such as for cross-compiles).
+  * checks/changelog-file:
+    + [RA] Quash more Perl warnings on badly malformed NEWS.Debian files.
+  * checks/control-files:
+    + [FL] Add 'triggers' as a valid control file.  Thanks, Joey Hess.
+      (Closes: #473840)
+  * checks/copyright-file{.desc,}:
+    + [RA] Document handling of false positives for GPL, GFDL, and LGPL
+      license references and catch the GFDL 1.1 false positive.
+    + [FL] Add CeCILL license to false positives list for
+      copyright-should-refer-to-common-license-file-for-gpl.  Thanks,
+      Alexandre Fayolle.  (Closes: #472933)
+  * checks/cruft:
+    + [RA] Subversion conflicts generate three files, two with revision
+      numbers and one with .mine.  Only warn about the revision numbers;
+      .mine probably won't occur alone and may be a false positive.
+  * checks/etcfiles:
+    + [RA] /etc/init.d/{skeleton,rc,rcS} are not conffiles, and README
+      files in /etc need not be.
+  * checks/fields.desc:
+    + [FL] Remove obsolete section base from list of valid sections in
+      unknown-section.  (Closes: #471751)
+  * checks/files{.desc,}:
+    + [RA] /etc/init.d/{skeleton,README} don't need to be executable.
+    + [RA] Warn about linda overrides since linda has been removed from
+      the archive.  Thanks, Y Giridhar Appaji Nag.  (Closes: #469603)
+    + [RA] Check for numeric owners or groups outside of the reserved
+      static ranges.  Patch from Håkon Stordahl.  (Closes: #469924)
+    + [RA] Issue errors for installing files under /var/www.  This isn't
+      in FHS, may not be the document root, and may break local files if
+      it is the document root.  Thanks, Joerg Jaspert.  (Closes: #470403)
+    + [RA] Don't consider files in bin directories that contain "copying"
+      or "license" to be extra license files.
+    + [FL] Don't complain about empty directories under
+      /usr/share/python-support since those might be needed.  Thanks,
+      Josselin Mouette.  (Closes: #473428)
+    + [RA] Ignore extra license files in examples subdirectories of
+      /usr/share/doc.  Thanks, Daniel Jacobowitz.  (Closes: #476149)
+  * checks/lintian.desc:
+    + [FL] Rename md5sum-mismatch-in-changes-file to
+      checksum-mismatch-in-changes-file.
+  * checks/nmu{.desc,}:
+    + [RA] Add support for +nmuX versioning for NMUs of native packages.
+      Patch from James Vega.  (Closes: #475026)
+    + [RA] Don't consider an NMU changelog entries that mention NMU with
+      a variation of the word "incorporate."
+  * checks/scripts:
+    + [RA] Attempt to quash some Perl warnings.
+    + [RA] *.py files in /usr/{lib,share}, /etc/init.d/skeleton, and *.ex
+      files do not need to be executable even if they look like scripts.
+    + [RA] Add clisp, procmail, and rrdcgi, and another way interpretors
+      are templated in *.in files.
+    + [RA] Expect unversioned dependencies on OCaml packages rather than
+      versioned dependencies since the version changes frequently and
+      unversioned dependencies are what people are already using.  Thanks,
+      Hideki Yamane.  (Closes: #476417)
+    + [RA] Add inetutils-inetd and xinetd as additional update-inetd
+      providers.  Patch from Guillem Jover.  (Closes: #474077)
+    + [RA] If the call to some supporting program like update-inetd is
+      conditional on the existence of the program, assume the maintainer
+      knows what they're doing and don't warn.
+  * checks/shared-libs:
+    + [RA] Move the default ld.so search path into data.  Drop obsolete
+      /usr/lib/libg++-dbg, /usr/X11R6/lib/Xaw3d, and libc5 compatibility
+      directories in the process.
+    + [RA] Allow and expect ldconfig, SONAMEs, and shlibs treatment of
+      libraries in multiarch directories.
+
+  * data/binaries/multiarch:
+    + [RA] New file listing multiarch binary directories.
+  * data/shared-libs/ldconfig-dirs:
+    + [RA] New file listing directories searched by ld.so.
+
+  * debian/compat:
+    + [FL] Increase debhelper compat level to 5. There is really
+      no need anymore to support building on sarge.
+  * debian/control:
+    + [FL] Add dependency on libdigest-sha-perl.
+    + [FL] Increase debhelper dependency to >= 5
+
+  * frontend/lintian:
+    + [RA] Qualify relative --root directories so that we don't break
+      later.  Patch from Håkon Stordahl.  (Closes: #469925)
+    + [CW] Add intrepid as an allowable distribution for Ubuntu.
+    + [FL] Support Checksums-* fields in .changes files. Follows
+      the same rules as the md5sum check. Add new option --checksums
+      as alias for --md5sums.  (Closes: #476565)
+
+  * lib/Spelling.pm:
+    + [RA] Avoid Perl warnings when called with an uninitialized value.
+    + [RA] Correct "meta package" and "meta-package" in descriptions to
+      "metapackage".  Thanks, Frank S. Thomas.  (Closes: #476681)
+  * lib/Util.pm:
+    + [FL] Rename function get_file_md5sum to get_file_checksum and
+      support SHA1 and SHA256.
+
+  * man/lintian.1:
+    + [FL] Drop linda from SEE ALSO since it is obsolete now. Suggested
+      by Hideki Yamane. (Closes: #474478)
+    + [FL] Add new --checksums option.
+
+  * reporting/html_reports:
+    + [RA] Base the generation of clean report pages on the maintainer URL
+      rather than the full maintainer string so that maintainers with
+      different forms of their name won't have clean reports that
+      overwrite dirty ones.
+    + [RA] Fix the counts in qa-list.txt, which were broken in several
+      respects.
+    + [RA] Don't consider a maintainer's page error/warning free if there
+      are errors or warnings in their co-maintained packages.
+  * reporting/templates/maintainer.tmpl:
+    + [RA] Always add anchors to the package names even for uploaders.
+  
+  * testset/copyright:
+    + [FL] New testcases by Tobias Toedter.  (Closes: #472665)
+  * testset/description:
+    + [FL] New testcases by Tobias Toedter.  (Closes: #471838, #477471)
+
+  * unpack/list-srcpkg:
+    + [RA] Fix syntax error introduced by Uploaders support.
+  * unpack/unpack-binpkg-l1:
+    + [RA] Extract a tar listing with numeric owners and groups into
+      index-owner-id in the lab.
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu, 01 May 2008 15:04:08 +0200
+
+lintian (1.23.46) unstable; urgency=low
+
+  The "five Lintian committers!" release.
+
+  * checks/binaries:
+    + [RA] Anchor file matches for Perl libraries and debugging symbols so
+      as to not match partial paths.  Based on a patch from Niko Tyni.
+      (Closes: #466501)
+    + [RA] Also check for make -i when checking if errors from make clean or
+      distclean are ignored.  Thanks, Jörg Sommer.  (Closes: #469024)
+  * checks/changelog-file:
+    + [RA] Adjust for the extra space added by Parse::DebianChangelog when
+      checking line length.  Thanks, Robert Millan.  (Closes: #467019)
+  * checks/common_data.pm:
+    + [RA] Accept (and ignore for now) the new Checksums-Sha1,
+      Checksums-Sha256, and Checksums-Md5 fields in source packages.
+      Thanks, Raphael Hertzog.  (Closes: #466979)
+  * checks/control-file:
+    + [RA] Skip empty dependencies for stronger-dependency-implies-weaker.
+  * checks/control-files{.desc,}:
+    + [FL] Warn about empty control files. I can't see any use for
+      them. Exclude udebs though, since they might differ there.
+  * checks/copyright-file{.desc,}:
+    + [RA] Tests for copyright notices must be case-insensitive.  Patch
+      from Chris Lamb.  (Closes: #464992)
+    + [RA] When looking for cases where Copyright is separated from a year
+      by a newline, also allow (C) before or after the newline.  Thanks,
+      Michael Meskes.  (Closes: #465258)
+    + [RA] Further explain why lintian looks for a valid copyright notice.
+      (Closes: #466714)
+    + [RA] Suggest an override if only the Debian packaging or some other
+      part of the package not linked with OpenSSL is covered by the GPL.
+      Thanks, Andrew Pollock.  (Closes: #469106)
+  * checks/cruft{.desc,}:
+    + [FL] Add hg to the list of <vcs>-control-dir tags.
+    + [RA] In the long description of outdated-autotools-helper-file,
+      point to autotool-dev's documentation.  (Closes: #465132)
+    + [RA] Remove now-unnecessary workarounds for calling File::Find with
+      symlink starting directory.
+  * checks/debian-readme{.desc,}:
+    + [RA] Warn of references to /usr/doc in README.Debian.  Thanks,
+      Guillem Jover.  (Closes: #465192)
+  * checks/files{.desc,}:
+    + [FL,RA] Merge all the tags for vcs ignore files, inventory files,
+      and vcs control dirs. Since the explanations don't actually differ,
+      different tags make no sense. While at it, add the mercurial
+      equivalents as well and update some of the tag descriptions. Partly
+      based on a patch by Chris Lamb.
+  * checks/md5sums{.desc,}:
+    + [FL] Remove tag md5sums-control-file-is-empty in favour of
+      a more general tag in control-files.
+  * checks/manpages.desc:
+    + [RA] Mention in binary-without-manpage that if the man pages are
+      provided by another package on which this package depends, a lintian
+      override is appropriate.
+  * checks/menu-format:
+    + [RA] When the menu or desktop file invokes a quoted command via an
+      su program, don't try to check whether the command is in the
+      package.  Thanks, Paul Wise.  (Closes: #466665)
+  * checks/menus{,desc}:
+    + [RA] Check that doc-base files are encoded in UTF-8.  Thanks, Robert
+      Luberda.  (Closes: #468759)
+    + [RA] Check doc-base sections against the new canonical list.
+      Thanks, Robert Luberda.  (Closes: #463474)
+  * check/patch-systems:
+    + [HE] Warn if the .diff.gz contains changes while the package uses
+      a patch system. (Closes: #452215)
+  * checks/scripts{.desc,}:
+    + [FL] Warn if a maintainer script is a valid shell script but
+      doesn't seem to have any actual code.  Based on an idea
+      by Justin Pryzby.  (Closes: #410042)
+    + [RA] Update regexes based on checkbashisms to remove additional
+      false positives and add additional checks.  Thanks, Adam D. Barratt.
+    + [RA] Add kaptain.  Thanks, Tobias Toedter.  (Closes: #466701)
+    + [RA] Allow zsh-beta as an alternative to zsh.  Thanks, Joost van
+      Baal.  (Closes: #468362)
+    + [RA] Add yorick.  Thanks, Thibaut Paumard.  (Closes: #468370)
+    + [RA] Add warnings for dpkg --assert* flags for features that have
+      been guaranteed for nearly a decade.  Thanks, Bernhard R. Link.
+      (Closes: #467642)
+  * checks/shared-libs{,desc}:
+    + [RA] Rename sharedobject-in-library-directory-not-actually-a-shlib
+      to sharedobject-in-library-directory-missing-soname for clarity.
+      Thanks, Peter Eisentraut.  (Closes: #467425)
+
+  * data/doc-base/sections:
+    + [RA] New file listing known doc-base sections.
+
+  * debian/dirs:
+    + [RA] Install the base directory for the Lintian root here.
+  * debian/rules:
+    + [RA] Redo the installation rules to support arbitrary nesting under
+      the copied directories.  As a side effect, install
+      lib/Tags/ColonSeparated.pm, unbreaking the experimental
+      colon-separated output format.
+
+  * frontend/lintian:
+    + [CW] Make the presence of an Ubuntu release name in the version number
+      trigger the Ubuntu distribution field checks.
+    + [RA] Fix option parsing bug leading lintian to incorrectly reject -a
+      or -p without a package.
+
+  * lib/Dep.pm:
+    + [RA] Skip empty dependencies, avoiding false positives for
+      stronger-dependency-implies-weaker.  Patch from Adam D. Barratt.
+      (Closes: #469222)
+  * lib/Lintian/Data.pm:
+    + [RA] New module for loading and querying lists of keywords.
+  * lib/Read_pkglists.pm:
+    + [RA] Extract Uploaders from the source package list.
+  * lib/Spelling.pm:
+    + [RA] Add another spelling correction.
+    + [RA] Merriam-Webster and the OED have both given up on publically
+      vs. publicly, so we should as well.  (Closes: #466617)
+
+  * reporting/html_reports:
+    + [RA] Load the correct configuration file.
+    + [RA] Include packages for which one is an uploader in one's
+      maintainer page, marked accordingly.  (Closes: #421011)
+  * reporting/templates/*:
+    + [TK] Correct Lintian maintainers address in page footers.
+  * reporting/templates/maintainer.html:
+    + [RA] Include packages for which the maintainer is an uploader.
+
+  * unpack/list-srcpkg:
+    + [RA] Include Uploaders in the package list.
+  * unpack/unpack-srcpkg-l2:
+    + [RA] Don't rely on the output format of dpkg-source to learn the
+      source directory and create a symlink.  Instead, tell dpkg-source to
+      unpack the source directly into the unpacked directory.  Discard
+      output of dpkg-source to allow for the current version, which prints
+      things even with -q (fixed in later versions).  Thanks, Raphael
+      Hertzog.  (Closes: #468927)
+
+ -- Russ Allbery <rra@debian.org>  Mon, 03 Mar 2008 18:21:32 -0800
+
+lintian (1.23.45) unstable; urgency=low
+
+  The "100 open bugs is magical" release.
+
+  * checks/debconf:
+    + [RA] Recognize require as well as use when loading debconf modules
+      in Perl.  Thanks, Manoj Srivastava.  (Closes: #464775)
+  * checks/fields:
+    + [RA] Fix coding error that didn't allow python-all-dev to satisfy a
+      Python build dependency.  Thanks, Joerg Jaspert.  (Closes: #464709)
+  * checks/manpages:
+    + [RA] Ignore another undefined macro generated by pod2man (will be
+      fixed with the Pod::Man in Perl 5.10).
+  * checks/po-debconf:
+    + [RA] Also accept nnn_NN names for po files.  nds_DE and nds_NL are
+      valid locales.  Thanks, Christian Perrier.
+  * checks/scripts{.desc,}:
+    + [RA] Warn of use of start-stop-daemon in maintainer scripts unless
+      used with --stop.  Thanks, Kurt Roeckx.  (Closes: #381180)
+
+ -- Russ Allbery <rra@debian.org>  Fri, 08 Feb 2008 22:58:32 -0800
+
+lintian (1.23.44) unstable; urgency=low
+
+  The "I can't release a quick fix without *some* other work" release.
+
+  * checks/binaries:
+    + [RA] Make an architecture specification after perlapi optional.
+      Thanks, gregor herrmann.  (Closes: #464626)
+  * checks/copyright-file{.desc,}:
+    + [RA] Check the copyright file to ensure it contains at least one
+      copyright statement with a date or the term "public domain".  It's
+      hard to be thorough without false positives, but this should catch
+      the most obvious omissions.  Thanks, Justin Pryzby and Jari Aalto.
+      (Closes: #286842, #409131)
+  * checks/fields:
+    + [RA] Warn of build-dependencies on a Debian revision of -1.  They
+      make backporting unnecessarily difficult.  Thanks, Erich Schubert.
+      (Closes: #345487)
+  * checks/po-debconf:
+    + [RA] Accept three-character language codes for po files.  Thanks,
+      Patrick Winnertz and Eddy Petrișor.  (Closes: #464511)
+
+  * lib/Spelling.pm:
+    + [RA] Don't strip hyphens before checking spelling.  Move all D-Bus
+      corrections to the picky list since the correction is too confusing
+      even if accurate without capitalization.  Thanks, Nelson A. de
+      Oliveira.  (Closes: #464461)
+
+ -- Russ Allbery <rra@debian.org>  Thu, 07 Feb 2008 20:07:45 -0800
+
+lintian (1.23.43) unstable; urgency=low
+
+  The "37 bug fixes is enough for one release" release.
+
+  * checks/binaries{.desc,}:
+    + [RA] Don't require objdump's errors on files with bad dynamic tables
+      to start at the beginning of the line.  Patch from Chris Lamb.
+      (Closes: #459509)
+    + [RA] Warn for packages that have binaries requiring libc but which
+      don't depend on libc.  Patch from Niko Tyni.  (Closes: #461350)
+    + [RA] Remove check for libc5 binaries.  libc5 is long-gone.
+    + [RA] Remove various dead tag descriptions we no longer issue.
+    + [RA] Warn on packages that provide Perl modules but don't depend on
+      perlapi-*.  Thanks, Niko Tyni.  (Closes: #463142)
+    + [RA] Check files in /usr/lib/debug directories mirroring the main
+      file system to verify they are detached debugging symbols and not
+      full libraries or executables.  Thanks, Neil Williams and Niko
+      Tyni.  (Closes: #462456)
+  * checks/changelog-file:
+    + [RA] Decode the changelog entry from UTF-8 before doing length
+      checks.  Thanks, Cyril Brulebois.  (Closes: #461822)
+    + [RA] Check for mismatches between the latest changelog and
+      NEWS.Debian entries if they're for the same package version.
+      Thanks, Cyril Brulebois.  (Closes: #461823)
+  * checks/common_data.pm:
+    + [RA] Add Bugs, Origin, and Breaks to known binary and udeb fields
+      and Bugs to known source fields, matching current dpkg.  Thanks,
+      Raphaël Hertzog.  (Closes: #459787)
+  * checks/debhelper:
+    + [RA] CDBS now defaults to a debhelper compatibility level of V5.
+    + [FL] Update list of debhelper commands that modify maintainer
+       scripts. Add dh_icons, dh_installudev, dh_pysupport, dh_pycentral
+       and rename dh_installtexfonts to dh_installtex.
+    + [RA] Add checks for versioned debhelper dependencies for dh_icons
+      and dh_installifupdown.  Thanks, Evgeni Golov.  (Closes: #463028)
+  * checks/fields{.desc,}:
+    + [RA] The CDBS ant rules are in class, not rules.  Thanks, Cyril
+      Brulebois.  (Closes: #460168)
+    + [RA] Versioned Python dependencies satisfy a Python debian/rules
+      requirement.  Add a separate tag for Python build dependencies to
+      explain the dependency possibilities.  Ignore dh_python if
+      debian/pyversion or a Python-Version control field are present.
+      Thanks, Loïc Minier.  (Closes: #460625)
+    + [RA] Check that -dbg packages depend on their base package.  Patch
+      from Chris Lamb.  (Closes: #458785)
+    + [RA] Check the value of Dm-Upload-Allowed.
+    + [RA] Warn about packages with a list as the maintainer and no
+      Uploaders.  Thanks, Sune Vuorela.  (Closes: #462635)
+    + [RA] Remove the package-has-duplicate-relation test.  It gets
+      relations with different version strictness in different levels of
+      dependency wrong and what it gets right dpkg-gencontrol strips out.
+  * checks/files{.desc,}:
+    + [RA] In many of the long descriptions for symlink-related tags,
+      mention that running dh_link will fix symlink problems.
+    + [RA] Fix a long-standing error in the regex checking for *.desktop
+      files in /usr/share/gnome/apps that caused the tag to never be
+      issued.  Remove the check for /usr/share/applnk, since obsolete or
+      not KDE appears to actively use it still.
+    + [RA] Check for *.devhelp{2,} files not linked into devhelp's search
+      path.  Based on a patch by Bradley Smith.  (Closes: #273309)
+    + [RA] Warn about /etc/cron.{hourly,daily,weekly,monthly} scripts that
+      won't be executed by run-parts because of periods in the name.
+      Patch from Chris Lamb.  (Closes: #458742)
+    + [RA] Warn of .gitignore files installed by the package.  Patch from
+      Chris Lamb.  (Closes: #459502)
+    + [RA] Warn of more language extensions on files in the user's path.
+      Patch from Chris Lamb.  (Closes: #459514)
+    + [RA] Remove the tag for empty Perl directories.  The underlying
+      issue is fixed in Perl 5.10; there's no need to add code to
+      debian/rules when 5.10 is landing soon.  (Closes: #463138)
+  * checks/infofiles:
+    + [RA] Don't issue unknown-intepreter for maintainer scripts with
+      weird interpreters.  checks/scripts already handles this and the tag
+      wasn't defined.  Thanks, Thijs Kinkhorst.  (Closes: #460964)
+    + [RA] Fix Perl warnings given a zero-byte maintainer script.  Thanks,
+      Thijs Kinkhorst.  (Closes: #460966)
+  * checks/init.d{.desc,}:
+    + [RA] Downgrade a missing LSB Short-Description keyword to info since
+      it's not required for functionality.  Thanks, Petter Reinholdtsen.
+      (Closes: #460499)
+  * checks/manpages{.desc,}:
+    + [RA] Make hyphen-used-as-minus-sign more conservative to avoid false
+      positives with non-ASCII text and catch hyphens at the start of
+      lines.  Thanks, Michal Čihař.  (Closes: #459871)
+    + [CW] Use man's new --warnings option to catch use of undefined
+      strings, macros, or diversions in manual pages, which usually indicate
+      mistaken use of "." or "'" at the start of a line. This check is only
+      enabled if man 2.5.1 or later is installed.  (Closes: #377392)
+  * checks/menu-format:
+    + [RA] Avoid a Perl warning for desktop entries without Exec.
+    + [RA] Fix a bug that prevented Exec keys in desktop files from being
+      checked at all.  Thanks, Raphael Geissert.  (Closes: #462601)
+    + [RA] Exempt packages providing the su wrappers from the check for
+      using su-to-root.  Thanks, Raphael Geissert.
+  * checks/menus:
+    + [RA] Don't issue unknown-interpreter for maintainer scripts with
+      weird interpreters.
+    + [RA] Fix Perl warnings given a zero-byte maintainer script.
+  * checks/po-debconf:
+    + [RA] Exclude from not-using-po-debconf template files with only the
+      shared templates used for coordination with dictionaries-common.
+      Thanks, Thomas Bushnell BSG.  (Closes: #460731)
+  * checks/rules.desc:
+    + [RA] To fix an ignores-make-clean-error, suggest removing "-" for
+      static makefiles.  Thanks, Andrea Colangelo.  (Closes: #458164)
+  * checks/scripts{.desc,}:
+    + [RA] Re-add php4-cli as a valid interpreter for those who want to
+      maintain stable compatibility.  Thanks, Thomas Goirand.
+    + [RA] Be clearer in the tag name that php-cli dependencies should be
+      versioned.  Add more explanation to the long description of several
+      interpreter tags about limitations and requested bug filings.
+    + [RA] Remove tcl as a valid interpreter since tclx8.3 is obsolete.
+      (tclsh is the standard interpreter name.)
+    + [RA] Require versioned dependencies for OCaml scripts.  Each version
+      is ABI-incompatible.  Thanks, Samuel Mimram.  (Closes: #462065)
+    + [RA] Add tcl and tk metapackages.  Thanks, Sergei Golovan.
+      (Closes: #463281)
+    + [RA] Catch exec wrappers that use $* instead of $@ (not that this is
+      a good idea).  Thanks, Adam D. Barratt.  (Closes: #463476)
+    + [RA] Integrate several more bashism checks from checkbashisms in
+      devscripts.  Patch from Adam D. Barratt.  (Closes: #464026)
+
+  * debian/control:
+    + [RA] Suggest man-db >= 2.5.1 for better warning support.
+    + [RA] Wrap Uploaders.
+
+  * frontend/lintian:
+    + [RA] Include info tags in the broken-down description of the
+      override count since they're included in the total.  Based on a
+      patch by Chris Lamb.  (Closes: #459851)
+    + [RA] Don't try to report overrides when not checking a package.
+      Thanks, Håkon Stordahl.  (Closes: #461978)
+    + [RA] Cope with a relative path to the lab.  Patch from Håkon
+      Stordahl.  (Closes: #461982)
+    + [RA] Don't require *.changes files for source-only uploads to have a
+      Description field.  Thanks, Cyril Brulebois.  (Closes: #462586)
+
+  * lib/Spelling.pm:
+    + [RA] Add spelling corrections for PostgreSQL and OCaml and lots of
+      new capitalization corrections.  (Closes: #460347)
+
+ -- Russ Allbery <rra@debian.org>  Tue, 05 Feb 2008 21:07:30 -0800
+
+lintian (1.23.42) unstable; urgency=low
+
+  The "what did you do on your Christmas vacation?" release.
+
+  * checks/binaries:
+    + [RA] Don't warn about unstripped binaries in .../lib/debug.  Some
+      packages include debugging symbols in the main package.
+    + [RA] Allow rpath pointing to /usr/lib/games/<package>.  Thanks, Bas
+      Wijnen.  (Closes: #456318)
+    + [RA] Exclude nsswitch modules from multiple SONAME and package
+      naming checks.
+  * checks/changelog-file{.desc,}:
+    + [RA] Don't spell-check lines that include the word "spelling".
+      Thanks, Andreas Hoenen.  (Closes: #456515)
+    + [RA] Allow long no-whitespace lines even when spaces or bullets
+      precede the text.
+  * checks/common_data.pm:
+    + [RA] Remove the obsolete base section.  (Policy change pending).
+  * checks/control-file{.desc,}:
+    + [RA] Include the package name in stronger-dependency-implies-weaker.
+    + [RA] Fix stronger-dependency-implies-weaker description cut and
+      paste error.  Thanks, Rafael Laboissiere.  (Closes: #456405)
+  * checks/copyright-file{.desc,}:
+    + [RA] Warn about packages covered by the GPL and linked with libssl
+      that don't list other common licenses or mention a license exception
+      or exemption.  Requested by Joerg Jaspert.  (Closes: #454238)
+  * checks/cruft:
+    + [RA] Ignore debian/config.cache.
+  * checks/debconf{.desc,}:
+    + Remove partially-translated-question at the request of Christian
+      Perrier.  Only the translator could fix this, and debconf doesn't
+      show the translation unless it's complete.  (Closes: #459293)
+  * checks/debian-readme{.desc,}:
+    + Combine readme-debian-{is,contains}-debmake-template and be less
+      particular about the exact formatting of the dh-make template.
+      Triggering off the template text is enough and matches linda.
+      Thanks, Joerg Jaspert.  (Closes: #458074)
+  * checks/description{.desc,}:
+    + [RA] Do picky spelling and capitalization checks on the description
+      and note and explain this in the long description.
+  * checks/fields:
+    + [RA] Handle double-colon rules when checking that build dependencies
+      match debian/rules.  (Closes: #457501)
+    + [RA] Allow python-setuptools in Build-Depends for arch-independent
+      Python packages.  Thanks, Vincent Bernat.  (Closes: #459042)
+  * checks/fields.desc:
+    + [RA] Remove X.X.X versions from the debian-revision-not-well-formed
+      long description.  (Closes: #456286)
+    + [RA] Update references and binary-NMU version descriptions.
+  * checks/files:
+    + [RA] Ignore zero-length files in /usr/share/doc/examples.
+    + [RA] The underFooLicense.docbook files from KDE are not license
+      files.  Thanks, Sune Vuorela.  (Closes: #458831)
+    + [RA] Allow /emul as a top-level directory and files in
+      /emul/ia32-linux/{lib,usr/lib}.  (Closes: #459254)
+  * checks/files.desc:
+    + [RA] Remove a stray variable from the config-file-reserved tag.
+  * checks/init.d{.desc,}:
+    + [RA] Warn on init scripts that list S in their Default-Stop LSB
+      keyword.  Thanks, Petter Reinholdtsen.  (Closes: #458596)
+  * checks/menu-format{.desc,}:
+    + [RA] Fix non-wm-module-in-wm-modules-menu-section pluralization to
+      match the check and reword the long description to be hopefully
+      clearer.  Thanks, Martín Ferrari.  (Closes: #457527)
+    + [RA] Warn about use of su wrappers other than su-to-root for desktop
+      and Live CD support.  Thanks, Daniel Baumann.  (Closes: #453931)
+    + [RA] Only check for desktop files in /usr/share/applications.  The
+      ones elsewhere are too strange.  (Closes: #459252)
+  * checks/menus{.desc,}:
+    + [RA] Spelling errors in doc-base files should only be warnings.  Do
+      picky spelling and capitalization checks on the abstract and title
+      fields.
+  * checks/patch-systems:
+    + [RA] dpatch permits multiple patches to be listed on the same line
+      of 00list.  Patch by Chris Lamb.  (Closes: #457523)
+  * checks/scripts{.desc,}:
+    + [RA] Add lua40 and lua5.1.  Thanks, Enrico Tassi.  (Closes: #457219)
+    + [RA] Improve recognition of heredocs.
+    + [RA] Recognize quoted strings that start at beginning of the line.
+    + [RA] Rewrite script path and dependency checking.  Remove scripts
+      and packages no longer in the archive.  Add new versions of
+      versioned scripts and packages.  Fix the dependencies for pike
+      interpreters.  (Closes: #458896)
+    + [RA] Reformat long descriptions and collapse some tags.
+    + [RA] For consistent results, only syntax-check sh and bash scripts.
+      Also ignore all dpatch files, not just those in /usr/src.
+  * checks/shared-libs{.desc,}:
+    + [RA] New check for version numbers in symbol files.  Based on a
+      patch from Raphael Hertzog.  (Closes: #457067)
+    + [RA] Exclude nsswitch modules from shlibs file checks.
+    + [RA] ld.so may also look in /emul/ia32-linux/{lib,usr/lib}.
+
+  * debian/control:
+    + [RA] Suggest libtext-template-perl, needed for HTML reporting.
+  * debian/copyright:
+    + [RA] Add my copyright statement.
+    + [RA] Reference GPL-2, not the GPL symlink, reflecting our license.
+
+  * frontend/lintian:
+    + [RA] Merge all override messages into a single message per run.  Add
+      -q/--quiet option to suppress that message.  (Closes: #457513)
+    + [RA] Allow + and . in tag names in overrides.  Thanks, Stefan
+      Fritsch.  (Closes: #454790)
+    + [RA] Check that the argument to --color is valid.
+    + [RA] Warn about no package arguments unless --setup-lab or
+      --remove-lab are given.  Thanks, Damyan Ivanov.  (Closes: #455732)
+    + [RA] Add support for HTML coloring.  (Closes: #458376)
+  * frontend/lintian-info:
+    + [RA] Allow for HTML color tags.
+    + [RA] Add -a to annotate an override file.
+
+  * lib/Dep.pm:
+    + [RA] Allow substvars instead of package names so that dependency
+      checks against the source debian/control file don't treat all
+      substvars as equivalent.  Thanks, Julien Cristau.  (Closes: #456802)
+  * lib/Spelling.pm:
+    + [RA] Stop doing capitalization checks on all files; there's too much
+      of a risk of false positives.  Instead, provide a separate picky
+      spelling check function for package descriptions and similar cases
+      where we're more sure of the contents.
+    + [RA] Expand the picky capitalization checks to catch Debian, GNOME,
+      KDE, and Linux.  (Closes: #456582)
+  * lib/Tags.pm:
+    + [RA] Add support for HTML coloring.
+
+  * man/lintian.1:
+    + [RA] Document the --color=html and -q/--quiet options.
+  * man/lintian-info.1:
+    + [RA] Document the --annotate option.
+
+  * reporting/html_reports:
+    + [RA] Rewritten.
+      - Include info, experimental, and overridden tags in the tag pages.
+      - Generate a second report for each maintainer showing all tags.
+      - Correctly handle multiple different maintainer strings with the
+        same e-mail address.
+      - Correctly report the version number of a binary package when it
+        differs from the source package.  (Closes: #458036)
+      - Formatting changes (hopefully improvements) to the web pages.
+      - New template-driven system for easier revision of the HTML.
+  * reporting/lintian.css:
+    + [RA] New minimal style sheet for the HTML reports.
+  * reporting/templates/*:
+    + [RA] New Text::Template page templates for the HTML reports.
+
+  * testset/runtests:
+    + [RA] Test tags for valid characters.
+
+ -- Russ Allbery <rra@debian.org>  Sat, 05 Jan 2008 17:16:32 -0800
+
+lintian (1.23.41) unstable; urgency=low
+
+  The "it would be lovely if there were an actual desktop file standard"
+  release.
+
+  * checks/*.desc:
+    + [RA] Escape all literal angle brackets and fix unclosed and unknown
+      HTML tags.  Based on a patch by Thijs Kinkhorst.  (Closes: #455211)
+  * checks/field{.desc,}:
+    + [FL] Add some checks for the Homepage field:
+      - warn about enclosing < and >
+      - warn about non-absolute URLs
+  * checks/menu-format{.desc,}:
+    + [RA] Add Actions to the KDE-specific desktop file keys.  Add
+      Application as an acceptable Main Category even though it's not
+      listed in the standard; given how widely it's used, it doesn't
+      appear to be worth warning about right now.  (Closes: #444651)
+    + [RA] Add GNUstep as an acceptable Main Category, since it's used as
+      a non-standard category by GNUstep applications.
+    + [RA] Warn about desktop files containing CRLF line endings (and then
+      strip the CR for later checks).  The standard is explicit that each
+      line ends in only LF.
+  
+  * debian/control:
+    + [FL] Add liburi-perl to Depends for the Homepage checks.
+    + [RA] Wrap Depends for readability.
+
+  * testset/runtests:
+    + [RA] Check all tag descriptions for unknown or unclosed HTML tags
+      and for stray angle brackets.
+
+ -- Russ Allbery <rra@debian.org>  Sun, 09 Dec 2007 20:03:03 -0800
+
+lintian (1.23.40) unstable; urgency=low
+
+  The "Russ's brown paper bag bug" release.
+
+  * checks/doc-base:
+    + [RA] My mistaken precedence fiddling with the doc-base checks caused
+      them to warn about every abstract containing a period.  Patch from
+      Chris Lamb.  (Closes: #454941)
+
+  * lib/Spelling.pm:
+    + [RA] Add common mistakes for publicly and spelling.
+
+ -- Russ Allbery <rra@debian.org>  Sat, 08 Dec 2007 12:15:33 -0800
+
+lintian (1.23.39) unstable; urgency=low
+
+  The "Ubuntu and doc-base patch merge, with extra fixes" release.
+
+  * checks/*.desc:
+    + [RA] Remove the unused Standards-Version header.
+  * checks/changelog-file{.desc,}:
+    + [RA] Check the latest entry of the Debian changelog and any
+      NEWS.Debian file for common spelling errors.  (Closes: #36017)
+    + [RA] If this looks like a new package (Debian revision of -1 and
+      only one changelog entry), warn if it doesn't close a bug.  Thanks,
+      Margarita Manterola.  (Closes: #356051)
+    + [RA] Check for lines over 80 columns in the most recent entry.
+      Thanks, Guillem Jover.  (Closes: #435963)
+  * checks/copyright-file{.desc,}:
+    + [RA] Moved spelling-error-in-copyright check to here.
+  * checks/debconf:
+    + [RA] Go back to not warning about "no" in boolean debconf
+      questions.  The word is too common in normal English prose for
+      reasons other than assuming a particular debconf interface.  Thanks,
+      Rafael Laboissiere.  (Closes: #453177)
+  * checks/debian-readme{.desc,}:
+    + [RA] Moved spelling-error-in-readme-debian check to here.
+  * checks/description{.desc,}:
+    + [RA] Moved spelling-error-in-description check to here.
+  * checks/fields:
+    + [RA] Python documentation packages should still be in section doc.
+      Thanks, Michal Čihař.  (Closes: #454688)
+    + [RA] Warn about lib.*-dev packages not in section libdevel.
+    + [RA] Warn about debug packages that aren't priority: extra.  Thanks,
+      Joerg Jaspert.  (Closes: #454358)
+    + [RA] Ignore Original-Maintainer if the version contains ubuntu.
+    + [RA] Only warn about Section for Python packages starting with
+      python-, not py, since py picks up too many things that aren't
+      Python modules.
+    + [RA] Only warn about Section for Perl packages matching lib.*-perl
+      to avoid false positives for things like dh-make-perl.  Thanks,
+      Damyan Ivanov.  (Closes: #454723)
+  * checks/files:
+    + [RA] Warn about packages providing files in /usr/lib/debug that
+      aren't named -dbg.  Thanks, Joerg Jaspert.
+  * checks/lintian.desc:
+    + [RA] Add bad-ubuntu-distribution-in-changes-file, merged from the
+      Ubuntu patch.
+    + [RA] Fix the malformed-override long description.  Thanks, Stefan
+      Fritsch.
+  * checks/menus{.desc,}:
+    + [RA] Substantial overhaul and expansion of the doc-base control file
+      checks.  Patch from Robert Luberda.  (Closes: #448783)
+  * checks/nmu:
+    + [RA] No packages with ubuntu in the version number are NMUs.  Merged
+      from the Ubuntu patch.
+  * checks/patch-systems:
+    + [RA] Ignore blank lines in 00list and don't report them as patches
+      without descriptions.  Thanks, Julien BLACHE.  (Closes: #454730)
+  * checks/spelling{.desc,}:
+    + [RA] Subsumed into other check scripts and lib/Spelling.pm.
+
+  * frontend/lintian:
+    + [RA] If the version number indicates an Ubuntu package, check
+      against a different list of allowable distributions.  Merged from
+      the Ubuntu patch.
+    + [RA] Skip check and collection *.desc files whose names start with a
+      period (mostly to avoid testing artifacts from editor lock files).
+    + [RA] Restore previous override parsing and make the package name
+      optional again.  Thanks, Stefan Fritsch.  (Closes: #454790)
+    + [RA] Check overrides for implausible tags.
+
+  * lib/Spelling.pm:
+    + [RA] New module to do general spelling checks for specific
+      misspellings.  Based on the previous checks/spelling and a patch by
+      Robert Luberda.
+
+ -- Russ Allbery <rra@debian.org>  Fri, 07 Dec 2007 22:12:56 -0800
+
+lintian (1.23.38) unstable; urgency=low
+
+  * The "HE's brown paper bag bug" release
+
+  * checks/changelog-file:
+    + [RA] Don't warn about version numbers going backwards in the
+      changelog file if the comment says this is a backport.
+  * checks/patch-systems:
+    + [FL] Try appending .dpatch to patchnames found in 00list.
+           Patch by Leo Antunes. (Closes: #454516, #454518)
+  
+  * lib/Dep.pm:
+    + [FL] Fix "uninitialized value" warning in pred_implies().
+
+ -- Russ Allbery <rra@debian.org>  Wed, 05 Dec 2007 17:21:44 -0800
+
+lintian (1.23.37) unstable; urgency=low
+
+  The "Policy 3.7.3" release.
+
+  * checks/binaries:
+    + [HE] Fix RegEx to re-enable 'binary-in-etc' and
+           'arch-dependent-file-in-usr-share' checks. (Closes: #452336)
+    + [HE] When checking that a lib is linked against libc, search for
+           libc.so, not any library beginning with libc. Thanks for
+           the bug and patch to Ruben Porras <nahoo82@gmail.com>. (Closes:
+           #448652)
+    + [RA] Ignore the gf suffix from the gfortran migration when checking
+      whether the package name matches the SONAME.  Thanks, Kevin
+      B. McCarty.  (Closes: #448207)
+  * checks/changelog-file{.desc,}:
+    + [RA] Check that the latest changelog entry has a later version than
+      the previous entry.  Thanks, Thijs Kinkhorst.  (Closes: #449257)
+  * checks/common_data.pm:
+    + [RA] Add Dm-Upload-Allowed as a control field.  (Closes: #453779)
+  * checks/control-file{.desc,}:
+    + [RA] Diagnose stronger dependencies that imply weaker dependencies,
+      such as the same dependency in both Depends and Recommends or
+      Recommends and Suggests.  Thanks, Joerg Jaspert.  (Closes: #453302)
+    + [RA] Upgrade no-section-field-for-source to warning at the request
+      of Joerg Jaspert.
+  * checks/control-files:
+    + [RA] Add symbols as a known control file for debs and udebs.
+  * checks/copyright-file:
+    + [HE] Check that encoding of copyright file is UTF-8. Patch by
+           gregor herrmann <gregor+debian@comodo.priv.at>. (Closes: #451689)
+    + [HE] Add warning copyright-contains-dh_make-todo-boilerplate
+           if the maintainer left the dh_make boilerplate in the
+           copyright file. Based on patch by Cyril Brulebois
+           <cyril.brulebois@enst-bretagne.fr>. (Closes: #448677)
+    + [RA] Check for the complete GFDL included in the copyright file and
+      expand copyright-file-contains-full-gpl-license to look for GPL v3
+      references.  Also check for correct references to common-licenses
+      for the GFDL and LGPL.
+  * checks/deb-format:
+    + [HE] Remove, not needed any more. (Closes: #447257)
+  * checks/debconf:
+    + [HE] Explicitly allow the phrase "no longer" in boolean debconf
+      questions. (Closes: #447718)
+  * checks/description.desc:
+    + [RA] Upgrade the legacy Homepage tag to a warning.
+  * checks/fields:
+    + [HE] Add 'doc-package-should-be-section-doc',
+           'python-package-should-be-section-python',
+           'perl-package-should-be-section-perl'. Ideas shamelessy
+           stolen from linda. (Closes: #452839)
+    + [RA] Allow Python dependencies in Build-Depends when using another
+      variant for calling Python in the clean target.  Thanks, Bernd
+      Zeimetz.  (Closes: #444642)
+  * checks/files{.desc,}:
+    + [HE,RA] Add 'package-contains-empty-directory' check, but ignore
+      dirs in /var and /etc and handle /usr/lib/perl5 and /usr/share/perl5
+      directories separately with a lower priority level since they're
+      very common.  (Closes: #452316, #357838)
+    + [HE] Add checks for game packages that contain no game executables
+           (package-section-games-but-contains-no-game) or that contain
+           anything in usr/bin at all, which is usually a mistake.
+           (package-section-games-but-contains-no-game). (Closes: #451668)
+    + [RA] Downgrade symlink-should-be-relative to a warning since it's a
+      Policy should.  Thanks, Thijs Kinkhorst.  (Closes: #454239)
+  * checks/lintian.desc:
+    + [RA] Add critical as a recognized urgency.
+  * checks/patch-systems:
+    + [HE] Add complete new check script, intended to check for usual
+           problems when using patch systems. Start with three
+           checks for common dpatch problems. Idea loosely based on
+           patch by Carl Fürstenberg <azatoth@gmail.com>. (Closes: #437959)
+  * checks/po-debconf.desc:
+    + [RA] not-using-po-debconf is now an error per Policy section 3.9.1.
+  * checks/rules:
+    + [HE] Implement 'binary-arch-rules-but-pkg-is-arch-indep', checking
+           for rules in binary-arch when the package is arch: all.
+           (Closes: #409109, #119097)
+    + [HE] Implement 'desktop-file-but-no-dh_desktop-call', checking for
+           missing dh_desktop calls when .desktop files are installed in
+           a debhelperized package. (Closes: #409138)
+  * checks/scripts:
+    + [HE] Allow packages to drop snippets into /etc/csh/login.d
+           without a dependency on csh. Files there should also
+           be allowed to have csh in the shebang line. (Closes: #453417)
+    + [HE] Allow packages to drop snippets into /etc/fish.d/ without
+           a dependecy on fish. (Closes: #453416)
+    + [RA] Remove possible-non-posix-code-in-maintainer-script entirely.
+      Debian Policy now allows local and test -a/-o specifically and this
+      is pointless portability.
+  * checks/standards-version:
+    + [RA] 3.7.3 is now the current Standards-Version and anything older
+      than 3.6.2 is ancient.
+
+  * debian/control:
+    + [TK] Add Vcs-* fields to point to Lintian's repository.
+    + [RA] Update standards version to 3.7.3.
+  * debian/dirs:
+    + [RA] Stop creating empty /usr/share/lintian/{overrides,info}
+      directories.  The latter is no longer used and the former is shipped
+      with packages that include overrides.
+
+  * frontend/lintian:
+    + [RA] Add critical as a recognized urgency.
+    + [RA] Diagnose malformed override entries; don't just ignore them.
+    + [RA] Fix some odd formatting.
+    + [RA] Display a summary of overridden tags as an N: output line.
+      Requested by Steve McIntyre.  (Closes: #452804)
+
+  * man/lintian.1:
+    + [RA] Be clearer about what files lintian takes as arguments; in
+      particular, mention that source packages are checked by providing
+      the .dsc file as an argument.  (Closes: #441636)
+    + [RA] Fix a slight spacing problem with the --color flag.
+    + [RA] Remove mention of unused /usr/share/lintian/info directory.
+
+  * lib/DebVersions.pm:
+    + [RA] Remove.  This isn't used by anything and would produce
+      incorrect results (it doesn't understand ~), and Dep.pm provides
+      version comparison routines that use dpkg.
+  * lib/Tags.pm:
+    + [RA] Keep statistics on overrides by severity.
+
+  * reporting/html_reports:
+    + [RA] Change the layout of the per-maintainer lintian pages.  Now,
+      each report will be in /reports/maintainer/<email>.html where
+      <email> is the maintainer's e-mail address with unsafe characters
+      replaced by _.  This should allow better links from the QA pages.
+      Thanks, Stefano Zacchiroli.
+
+  * unpack/list-srcpkg:
+    + [RA] Escape ; and newline characters in all package fields before
+      writing them to the index (uncovered when someone accidentally
+      appended a package description to Standards-Version).
+
+ -- Russ Allbery <rra@debian.org>  Tue, 04 Dec 2007 16:43:13 -0800
+
+lintian (1.23.36) unstable; urgency=low
+
+  The "grand open change and desktop cleanup" release.
+
+  * {checks,collection,depcheck,frontend,lib,reporting,unpack}/*:
+    + [RA] Use the three-argument form of open uniformly, whether needed
+      or not, to head off further quoting and whitespace interpretation
+      bugs.
+  
+  * checks/files{.desc,}:
+    + [RA] Catch .DS_Store.gz files as well.
+    + [RA] Warn about ._ Mac OS X resource files in the package.
+    + [RA] Add a hopefully helpful note about how cruft from other
+      operating systems can show up in binary packages.
+  * checks/menu-format:
+    + [RA] Fix detection of commands for menu entries when the command is
+      given with its full path.  (Closes: #446796)
+    + [RA] Remove Actions from known desktop keys again, as I believe the
+      root problem was our willingness to inspect desktop types other than
+      Application (also fixed in the previous release).
+    + [RA] Fix Perl flow error when skipping some desktop files.
+    + [RA] Skip unknown and deprecated key warnings and encoding key
+      warnings in desktop files if they were of an unknown type.
+
+  * lib/Dep.pm:
+    + [RA] Fix negative implication in some boundary cases when comparing
+      two versioned relationships in the same direction.  Thanks to
+      Raphael Hertzog for the analysis and fix.  (Closes: #446768)
+
+ -- Russ Allbery <rra@debian.org>  Mon, 15 Oct 2007 21:23:16 -0700
+
+lintian (1.23.35) unstable; urgency=low
+
+  The "frantic bug catchup" release.
+
+  * checks/changelog-file{.desc,}:
+    + [RA] Add some basic checks for NEWS.Debian files: naming,
+      compression, encoding, a syntax check with Parse::DebianChangelog,
+      and unreleased for the distribution.  (Closes: #437707)
+  * checks/common_data.pm:
+    + [RA] Allow Homepage in source and binary packages.
+  * checks/control-file:
+    + [RA] Support and ignore comments in debian/control.  Thanks, Julien
+      Cristau.  (Closes: #440830)
+    + [RA] Check for XS-Vcs-* headers and recommend (at info level) that
+      they be changed to Vcs-* headers.  (Closes: #444661)
+  * checks/cruft.desc:
+    + [RA] Fix incorrect tag name for patch failure files.  Thanks, Romain
+      Francoise.  (Closes: #437463)
+  * checks/debconf:
+    + [RA] A cdebconf that supported error was released with sarge, so
+      don't require a versioned cdebconf dependency.  Thanks, Thijs
+      Kinkhorst.  (Closes: #438860)
+    + [RA] Various improvements from Thomas Huriaux: Diagnose select
+      templates with only yes/no options, diagnose more question prompts,
+      warn on any questions in the extended description, allow yes/no
+      mentions in non-boolean templates, and catch more first-person
+      language.  (Closes: #439508)
+    + [RA] More exactly follow the Developer's Reference recommendations
+      by only requiring open prompts for string and password prompts and
+      only complaining about imperative wording for select and multiselect
+      templates.  Thanks, Steve Langasek.  (Closes: #442711)
+  * checks/description{.desc,}:
+    + [RA] Warn (at info level for now) about Homepage pseudo-fields in
+      the extended description.  (Closes: #444336)
+  * checks/fields:
+    + [RA] Allow python-all as yet another way of satisfying a Python
+      build dependency.  (Closes: #444642)
+  * checks/fields.desc:
+    + [RA] Properly escape < and >.
+  * checks/files{.desc,}:
+    + [RA] Warn about Thumbs.db files, which are usually useless Windows
+      thumbnail databases.  Thanks, Paul Wise.  (Closes: #438202)
+    + [RA] Warn about .DS_Store files, used by Mac OS X to store extended
+      folder attributes.  Thanks, Paul Wise.  (Closes: #438203)
+    + [RA] Improve the recommended command to remove .packlist files.
+      Thanks, Justin Pryzby.
+    + [RA] Don't think hard links are zero-length files.
+    + [RA] Diagnose files with names ending in whitespace.
+  * checks/infofiles:
+    + [RA] Emacs 22 now allows embedded images in info files, so accept
+      and ignore PNG files in the info directory.  More image types may be
+      needed.  Thanks, Andreas Metzler.  (Closes: #438602)
+  * checks/menu-format{.desc,}:
+    + [RA] Reserved categories are okay in .desktop files if OnlyShowIn is
+      present, and generally deserve their own separate tag regardless.
+      Thanks, Michael Biebl.  (Closes: #442709)
+    + [RA] Ignore categories beginning with "X-", reserved for category
+      extensions.  Thanks, Josselin Mouette.  (Closes: #443827)
+    + [RA] Allow Actions keys.  This isn't in the desktop standard but
+      is widely used.  Thanks, Raphael Geissert.  (Closes: #444651)
+    + [RA] Ignore desktop files not for one of the known types.  This
+      should significantly reduce the noise for KDE packages.
+    + [RA] Only check whether a program referenced by Exec is in the
+      package if the desktop file is in /usr/share/applications.  Too many
+      applications use Exec for desktop files elsewhere without the
+      standard PATH.
+    + [RA] Ignore Exec fields pointing to kcmshell.
+    + [RA] Ignore desktop files in /usr/share/doc or that appear to be
+      templates.
+    + [RA] Avoid uninitialized warnings on all-whitespace commands.
+  * checks/menus:
+    + [RA] Find the targets of hard links correctly.  (Closes: #444355)
+    + [RA] Use the three-argument form of open to not fail on doc-base
+      files ending in whitespace.  Error on doc-base files with Document
+      fields that end in whitespace, since currently they break multiple
+      tools.  Thanks, Ian Zimmerman.  (Closes: #444889)
+  * checks/nmu.desc:
+    + [RA] Remove obsolete note about binary NMUs.  Patch from Thijs
+      Kinkhorst.  (Closes: #437925)
+  * checks/scripts{.desc,}:
+    + [RA] We now have a csh package.  Allow it as an alternative for csh
+      script dependencies.  Thanks, Bernd Zeimetz.  (Closes: #440825)
+    + [RA] Allow install-sgmlcatalog --remove in postinst as well as
+      prerm and suggest removing it entirely in the long description.
+  * checks/version-substvars.desc:
+    + [RA] Properly escape < and >.
+
+  * collection/changelog-file{.desc,}:
+    + [RA] Collect NEWS.Debian as well as changelog.
+
+ -- Russ Allbery <rra@debian.org>  Sun, 14 Oct 2007 22:29:51 -0700
+
+lintian (1.23.34) unstable; urgency=low
+
+  The "brown paper operator" release.
+
+  * frontend/lintian:
+    + [RA] Use =~ with regexes, not eq.  Thanks, Guillem Jover.
+      (Closes: #436180)
+
+ -- Russ Allbery <rra@debian.org>  Sun, 05 Aug 2007 19:58:38 -0700
+
+lintian (1.23.33) unstable; urgency=low
+
+  The "menu and cruft reorganization" release.
+  
+  * checks/common_data.pm:
+    + [CW] Add automaken as a known virtual package.
+    + [CW] Update architectures to dpkg 1.14.5, adding solaris-* and lpia.
+    + [RA] Add %known_obsolete_emacs.
+  * checks/cruft{.desc,}:
+    + [RA] Check for .git directories in source packages.  Thanks, Julien
+      Cristau.  (Closes: #433516)
+    + [RA] Substantially rewrite how all cruft checking against source
+      packages is done, incorporating debdiff in the process.  There are
+      now two tags for most source package cruft problems: one for files
+      introduced in the Debian diff or in a native package, and one for
+      files present upstream.  The former is at warning severity and the
+      latter is at info severity, since it's usually not worth repackaging
+      the upstream source to remove such files.  In the process,
+      standardize the names of all of the tags and pull the regexes out
+      into data instead of code for easier maintenance.  (Closes: #434744)
+  * checks/debdiff{.desc}:
+    + [RA] Removed, incorporated into checks/cruft.
+  * checks/debian-readme:
+    + [RA] Replace all uses of tag_error and tag_warn with just tag.
+  * checks/fields{.desc,}:
+    + [RA] Tag packages listing emacs21 as the preferred Emacs flavor in a
+      dependency.  Thanks, Tatsuya Kinoshita.  (Closes: #434978)
+    + [RA] Start tagging unversioned dependencies on coreutils again since
+      the transition from fileutils is long-since finished.  Thanks,
+      Guillem Jover.  (Closes: #436058)
+  * checks/files{.desc,}:
+    + [RA] Check for .git directories in binary packages.
+  * checks/menu-format{.desc,}:
+    + [RA] Switch to the new menu hierarchy, which will be in the next
+      release of Policy.  Add specific checks for the major renamings to
+      hopefully cut down on the confusion and provide some specific
+      guidance.  Remove the code that allowed for applications to create
+      new sub-menus, since the current menu documentation says not to do
+      that.  (Closes: #431844)
+    + [RA] Add checks of desktop files.  The checks so far are basic, but
+      do include key and category verification.  Based heavily on work by
+      Javier Fernández-Sanguino Peña.  (Closes: #277441, #433411)
+  * checks/scripts{.desc,}:
+    + [RA] If rm output is redirected to /dev/null, don't think that rm is
+      removing /dev/null.  Thanks, Robert Luberda.  (Closes: #431259)
+    + [RA] xjed also provides jed-script.  Thanks, Jörg Sommer.
+      (Closes: #431629)
+    + [RA] Don't complain about ruby libraries in /usr/lib/ruby that have
+      shebang lines.  This is a common means for embedding unit tests in
+      Ruby libraries.  Thanks, Paul van Tilburg.  (Closes: #431545)
+    + [RA] Don't push depending directly on update-inetd in the long
+      description of maintainer-script-needs-depends-on-update-inetd.
+      Most packages should depend on inet-superserver.  Leave the check
+      the same for the time being, however.
+    + [RA] Replace all uses of tag_error and tag_warn with just tag.
+  * checks/shared-libs:
+    + [RA] Exclude udebs from dependency checking in the shlibs files
+      since binary packages may legitimately declare udeb dependencies on
+      other packages.  Thanks, Loïc Minier.  (Closes: #431395)
+  * checks/spelling:
+    + [RA] Replace all uses of tag_error and tag_warn with just tag.
+  * checks/version-substvars:
+    + [RA] Don't skip other checks for binNMUability when warning about
+      the deprecated ${Source-Version} substvar.  Thanks, Lior Kaplan.
+      (Closes: #432959)
+
+  * frontend/lintian:
+    + [RA] Add \w+-backports to the known distribution list.  Thanks,
+      Vincent Danjean.  (Closes: #432268)
+
+  * lib/Tags.pm:
+    + [RA] Replace any newlines in the extra information to the tag
+      function with \n.
+
+  * man/lintian.1:
+    + [RA] Remove the mention of the debdiff check script.
+
+ -- Russ Allbery <rra@debian.org>  Sun, 05 Aug 2007 11:59:15 -0700
+
+lintian (1.23.32) unstable; urgency=low
+
+  The "stability of output" release.
+
+  * checks/binaries:
+    + [RA] Sort the package SONAMEs to provide more stable lintian tags.
+      Patch from Cyril Brulebois.  (Closes: #428681)
+  * checks/files{.desc,}:
+    + [RA] Limit the Zope license exception to only .dtml, .pt, and .cpt
+      files.  Thanks, Bernd Zeimetz.
+    + [RA] Sort the files listed in package-contains-hardlink so that the
+      lintian output is stable regardless of the hash order of the
+      directory when the tar file was built.
+    + [RA] Don't incorrectly skip all other file location checks for hard
+      links.
+    + [RA] Check for files installed in /usr/lib/sgml.  This transition
+      was probably completed long ago, but checking for regression can't
+      hurt.  (Closes: #90019)
+  * checks/manpages{.desc,}:
+    + [RA] Check for dh_make man page templates (by looking for the
+      template whatis entry).  Thanks, Bill Allombert.  (Closes: #173583)
+  * checks/menus:
+    + [RA] Avoid a quadratic search of the files in the package on
+      doc-base files that list tons of files individually.  This speeds up
+      a lintian check of openoffice.org-dev-doc enormously.
+  * checks/po-debconf:
+    + [RA] Close the template file handle between files so that the line
+      numbers for translated default fields are correct.
+  * checks/rules{.desc,}:
+    + [RA] Check for ignoring all errors from make clean or make distclean
+      and recommend skipping the call if there's no Makefile instead.
+      Thanks, Branden Robinson.  (Closes: #325372)
+  * checks/scripts{.desc,}:
+    + [RA] Add Octave as an interpreter, and allow both versioned and
+      unversioned forms.  Thanks, Sebastian Harl.  (Closes: #428403)
+    + [RA] Check for deprecated install-sgmlcatalog usage.
+  * checks/shared_libs:
+    + [RA] Report the correct file for shlib-with-nonpic-code rather than
+      the last shlib in the package.  (Closes: #429840, #429528)
+
+  * frontend/lintian:
+    + [RA] Don't require -v in order to report unused overrides; they're
+      already info-level tags, which is enough hiding.
+    + [RA] Remove old dead unused override code.
+
+  * reporting/html_reports:
+    + [RA] Fix a Perl warning when generating the clean maintainer pages.
+
+  * unpack/unpack-binpkg-l1:
+    + [RA] Sort the output of tar tfv by filename so that the lintian
+      output will be stable regardless of the hash order of the directory
+      when the tar file was built.
+
+ -- Russ Allbery <rra@debian.org>  Thu, 21 Jun 2007 01:47:53 -0700
+
+lintian (1.23.31) unstable; urgency=low
+
+  The "back under 100 open bugs" release.
+
+  * checks/changelog-file:
+    + [RA] Only check for missing colons in bug closers in the most recent
+      changelog entry.  Thanks, Thijs Kinkhorst.  (Closes: #423171)
+  * checks/common_data.pm:
+    + [RA] Update architectures to dpkg 1.14.1.  Remove all linux-*
+      architectures and add armel.  (Closes: #421995)
+  * checks/control-files.desc:
+    + [RA] Change unknown-control-file to a warning, since Policy only
+      discourages it and doesn't outlaw it.  (Closes: #287209)
+  * checks/cruft:
+    + [RA] Allow any automake package to satisfy the autotools-dev build
+      dependency for suppressing warnings about out of date autotools
+      helper files.  (Closes: #417067)
+  * checks/fields:
+    + [RA] Require libmodule-build-perl in Build-Depends if the clean rule
+      runs perl Build.  Hopefully this isn't too aggressive.  Thanks, Ian
+      Beckwith.  (Closes: #421549)
+  * checks/files:
+    + [RA] Don't warn about LICENSE files in Zope products, since they may
+      be used for runtime display.  (Closes: #424164)
+  * checks/manpages:
+    + [RA] Avoid false positives on binaries with X11 in the name.  Patch
+      from Kevin B. McCarty.  (Closes: #423229)
+  * checks/menu-format.desc:
+    + [RA] Improve the pkg-not-in-package-test long description and add a
+      manual reference.  (Closes: #423519)
+  * checks/menus:
+    + [RA] Allow multiple blank lines between doc-base sections and
+      trailing blank lines in the file.  doc-base is fine with this.
+      Reported by Luis Rodrigo Gallardo Cruz.  (Closes: #423096)
+  * checks/scripts:
+    + [RA] Add pagsh, provided by openafs-client and heimdal-clients.
+    + [RA] Diagnose removal of device files in maintainer scripts per
+      Policy 10.6.  (Closes: #268688)
+    + [RA] Add jruby1.0.  Thanks, Sebastien Delafond.  (Closes: #426950)
+    + [RA] Add jed and friends.  Thanks, Jörg Sommer.  (Closes: #426469)
+    + [RA] Move several maintainer script checks specific to shell scripts
+      inside the conditional so that they won't run on maintainer scripts
+      not written in shell.
+    + [RA] Diagnose maintainer scripts looking at /var/lib/dpkg/status
+      directly.  Thanks, Guillem Jover.  (Closes: #426628)
+    + [RA] Diagnose direct modifications to /etc/services, /etc/protocols,
+      /etc/rpc, and /etc/inetd.conf in maintainer scripts.  (Yes, an
+      eight-year-old bug!)  (Closes: #32532)
+  * checks/version-substvars{.desc,}:
+    + [RA] Add a check for deprecated ${Source-Version} substvars.  Patch
+      from Guillem Jover.  (Closes: #427577)
+
+  * frontend/lintian-info:
+    + [CW] Fix uninitialized value warning after reading a blank line.
+
+ -- Russ Allbery <rra@debian.org>  Mon, 04 Jun 2007 20:29:55 -0700
+
+lintian (1.23.30) unstable; urgency=low
+
+  The "beating false positives off with a stick" release.
+
+  * checks/common_data.pm:
+    + [RA] Add mktemp and sysvinit-utils as known essential packages.
+    + [RA] Add Vcs-Mtn and Vcs-Browser to the known source package
+      fields.
+    + [RA] Add Kernel-Version to known udeb control fields.
+  * checks/control-files:
+    + [RA] Allow clilibs, but don't try to check the syntax of it yet.
+      Thanks, Sebastian Dröge.  (Closes: #378088)
+  * checks/copyright-file:
+    + [RA] Exclude the Affero General Public License from the check for
+      references to the shared GPL copy.  (Closes: #420077)
+    + [RA] Replace yet another hand-rolled dependency parser with Dep.
+  * checks/cruft{.desc,}:
+    + [RA] Check for svk commit message files.
+  * checks/debconf{.desc,}:
+    + [RA] Remove the dependency check for SETTITLE since all debconf
+      implementations back to oldstable support it.
+    + [RA] Reduce the dependency check for error templates to info since
+      all debconf implementations back to stable support it.
+  * checks/debhelper{.desc,}:
+    + [RA] Downgrade the dependency check for dh_python and the Python
+      policy to info since all debhelpers back to stable support it.
+    + [RA] Downgrade the dependency check for compatibility level V5 to
+      info since all debhelpers back to stable support it.
+  * checks/fields{.desc,}:
+    + [RA] The CDBS Python rules only call pycentral or pysupport during
+      the binary targets, so those dependencies can be safely moved to
+      Build-Depends-Indep.  Still allow them in Build-Depends, though,
+      since that's where CDBS likes to put them.  Thanks, Tristan
+      Seligmann.  (Closes: #420526)
+    + [RA] Allow the Python core packages themselves to depend on
+      python-minimal.
+    + [RA] Remove the version constraints for python-central and
+      python-support dependencies since stable released with a working
+      version and they weren't in oldstable.
+    + [RA] Remove the dependency check on dh_installxfonts for the X.Org
+      transition since the debhelper released with stable does the right
+      thing and this dependency is not useful for backports to oldstable.
+    + [RA] Remove the version on the quilt dependency check.  It's not
+      worth the effort to maintain a separate version check for oldstable
+      backports.  (Closes: #420160)
+  * checks/files{.desc,}:
+    + [RA] Check for svk commit message files.
+    + [RA] Don't consider {copying,license}.dtd extra license files; the
+      Mozilla suite uses them for non-licenses.  (Closes: #420558)
+    + [RA] Use $pkg rather than reading fields/package for the x11-common
+      pre-depend check.
+    + [RA] Allow x11-common to install /usr/X11R6/bin.
+    + [RA] Downgrade the pre-depends on x11-common requirement for
+      packages installing into /usr/include/X11 or /usr/lib/X11 to info
+      since it's only needed for upgrades from sarge or early etch.
+  * checks/md5sums:
+    + [RA] Don't warn about a missing md5sums file if the package contains
+      nothing for which we would generate an MD5 checksum.  Thanks,
+      Andreas Beckmann.  (Closes: #420465)
+  * checks/manpages:
+    + [RA] Cope with more uses of - in *roff escapes that don't need
+      hyphen warnings.
+    + [RA] Don't consider a binary an X binary if it's a symlink into
+      /etc/X11.  (seyon does something weird but probably legitimate.)
+    + [RA] Fix manpage-for-non-x11-binary-in-wrong-directory and
+      manpage-for-x11-binary-in-wrong-directory output.  (Closes: #295072)
+  * checks/menus{.desc,}:
+    + [RA] In doc-base control files, check for Index fields for HTML and
+      Info documents and require that each section after the header have a
+      Format field.  Thanks, Bernhard R. Link.  (Closes: #419847)
+  * checks/rules:
+    + [RA] Listing a rule as a dependency of .PHONY is sufficient to mark
+      it as present for GNU make and hence sufficient for Policy's
+      requirement.  Thanks, Peter Eisentraut.  (Closes: #419446)
+  * checks/scripts{.desc,}:
+    + [RA] Packages calling update-xmlcatalog must depend on xml-core.
+      Also avoid false positives when a package itself provides the
+      program its maintainer scripts use.  Thanks, Daniel Leidert.
+      (Closes: #419461)
+    + [RA] Check for maintainer scripts calling read (but exclude those
+      that include /usr/share/debconf/confmodule on the grounds that
+      they're probably only using it as a fallback).  Based on a patch by
+      Luk Claes.  (Closes: #231770)
+    + [RA] Add pike7.6 and ruby1.9 as valid interpreters.
+    + [RA] Diagnose use of /bin/env with a more specific message than the
+      generic unusual interpreter tag.
+    + [RA] Remove the version constraint on the gconf-schemas check since
+      all versions of gconf2 back to stable provide this script and it's
+      not worth maintaining a separate check for oldstable backports.
+  * checks/shared-libs{.desc,}:
+    + [RA] Warn if a package declares dependencies in its shlibs control
+      file that cannot be satisfied by that package (including via
+      Provides).  (Closes: #56440)
+
+  * reporting/harness:
+    + [RA] Include overridden tags in the lintian output so that we can do
+      statistical reporting on them and see them in lintian.log.
+  * reporting/html_reports:
+    + [RA] Create stub pages for maintainers with only lintian-clean
+      packages.  (Closes: #305173)
+    + [RA] Sort packages on each maintainer's page.
+    + [RA] Report statistics on info tags as well.
+    + [RA] Generate better file names for maintainer pages with weird
+      characters.
+    + [RA] Fix Perl warnings.
+
+ -- Russ Allbery <rra@debian.org>  Sat, 28 Apr 2007 16:31:31 -0700
+
+lintian (1.23.29) unstable; urgency=low
+
+  The "look at all the stuff that accumulated during the etch freeze"
+  release.
+
+  * COPYING:
+    + [CW] Update to current text of GPL v2 (which talks about the GNU
+      Lesser General Public License rather than Library, etc.; no functional
+      changes).
+
+  * checks/changelog-file{.desc,}:
+    + [RA] Check for bug closers without a colon after closes, but only if
+      there are at least six digits in the bug number and no non-digits.
+      Suggestion from Jari Aalto.  (Closes: #373918)
+  * checks/copyright-file{.desc,}:
+    + [JA] Update usr-doc-* test to report user-share-doc-* instead.
+      New tests added: postinst-should-not-set-usr-doc-link,
+      doc-base-file-references-usr-doc.
+      Patch from Thijs Kinkhorst.  (Closes: #406349).
+  * checks/common_data.pm:
+    + [JA] Perl syntax corrections.
+    + [JA] Support the Autobuild: and Vcs-* fields in .dsc files.
+      Applied patch to implement this by Ian Beckwith.  (Closes: #403553).
+  * checks/control-file:
+    + [RA] Allow source in main to generate contrib packages.  Thanks,
+      Bdale Garbee.  (Closes: #401881)
+  * checks/cruft{.desc,}:
+    + [RA] Use Dep to check autotools-dev build dependency rather than
+      rolling our own dependency parsing, thus avoiding problems when it's
+      the first dependency.  Thanks, Tilman Koschnick.  (Closes: #412406)
+    + [RA] Mention that including CVS or .svn directories in a release
+      tarball should generally be reported as an upstream bug.  Qualify
+      the statement that export should be used instead of checkout to
+      refer to snapshot packaging.  Thanks, Jari Aalto.  (Closes: #373668)
+    + [RA] Allow a build dependency on automake to satisfy the
+      autotools-dev requirement since users may use autoreconf to update
+      config.{sub,guess}.  Thanks, Jordà Polo.  (Closes: #417067)
+  * checks/debconf:
+    + [RA] Rather than munging dependencies to cope with the various
+      implementations of debconf, take advantage of our new dependency
+      comparison routines and check the full correct dependency.  This
+      should really fix problems with checking the dependencies for
+      settitle.  Patch from Damyan Ivanov.  (Closes: #349616)
+    + [RA] Check that an appropriate versioned dependency on debconf
+      and/or cdebconf is present if error template types are used.
+      Thanks, Christian Perrier.  (Closes: #416140)
+  * checks/debhelper.desc:
+    + [RA] Use consistent file naming when diagnosing possibly conflicting
+      debhelper compat settings.  Thanks, Jari Aalto.  (Closes: #409122)
+  * checks/fields{.desc,}:
+    + [RA] Add an exception to maintainer-not-full-name for Wookey and a
+      comment to consider removing the check if we get more false
+      positives.  Thanks, Neil Williams.  (Closes: #406731)
+    + [RA] Rename build-depends-indep-should-be-build-depends to
+      clean-should-be-satisfied-by-build-depends to make the reason for
+      the message clearer without running lintian -i.  Thanks to Osamu
+      Aoki for the suggestion.  (Closes: #405840)
+    + [RA] Recognize the +bX convention for binary NMUs.  Warn about use
+      of the old three-part version numbers.
+  * checks/files{.desc,}:
+    + [RA] Diagnose creation of subdirectories of /usr/bin other than mh
+      and the legacy X11 directory.  (Closes: #417912)
+  * checks/manpages:
+    + [RA] When checking for hyphen used as a minus sign, avoid false
+      positives on \s-1 (small font) and \*(-- (pod2man long dash).
+    + [RA] Display the full path for binary-without-manpage tags to make
+      it easier to track down problems.
+    + [RA] Ignore binaries in subdirectories of the normal binary
+      directories (other than /usr/bin/X11 and /usr/bin/mh).  These should
+      be caught by other checks and the man page warnings would likely be
+      confusing noise.
+  * checks/menu-format{.desc,}:
+    + [RA] If a menu icon isn't an absolute path, only look for it in
+      /usr/share/pixmaps, not in the old X11R6 paths.  Update the long tag
+      description accordingly.
+  * checks/menus:
+    + [JA] Perl syntax corrections.  Removed extra empty newlines.
+  * checks/lintian.desc:
+    + [RA] List emergency as a valid urgency.
+  * checks/nmu{.desc,}:
+    + [RA] List the exact phrases recognized by lintian as marking an NMU.
+      Reported by Jari Aalto.  (Closes: #409108)
+    + [RA] Recognize the +bX convention for binary NMUs.
+  * checks/po-debconf:
+    + [RA] Now that we're passing --use-untranslated to msgcmp, we have to
+      compare the generated pot file with the one in the package both
+      directions to catch all out of date errors.  Thanks, Thomas
+      Huriaux.  (Closes: #402662)
+  * checks/rules{.desc,}:
+    + [RA] Fix the policy section for debian-rules-missing-required-target
+      and debian-rules-not-a-makefile.  Thanks, Daniel Kahn Gillmor.
+      (Closes: #414964)
+    + [RA] Warn about use of $(PWD) instead of $(CURDIR).
+    + [RA] Setting DH_COMPAT globally in debian/rules is now deprecated in
+      favor of debian/compat.  Patch from Luk Claes.  (Closes: #330025)
+  * checks/scripts{.desc,}:
+    + [RA] update-inetd is now its own package and netbase may not always
+      depend on it.  Update the check to require a dependency on
+      update-inetd, inet-superserver, or one of the inet-superserver
+      packages that provides update-inetd.  Reported by Tatsuya Kinoshita.
+      (Closes: #402319)
+    + [RA] Mention SUSv3 in the bashism and non-posix tag descriptions,
+      note that use of test -a/-o and local aren't bugs but may still be
+      worth avoiding, and mention short circuiting of && and ||.  (Thanks
+      to Jari Aalto for the latter).
+    + [RA] Add /usr/bin/gbr2, provided by gambas2-runtime.  Thanks, José
+      "L. Redrejo" Rodríguez.  (Closes: #403515)
+    + [RA] Add /usr/bin/jruby0.9, provided by jruby0.9.  Thanks, Sebastien
+      Delafond.  (Closes: #418105)
+
+  * doc/README:
+    + Document --color option.  Based on a patch from Loïc Minier.
+
+  * depcheck/deppages.pl:
+    + [JA] Perl syntax corrections.
+  * depcheck/report2html.pl:
+    + [JA] Perl syntax corrections.
+
+  * frontend/lintian:
+    + [JA] Removed trailing spaces and other perl syntax corrections.
+    + [RA] Add --color option to optionally colorize lintian tags based on
+      their severity.  Based on a patch from Loïc Minier.
+    + [RA] Accept emergency as a valid urgency and check urgencies
+      case-insensitively since that's what Policy specifies.  Thanks, Joey
+      Hess.  (Closes: #412577)
+  * frontend/lintian-info:
+    + [RA] Ignore ANSI color sequences when parsing lintian tags.
+
+  * lib/Checker.pm
+    + [JA] Perl syntax corrections.
+  * lib/Lab.pm
+    + [JA] Perl syntax corrections.
+  * lib/Tags.pm
+    + [JA] Perl syntax corrections.
+    + [RA] Support for colorizing lintian tags based on their severity.
+      Based on a patch from Loïc Minier.  (Closes: #399714)
+
+  * man/lintian.1:
+    + [RA] Document --color.  Based on a patch from Loïc Minier.
+
+  * unpack/unpack-*pkg*
+    + [JA] Perl syntax corrections.
+
+ -- Russ Allbery <rra@debian.org>  Tue, 10 Apr 2007 21:08:23 -0700
+
+lintian (1.23.28) unstable; urgency=high
+
+  * collection/objdump-info:
+    + [RA] Remove unsafe temporary file creation in left-over debugging
+      code added accidentally when fixing #399456.  Thanks, Josh
+      Triplett.  (Closes: #414237)
+
+ -- Russ Allbery <rra@debian.org>  Fri,  9 Mar 2007 22:58:59 -0800
+
+lintian (1.23.27) unstable; urgency=low
+
+  The "we haven't run this against the whole archive in a while" release
+
+  * checks/binaries{.desc,}:
+    + [RA] Tag unrecognized ELF binaries as apparently corrupted rather
+      than failing with a note that binutils-multiarch is required.  Some
+      packages have had ELF binaries recognized by file but unreadable.
+      Reported by Bill Allombert.  (Closes: #399456)
+  * checks/infofiles:
+    + [RA] Don't consider /usr/share/infon to be an info directory.
+      Reported by Joachim Breitner.  (Closes: #399857)
+  * checks/md5sums:
+    + [RA] Also don't complain about missing md5sums for files in
+      /var/lib/ispell as they're changed after installation.  Thanks,
+      Agustin Martin.  (Closes: #401070)
+  * checks/po-debconf:
+    + [RA] gettext 0.16's msgcmp requires --use-untranslated when checking
+      for newer templates than PO files or it gives false positives for
+      every package.  Thanks, Damyan Ivanov.  (Closes: #400957)
+    + [RA] Don't consider directories to be stray template files even if
+      named template.  Thanks, Thomas Huriaux.  (Closes: #401442)
+  * checks/shared-libs:
+    + [RA] Don't report shlib-with-non-pic-code unless we're sure that
+      we're looking at a shared library.  Otherwise, we get many false
+      positives on some platforms where text relocations are normal for
+      binaries.  Reported by Bill Allombert.  (Closes: #399525)
+
+  * collection/file-info:
+    + [RA] Unescape non-ASCII characters escaped by tar before running
+      file on the resulting filename.  Otherwise, file can't find the
+      file, exits with an error, and lintian aborts.  Reported by Bill
+      Allombert.  (Closes: #399392)
+  * collection/objdump-info:
+    + [RA] Include unrecognized format errors from objdump in the output
+      rather than aborting; some packages contain apparently corrupt ELF
+      binaries.
+
+  * debian/control:
+    + [RA] Depend on gettext 0.16 or later for --use-untranslated.
+
+  * lib/Lab.pm:
+    + [RA] Preserve the old package lists when setting up a static lab so
+      that the unpack programs can build a list of changed packages and
+      incremental mode works.  Thanks, Bill Allmobert.  (Closes: #400342)
+
+  * unpack/list-udebpkg:
+    + [RA] Handle compressed udeb Packages files.  Thanks, Bill
+      Allombert.  (Closes: #400338)
+
+ -- Russ Allbery <rra@debian.org>  Sun,  3 Dec 2006 11:06:33 -0800
+
+lintian (1.23.26) unstable; urgency=low
+
+  * checks/binaries{.desc,}:
+    + [RA] Add a policy reference for unstripped-binary-or-object.
+      Thanks, Bas Wijnen.  (Closes: #394419)
+    + [RA] Add a special exception to the shared library dependency check
+      for the dynamic loader itself.
+  * checks/changelog-file.desc:
+    + [RA] Downgrade to a warning several errors with changelog files,
+      including compression and a text version of HTML changelogs, that
+      are only shoulds in Policy.  (Closes: #289723)
+    + [RA] Cleaned up language and use of unbalanced single quotes in
+      numerous descriptions.
+  * checks/control-file{.desc,}:
+    + [RA] Diagnose a control file that creates binary packages in a
+      different archive category from the source package or the other
+      binary packages.  Idea from Yann Dirson.  (Closes: #394720)
+    + [RA] Close opened files.
+    + [RA] Add info-level check for Section in the source section of the
+      control file.  (Closes: #322244)
+  * checks/cruft{.desc,}:
+    + [RA] Tighten the timestamp check on config.{sub,guess} to look for
+      files dated 2004 or newer, since that's when x86_64 was added.
+      Increase to an error at the request of Ryan Murray since we already
+      suppress this warning of config.{guess,sub} are modified by the
+      Debian patch or if the package build-depends on autotools-dev.
+      (Closes: #190897)
+  * checks/debconf{.desc,}:
+    + [RA] Take into account comma escaping when checking the number of
+      translated choices.  Reported by Frans Pop.  (Closes: #395028)
+    + [RA] Only require debconf be loaded in the postinst script if a
+      config script exists.  Reported by Josselin Mouette.
+    + [RA] Require pre-depends on debconf if debconf is used in the
+      preinst script.  Update the long description to deprecate only
+      depending on debconf and falling back on another configuration
+      system.  Reported by Josselin Mouette.  (Closes: #395468)
+    + [RA] Warn of debconf notes displayed with low or medium priority,
+      with an exception for Policy-required device file warnings.  Based
+      on a patch by Thomas Huriaux.  (Closes: #389070)
+    + [RA] Close files after opening them, fixing incorrect line numbers
+      when reporting problems with config scripts.
+  * checks/debdiff{.desc,}:
+    + [RA] Check for creation of ~ and .xxx.swp backup files in the Debian
+      diff, but only at the info level for now since they cause no harm.
+      (Closes: #332770)
+  * checks/fields{.desc,}:
+    + [RA] Clarify in missing-build-dependency why lintian does not take
+      into account transitive build dependencies.  (Closes: #393975)
+    + [RA] Avoid Perl warning when diagnosing a Python-Version of the form
+      "all, >= 2.4".  Thanks, Thijs Kinkhorst.  (Closes: #394104)
+    + [RA] Teach the debian/rules parsing about make conditionals and
+      don't require build dependencies for lines encountered inside a
+      conditional (in other words, assume people using conditionals know
+      what they're doing).  Fixes a false positive due to the unusual
+      arch-specific build dependencies for openoffice.org, reported by
+      Rene Engelhard.  (Closes: #380286)
+  * checks/files{.desc,}:
+    + [RA] Check for vim .swp files in the package.
+    + [RA] Split the warning for NFS temporary files into a separate tag
+      from the warning for editor backup files.
+  * checks/infofiles:
+    + [RA] Close opened files.
+    + [RA] debhelper no longer adds a --section flag to install-info, so
+      don't warn about any install-info invocation without --section.
+      Instead, check each info file for INFO-DIR-SECTION and diagnose
+      calling install-info without --section if any info file is missing
+      this information.  (Closes: #97502, #398670)
+    + [RA] Checks for the compression and suffixes of info files were not
+      being run due to a mistake in specifying either /usr/info or
+      /usr/share/info as an info directory.  Re-enable them.
+  * checks/md5sums{.desc,}:
+    + [RA] Add a tag for a missing md5sums control file, but only at info
+      level, at least for now.  (Closes: #133027)
+    + [RA] Do better syntax checking of the md5sums control file and
+      report malformed lines as a tag rather than aborting lintian.
+    + [RA] Downgrade file-missing-in-md5sums to a warning since it doesn't
+      break the package or debsums and may be intentional.
+  * checks/menu.desc:
+    + [RA] Remove stray commas in Ref strings since the reporting code
+      considers commas to be separating two different references.
+  * checks/menu-format{.desc,}:
+    + [RA] Support the sux, gksu, and kdesu wrappers in menu commands as
+      well as su-to-root.  (Closes: #360227)
+    + [RA] Fix tag name for menu-icon-cannot-be-parsed.  Thanks, Bill
+      Allombert.  (Closes: #399245)
+  * checks/po-debconf{.desc,}:
+    + [RA] Check for misnamed PO files in debian/po, which cause
+      translations to be merged into the template with the wrong names and
+      not found.  Based on a patch by Thomas Huriaux.  (Closes: #387360)
+  * checks/shared-libs:
+    + [RA] Calling ldconfig is also required for libraries installed in
+      various subdirectories of its standard search path based on hardware
+      capabilities.  Reported by Aurelien Jarno.  (Closes: #396278)
+
+  * debian/rules:
+    + [RA] Exclude testset/diffs/binary.c~ from dh_clean.
+
+  * frontend/lintian:
+    + [RA] Add --fail-on-warning option to exit with non-zero status if
+      any warnings were found.  Thanks, Daniel Bonniot.  (Closes: #189656)
+
+  * man/lintian.1:
+    + [RA] Document --fail-on-warning.
+
+ -- Russ Allbery <rra@debian.org>  Sat, 18 Nov 2006 17:21:22 -0800
+
+lintian (1.23.25) unstable; urgency=low
+
+  The "dependency and debconf" release
+
+  * checks/debconf:
+    + [CW] Don't trigger partially-translated-question when Choices-C exists
+      but not Description-C.
+    + [RA] Remove select-with-translated-default-field since there are
+      cases where this is correct and we can perform a better check
+      against the source package.  Patch from Thomas Huriaux.
+    + [RA] Fix Perl warnings when a template has no type.
+  * checks/debdiff:
+    + [RA] Remove the source-tar-is-posix-tar tag.  This was only a
+      problem for woody and earlier, and woody support is no longer
+      needed.  Reported by Loïc Minier.  (Closes: #385833)
+  * checks/fields{.desc,}:
+    + [RA] Improve the long descriptions of the warnings about dependencies
+      on essential or build-essential packages to make it clearer that the
+      correct resolution is normally to omit the dependency and why.
+    + [RA] Add a check for duplicate build dependencies.  (Closes: #359178)
+  * checks/files:
+    + [RA] Don't consider files named license.rb to be extraneous
+      licenses.  Patch from NIIBE Yutaka.  (Closes: #387269)
+  * checks/init.d:
+    + [RA] Correctly handle LSB keywords which are present but have an
+      empty value.  Reported by Erich Schubert.  (Closes: #386968)
+  * checks/lintian.desc:
+    + [RA] Add tags for missing and bad Urgency fields in *.changes files.
+    + [RA] Improve the no-description-in-changes-file information.
+  * checks/md5sums:
+    + [RA] aspell dictionary packages may ship files in /var/lib/aspell
+      that should not have MD5 checksums in md5sums because they change
+      after installation.  Don't complain that those files are missing.
+  * checks/po-debconf:
+    + [RA] Avoid Perl warnings on .po files that don't contain msgstr
+      lines.  Patch from Thomas Huriaux.  (Closes: #387357)
+    + [RA] Check templates for a translatable Default or DefaultChoice
+      field and warn if there isn't a translator comment.  Patch from
+      Thomas Huriaux.  (Closes: #388824)
+  * checks/scripts:
+    + [RA] Add /usr/bin/gosh from the gauche package to the list of valid
+      interpreters.  Thanks, Tatsuya Kinoshita.  (Closes: #386798)
+    + [RA] Add a separate tag for tclsh dependencies to explain about the
+      virtual package and improve the description of the wish virtual
+      package in its tag.  Fix inverted logic that got the wish dependency
+      backwards.  Reported by Hamish Moffatt.  (Closes: #387845)
+    + [RA] Allow tcsh to satisfy a csh dependency.  Reported by Yann
+      Dirson.  (Closes: #389615)
+    + [RA] Improve the check for shell scripts that are actually exec
+      wrappers around scripts written in another language.
+    + [RA] Allow update-inetd to fulfill the dependency requirements for
+      the update-inetd script.  Thanks, Michael Holzt.  (Closes: #389960)
+
+  * frontend/lintian:
+    + [RA] Check the existence and value of the Urgency field in *.changes
+      files.  (Closes: #384219)
+
+  * lib/Dep.pm:
+    + [RA] Improve the dependency resolution engine so that it can prove
+      aa|bb implies aa|bb|cc.  Fix the comparison of dependencies for
+      inverse implication to catch many more cases.  (The latter code
+      isn't currently used in lintian.)
+    + [RA] Add an unparse function to take an internal representation and
+      convert it back to human-readable text.
+    + [RA] Significantly improve and rewrite the get_dups function to only
+      find relations that imply each other and to return the complete
+      duplicate dependencies in sets.
+
+  * man/lintian.1:
+    + [RA] Document setting TMPDIR to change the location of lintian's
+      temporary lab.  (Closes: #388786)
+
+ -- Russ Allbery <rra@debian.org>  Sun,  8 Oct 2006 12:57:05 -0700
+
+lintian (1.23.24) unstable; urgency=low
+
+  The "LSB init script" release
+
+  * checks/control-files:
+    + [RA] perm2oct definition moved to Util.pm.
+  * checks/cruft{.desc,}:
+    + [RA] Remove the (info-level) check for .cvsignore files in the
+      source tarball.  This isn't an error; those files contain metadata
+      that may be useful for people making modifications and it's quite
+      common to distribute them.
+  * checks/debconf{.desc,}:
+    + [RA] Diagnose unknown priorities in db_input and db_text
+      invocations.  Patch from Thomas Huriaux.  (Closes: #386014)
+  * checks/fields{.desc,}:
+    + [RA] Depending on versioned variants of python-minimal is also an
+      error.  Thanks, Adeodato Simó.  (Closes: #384476)
+  * checks/files:
+    + [RA] perm2oct definition moved to Util.pm.
+  * checks/init.d{.desc,}:
+    + [RA] Added a warning for init scripts missing an LSB keyword
+      section, checks of the syntax of such a section if present, and
+      some basic semantic checks of the easiest fields.  Based on initial
+      work by Carlos Villegas.  (Closes: #377740)
+  * checks/menus:
+    + [RA] perm2oct definition moved to Util.pm.
+  * checks/scripts:
+    + [RA] Properly concatenate the dependencies for a package when
+      checking whether the dependency for an interpreter is included.
+      Thanks, Vincent Danjean.  (Closes: #385178)
+  * checks/shared-libs:
+    + [RA] perm2oct definition moved to Util.pm.
+
+  * lib/Util.pm:
+    + [RA] Move perm2oct to here and improve recognition of s, S, t, and T
+      characters.  Thanks to Justin B. Rye for patch.  (Closes: #376119)
+
+ -- Russ Allbery <rra@debian.org>  Mon,  4 Sep 2006 12:03:16 -0700
+
+lintian (1.23.23) unstable; urgency=low
+
+  The "new Python policy" release
+
+  * checks/binaries.desc:
+    + [RA] Greatly expand the binary-or-shlib-defines-rpath long
+      description based on recent discussion in debian-policy.  Add a
+      reference to the wiki page.  (Closes: #378054, #378055)
+  * checks/changelog-file{.desc,}:
+    + [RA] Diagnose changelog files that are symlinks, using the new way
+      the changelog-file collection script processes them.
+  * checks/common_data.pm:
+    + [RA] Add Python-Version as a known source and binary field.
+  * checks/copyright-file:
+    + [RA] Catch "<fill in http/ftp site>" as well as the string without
+      "http/".  Thanks, Jari Aalto.  (Closes: #374167)
+  * checks/deb-format{.desc,}:
+    + [RA] Remove deb-created-with-broken-tar; the bug was actually in
+      dpkg, and the dpkg in stable has been fixed.  Thanks Jari Aalto and
+      Thijs Kinkhorst.  (Closes: #375638, #376030)
+  * checks/debconf:
+    + [RA] Diagnose a missing template description only once and avoid
+      Perl warnings.  Thanks, Thomas Huriaux.  (Closes: #377654)
+  * checks/debhelper:
+    + [RA] Use the standard control file parser rather than a custom
+      parser that can't handle continuation lines.
+    + [RA] Warn if dh_python is used without debian/pycompat in non-CDBS
+      packages and check for the debhelper version required for Python
+      policy.  Thanks, Raphaël Hertzog.  (Closes: #375318)
+  * checks/fields{.desc,}:
+    + [RA] Don't warn virtual-package-depends-without-real-package-depends
+      for Recommends and rewrite the tag description to be more accurate.
+      Thanks to Martin F. Krafft for the report.  (Closes: #370720)
+    + [RA] ~ is now permitted in version numbers.  (Closes: #381965)
+    + [RA] Catch and check dependencies correctly for debconf-updatepo run
+      from the clean target.  Thanks, James Westby.  (Closes: #380399)
+    + [RA] Warn when encountering an aspell dictionary package that isn't
+      arch: all.  Thanks, Piotr Engelking.  (Closes: #374899)
+    + [RA] Check the syntax of the new Python-Version field.
+    + [RA] Check for missing build dependencies on python-central or
+      python-support.  Thanks, Raphaël Hertzog.
+    + [RA] Check for old << dependencies on Python in Python packages that
+      lack a Python-Version control field, as these are probably packages
+      that don't follow the new Python policy.  Thanks, Raphaël Hertzog.
+  * checks/files{.desc,}:
+    + [RA] Provide a better explanation of why Debian packages shouldn't
+      ship files in /srv.  (Closes: #379176)
+    + [RA] Warn about files installed into /etc/gconf/schemas.
+    + [RA] Warn about files in /usr/lib/site-python.  Thanks, Thomas
+      Viehmann and Raphaël Hertzog.  (Closes: #372748)
+  * checks/manpages{.desc,}:
+    + [RA] Warn about manpage short descriptions of the form "manual page
+      for program" (usually generated by help2man).
+  * checks/menu:
+    + [RA] Ignore trailing whitespace in doc-base files.  Patch from Bas
+      Zoetekouw.  (Closes: #379749)
+  * checks/nmu{.desc,}:
+    + [RA] When checking for an NMU changelog entry, require "NMU" be
+      surrounded by word boundaries.
+    + [RA] Warn if the changelog incorrectly indicates an NMU.  Thanks to
+      George Danchev for the report.
+  * checks/scripts{.desc,}:
+    + [RA] Except mkstemp from possibly-insecure-handling-of-tmp-files for
+      maintainer scripts written in Perl.
+    + [RA] Mention [[ ]] explicitly in the possible-bashism long
+      description as requiring a Korn shell and make it clearer that the
+      primary arbiter of this test is the POSIX shell specification.
+      (Closes: #381800 by clarification)
+    + [RA] Use the Dep library to check dependencies.  Add php5 to the
+      interpreter list and correctly handle the dependencies for
+      version-less PHP scripts.  (Closes: #379558)
+    + [RA] Check for proper dependencies if gconf-schemas is called in
+      maintainer scripts and diagnose calling gconftool(-2) directly.
+      Thanks, Josselin Mouette.  (Closes: #333311)
+  * checks/version-substvars{.desc,}:
+    + [RA] New check from Adeodato Simó for proper use of substvars for
+      versioned dependencies between packages built from the same source
+      package so that NMUs will work properly.  Also catch use of such a
+      substvar for a versioned dependency on a package not built from the
+      same source.  (Closes: #377141, #376596)
+
+  * collection/changelog-file:
+    + [RA] Be much more careful about changelog files that are symlinks.
+      Don't skip over changelog symlinks just because they point to
+      non-existant files, mark unsafe symlinks or symlinks to non-existent
+      files by creating copyright as a symlink to a non-existent file in
+      the lab, and don't create an empty dummy changelog if we couldn't
+      find a changelog.  Correctly handle changelog files that are
+      symlinks to other files in the same directory.
+
+  * debian/copyright:
+    + [RA] Add Subversion repository location.
+
+  * frontend/lintian:
+    + [JvW] Give error if there is no "Description" field in .changes, this is
+      required by dak
+
+  * frontend/lintian-info:
+    + [RA] Add the -t or --tags option that, given a tag name, prints out
+      the description.  (Closes: #376109)
+
+  * lib/Tags.pm:
+    + [RA] If a tag has been overriden via any mechanism, do not add it to
+      any of the statistics (tag, severity, or significance).  Before, the
+      override only suppressed a record for the specific statistic the
+      override was based on, meaning that classic tag-based overrides
+      didn't suppress severity statistics.  Overridden error tags would
+      therefore cause lintian to exit with non-zero status.  Thanks,
+      Andree Leidenfrost and Martin F. Krafft.  (Closes: #377182, #374314)
+
+  * man/lintian.1:
+    + [RA] Better document the --archivedir and --dist options and how
+      lintian constructs the path to an archive.  (Closes: #383203)
+    + [RA] Document new version-substvars check script.
+  * man/lintian-info.1:
+    + [RA] Document the new -t or --tags option.
+
+  * reporting/html_reports:
+    + [RA] Include the lintian version in HTML page footers.  Thanks,
+      Thijs Kinkhorst.  (Closes: #377616)
+
+ -- Russ Allbery <rra@debian.org>  Mon, 21 Aug 2006 10:28:14 -0700
+
+lintian (1.23.22) unstable; urgency=low
+
+  * checks/debconf:
+    + [JvW] Teach lintian to know about the 'error' debconf template
+      question type. (Closes: #374399)
+    + [RA] Exclude debconf templates with "for internal use" in the short
+      description from style checks and document this in the log
+      description of the tags most likely to trigger on internal
+      templates.  (Closes: #368206)
+  * checks/common_data.pm:
+    + [RA] Add amd64 to the standard architectures.  (Closes: #367324)
+  * checks/debhelper:
+    + [RA] Use the Dep library to check debhelper build dependencies
+      rather than parsing Build-Depends with regexes.  This avoids false
+      positives due to matching package names ending in debhelper.
+      Reported by Fabio Tranchitella.  (Closes: #366531)
+  * checks/fields:
+    + [RA] Allow build-depend on quilt if clean depends on the xsfclean
+      rule, for packages maintained by the X Strike Force.
+    + [RA] CDBS packages that use the python-distutils class should list
+      Python in Build-Depends, not Build-Depends-Indep, since CDBS wants
+      to use it in debian/rules clean.  Thanks, Jan Lübbe.
+    + [HE] Add check for build-deps on build-essential. Yes, people do that.
+    + [RA] Recognize direct invocations of quilt in clean rules and allow
+      Build-Depends on quilt in that case.  Reported by Sam Hocevar.
+      (Closes: #374878)
+    + [RA] Fix handling of versioned Build-Depends to avoid spurious
+      build-depends-without-arch-dep warnings.  Reported by Marcus
+      Better.
+    + [RA] Don't require Build-Depends on perl even if run explicitly in
+      debian/rules clean, since perl-base may be sufficient.  Catch more
+      ways perl could be run, including the common idiom for packages that
+      use Build.PL.
+    + [RA] Downgrade build-depends-without-arch-dep to info from warning.
+      Policy doesn't require using Build-Depends-Indep for
+      arch-independent packages and the test has a lot of false positives.
+    + [RA] Require ant in Build-Depends when using the CDBS ant rule.
+    + [RA] Bypass the build-depends-without-arch-dep check entirely when
+      using ant, since determining which Java dependencies are then
+      permissible in Build-Depends is too complex to do a proper job.
+      Reported by Peter Eisentraut.  (Closes: #372190)
+    + [RA] Only allow patch in Build-Depends for yada unpatch, don't
+      require it, since yada depends on patch.  (Closes: #375479)
+  * checks/po-debconf:
+    + [RA] Don't consider templates.in to be a stray translated template
+      file.  Thanks, Thomas Huriaux.  (Closes: #367534)
+
+  * lib/Util.pm:
+    + [RA] Pass the --wildcards option to tar, now required by a change in
+      the default tar semantics.  (Closes: #375246)
+
+ -- Russ Allbery <rra@debian.org>  Tue, 27 Jun 2006 17:50:05 -0700
+
+lintian (1.23.21) unstable; urgency=low
+
+  * checks/menus:
+    + [RA] Tell Perl where common_data.pm is since we're now including it.
+      Doh.  Thanks, Nelson A. de Oliveira.  (Closes: #366481)
+
+ -- Russ Allbery <rra@debian.org>  Mon,  8 May 2006 18:52:45 -0700
+
+lintian (1.23.20) unstable; urgency=low
+
+  The "Policy backlog clearing is a wonderful sight" release
+
+  * checks/debconf{.desc,}:
+    + [RA] Add checks for the Developer's Reference guidelines for debconf
+      templates.  Based on a patch by Thomas Huriaux.  (Closes: #362145)
+  * checks/fields{.desc,}:
+    + [RA] xfonts-encodings is also not an xfont package.  Thanks, Drew
+      Parsons.  (Closes: #365503)
+    + [RA] Report errors for dependencies on python-minimal.  Thanks to
+      Steve Langasek for the analysis.
+    + [RA] Allow a build-dependency on patchutils when using CDBS with one
+      of the patch systems, as patchutils may be optionally used to check
+      for bad patches.  Thanks, Marc Dequènes (Duck).  (Closes: #365466)
+    + [RA] Since some packages should be in Build-Depends and some should
+      be in Build-Depends-Indep, report all of the misplaced ones rather
+      than just the first one.  That way, users know which to move.
+    + [RA] Allow perl in Build-Depends if invoked in clean rules.
+    + [RA] Allow patch in Build-Depends if yada unpatch is invoked in
+      clean rules.
+  * checks/files{.desc,}:
+    + [RA] Add an explicit check for non-world-readable executables to
+      provide a more detailed explanation and tighten the accepted
+      permissions of setuid and setgid executables to just the permissions
+      mentioned in Policy 10.9.  Add Policy 10.9 references to the
+      descriptions.  Reported by Piotr Engelking.  (Closes: #365452)
+    + [RA] Add a request to the descriptions of setuid and setgid tags to
+      add a lintian override for documentation if the permissions are
+      intentional.
+    + [RA] Report a more specific tag for binaries that are owned by group
+      games but are not setgid.
+    + [RA] Remove the check for files in /usr/lib/cgi-bin.  This policy
+      change was reverted.
+    + [RA] Allow files installed in /usr/include/X11 and /usr/lib/X11 but
+      require Pre-Depends on x11-common (>= 1:7.0.0).  Remove the
+      duplicate check for files in /usr/bin/X11 since it no longer adds
+      additional information.
+  * checks/menus{.desc,}:
+    + [RA] Check that all files referenced in doc-base control files are
+      present in the package, based on a patch by Robert Luberda.  Also
+      check that Index references only one file and that Format names a
+      known format.  (Closes: #196122)
+    + [RA] Fix incomplete diagnosis of missing calls to update-menus.
+    + [RA] Change postrm to prerm in the check for a useless install-docs
+      call; calling install-docs in postrm is always a warning and useless
+      calls in prerm were not being diagnosed.
+  * checks/po-debconf{.desc,}:
+    + [RA] Exempt packages that use yada from the POTFILES.in check and
+      from checking for up-to-date templates, since yada does this at
+      build time.  Reported by Piotr Roszatycki.  (Closes: #321139)
+    + [RA] Check for stray debconf-mergetemplate files in packages
+      using po-debconf.  Thanks, Martin Quinson.  (Closes: #232442)
+    + [RA] General cleanup of tag descriptions for grammar and markup.
+      Move man page references into Ref fields.
+  * checks/shared-libs.desc:
+    + [RA] Document that exceptions to the -fPIC rule for shared libraries
+      are possible and ask that such exceptions be documented with lintian
+      overrides.
+  * checks/standards-version:
+    + [RA] Update to 3.7.2.  (Closes: #366233)
+    + [RA] Report the current standards version when warning about too old
+      or too new versions.  Thanks, Jari Aalto.  (Closes: #366104)
+
+  * debian/control:
+    + [RA] Update standards version to 3.7.2 (no changes required).
+    + [RA] Update description to note calibration for Policy 3.7.2.
+
+ -- Russ Allbery <rra@debian.org>  Mon,  8 May 2006 13:22:03 -0700
+
+lintian (1.23.19) unstable; urgency=low
+
+  The "Policy 3.7.0" release
+
+  * checks/fields{.desc,}:
+    + [RA] python-all-dev also satisfies dh_python's requirements.
+      Thanks, Marc Dequènes (Duck).  (Closes: #364943)
+    + [RA] Allow python in Build-Depends if it's invoked explicitly in the
+      clean rule.  Thanks, Marc Dequènes (Duck).  (Closes: #365030)
+    + [RA] Recognize the CDBS included rule files that indicate dpatch or
+      quilt will be used, check those dependencies, and require that they
+      be in Build-Depends since they're used for clean.  Thanks, Marc
+      Dequènes (Duck).  (Closes: #365041)
+  * checks/files{.desc,}:
+    + [RA] Add the references to Policy for the deprecation of X11R6
+      directories now that Policy has been updated in 3.7.0.0.
+    + [RA] Policy now mandates FHS 2.3.  Update tag descriptions.
+    + [RA] Warn about files installed in /usr/lib/cgi-bin.  Policy now
+      states they should be installed in /usr/lib/cgi-lib.
+    + [RA] Warn about scripts installed on the user's PATH with names that
+      include language extensions (.sh, .pl, .py), per Policy 10.4.
+    + [RA] Report directories under /usr/share/man that don't match the
+      directory layout specified in the FHS.  (Closes: #176683)
+    + [RA] Fix a very long-standing bug that caused the check for
+      executable manpages to be silently skipped.
+  * checks/scripts:
+    + [RA] Debian etch release policy explicitly forbids scripts without
+      #! magic and they rely on being run from a shell.  Revert the change
+      that permitted the Perl magic without a #! line.  Thanks to Piotr
+      Engelking and Steve Langasek for pointing this out.
+    + [RA] Don't syntax-check *.dpatch scripts in /usr/src.  bash -n
+      doesn't stop at exit 0 and then may choke on the patch.  Thanks,
+      Matthias Klose.  (Closes: #364521)
+  * checks/scripts.desc:
+    + [RA] Using invoke-rc.d is now required by Policy.
+  * checks/standards-version:
+    + [RA] Update to 3.7.0.
+
+  * debian/control:
+    + [RA] Update standards version to 3.7.0 (no changes required).
+    + [RA] Update description to note calibration for Policy 3.7.0.
+
+ -- Russ Allbery <rra@debian.org>  Sat, 29 Apr 2006 01:06:59 -0700
+
+lintian (1.23.18) unstable; urgency=low
+
+  The "brown paper Python" release
+
+  * checks/fields{.desc,}:
+    + [RA] Redo handling of build dependencies to allow a custom tag to be
+      specified and to allow a general dependency string to be required
+      rather than a simple package name.  As a result, dh_python handling
+      is no longer a buggy special case.  Allow either python or
+      python-dev for dh_python and the cdbs Python rules.  Thanks, Torsten
+      Merek and Aaron M. Ucko.  (Closes: #364297, #364330)
+    + [RA] Require at least quilt 0.40 if /usr/share/quilt/quilt.make is
+      included.  Thanks, Michele Baldessari.
+    + [RA] Packages using dh_installxfonts must build-depend on 5.0.31 or
+      later of debhelper for the X.Org 7 transition.
+
+ -- Russ Allbery <rra@debian.org>  Sat, 22 Apr 2006 16:17:14 -0700
+
+lintian (1.23.17) unstable; urgency=low
+
+  The "happy Nanaimo hacking" release
+
+  * checks/binaries:
+    + [RA] Detect klibc binaries from their requested interpreter and
+      allow them to appear static.  (Closes: #328850)
+  * checks/common_data.pm:
+    + [RA] Include all combinations of cpu and os from the dpkg cputable
+      and ostable files (as of dpkg 1.13.16).  (Closes: #337034, #357433)
+    + [RA] Include a list of known X metapackages.
+  * checks/control-file{.desc,}:
+    + [RA] Warn if debian/control in a source package is a symlink.
+  * checks/copyright-file{.desc,}:
+    + [RA] Don't assume mentions of GPL or GNU General Public License
+      after what look like mail headers are referring to the license of
+      the package.  Be a bit more specific in the old FSF address check
+      to avoid false positives on other Cambridge, MA addresses.  Reported
+      by Adam C. Powell IV.  (Closes: #205934)
+  * checks/debconf:
+    + [RA] Allow Indices as a template field.  cdebconf uses it and
+      debconf ignores it.  Reported by Frans Pop.  (Closes: #361986)
+  * checks/debdiff{.desc,}:
+    + [RA] Warn if the diff contains debian/substvars.  Based on a patch
+      by Michael Ablassmeier.  (Closes: #359646)
+  * checks/debhelper.desc:
+    + [RA] When explaining the warning about deprecated debhelper
+      compatibility versions, mention that debhelper defaults to version 1
+      if not set anywhere.  (Closes: #360711)
+    + [RA] Move simple man page references from Info into Ref.
+  * checks/fields{.desc,}:
+    + [RA] Allow dpatch in Build-Depends for arch-independent packages if
+      it is invoked in clean, build-arch, or binary-arch.
+    + [RA] Only list examples of non-standard architectures, since there
+      are now too many combinations to list completely.
+    + [RA] Catch dependencies on X metapackages, based on a patch by Josh
+      Triplett.  No packages are allowed to build-depend, and only
+      packages that look like metapackages (arch: all, no files outside of
+      /usr/share/doc) are allowed to depend.  (Closes: #347169)
+    + [RA] Look for an explicit section of unknown, probably left over
+      from dh_make templates, and diagnose it with an error rather than a
+      warning.  Reported by Jari Aalto.  (Closes: #355032)
+    + [RA] Reorganize dependency checking based on debian/rules analysis.
+      Diagnose missing build dependencies on the helper packages we know
+      about, catch cases where Build-Depends-Indep should be Build-Depends
+      because of the clean target, and make sure users of dh_python
+      build-depend on python.  yada is no longer a special case.
+      (Closes: #242789, #278290)
+    + [RA] Check for conflicting with dependencies and build-conflicting
+      with build dependencies.  (Closes: #122760)
+    + [RA] Allow xfonts-utils in dependencies.  It's not actually an X
+      font package.
+  * checks/files{.desc,}:
+    + [RA] For the X.Org 7 transition, add explicit checks for fonts and
+      binaries installed in /usr/X11R6.  Rename the existing check for
+      other files in /usr/X11R6 since the tag had a pluralization error
+      and we want package maintainers to see the error again and
+      reconsider whether to ignore it.  No packages should be installing
+      files in /usr/X11R6 going forward.  Remove the policy cross-refs for
+      right now until policy catches up.
+  * checks/manpages:
+    + [RA] Use system_env instead of system and sanitize the environment
+      before running man -l out of caution and to avoid extraneous output
+      when CDPATH is set.  Reported by Marc Haber.  (Closes: #360217)
+  * checks/nmu{.desc,}:
+    + [RA] Warn if debian/changelog in a native source package is a
+      symlink and skip checks rather than aborting if it was a symlink to
+      a file we didn't unpack.  (Closes: #257650)
+  * checks/po-debconf:
+    + [RA] Use system_env instead of system out of caution and to avoid
+      extraneous output when CDPATH is set.
+  * checks/rules{.desc,}:
+    + [RA] A new set of checks that parses debian/rules and checks for
+      required rules, debian/rules as a symlink, and the correct first
+      line.  Based heavily on previous work by René van Bevern.
+      (Closes: #294926, #311786)
+  * checks/scripts{.desc,}:
+    + [RA] Ignore text inside single quotes and, for most checks, text
+      inside double quotes when checking for bashisms.  Reported by Frank
+      Küster.  (Closes: #344266)
+    + [RA] Change canonical zsh path to /bin/zsh at the request of the zsh
+      maintainer.  (Closes: #360534)
+    + [RA] Change the check for broken error handling with invoke-rc.d to
+      maintainer-script-hides-init-failure to be more generic and explain
+      what the test looks at.  Add the script name and line number and fix
+      a typo.  Thanks, Marc Haber.  (Closes: #360214, #360216)
+    + [RA] Warn when maintainer scripts run init scripts directly and
+      don't use invoke-rc.d.  Thanks, Lars Wirzenius.  (Closes: #353659)
+    + [RA] Find missing ucf dependencies and restructure the code to allow
+      easier addition of similar checks.  (Closes: #261891)
+    + [RA] Add python2.5, lua50, gbx, and gbx2 to the list of valid
+      interpreters.  (Closes: #361601, #361644, #362566)
+  * checks/shared-libs:
+    + [RA] Limit shlib-without-PT_GNU_STACK-section to only those
+      architectures where gcc always adds the section.  Thanks to Frans
+      Pop for the report and Bastian Blank for the architecture list.
+      (Closes: #357636)
+
+  * collection/objdump-info:
+    + [RA] Unset CDPATH before running cd to avoid strange effects from
+      the user's environment.
+    + [RA] Run readelf -l to collect interpreter information.
+
+  * lib/Dep.pm:
+    + [RA] Add initial support for analyzing architecture information in
+      dependencies instead of ignoring it.
+  * lib/Read_taginfo.pm:
+    + [RA] Add support for formatting man page references from Ref.
+  * lib/Util.pm:
+    + [RA] Add system_env, like system but sanitizing the environment.
+
+  * man/lintian.1:
+    + [RA] Mention the new rules check class.
+
+ -- Russ Allbery <rra@debian.org>  Fri, 21 Apr 2006 09:36:34 -0700
+
+lintian (1.23.16) unstable; urgency=low
+
+  The "What's this Russ guy up to?" release
+
+  * checks/binaries{.desc,}:
+    + [RA] Add a check for the new "Invalid operation" error from
+      objdump -T.  Skip shared-lib-without-dependency-information for
+      files in /usr/lib/debug.
+  * checks/changelog-file:
+    + [FL] Add line number to output of wrong-bug-number-in-closes.
+      Inspired by #349761 from Steinar H. Gunderson.
+  * checks/common_data.pm:
+    + [FL] Add armeb to %non_standard_archs as requested by
+      Martin Michlmayr. (Closes: #350653)
+  * checks/debconf:
+    + [RA] Packages that depend on dbconfig-common are allowed to have
+      config scripts without templates or an explicit debconf dependency.
+      Reported by Marcus Better.  (Closes: #344421)
+  * checks/debconf.desc:
+    + [RA] Clarify the necessary dependencies for packages using SETTITLE.
+      (Closes: #349616)
+  * checks/debhelper:
+    + [RA] Recognize setting DH_COMPAT with := in addition to = in
+      debian/rules.  (Closes: #349272)
+    + [RA] CDBS sets DH_COMPAT to 4 but doesn't export it.  It does create
+      debian/compat with that value if none was present.  Reflect this
+      behavior to avoid spurious compat level warnings when using CDBS.
+      Based on a patch by Jay Berkenbilt.  (Closes: #350228)
+  * checks/fields:
+    + [RA] Allow a quilt build-dependency for arch-independent packages if
+      the quilt makefile rules are included.  (Closes: #349273)
+    + [RA] If clean depends on a rule that calls dh_clean rather than
+      calling it directly, still allow debhelper in Build-Depends for
+      arch-independent packages.  Reported by Michael Stilkerich.
+    + [JvW] Commented that Uploaders no longer will hit the multiline field
+      issue, updated testsuite accordingly
+  * checks/manpages:
+    + [FL] Ignore more warnings ("cannot adjust line", "can't break
+      line") in non-English manpages. (Closes: #349792)
+    + [RA] cd into the parent directory before checking man pages with man
+      so that .so inclusions are processed correctly.  Based on a patch by
+      Nicolas François.  (Closes: #349614)
+  * checks/menu-format:
+    + [RA] Look for binaries in /usr/X11R6/bin, not /usr/bin/X11, per
+      Policy 11.8.7.  Thanks, Matej Vela.  (Closes: #354890)
+  * checks/menu-format.desc:
+    + [RA] Use "menu manual" rather than "menu" for references to more
+      clearly distinguish from the Debian Menu Policy.  (Closes: #347510)
+  * checks/po-debconf:
+    + [RA] If there are template files in debian, assume the package uses
+      debconf; don't require a dependency or config script.  Patch by
+      Thomas Huriaux.  (Closes: #353294)
+  * checks/scripts:
+    + [RA] Allow /tmp in variable settings.  It's likely to be a false
+      positive.  Reported by Frank Küster.  (Closes: #344998)
+    + [RA] Make the syntax checking of shell scripts more robust against
+      filenames containing shell metacharacters.  Reported by Michael
+      Stilkerich.
+    + [RA] Add fish and expectk to the list of valid interpreters.
+      (Closes: #351624, #353770)
+    + [RA] /usr/bin/tcl is provided by tclx8.3, not tcl.  Reported by
+      James R. Van Zandt.  (Closes: #351324)
+    + [RA] Allow more variations on leading magic to invoke some
+      interpreter rather than then shell.  Bypass the ELF magic check for
+      scripts using magic that relies on having no leading #! line.
+      Reported by Frank Küster.  (Closes: #344269)
+    + [JvW] Add check against package suffering from debhelper bug #337664,
+      per Joey Hess, which had broken error detection (Closes: #358523)
+  * checks/shared-libs:
+    + [JvW] Fix postinst-must-call-ldconfig to also get emitted when there is
+      no postinst at all, instead of just one lacking a ldconfig call
+    + [JvW] Implement checks for "udeb:" lines in shlibs files
+      (Closes: #357541)
+    + [JvW] Consider also the soname version for shlibs checking, preventing
+      some bogus 'duplicate' warnings, and actually throw a warning when
+      soname version doesn't match
+    + [JvW] Added error when udeb postinst calls ldconfig, that must never
+      happen (thanks to Frans Pop for noticing, see #203056)
+
+  * debian/{control,copyright}:
+    + [RA] Add Russ Allbery to Uploaders and copyright.
+    + [JvW] Version dpkg-dev requirement to >= 1.13.17, for
+      unpack/unpack-srcpkg-l2
+
+  * frontends/lintian-info:
+    + [RA] Avoid Perl uninitialized value warnings when given output that
+      looks like lintian messages without tags.  (Closes: #352606)
+
+  * collection/objdump-info:
+    + [RA] Pass "Invalid operation" errors from objdump -T on to the check
+      scripts instead of failing.  (Closes: #249435)
+
+  * man/lintian.1:
+    + [RA] Add references to dh_make, debhelper, dpkg-buildpackage, and
+      linda in new reference sections.  (Closes: #322288)
+  * man/{lintian.1,lintian-info.1}:
+    + [RA] Left-justify and disable hyphenation for readability.
+
+  * unpack/unpack-srcpkg-l2:
+    + [JvW] Use -q with dpkg-source to surpress warnings about unsigned source
+      packages. Requires dpkg-dev 1.13.17
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Sun, 26 Mar 2006 15:38:37 +0200
+
+lintian (1.23.15) unstable; urgency=low
+
+  * The "www.no-name-yet.eu" release
+
+  * debian/changelog:
+    + [FL] Fix wrapping of last changelog entry (Closes: #344899)
+
+  * checks/common_data.pm:
+    + [FL] Add xlibs-dev and debmake to %known_obsolete_packages
+  * checks/debconf:
+    + [CW] Show template name for empty-translated-choices,
+      mismatch-translated-choices, and unknown-field-in-templates.
+  * checks/debhelper:
+    + [FL] Also check for debhelper build-dependency in debhelper-using
+      cdbs based packages
+    + [FL] Indicate where we found which compat version in
+      declares-possibly-conflicting-debhelper-compat-versions
+      (Closes: #329953)
+    + [FL] Add dh_installtexfonts to list of commands that modfiy
+      the maintainer scripts
+    + [FL] Try a little harder to find the DH_COMPAT setting in debian/rules
+      (Closes: #348380)
+  * checks/fields:
+    + [FL] Allow version numbers of 0 by correctly checking the output
+      of _valid_version for definedness and not the boolean value
+      (Closes: #345005)
+    + [FL] Better check for false postives of build-depends-without-arch-dep.
+      Should fix false positives for cdbs, dbs, dpatch and yada. Based on
+      a patch by Russ Allbery (Closes: #344609, #321135, #339750)
+    + [FL] Also check for build-dependencies on obsolete packages not
+      only dependencies (Closes: #234531)
+  * checks/fields.desc:
+    + [JvW] Fix typo in description
+  * checks/init.d:
+    + [FL] Only try to validate update-rc.d calls where the name of the
+      script matches [\w.-]+. That accounts for all today known init
+      scripts and eliminates false positives like shell variables in the
+      name (Closes: #343865)
+  * checks/manpages:
+    + [FL] Fix stupid mistake in regex to strip of filenames from roff
+      output (which was hidden by another stupid mistake in the test
+      suite). Patch by Nicolas François (Closes: #347999)
+  * checks/scripts:
+    + [FL] Make mknod-in-maintainer-script an error since this is now
+      a must in policy. Pointed out by Bartosz Fenski (Closes: #344928)
+    + [FL] dpkg --print-installation-architecture is deprecated
+      so delete dpkg-print-architecture-in-maintainer-script
+    + [FL] Add parrot to list of valid interpreters (Closes: #346335)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu, 19 Jan 2006 15:13:02 +0100
+
+lintian (1.23.14) unstable; urgency=low
+
+  * The "fix those frontend regressions" release
+
+  * frontend/lintian:
+    + [FL] Fix exit status computing so that we exit with 1 again
+      if we found any error. (Closes: #329458)
+    + [FL] Re-enable reporting unused overrides.
+
+  * lib/Tags.pm:
+    + [FL] Some fixes to the statistics code to make the fixes
+      in frontend/lintian possible
+
+  * checks/binaries{.desc,}:
+    + [FL] support c2a suffix in soname check, too (Closes: #340856)
+    + [FL] fix typo in description of package-name-doesnt-match-sonames
+      (Closes: #339360)
+    + [FL] The Debian specific patches from coreutils to call strip with
+      --remove-section arguments on install -s have been dropped. Adapt
+      description of binary-has-unneeded-section accordingly and demote
+      it to "info" because many packages will get this now.
+  * checks/debconf{.desc,}:
+    + [FL] drop seen-flag-requires-versioned-depends and
+      multiselect-without-dependency and drop version requirement from
+      missing-debconf-dependency-for-preinst. All due to the fact that
+      woody shipped with 1.0.x and therefor versioned depends on versions
+      lesser than that don't make much sense anymore (Closes: #333736)
+  * checks/debhelper:
+    + [FL] debhelper compat level 3 is deprecated as well now (Closes: #340222)
+  * checks/files:
+    + [FL] forgot /lib(32|64) (more #328612 fixes)
+  * checks/menu-format:
+    + [FL] Drop su-to-root-with-usr-bin and su-to-root-without-usr-sbin,
+      and add su-to-root-with-usr-sbin to adapt to current menu package
+      and policy (Closes: #332400)
+  * checks/po-debconf:
+    + [FL] Fix logical error in search for files (Closes: #342707)
+  * checks/scripts{.desc,}:
+    + [FL] Drop install-fvwmgenmenu as valid interpreter. Was dropped
+      from menu package before sarge. (also for #332400, see
+      checks/menu-format)
+    + [FL] Change path for install-menu from /usr/sbin to /usr/bin (also
+      for #332400)
+    + [FL] Merge most of the wrong-path-for-* and *-script-but-no-*-dep
+      tags to two tags wrong-path-for-interpreter and
+      missing-dep-for-interpreter. This makes maintaining the list of
+      valid interpreters way easier. Some tags with special text have
+      been special cased (php\d? and (m|g)awk).
+    + [FL] Add speedy and slsh to list of valid interpreters
+      (Closes: #333955, #336700)
+  * checks/shared-libs:
+    + [FL] forgot /lib(32|64) (hopefully finally closes: #328612)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Sun, 18 Dec 2005 02:04:46 +0100
+
+lintian (1.23.13) unstable; urgency=low
+
+  * The "doesn't contain all the fixes I would like but that's no
+    reason to let the others wait forever" release
+
+  * debian/control:
+    + [FL] Fix typo in description. Noted by Bill Allombert
+      (Closes: #327859)
+
+  * checks/copyright-file:
+    + [JvW] Demote FSF address check to warning
+  * checks/description:
+    + [HE] Change description-synopsis-is-duplicated to only be emitted if
+      the synopsis is copied without being extended. (Closes: #316523)
+  * checks/files:
+    + [FL] Add some formats to the exception list for extra-license-file
+      (jpe?g, gif and svg) (Closes: #324944)
+    + [FL] Don't complain about lib(32|64) as unusual directories. Noted
+      by Matthias Klose (partly fixes #328612, see checks/shared-libs for
+      the rest)
+  * checks/infofiles:
+    + [FL] Don't issue install-info-not-called-with-section-option if
+      the call in postinst is really a removal. Experienced by Ben Pfaff
+      in autoconf (Closes: #329170)
+  * checks/po-debconf:
+    + [FL] Previously we only run the checks if we found a templates file
+      and a debconf dependency. Since the latter is mostly generated by
+      ${misc:Depends} nowadays, we now also run the checks if we find
+      a templates and a config file. (Closes: #331672)
+  * checks/scripts:
+    + [FL] PythonX.Y dependency can also be satisfied with pythonX.Y-minimal.
+      Noted by Matthias Klose (Closes: #326643)
+    + [FL] Only match 'local' at the beginning of a line. The check is too
+      ambigious otherwise. Reported by Marc Haber (Closes: #330548)
+    + [FL] Better reflect the current discussions wether some of the
+      XSI:sms should be allowed in shell scripts by moving some of
+      them to a separate check possible-non-posix-code-in-maintainer-script.
+      Not doing that for kill -NAME as reuqested since -s NAME is available
+      and should be perfectly portable. (Closes: #323053)
+  * checks/shared-libs:
+    + [HE] Apply patch from Bastian Blank to check for executable stacks in
+      binaries. New checks are called shlib-without-PT_GNU_STACK-section,
+      shlib-with-executable-stack, thanks waldi. (Closes: #321750)
+    + [FL] Add lib(32|64) to ldso directories. Pointed out by
+      Matthias Klose (Closes: #328612)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu, 13 Oct 2005 15:19:05 +0200
+
+lintian (1.23.12) unstable; urgency=low
+
+  * The "bad, bad SONAME check" release
+
+  * all files:
+    + [FL] Update FSF address
+
+  * debian/control:
+    + [FL] Depend on dpkg-dev since we use dpkg-source. How old exactly is
+      this bug? (Closes: #324673)
+
+  * checks/binaries:
+    + [FL] Only use sonames from files in common library directories for
+      the soname checks. This avoids many false positives. Patch by
+      Russ Allbery (Closes: #321564)
+    + [FL] Convert the SONAME to lower case before comparing with
+      package name. Suggested by Josh Triplett (Closes: #321206, #325225)
+    + [FL] Try to remove strings added for transition purposes from
+      library package names before comparing package name with SONAME.
+      Pointed out by Rene Engelhard (Closes: #322241, #324121)
+    + [FL] Also remove -udeb strings and substitute lib64 with lib in
+      package name before comparing with SONAME
+    + [FL] Replace any occurence of _ in the SONAME with - since the
+      former isn't allowed in package names but occasionally used in
+      sonames
+    + [FL] Remove trailing .so from SONAMEs
+    + [FL] Also ignore static binaries in sub directories of /boot,
+      not only in /boot itself. Patch by Guillem Jover
+      (Closes: #320382)
+  * checks/changelog-file:
+    + [FL] Detect old FSF address additionally to the even older
+      one
+  * checks/{cruft,files}{,.desc}:
+    + [FL] Also check for .arch-ids/ {arch}/ .arch-inventory and .bzr/
+      in packages and sources (Closes: #324255)
+  * checks/debhelper{,.desc}:
+    + [FL] Warn about using debhelper compat version lower than 3
+      like debhelper itself
+    + [FL] Drop package-lacks-versioned-build-depends-on-debhelper
+      tag for compat versions < 5. With debhelper 4 even in oldstable
+      issuing an error here is silly
+    + [FL] Fix typo (s,debian/control,debian/compat,) in description of
+      declares-possibly-conflicting-debhelper-compat-versions
+  * checks/description{,.desc}:
+    + [FL] Avoid double warning about description-is-dh_make-template
+      in the same way we do it for the corresponding debmake tag
+    + [FL] Policy section of Description field has changed
+  * checks/fields{,.desc}:
+    + [FL] Fix a lot of off-by-one errors in the policy references
+      (caused by the addition of the Uploaders field). Unknowningly
+      pointed out by Russ Allbery
+    + [FL] Also use non_standards_archs when checking source package
+      relations. Patch by Russ Allbery (Closes: #322291)
+  * checks/manpages:
+    + [FL] Don't issue warnings about 8bit characters in translated
+      man pages. Patch by Denis Barbier (Closes: #321650)
+  * checks/scripts:
+    + [FL] Don't issue bashism warning on POSIX character classes ([[:foo:]]).
+      Noted by Stephen Gran (Closes: #323098)
+    + [FL] Remove some useless groupings in the bashism regexes
+
+ -- Frank Lichtenheld <djpig@debian.org>  Sun, 28 Aug 2005 22:05:54 +0200
+
+lintian (1.23.11) unstable; urgency=low
+
+  * frontend/lintian:
+    + [FL] Don't use dpkg --print-installation-architecture since
+      it is deprecated, use dpkg --print-architecture instead.
+
+  * debian/control:
+    + [FL] Depend on libparse-debianchangelog-perl, require
+      >= 0.6 since prior versions have bugs regarding parse
+      error handling
+
+  * checks/binaries:
+    + [FL] Check that the package name of a shared library matches
+      the SONAME as defined in the "Library Packaging guide"
+      (Closes: #305575, #313118)
+  * checks/changelog-file{,.desc}:
+    + [FL] Use libparse-debianchangelog-perl to parse the changelog,
+      which detects a lot of syntax errors
+    + [FL] Add a new tag debian-changelog-file-missing-or-wrong-name
+      which is issued if we found no Debian changelog but an upstream
+      changelog since the further checks will treat the
+      latter file as the Debian changelog and only issuing
+      debian-changelog-file-missing would be confusing then
+      (Closes: #285152)
+    + [FL] Detect closes: statements with non-valid bugnumbers,
+      suggested by martin f. krafft (Closes: #294409)
+  * checks/common_data.pm:
+    + [FL] Fix typo (hurd-386 -> hurd-i386) from last release
+      that lead to spurious warnings about unknown architectures
+      (Closes: #318110)
+  * checks/control-file:
+    + [CW] Break control paragraphs at lines containing only whitespace, not
+      just on zero-length lines. (Closes: #319370)
+  * checks/fields:
+    + [FL] Actually mention which architecture we're complaining about
+  * checks/manpages:
+    + [FL] Report errors from man when parsing man pages. Based on
+      a patch by Kevin Ryde (Closes: #285540)
+  * checks/po-debconf:
+    + [FL] Abort check if the package doesn't seem to use debconf to
+      avoid false positives in case maintainers use debian/po for
+      other Debian specific strings (Closes: #262749)
+  * checks/scripts:
+    + [FL] increase search limit for exec hack by not counting comments
+      and empty lines (Closes: #294661)
+    + [FL] detect more bashisms, suggested by Clint Adams and
+      martin f krafft (Closes: #253498, #296233 and addresses #253012
+      partly).
+    + [FL] Adjust check for positional arguments after ". file" to detect
+      more shell control and piping commands that are all allowed.
+      Noted by Thomas Hood. (Closes: #319212)
+
+  * reporting/html_reports:
+    + [FL] Fix counting of binary package names
+    + [FL] Generate mostly valid HTML (id and name attributes still
+      aren't valid in all cases)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Mon, 11 Jul 2005 15:50:10 +0300
+
+lintian (1.23.10) unstable; urgency=low
+
+  * The "Ah, it's LinuxTag and I still have free time!" release
+
+  * debian/control:
+    + [HE] Updated description to say that we're calibrated for Policy
+      version 3.6.2. As the changes between 3.6.{1,2} aren't stuff we
+      (can) check, this is actually true! (Closes: #317049)
+
+  * testset/runtests:
+    + [HE] Fix symlinking of original tarballs to allow run directories
+      outside the lintian source tree.
+
+  * checks/control-file
+    + [HE] Check for duplicated fields. (Closes: #299792)
+
+  * checks/fields:
+    + [HE] Change unknown-architecture a bit: We don't complain about
+      "known" non-standard archs (like amd64, ppc64, *bsd-i386) and only
+      print out an info message for those. (Closes: #253405, #311471)
+
+  * checks/files:
+    + [HE] Allow backupninja configuration files in /etc/backup.d/ to be
+      0600. (Closes: #307639)
+
+  * checks/scripts:
+    + [HE] Allow Scripts in /etc/Xsession.d/ to be not executable, as they're
+      not directly called, but only sourced. (Closes: #309203)
+    + [HE] Check for use of adduser and update-inetd and warn if the package
+      has no (pre-)dependency on adduser/netbase. Patch by Russ Allbery,
+      thanks for the work. (Closes: #308569)
+    + [HE] Check for use of "." as a deprecated separator between user and
+      group names in chown call. (Closes: #88340)
+    + [HE] Fix to work $interpreter-script-but-no-$pkg-dep with more than one
+      dependency if needed. First use case is depending on build-essential
+      to provide /usr/bin/make. (Closes: #294894)
+    + [HE] Add lefty as a valid interpreter and check for a correct dependency
+      on graphviz. (Closes: #295093)
+
+  * checks/shared-libs:
+    + [HE] Don't allow non-PIC shared libraries. This conforms to the new
+      etch release policy. Thanks for the report and patch to Kurt Roeckx
+      <kurt@roeckx.be>. (Closes: #309220)
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Sun, 10 Jul 2005 16:20:42 +0200
+
+lintian (1.23.9) unstable; urgency=low
+
+  * The "Wow, so much time at hand" release
+
+  * [FL] Convert build process to debhelper
+    - debian/rules    - adapted
+    - debian/compat   - new
+    - debian/dirs     - new
+    - debian/docs     - new
+    - debian/control  - add build depends
+    - debian/postinst - remove (Closes: #292981)
+    - debian/conffiles- remove
+    - debian/prerm    - adapted
+  * debian/control:
+    + [FL] Update Standards-Version to 3.6.2
+
+  * checks/conffiles:
+    + [JvW] Warn on /var files being a conffile too (Closes: #293443)
+  * checks/debconf:
+    + [FL] Also report postinst-does-not-load-confmodule and
+      postrm-does-not-purge-debconf if the related files don't
+      exist at all. Spotted by Gerfried Fuchs (Closes: #301056)
+  * checks/menus:
+    + [FL] New check menu-file-in-usr-lib because /usr/lib/menu is
+      deprecated
+    + [FL] Also find menu files in /usr/share/menu (Closes: #314187)
+    + [FL] Rename executable-in-usr-lib-menu to executable-menu-file
+  * checks/menu-format:
+    + [FL] Adapt to changes in collections/menu-files
+  * checks/standards-version:
+    + [FL] Update to 3.6.2 (Closes: #314879)
+
+  * collections/menu-files:
+    + [FL] Also collect files from /usr/share/menu
+
+ -- Frank Lichtenheld <djpig@debian.org>  Fri, 17 Jun 2005 02:17:52 +0200
+
+lintian (1.23.8) unstable; urgency=low
+
+  The "Hm, this is the team's one year anniversery of maintaining lintian"
+  release[1], and still using the "temporary" subversion repository...
+
+  Featuring Steve "R." Langasek in a guest appearance.
+
+  [1] http://lists.debian.org/debian-lint-maint/2004/01/msg00014.html
+
+  * checks/*.desc,doc/lintian.sgml:
+    + [JvW] Stop bugging us for exceptions, mmkay, just install overrides.
+      Hints like this should be in the general documentation anyway, not in
+      per-tag descriptions. The general documentation will now only ask to
+      contact us if in doubt
+  * checks/changelog-file{,desc}:
+    + [JvW] (new test) Bark on @toplevel email signatures in changelogs
+    + [JvW] Display invalid debmake email address upon detection
+  * checks/common_data.pm:
+    + [CW] Add tclx8.4 to %known_tclxs.
+  * checks/description:
+    + [SRL] Do not generate warnings when a short description starts with an
+      article; this is good grammar and should not be discouraged.
+      (Closes: #290505)
+    + [JvW] Drop description-synopsis-starts-with-a-capital-letter by popular
+      demand (Closes: #288568)
+  * checks/files{,.desc}:
+    + [JvW] Warn only for hardlinks in /etc or amongst different directories
+      (Closes: #288634)
+    + [JvW] Only check for desktop files in GNOME's and KDE's obsolete places,
+      not in all the package, as KDE uses .desktop files also for other
+      purposes (Closes: #289773)
+  * checks/nmu.desc:
+    + [JvW] Be more precise in explaining why lintian thinks this is a NMU,
+      and copy explanation to changelog-should-mention-nmu
+  * checks/scripts{,.desc}:
+    + [CW] Add checks for tclsh8.4 and wish8.4. (Closes: #288287)
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Mon, 31 Jan 2005 23:14:01 +0100
+
+lintian (1.23.7) unstable; urgency=high
+
+  * lib/Lab.pm:
+    + Fixed creation of static lab if the directory already existed, this
+      failed in 1.23.6
+    + In temporary lab mode, try to create the directory several
+      times before giving up
+
+  * testset/runtests: Extend the static lab test
+
+ -- Frank Lichtenheld <djpig@debian.org>  Sat,  8 Jan 2005 21:41:21 +0100
+
+lintian (1.23.6) unstable; urgency=low
+
+  The "Let's see if I can upload myself now" release, made by Marc, Frank and
+  Colin, uploaded by Jeroen.
+
+  * checks/description
+    + [HE] Warn if the short description start with an article or a capital
+      letter. Patch by Tobias Toedter <t.toedter@gmx.net>, thanks. (Closes:
+      #258824)
+  * checks/fields:
+    + [HE] Warn if the debian revision has three parts, as this is the sign of
+      a binary NMU. New check's name is binary-nmu-debian-revision-in-source.
+      (Closes: #244830)
+    + [HE] Warn if people use the Bugs field to refer to the Debian BTS, the
+      new check is called redundant-bugs-field. (Closes: #245883)
+  * checks/files:
+    + [HE] Check that .desktop files are placed in /usr/share/applications.
+      This seems to be the standard place for those files that are used
+      to create menus. The check is called desktop-file-in-wrong-dir.
+      (Closes: #200171)
+  * checks/manpages:
+    + [HE] Don't compare the manpage filename extension and the content of
+      .TH case-sensitive. Report + patch by Jay Berkenbilt <ejb@ql.org>,
+      thanks. (Closes: #285335)
+    + [HE] Emit binary-without-english-manpage if a package only provides
+      translated manpages for a binary. (Closes: #259227)
+    + [HE] Skip all comment lines when checking for .so links in manpages.
+      Thanks for the report and fix suggestion to Steinar H. Gunderson
+      <sgunderson@bigfoot.com>. (Closes: #284662)
+  * checks/md5sums:
+    + [HE] Strip off ./ at the beginning of the filenames in md5sums
+      files (this seems to happen on some systems, though we don't know
+      how). (Closes: #284728)
+  * checks/standards-version:
+    + [CW] By definition, udebs aren't required to conform to policy, so
+      don't issue no-standards-version-field for them. (If they happen to
+      have a Standards-Version field anyway, we still check that it's
+      valid.)
+
+  * lib/Lab.pm, frontend/lintian:
+    SECURITY (CAN-2004-1000):
+    + [FL] Overhaul lab directory handling. This also fixes the issue
+      of removing a lab that never was created (Closes: #286681)
+
+ -- Debian Lintian Maintainers <lintian-maint@debian.org>  Mon, 27 Dec 2004 05:40:13 +0100
+
+lintian (1.23.5) unstable; urgency=low
+
+  The "learn how to use intltool-debian correctly the hard way" release
+
+  * checks/po-debconf: Set INTLTOOL_EXTRACT to fix invocation
+    of intltool-update (Closes: #285419, #285471)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Mon, 13 Dec 2004 18:16:52 +0100
+
+lintian (1.23.4) unstable; urgency=low
+
+  The "A little pause from the sarge release work" release.
+
+  * checks/changelog-file:
+    + [FL] file has apparently changed its output format for
+      symlinks sometime in the past. This broke symlink detection.
+      (Closes: #276504)
+  * checks/deb-format, unpack/unpack-binpkg-l1, unpack/unpack-binpkg-l2:
+    + [CW] Fix binary package data member extraction to work with arbitrary
+      compression algorithms instead of hardcoding data.tar.gz.
+  * checks/debconf{,.desc}:
+    + [FL] The SETTITLE command was introduced in debconf version
+      1.3.22. Check the depends for that (Closes: #261890)
+    + [FL] Warn about incorrect usage of commas in translated Choices
+      fields. Patch by Denis Barbier after a suggestion by Andreas
+      Metzler (Closes: #282030)
+  * checks/debhelper:
+    + [FL] Update list of debhelper scripts that modify maintainer
+      scripts
+  * checks/menu-format.desc:
+    + [FL] Adjust references to the menu documentation. Noted by
+      Jack Moffitt (Closes: #277393)
+  * checks/po-debconf{,.desc}:
+    + [FL] Check for outdated .pot files when using po-debconf.
+      This requires a new dependency on intltool-debian. Patch
+      by Denis Barbier with corrections by JvW (Closes: #242345)
+  * checks/scripts{,.desc}:
+    + [FL] Fix copy-and-paste error in description
+      of wrong-path-for-gnuplot (Closes: #276945)
+      Thanks to Lionel Elie Mamane for reporting.
+    + [FL] Add tclsh8.3 to list of valid interpreters as it is used
+      in at least one package. (Closes: #280080)
+    + [FL] Issue wrong-path-for-{ruby,python} even if the path contained
+      a version number. Change the description of the tag to reflect that.
+      (Closes: #257904)
+
+  * frontend/lintian-info:
+    + [FL] Overrides start with O:, not with 0:, d'oh!
+      (Closes: #258815)
+
+  * lib/Tags.pm:
+    + [FL] Add missing "use Util;", noted by Robert Luberda
+      (Closes: #278513)
+
+  * testset/debconf/*,testset/tags.debconf:
+    + [FL] New test package for debconf and udeb tests
+  * testset/diffs:
+    + [JvW] Remove the shipped ELF binary, can be compiled at test-time
+  * testset/runtests:
+    + [FL] Make checks of udeb packages possible
+
+ -- Frank Lichtenheld <djpig@debian.org>  Mon,  6 Dec 2004 01:41:21 +0100
+
+lintian (1.23.3) unstable; urgency=low
+
+  The ``the others must be busy releasing Sarge or something'' release,
+  prepared by yours truly
+
+  * checks/conffiles.desc:
+    + Note the most likely cause for duplicate-conffile in the description
+      (thanks Chris Anderson for running into this problem and asking me
+      about it)
+  * checks/copyright-file:
+    + Revert the extra pedantic check introduced in 1.23.0 that
+      complained about unstrict dependencies when one as a
+      /usr/share/doc/<package> that is a symlink (Closes: #249414)
+  * checks/debconf:
+    + Don't warn when the Choices field of a debconf question is
+      not translated, often it makes no sense to translate it
+      (Closes: #262649)
+  * checks/debhelper:
+    + dh-make also creates sample files named .EX, so make that check
+      case-insensitive (Closes: #251262)
+  * checks/fields.desc:
+    + Adjust package-has-a-duplicate-relation to warning, and note that
+      this sometimes happens to you when using ${shlibs:Depends}, and you
+      shouldn't bother too much if that's the case (Closes: #274286)
+      Thanks Peter Eisentraut for the suggestion
+    + Fix English language depends-on-essential-package-without-using-version,
+      thanks to Peter Eisentrautf for noticing (Closes: #261603)
+    + [FL] Clone depends-on-essential-package-without-using-version as
+      build-depends-on-essential-package-without-using-version to give
+      correct policy reference (Closes: #261602)
+  * checks/init.d:
+    + Don't warn for missing init.d scripts in package and conffile list
+      if a variable is used instead of a real name (Closes: #264218)
+  * checks/manpages.desc:
+    + Demote binary-without-manpage to warning, and adjust description,
+      to be consistent with policy, which says a manpage should be available
+      (and doesn't use "must" for it). Thanks to Robert Millan for his patch
+      (Closes: #271014)
+  * checks/nmu.desc:
+    + Note in source-nmu-has-incorrect-version-number's description that
+      the mistake could also be the other way around (Closes: #258604)
+  * checks/po-debconf:
+    + Don't give missing-file-from-potfile-in on empty lines
+      (Thanks Adam Conrad for noticing)
+  * checks/scripts:
+    + The php commandline interpreter is now provided by php4-cli, and
+      not php4-cgi, update dependency check accordingly (Closes: #268077)
+    + Give an error if the 'config' script uses a non-essential
+      interpreter (Closes: #274832)
+  * checks/shared-libraries:
+    + Ignore comments in shlibs files (Closes: #275124)
+
+  * doc/lintian.sgml:
+    + Document that you can use comments in overrides (Closes: #87805)
+
+  * frontend/lintian:
+    + Fix overrides so that they allow all of (1) <package> <type>:,
+      (2) <package>:, and (3) <nothing> as prefix to tags you want to
+      override, and modify documentation accordingly. This used to be buggy
+      (Closes: #261435)
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Wed, 13 Oct 2004 02:45:36 +0200
+
+lintian (1.23.2) unstable; urgency=low
+
+  * The "of course it had to go wrong on my first own lintian
+    upload" release.
+  * Tigthen versioned Build-Depends on sed to (>= 4.1-4) to avoid
+    be hitten by a bug in sed that changes the permissions of files
+    when processed with sed -i (Closes: #259109)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Tue, 13 Jul 2004 13:36:45 +0200
+
+lintian (1.23.1) unstable; urgency=low
+
+  The ``Now featuring over 500 checks'' release, prepared by the usual
+  suspects.
+
+  * checks/*:
+    + [JvW] Changed from executables to check-plugins
+    + [HE] Drop the misuse of charset when we want to say "encoding".
+      Renamed 2 tests for that:
+      unknown-charset-in-po-file -> unknown-encoding-in-po-file
+      debian-changelog-file-uses-obsolete-national-charset ->
+      debian-changelog-file-uses-obsolete-national-encoding
+      (Closes: #248194)
+  * checks/binaries:
+    + [FL] Change check for binary-compiled-with-profiling-enabled on
+      hppa to look for _mcount instead of __gmon_start__ since the
+      latter can't be used as an indicator on that arch (Closes: #207063)
+    + [JvW] Exempt ocaml binaries from the 'is the binary stripped?' test,
+      since they cannot be stripped harmlessly. See #256900 (Closes: #252695)
+    + [JvW] Parse the output of file a little bit more strict, and make it
+      consequent across checks (Closes: #257898)
+  * checks/changelog-files{,.desc}:
+    + [HE] New check latest-debian-changelog-entry-without-new-date, comparing
+      the dates of the last 2 changelog entries. (Closes: #111215)
+    + [FL] New tag invalid-date-in-changelog which is issued if
+      latest-debian-changelog-entry-without-new-date encounters a
+      parse error
+  * checks/common-data.pm:
+    + [JvW] Add libgl(u)-dev to list of virtual packages (Closes: #255595)
+    + [JvW] Added amd64 to list of known architectures, as the name has
+      settled and it'll likely enter the archive soonish (Closes: #257503)
+  * checks/control-file{,.desc}:
+    + [HE] Introduced new check script. New checks:
+      - build-info-in-binary-control-file-section, triggered
+        by a Build-* field in a binary section (Closes: #94928)
+      - debian-control-file-uses-obsolete-national-encoding, stolen from
+        changelog-file (Closes: #247197)
+  * checks/cruft{,.desc}:
+    + [JvW] cvsignore-file-in-source is now info, because it happens so often
+      by upstream, and is only very minor in size
+    + [HE] New check: source-contains-cvs-conflict-copy, triggered by
+      .#file.version files. They are created by cvs when it tries to merge
+      local changes and an update from the repo. (Closes: #246060)
+    + [JvW] Also check for source-contains-svn-conflict-copy (for .r123 and
+      .mine files)
+  * checks/debhelper:
+    + [FL] Avoid Perl warning about undefined values. Noted by JvW.
+  * checks/fields{,.desc}:
+    + [JvW] Added debian-revision-should-not-be-zero, suggested by Adam
+      Conrad
+    + [FL] Downgrade build-depends-without-arch-dep to warning as it's
+      heuristic. Reword explanation. This partly handles #247171.
+    + [JvW] For build-depends-without-arch-dep, fix detection of debhelper
+      usage in clean when used by means of CDBS (combined with above change,
+      now fully closes: #247171)
+    + [HE] Check Build-Depends(-Indep) for virtual packages without a
+      real dependency. Fix based on patch by Steinar H. Gunderson
+      <sgunderson@bigfoot.com>. (Closes: #255593)
+    + [HE] Don't issue virtual-package-depends-without-real-package-depends
+      if this happens in Suggests. (Closes: #254367)
+    + [FL] Allow whitespace in relations after the version number
+  * checks/huge-usr-share:
+    + [FL] Skip check for packages that don't have usr/share at all
+      (Closes: #247708)
+  * checks/manpages:
+    + [FL] Comment check for no-manpage-in-correct-directory out until
+      I know if it's worth keeping it at all (Closes: #253011)
+      Thanks to Stephen Stafford for pointing this out.
+  * checks/menus:
+    + [FL] Fix regex which checks for update-menus calls (missing
+      whitespace) and allow path before executable name (perhaps this
+      should be another warning, though?) (Closes: #254420)
+    + [FL] Some clean-up and warn that wm-menu-config is deprecated
+      (Closes: #248997)
+    + [FL] Demote executable-in-usr-lib-menu to warning as executables
+      are supported (but seldomly used) (Closes: #254498)
+  * checks/menu-format:
+    + [FL] Fix su-to-root checks to cope with the new -X option and
+      improve the option parsing to better handle unknown options
+    + [FL] Allow a comma separated list in the package test. Pointed
+      out by Gerfried Fuchs (Closes: #246507) Change incorrect-package-test
+      to pkg-not-in-package-test which is issued when the package is
+      not in the list. Don't issue menu-command-not-in-package when
+      we have a list.
+    + [FL] Commands for window manager's modules can't be expected
+      to be available as executables, so don't issue
+      menu-command-not-in-package in this case. Thanks to
+      Manoj Srivastava for reporting (Closes: #247805)
+    + [HE] Change menu-command-not-in-package to also look into the standard
+      PATH. (Closes: #255155)
+  * checks/po-debconf:
+    + [JvW] Simply fail if stuff from gettext is missing.
+  * checks/scripts:
+    + [FL] Don't issue executable-not-elf-or-script for files
+      that are named *.exe (Closes: #251075, #255083)
+    + [CW] Add python2.4 as a valid interpreter (Closes: #254482)
+    + [FL] Add ruby1.[68] as valid interpreters, introduce new
+      ruby-script-but-no-ruby-dep error, copied from the python stuff
+    + [FL] Don't issue script-not-executable for menu-methods. There
+      are reasons why they are sometimes not executable (Closes: #250632)
+    + [FL] 'and' and 'or' are no bash keywords (Closes: #194283)
+  * checks/shared-libs:
+    + [FL] Don't report shlib-with-executable-bit and
+      shlib-with-bad-permissions on symbolic links to such files
+    + [JvW] Fix the pic-detection code (Closes: #185816)
+
+  * debian/{control,rules}, frontend/lintian:
+    + [JvW] Insert version number at package build time, no need to commit a
+      change to frontend/lintian on every version number change... Requires
+      sed version 4 at build-time.
+    + [JvW] Start depending on gettext.
+    + [JvW] Start depending on libdigest-md5-perl on woody, for using md5 on
+      files.
+
+  * frontend/lintian:
+    + [JvW] Partial rewrite: checks are now plugins loaded into lintian,
+      rather than executed as separate executables. Makes it easy to make
+      common functions available, tags are done centrally, etc etc. Should
+      also save quite a number of forks, thus more speedier.
+
+  * lib/Util.pm:
+    + [FL] dpkg supports comments in control files now, handle them
+      correctly
+    + [FL] a space after the colon is not mandatory in dpkg control
+      files
+
+  * man/lintian.1:
+    + [FL] Document new control-file check script
+
+  * reporting/harness:
+    + [FL] Correctly support udeb packages
+  * reporting/html_reports:
+    + [FL] Correctly support udeb packages
+    + [FL] Remove some unused code for bug references
+  * reporting/bug.status:
+    + [FL] Remove
+
+  * testset/filenames:
+    + [JvW] Fix two lintian warnings in lintian itself by touching files only
+      on clean target, and not distributing them in the source
+
+  * unpack/list-srcpkg:
+    + [FL] Some packages don't specifiy a standards-version, e.g. d-i ones.
+      Prevent Perl warnings.
+  * unpack/list-udebpkg:
+    + [FL] Fix sort of copy & paste error which caused the whole
+      script to behave ill
+  * unpack/unpack-binpkg-l2:
+    + [FL] While fixing permissions, also enable write access
+      so we get no problems on removal. Disable group write
+      permissions, we need nobody to interfere with us.
+
+ -- Debian Lintian Maintainers <lintian-maint@debian.org>  Tue, 13 Jul 2004 01:23:20 +0200
+
+lintian (1.23.0) unstable; urgency=low
+
+  The ``moving forward'' release, prepared by Marc 'HE' Brockschmidt,
+  Frank Lichtenheld and Jeroen van Wolffelaar.
+
+  * [FL] add udeb support (Closes: #216117)
+    Thanks to Joey Hess for his input. Many changes, mostly to
+    frontend/lintian, checks/debconf and checks/files
+
+  * checks/binaries:
+    + [JvW] Ignore static binaries in /usr/lib/debug
+  * checks/changelog-file:
+    + [HE] Check for the debmake template email address in the changelog
+      entries. Patch by Steffen Moeller <moeller@pzr.uni-rostock.de>,
+      thanks! (Closes: #199903)
+    + [JvW] Loosen up checks for -0.x versions, could be either native or
+      upstream + Debian revision, so some tests cannot be performed because of
+      that uncertainty
+  * checks/copyright-file:
+    + [HE] Change usr-doc-symlink-to-foreign-package check to throw an
+      error when a package doesn't depend on the *same* version of the
+      package its /usr/share/doc/$foo dir is symlinked to. This is supposed
+      to ensure that both come from the same source and the same source
+      version. (Closes: #201470)
+  * checks/cruft.desc:
+    + [HE] Reworded some parts and bumped the Standards-Version after
+      checking for changes. (Closes: #235735)
+  * checks/debconf{,.desc}:
+    + [JvW] Add an error for a bogus default for a boolean template
+      (Closes: #236846)
+    + [HE] Check for duplicate fields in templates. Fix based on
+      patch by Denis Barbier <barbier@linuxfr.org>, thanks! (Closes: #233116)
+    + [HE] Check if the translation of a Choices: field is empty, leading to
+      skipped questions. (Closes: #149451)
+  * checks/debdiff:
+    + [HE] Check for accidental native packaging. This is done by checking for
+      a dash in the version number (though -0.\d+ and -0.\d+.\d+ are allowed
+      for (binary) NMUs) and the existence of a .diff.gz. (Closes: #216327)
+    + [JvW] Implement source-tar-is-posix-tar, which checks for upstream
+      tarballs that are tar --posix tarballs, which cannot be untarred by the
+      tar version in woody (Closes: #245138)
+  * checks/debhelper{,.desc}:
+    + [JvW] Add error if debian/compat is empty, happens once in current
+      sid and gave internal error before
+  * checks/debian-readme:
+    + [HE] Add check for the debmake template email address. Patch by Steffen
+      Moeller <moeller@pzr.uni-rostock.de>, thanks!
+  * checks/deb-format:
+    + [HE] Add a check for the data member of a deb. dpkg 1.11 introduces
+      support for configurable compression algorithms (bzip2, for example),
+      but this shouldn't be allowed before dpkg 1.11 hits stable.
+      (Closes: #159874)
+  * checks/fields:
+    + [HE, FL] Nearly complete rewrite for clean up:
+      - bad-relation seems to work better now (Closes: #171763)
+      - duplicate relations checking now works for different fields, too
+        (Closes: #234978, #235356)
+    + [HE] Add check for an Origin field with "Debian" as value.
+      (Closes: #119618)
+    + [HE] Reintroduce build-depends-without-arch-dep check with the patch
+      I proposed in #214231. (Closes: #242484)
+    + [JvW] Check for well-formed Debian-revision
+    + [JvW] Check for correct realname when QA mailaddress used
+  * checks/fields.desc:
+    + [FL] Fix some wrong policy references
+  * checks/files:
+    + [HE] New check for compiled python files (*.pyc). Patch by David
+      Kimdon <david@kimdon.org>, thanks. (Closes: #236606)
+    + [HE] Check for gzipped zero byte files. (Closes: #172052)
+    + [FL] Don't complain about read-only *.ali files as requested by
+       Ludovic Brenta. This makes #226879 wishlist again.
+    + [FL] Warn about ancient files with the value of
+      Dinstall::CutOffPastYear from dak CVS as limit.
+      (Closes: #204801, #218304)
+    + [HE] Check for *.ali files introduced, warn if their permissions are !=
+      0444. (Closes: #226879)
+    + [HE] New checks for deprecated X11 dirs (/usr/{bin,lib,include}/X11 and
+      usr/X11R6/*). (Closes: #81004)
+    + [HE] Check for README for other distributions/platforms and warn if
+      they're installed. Based on patch by Jay Bonci. (Closes: #178441)
+  * checks/init.d:
+    + [FL] output-of-updaterc.d-not-redirected-to-dev-null should be
+      only a info tag since it is more a aesthetical issue, not a
+      policy violation. (Closes: #149700)
+  * checks/lintian.desc:
+    + [JvW] Added missing Type: tags
+  * checks/manpages:
+    + [FL] New checks:
+       - Section number of directory and file differ
+       - Section number of file differs from what is expected
+         from the location of the binary. (Closes: #203831)
+    + [FL] Parse contents of man page and implement more new checks:
+      - Section number of file and header differ (Closes: #89488)
+      - Try to search for hyphens that should be minus signs
+        (Closes: #205924). First patch by Eduard Bloch, final
+        regex by Josip Rodin.
+      - Search for FSSTND directories referenced in man pages. Only
+        an info tag. (Closes: #111098)
+    + [FL, HE] Fix false positives of
+      manpage-for-non-x11-binary-in-wrong-directory when a link
+      from a normal bin/ is pointing to a binary in an X11 dir. Based
+      on patch by FL. (Closes: #203389)
+    + [JvW] x11-games-should-be-in-usr-games is now error, because it's
+      mandated by policy
+  * checks/menus:
+    + [JvW] Stricter checking for whether update-menus is actually called
+      (Closes: #244628)
+  * checks/menu-format:
+    + [FL] Only issue one warning about needs=dwww, not two
+    + [HE] Check if the command given with command= is in the package
+      (Closes: #199346)
+  * checks/nmu{,desc}:
+    + [JvW] New series of checks: Check whether NMU's have correct NMU version
+      number, and whether maintainer uploads have correct maintainer version.
+      Also, check whether NMU's and QA uploads are identified as such in the
+      changelog (Closes: #111948)
+  * checks/scripts:
+    + [FL] Add /usr/bin/php as valid interpreter. (Closes: #239115)
+      Thanks to Peter Eisentraut for pointing this change out
+    + [FL] Reflect new suidperl handling. /usr/bin/suidperl
+      shouldn't/can't be called directly anymore so add a new
+      error and remove it from the list of usual interpreters.
+      (Closes: #240806)
+    + [HE] Don't warn about files with a shebang line which are not executable
+      when they are called *in, as they're probably just templates. (Closes:
+      #114740)
+  * checks/shared-libs:
+    + [HE] Add some new logic to cope with symlinks from /usr/lib to another
+      dir to fix false positives of postrm-has-useless-call-to-ldconfig and
+      friends. (Closes: #190714)
+    + [HE] Also handle case statements in postrm scripts. (Closes: #179435)
+  * checks/standards-version:
+    + [JvW] Also emit warning if standards version is 3.6.0, and not yet 3.6.1
+
+  * collection/diffstat
+    + [HE] The diff.gz file name does not include the the epoch, so strip it
+      before trying to get the file.
+  * collection/override-file:
+    + [FL] add support for source overrides (Closes: #129510)
+      See the User Manual for more information.
+  * collection/source-control-file:
+    + [FL] New collection script to extract field information
+      from debian/control in source packages. Currently used
+      in checks/debhelper to guess udeb packages.
+
+  * debian/control,debian/copyright:
+    + [FL] Add Marc 'HE' Brockschmidt to Uploaders and
+      to copyright file
+
+  * doc/lintian.sgml:
+    + [FL] Some updates, some more verbatim explantions
+      (Closes: #197955)
+    + [FL] Reworked the override section to handle udeb and
+      source packages, too
+  * doc/README:
+    + [FL] Update options
+
+  * frontend/lintian:
+    + [HE] Added a --dont-check-parts|-X option to allow users to specify
+      which tests should not be run. Also added infos about this to the
+      manpage. (Closes: #206674)
+  * frontend/lintian-info:
+    + [JvW] Fixed that lintian -I also displays info for I: entries
+
+  * lib/Dep.pm:
+    + [FL] Fixed some semantic errors (since noone ever observed the
+      correspoding perl warnings the fixed parts are probably never
+      used in the current code)
+  * lib/Utils.pm
+    + [HE] Changed {read,parse}_dpkg_control a bit to cope with the fact
+      that template files sometimes contain lines consisting only of
+      whitespace which do *not* separate to blocks. (Closes: #242479)
+
+  * testset/runtests:
+    + [JvW] Rewrote so that it is actually useful:
+      - sort output to nullify filesystem directory ordering differences
+      - run lintian just once
+      - check that all tests that are triggered have a description, if verbose
+        specified, warn about tests that are not tested
+
+  * unpack/list-binpkg:
+    + [HE] Try to open Packages.gz if no Packages file can be found. Fix
+      based on patch by Robert Lemmen <robertle@semistable.com>, thanks!
+      (Closes: #198617)
+
+ -- Debian Lintian Maintainers <lintian-maint@debian.org>  Fri, 23 Apr 2004 12:32:36 +0200
+
+lintian (1.22.12) unstable; urgency=low
+
+  The ``Fix those false positives, mkay'' release, prepared for all Debian
+  Maintainers by Frank Lichtenheld and Jeroen van Wolffelaar.
+  Best served cold.
+
+  * debian/control:
+    + [FL] Make Uploaders a single line field. It didn't really
+      break, but at least DDPO had its difficulties
+
+  * man/lintian.1:
+    + [FL] sync man page with the --help output by adding missing options
+      Based on a patch by Robert Lemmen. (Closes: #198615)
+    + [FL] sync man page with the current list of checks and collection
+      scripts
+
+  * checks/binaries:
+    + [FL] Don't complain about non-stripped kernel modules.
+      Patch by Dagfinn Ilmari Mannsaker (Closes: #203373)
+    + [JvW] Exclude binaries and packages named *-static from the
+      binary-is-static test. Exception for sash removed. (Closes: #215235)
+  * checks/changelog-file:
+    + [FL] Check that encoding of changelog file is UTF-8, based on a patch by
+      Denis Barbier (Closes: #175318)
+  * checks/copyright-file{,.desc}:
+    + [FL] Don't advise to point to the perl packages' copyright file.
+      Thanks to Martin Orr for pointing this out. (Closes: #193293)
+    + [FL] Fixed false positives of
+      copyright-should-refer-to-common-license-file-for-gpl due to
+      the GFDL. Thanks to Ross Burton for reporting this. (Closes: #192278)
+  * checks/deb-format{,.desc}:
+    + [JvW] Fix perl variable-name clash causing unusually formatted error
+      output (only important if you do automatic processing on it)
+    + [FL] The current script is by Denis Barbier, correcting author in
+      .desc file
+  * checks/debhelper.desc:
+    + [FL] correct reference to debhelper manpage. It's debhelper(7), not
+      debhelper(1). Thanks to Brian Nelson for pointing this out
+      (Closes: #188245)
+  * checks/debconf:
+    + [JvW] Update valid types, since currently 'title' is supported now too
+      (Closes: #234379, #234608)
+  * checks/description:
+    + [FL] fix description-is-dh_make-template check. (Closes: #215125)
+      Fix suggested by Josip Rodin
+  * checks/etcfiles.desc:
+    + [FL] correcting abbrevation of etcfiles to 'etc', was 'ini' which
+      is already used by init.d
+  * checks/fields:
+    + [FL] Really check only "real" dependency fields for needlessy
+      depends (Closes: #185035)
+    + [JvW] Don't consider depending on coreutils bad, as this is in a way a
+      versioned depend (Closes: #216536)
+    + [FL] Remove the build-depends-without-arch-dep check. It produces
+      way too much false positives and can only be replaced by
+      a sophisticated debian/rules parser
+      (Closes: #192037, #202950, #214231)
+    + [JvW] Test syntax of Uploaders: too
+    + [JvW] Accept more whitespace in relations, which is allowed according to
+      policy, thanks Adrian Bunk for noticing, FL for patch (Closes: #200280)
+  * checks/filenames:
+    + [JvW] Revised the symlink detection stuff, it is now more rigorous, and
+      has seperate warning for recursive symlinks that are otherwise not
+      necessarily wrong (Closes: #118080)
+  * checks/files:
+    + [FL] only issue package-installs-nonbinary-perl-in-usr-lib-perl5 if
+      there is no binary perl file at all in the package, since this
+      reflects the way the Installer module behaves (Closes: #199898)
+  * checks/huge-usr-share:
+    + [JvW] Check for a big /usr/share (currently 1-2MB will trigger it) in
+      arch-dependent packages. Currently just I:. Thanks Steve McIntyre for
+      the idea. (Closes: #232849)
+  * checks/menus{,.desc}:
+    + [FL] Remove non-exectuable-in-etc-menu-methods as it doesn't
+      reflects the current menu manual (Closes: #229460)
+  * checks/po-debconf:
+    + [JvW] Check whether files listed in debian/po/POTFILES.in actually
+      exist, and only positively detect po-debconf usage if dependency is
+      there. (Patch by Denis Barbier <barbier@debian.org>, only minimally
+      modified)
+  * checks/scripts:
+    + [FL] Fix check for "exec ..." line. Fix suggested by Josip Rodin.
+      (Closes: #212811)
+    + [JvW] Tighten up mknod, dpkg --print-architecture and killall detection
+      in maintainer scripts, would need rewrite to be really sane.
+      (Closes: #148548, #161820, #192300)
+  * checks/shared-libs:
+    + [FL] Be more tolerant to variations when checking for
+      postrm-unsafe-ldconfig. Thanks to Martin Godisch, Steinar H. Gunderson
+      and Aidas Kasparas for their input. (Closes: #218543, #233740)
+
+  * unpack/unpack-binpkg-l1:
+    + [FL] tar uses now h to signal hardlinks which breaks a lot of our code.
+      so sed'ing it away. Many many thanks to Theodore Y. Ts'o for bringing
+      this to our attention (Closes: #234545)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Mon,  8 Mar 2004 00:46:15 +0100
+
+lintian (1.22.11) unstable; urgency=low
+
+  Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+   * Upgrade lintian itself to policy 3.6.1
+     + Drop question about removing lab on purge, just do it.
+   * Update to Debian Policy 3.6.1, all references broken by
+     section-reorganization are updated (Closes: #194257, #208945, #214949,
+     also closes: #217384, #231884)
+     (Patch by Nicholas Breen <nbreen@ofb.net>)
+   * Support for dash scripts (Closes: #194787)
+     (Patch by Frank Lichtenheld <djpig@debian.org>)
+   * checks/binaries.desc:
+     + Fix typo (Closes: #202856)
+   * checks/deb-format, debian/control:
+     + Rewrite by Denis Barbier, slightly cleaned up, renders
+       libarchive-tar-perl dependency unneeded (Closes: #232875)
+   * checks/filenames (and more):
+     + Check for Subversion version control leftovers (Closes: #190067)
+     + Ignore empty __init__.py files in /usr/share/doc (Closes: #215234)
+       (based on patch by Frank Lichtenheld <djpig@debian.org>)
+   * checks/cruft:
+     + Check for CVS and Subversion cruft in source packages (Closes: #189776,
+       also closes: #190067)
+   * checks/po-debconf
+     + Rewrite in Perl
+     + Obsolete PO files are no more checked because po2debconf now
+       automatically runs debconf-updatepo if PO files are older than
+       templates files.  Of course PO files might be outdated (e.g. when
+       downloaded from a BR), but it should occur seldom.
+     + PO files are processed through msgfmt to ensure they are valid.
+     + Based on patch by Denis Barbier <barbier@debian.org>, Closes: #210576
+     + Check whether po-debconf is used at all, and warn if it isn't
+     + Check for required POTFILES.in and template.pot in debian/po
+   * checks/menu-format
+     + Drop menu-icon-has-bad-colors, it doesn't apply anymore (Closes: #199341)
+     + Menu sub-policy 3.6.0 added two sections (Closes: #207529)
+     + Added three checks for correct su-to-root usage (Closes: #188095)
+     + Understand icon32x32 and icon16x16 (Closes: #200046)
+     + Missing required tags are now an error (and check name changed)
+     + Check tag-quotation
+     + Rewrite needs check properly, being more precise what is allowed
+     + Complain about needs="dwww", as this is obsolete accordint to menu
+       maintainer
+       (parts menu-format updates based on patch by Bill Allombert
+       <ballombe@debian.org>)
+   * checks/scripts
+     + Recognise the 'tcl' interpreter, not the same as tclsh (Closes: #230182)
+
+  Frank Lichtenheld <djpig@debian.org>
+   * checks/debhelper:
+     + fix parsing debian/compat for needed
+       version (Closes: #198611)
+     + update list of existing debhelper commands
+   * checks/manpages:
+     + push back the extension after testing for
+       manpage-not-compressed (Closes: #225293)
+   * checks/copyright-file: don't complain about missing reference to
+      the GPL if we already detected a wrong reference (Closes: #225837)
+   * checks/debconf:
+     + don't complain about partially-translated-question, if
+       Choices is only a substitution variable (Closes: #200802,#222648)
+     + fix testing of dependencies to eliminate false
+       positives of missing-debconf-dependency (Closes: #195201)
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Mon, 16 Feb 2004 21:17:59 +0100
+
+lintian (1.22.10) unstable; urgency=low
+
+  * Lintian maintainance is now in the hands of the `Debian Lintian
+    Maintainers' group
+  * Add check for tar bug #230910
+    (tar check written by Marc 'HE' Brockschmidt <marc@marcbrockschmidt.de>)
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Fri, 13 Feb 2004 01:00:48 +0100
+
+lintian (1.22.9) unstable; urgency=low
+
+  * config.* files from 2000-09-05 and such had the timestamp in a
+    variable called version, not timestamp, so check for that as well
+    to detect the really old ones as well.
+  * Made sharedobject-in-library-directory-not-actually-a-shlib an E
+    because it uses the same method as
+    pkg-has-shlibs-control-file-but-no-actual-shared-libs does, and that
+    one's pretty reliable and already E, closes: #197951
+  * Fixed logic error in detecting whether the uncompressed changelog
+    file is really a symlink, closes: #198171.
+  * Ripped out those few remaining bits of code that watched over /usr/doc,
+    closes: #193598.
+  * Don't whine about policy 3.5.10. No changes.
+  * Avoid install-docs' --no-update-menus when checking for update-menus
+    calls, closes: #183193.
+  * Close the IN filehandle in menus:check_script() so that $. gets
+    properly reset (sloppy coding -- argh!).
+  * Fixed a $1 overwriting thinko in debhelper checks.
+  * Demoted build-depends-without-arch-dep from E to W. "Most likely"
+    isn't non-heuristic, dammit.
+
+ -- Josip Rodin <joy-packages@debian.org>  Sat, 06 Sep 2003 22:05:22 +0200
+
+lintian (1.22.8.1) unstable; urgency=high
+
+  * Fixed a small logic oversight in the new debhelper compat check,
+    closes: #187415.
+
+ -- Josip Rodin <joy-packages@debian.org>  Thu,  3 Apr 2003 12:27:55 +0200
+
+lintian (1.22.8) unstable; urgency=low
+
+  * Updated the list of valid archive sections, closes: #187111.
+  * Ignore symlinks in the image-file-in-usr-lib check, closes: #180280.
+  * Updated the list of virtual packages, closes: #179614, #180421.
+  * Fixed typo in the LaTeX license exception, closes: #184640.
+  * Removed anal-retentive check for a bug in debconf << 1.2.9,
+    closes: #185721.
+  * Updated policy version in the description, closes: #185882.
+  * Checks in debian/compat for debhelper compat version, and warns
+    if it finds that as well as DH_COMPAT, closes: #186269.
+
+ -- Josip Rodin <joy-packages@debian.org>  Wed,  2 Apr 2003 19:22:37 +0200
+
+lintian (1.22.7) unstable; urgency=low
+
+  * Adjusted Policy references for changes in the shared library stuff.
+    Updated standards-version checks to recognize 3.5.9, and shifted
+    old/ancient borders to 3.5.7/3.5.2.
+  * Allow for ${1+"$@"} as well in the evil exec line check, closes: #179145.
+  * Removed the CXXABI check because it's not reliable enough, not all
+    C++-linked programs include libsupc++ which provides those symbols.
+    Sorry. Closes: #179278, #184729.
+  * Allow /usr/lib/$pkg in the rpath check, thanks to Matej Vela,
+    closes: #173610.
+  * Added /usr/share/pixmaps to the icon file path, closes: #181552.
+  * Ignored symlinks in the gzip -9 check for changelogs, closes: #181899.
+  * Ignore LaTeX license in the common-licenses check for GPL, thanks
+    to Peter van Rossum, closes: #184640.
+  * Included (tcl|tk)8.4 on their respective lists, thanks to Chris Waters,
+    closes: #184655.
+  * Ignore alternatives in the check for duplicate relations, closes: #184660.
+    It's still not inclusive, but the remaining cases should be rare enough.
+  * Added Denis Barbier's po-debconf checks, closes: #173823.
+
+ -- Josip Rodin <joy-packages@debian.org>  Fri, 14 Mar 2003 23:21:41 +0100
+
+lintian (1.22.6) unstable; urgency=low
+
+  * Added missing description for empty-manual-page.
+  * Adjusted some descriptions for -dev symlinks.
+  * Updated the policy section for copyright files from 13.6 to 13.5,
+    closes: #177769.
+  * Updated the policy section for changelog files from 13.8 to 13.7,
+    closes: #176946.
+  * Added extended-description-line-too-long, closes: #176784.
+  * Warn against lack of CXXABI, thanks to Colin Watson, closes: #175920.
+  * Allow for all the other tricks scripts play with their interpreters
+    by making the check generic, /^\s*exec\s*.+\s*.?\$0.?\s*.?\$\@/.
+    Thanks to Colin Watson, closes: #175602.
+  * Changed the dh_testversion checks to also find disparities between
+    DH_COMPAT and debhelper build-dep version, closes: #175295.
+  * Ignore packages that build-depend on autotools-dev in the config.*
+    date check, since they probably copy stuff around, closes: #178347.
+
+ -- Josip Rodin <joy-packages@debian.org>  Thu, 30 Jan 2003 17:03:15 +0100
+
+lintian (1.22.5) unstable; urgency=low
+
+  * Ignore Zope's license in
+    copyright-should-refer-to-common-license-file-for-gpl, thanks to
+    Matej Vela, closes: #172211.
+  * Don't require \S+ but .+ while parsing @packages, closes: #172444.
+  * Rewrote the chunk of code dealing with names of manual pages, because
+    it was done all wrong, closes: #173548.
+  * Ignore files consisting merely of .so links completely, thanks to
+    Matej Vela, closes: #173609.
+  * Added code to check for bad-so-link-within-manual-page.
+  * Also added code to check for empty-manual-page.
+  * Added a few more cases of safe ldconfig invocation in postrm,
+    closes: #174042. Didn't handle the one with the "case" statement,
+    it's too bothersome. Oh well, the check is a warning instead of
+    an error for a reason.
+  * Added a check for the timestamp line in config.guess/sub files,
+    closes: #171295.
+  * Renamed the full-stop check to
+    description-synopsis-might-not-be-phrased-properly and rephrased its
+    description. This is where I draw the line :) closes: #174150.
+  * Added a warning on .pl and .pm files within /usr/lib/perl5,
+    closes: #174595.
+  * Renamed pkg-without-shlibs-has-shlibs-control-file to
+    pkg-has-shlibs-control-file-but-no-actual-shared-libs and improved
+    its long description.
+  * Added sharedobject-in-library-directory-not-actually-a-shlib,
+    which should properly address the issue of SONAME-less libraries,
+    closes: #174928.
+  * Exclude files that match "LICENSE AGREEMENT FOR PYTHON 1.6.1" from the
+    copyright-should-refer-to-common-license-file-for-gpl check,
+    closes: #174929.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Sat, 11 Jan 2003 12:32:33 +0100
+
+lintian (1.22.4) unstable; urgency=low
+
+  * Fixed typo in the description of description-synopsis-ends-with-full-stop,
+    closes: #172049.
+  * Slightly clarified the text as well, and added a pointer to Policy 5.7.1.
+  * Made it a warning, not an error which it was by mistake, closes: #172541.
+  * Removed an extra colon from copyright-file-lacks-pointer-to-perl-license.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Wed, 11 Dec 2002 20:39:38 +0100
+
+lintian (1.22.3) unstable; urgency=low
+
+  * Fixed typo in copyright-should-refer-to-common-license-file-for-gpl
+    which caused it to have no description. Also moved the opening of
+    the pipe to lintian-info before the first print E: line so that
+    bad-distribution-in-changes-file and other tags in lintian.desc
+    actually get displayed, closes: #171737.
+  * Updated the description of link-to-undocumented-manpage to better
+    match the current Policy and be more helpful.
+  * Added missing \Q and \E around the variable in
+    description-synopsis-is-duplicated, closes: #171721.
+  * Don't warn on _any_ mention of update-rc.d in postinst, just those that
+    follow whitespace or something else and a semicolon, closes: #171472.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Thu,  5 Dec 2002 12:25:17 +0100
+
+lintian (1.22.2) unstable; urgency=medium
+
+  * Fixed some random glitches.
+  * Change rgb-vs-cmap to first include the hex codes of colors in cmap.xpm,
+    and then go searching for names in rgb.txt. Updated the cmap.xpm
+    location in the description. This hopefully really closes: #170860.
+  * Added exception in the shell syntax checks for evil rep scripts,
+    thanks to Kevin Ryde, closes: #171175.
+  * Added checks for multiple dependencies on libstdc, tcl, tclx, tk, tkx
+    and libpng packages. This is currently beind done in a hardcoded manner,
+    but that should do for now, closes: #80447, #129548.
+  * Added a regression test as part of the relations regression test for
+    the above multiple dependencies.
+  * Don't barf on /var/local in the FSSTND-dir-in-var check, just in
+    non-standard-dir-in-var, closes: #119414. The normal packages
+    shouldn't install anything there anyway, and base-files can have
+    overrides :)
+  * Prepend a slash to the file names in file-in-etc-not-marked-as-conffile,
+    closes: #122285. We already don't have the prepended thing normalized,
+    so why not indulge this.
+  * Added dh_suidregister-is-obsolete, closes: #94031.
+  * Added copyright-lists-upstream-authors-with-dh_make-boilerplate,
+    closes: #107815. I am now the official maintainer so I get to do that >:)
+    This time I've written the description much better, so there should
+    be no confusion like there was the last time.
+  * Added description-synopsis-is-duplicated first by comparing the
+    lowercased synopsis with the lowercased start of the extended
+    description, and then if that fails, the letters and numbers are
+    removed and the strings are compared. This may not catch _everything_,
+    but should be satisfactory, and it closes: #118098.
+  * Added a regression test for the above error to the other relations test.
+    It seemed handy. :)
+  * Added an error for depending on libdb1-compat, just in case, as advised
+    by Colin Watson.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Fri, 29 Nov 2002 22:22:54 +0100
+
+lintian (1.22.1) unstable; urgency=medium
+
+  * Handle the $statistics_file rotation in harness.
+  * Warn on dh_dhelp use, thanks to Chris Tillman, closes: #130016.
+  * Exempt awk from the virtual-package-depends-without-real-package-depends
+    check, and add an error when there's a non-versioned dependency on awk,
+    closes: #136831. The description may be considered vague for some
+    cases, but I'll wait until someone actually complains about that
+    before rewriting it.
+  * Moved the generic exceptions before the script-without-interpreter check,
+    which should fix Daniel Kobras' dx false positive, closes: #165574.
+  * Added a warning for full stop in the synopsis line, thanks to
+    Colin Walters, closes: #131747.
+  * Added a warning for daemon stopping stuff in postinst, without
+    a dependency on debconf (>= 1.2.9), thanks to Martin Godisch,
+    closes: #168621.
+  * Based on hints from in Jim Van Zandt's otherwise rather flawed patch
+    posted in bug #94928, moved the diff file stuff from the cruft check
+    into the diffstat collector, and made it simply extract the patch into
+    a file called "debian-patch" which is then used elsewhere, instead of
+    zcatting it over and over again.
+  * Added a regression test for the debian/files and config.* checks.
+  * Added config.log to the list of configure-generated files to warn about.
+  * Updated menu icon colors with a little script I wrote, closes: #170860.
+  * It appears File::Find has changed semantics since woody and now refuses
+    to follow a symlink as the name of the directory to scan. Obviously,
+    a simple readlink() fixes it.
+  * I realized that bug #122855 couldn't have been fixed the diff scanning
+    code anyhow, since dpkg-source ignores file deletions in the first place.
+    Removed the hours of work and simply expanded on the description of the
+    error instead. Oh well.
+  * Added an error for GPL copyrights that don't refer to
+    /usr/share/common-licenses, thanks to Edward Betts, closes: #99885.
+  * Added a warning for some popular architecture-independent image files
+    in /usr/lib which suggests moving them to /usr/share per FHS, thanks to
+    Bill Allombert, closes: #114474.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Wed, 27 Nov 2002 20:00:05 +0100
+
+lintian (1.22) unstable; urgency=medium
+
+  * Further updated the python script checks to ignore obsolete -base
+    packages and watch versioned python interpreters better, thanks
+    to Federico Di Gregorio and Luca De Vitis, closes: #169872.
+  * Added an exception for sash in the statically-linked-binary check,
+    as reported by H. S. Teoh.
+  * Moved descriptions for two manual page location consistency checks
+    from shared-libs.desc (?!) to manpages.desc, and clarified them,
+    as reported by Othmar Pasteka.
+  * Accept /var/games as an exception for setgid stuff, closes: #169382.
+  * Removed the /etc/ppp perms exception as per discussion on debian-devel.
+  * Fixed the add-log-mailing-address check by not re-my-ing the prefix
+    and suffix variables in each iteration of the loop, closes: #129581.
+    Added the word obsolete in the name of the error and a paragraph break
+    to further clarify it.
+  * Added Apps/Science as a valid menu section. This and the removal of
+    the error for calling ldconfig anywhere in the postinst in 1.21.5
+    make Lintian Policy 3.5.8 compliant, closes: #170093.
+  * Exclude .png files from the extra-license-file check, closes: #164017.
+  * Exclude .php files from the extra-license-file check, closes: #116384.
+  * Added documentation-package-not-architecture-independent warning in
+    the cruft check, closes: #120261.
+  * Check if $action is defined before comparing it to avoid a warning with
+    the -C option, closes: #129582.
+  * Added Kevin Ryde's patch that implements menu-icon-too-big,
+    menu-icon-has-bad-colors, menu-icon-cannot-be-parsed, closes: #71396.
+  * Make .nfs* files trigger the backup-file-in-package check, closes: #95140.
+  * Added an error for .xvpics directories, closes: #169831.
+  * Added more misspellings from Matt Zimmerman, without the British
+    English stuff, with the four language names in a special arrangement,
+    closes: #119786.
+  * Made package-contains-CVS-dir an error, closes: #147301.
+  * Added an error for /usr/share/doc/<something>/examples/examples
+    directory, closes: #153144.
+  * Added an error for referring to the Perl license terms without actually
+    pointing to their location on the file system, thanks to Gergely Nagy,
+    closes: #157449.
+  * Check for localhost(.localdomain) in the Maintainer fields,
+    closes: #162248.
+  * Fixed the needs=dwww exception in the menu file check for an empty
+    section, thanks to Colin Watson, closes: #170437.
+  * Check for debian-qa@l.d.o in Maintainer fields, thanks to Colin Watson,
+    closes: #126687.
+  * Updated standards-version check to declare anything lesser than 3.2
+    ancient (1999!), and anything lesser than 3.5.6 old (2001).
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Mon, 25 Nov 2002 14:38:55 +0100
+
+lintian (1.21.6) unstable; urgency=high
+
+  * Fix two regexps in the scripts check in order to fix *sh -n checking,
+    closes: #167079.
+  * Added duplicate-conffile error, closes: #131632.
+  * There doesn't appear to be any provision in the Policy or in the FHS
+    for random compatibility symlinks, so I've just added "or symbolic
+    link" to the description of file-in-unusual-dir, closes: #135546.
+  * Fixed the regexp for package-contains-CVS-dir to actually recognize
+    directories that are printed with the trailing slash, closes: #146831.
+  * Made unregistered-script-in-etc-init.d a warning, renamed it to
+    script-in-etc-init.d-not-registered-via-update-rc.d and updated
+    its description to mention why it may not be an error, closes: #118823.
+  * Added dash into the regexps in the scripts check.
+  * Added a crude check for code within another shell (foosh -c something).
+    I say crude because it works with oneliners only -- anything that spans
+    lines sounds like pretty much impossible to do in without actually
+    _being_ a shell script interpreter :) closes: #166483.
+  * Added an exception for /etc/ppp being 750 root:dip, and complain if
+    it exists and it's not like that, closes: #169260.
+  * Expunged the notion of a global override file from the tag descriptions.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Sat, 16 Nov 2002 17:26:07 +0100
+
+lintian (1.21.5) unstable; urgency=medium
+
+  * Removed postinst-unsafe-ldconfig warning as per the discussion in
+    #120585, which also conveniently closes: #117260, #114123.
+    Note that postrm-unsafe-ldconfig stays!
+  * Further improvements to reporting/harness, reporting/html_reports
+    and related code.
+  * Fixed the display of info for python-script-but-no-python-dep on
+    python1*.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Wed, 13 Nov 2002 16:37:09 +0100
+
+lintian (1.21.4) unstable; urgency=medium
+
+  * Just check for bashisms in sh files, thanks to Jay Bonci for
+    pointing me a this.
+  * Recognize python source packages called pythonX.Y, which should fix
+    third-party-package-in-python-dir for all of them, closes: #114281.
+    Also extend the checking of that directory on all X.Y and not just 1.5.
+  * Fixed policy references in several init script related tags, made the
+    init.d not conffile check a warning since Policy allows otherwise and we
+    can't check reliably, extended the rc.d file check on rc(\d|S).d and
+    excluded sysvinit and file-rc from the check. All this closes: #118824.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Mon, 11 Nov 2002 11:52:47 +0100
+
+lintian (1.21.3) unstable; urgency=high
+
+  * Do _not_ close STDERR before running dpkg-source in unpack-srcpkg-l2.
+    The logname stuff has been fixed ages ago so there shouldn't be any
+    remotely valid reason to do this. This should explain bugs like #159474
+    and #162813 to the submitters, but I'll have to wait and see, since
+    I still can't reproduce it myself.
+  * Fixed the cruft check not to check the diff file just once, not for
+    every damn subdirectory of the source, d'oh.
+  * Backed out the --remove-lab move to postrm, lintian doesn't exist there
+    any more, silly, closes: #166309.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Sun, 27 Oct 2002 12:48:57 +0100
+
+lintian (1.21.2) unstable; urgency=low
+
+  * Changed the default path for ksh to /bin/ksh, as per the change
+    in the pdksh package, closes: #131484.
+    Maybe /usr/bin/ksh should still be allowed, but it seems inconsistent
+    to allow several paths like that... perhaps the same should be done
+    for zsh? Although, I suppose there are less zsh scripts out there
+    compared to ksh.
+  * Added $link to the usr-doc-symlink-to-foreign-package error message,
+    hopefully properly closes: #116309 (untested).
+  * Eradicated the remaining Packaging Manual references, from
+    Chris Tillman's patch in #116488. Also removed FSSTND references.
+  * Fixed typo in description-is-dh_make-template, closes: #145802.
+  * Replaced /usr/share/doc with /usr/doc in checks/copyright-file.desc,
+    thanks Matej, closes: #157423.
+  * Set binary mode to be able to grok UTF-8 with Perl 5.8 when reading
+    override files, thanks to Colin in #158119. Maybe this is all wrong,
+    but it shouldn't hurt anyway. :)
+  * Added Colin's patch check manual pages for correctness with lexprog,
+    along with the appropriate versioned dependency on man-db, closes: #52524.
+  * Cleaned up some typos in copyrights.
+  * Added *sh -n checking for syntax errors in shell scripts, closes: #42348.
+  * Moved script checks from control-files to the second part of scripts,
+    and also noticed and fixed a bug -- if a script e.g. called killall and
+    had a bashism on the same line, it would escape undetected.
+  * Check the .diff.gz file (if it exists) for config.(cache|status) that
+    includes no added and a number of removed lines and don't print the
+    configure-generated-file-in-source error for those files, closes: #122855.
+    The diff output analysis isn't perfect, but it oughta work.
+  * Clarified the virtual-package-depends-without-real-package-depends
+    warning with an additional paragraph, closes: #164813.
+  * Updated the testset/check_info.pl to work, similarly to lintian-info.
+  * Updated the testsets (this verified my s/elsif/if/g bug fix in
+    checks/scripts mentioned above).
+  * Updated %known_essential as per my sid available file.
+  * Updated %known_virtual_packages as per Policy's virtual packages list.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Thu, 17 Oct 2002 13:57:00 +0200
+
+lintian (1.21.1) unstable; urgency=low
+
+  * Removed FHS transition stuff from lintian's own maintainer scripts.
+    Lintian is now Lintian-clean. :o)
+  * Moved the purge stuff from the old prerm to postrm, and made the
+    (possibly redundant; to-do) question more forgiving.
+  * Added a doc-base file and run install-docs, closes: #129509.
+  * Removed spurious no-manpage exception for binaries that end in
+    numbers, closes: #118479.
+  * Fixed lintian-info's broken $ENV{LINTIAN_ROOT} use.
+  * Fixed --setup-lab to ignore already-existing packages, thanks to
+    Chris Tillman, closes #83593. Let's hope it all works out :o)
+  * Updated the list of allowed distributions, closes: #150466.
+  * Removed the leading ./ from filenames in %linked_against_libvga which
+    actually makes it work, thanks to Matej Vela, closes: #157317.
+  * Warn against all uncompressed changelogs, thanks again to Matej Vela,
+    closes: #157318.
+  * Nuked the code that checked that that for every /usr/share/doc/foo -> ...
+    symlink there exists an equivalent /usr/doc/foo -> ... symlink;
+    seems to be a leftover from the FHS transition days, thanks yet again
+    to Matej Vela for the patch, closes: #161716.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Mon,  7 Oct 2002 22:18:20 +0200
+
+lintian (1.21) unstable; urgency=low
+
+  * New maintainer.
+  * Applied the ever so appropriately named ``unfuck'' patch to the lab
+    code. It includes but is not limited to:
+     + code to read the pool from Bas Zoetekouw
+     + other changes to support new style distributions from myself
+     + fixes for the breakage induced by Shaleh's blitheful insertion of
+       "use strict" everywhere
+     + an array of assorted fixes from Colin Watson, myself and perhaps
+       others which I've accidentally forgotten.
+    The lab code is now officially not entirely broken. Yay! :)
+    There's still work to be done, but this still closes: #157369, #157942.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Wed, 25 Sep 2002 19:18:57 +0200
+
+lintian (1.20.19) unstable; urgency=high
+
+  * revert the frontend to using require as use is a compile time only option
+    which was causing the environment variables to not be read.
+    Closes: #160819
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri, 13 Sep 2002 17:55:54 -0700
+
+lintian (1.20.18) unstable; urgency=low
+
+  * "I release once a year whether I need to or not" release
+  * updated debhelper command list, closes: #119094
+  * applied lab patch from Joy, et. al., closes: #157942
+  * added python version 1.5, 2.{1,2,3} to checks/scripts, closes: #114164
+  * applied Colin Watson's patch for needs=dwww handling in menu files,
+    closes: 115486
+  * renamed autoconf-generated-file-in-source to
+    configure-generated-file-in-source, closes: #115744
+  * updated php checks in checks/scripts, closes: #116386
+  * yet another checks/script update.  This time we allow for unusual
+    interpreters when the file is not in a bin/ directory, closes: #116584
+  * updated policy revision, closes: 118694
+  * applied Colin Watson's patch for a bug in deplib which made A | B => A,
+    closes: #122742
+  * applied Chris Tillman's patch to clean up policy references,
+    closes: #123585
+  * applied Kevin Ryde <user42@zip.com.au>'s patch to better check for emacs
+    local variables in changelogs and updated the error message as well,
+    closes: #129581, #138216
+  * accept *-proposed-updates in distribution field, closes: #139288
+  * removed check for postrm removing usr doc symlink and inverted the
+    postinst check to now make sure the package does NOT set the symlink.
+    Closes: #154005
+  * removed global override file, it was getting ancient
+  * converted all uses of 'require' to use statements
+  * more use strict cleanups
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri, 13 Sep 2002 09:49:24 -0700
+
+lintian (1.20.17) unstable; urgency=high
+
+  * Colin patches:
+    fixed typo in man page causing incorrect formatting, closes: #114118
+    duplicate relations check is a lot more intelligent, closes: #119048
+  * urgency set to high to reflect the fact that the relations check is
+    reporting many packages violating policy when in fact they are following
+    it correctly.  This is especially true for the new python policy.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Sun, 25 Nov 2001 18:15:04 -0800
+
+lintian (1.20.16) unstable; urgency=low
+
+  * the "next day bug" release
+  * give an error if a package declares a relation on the same package twice,
+    i.e. Depends: libc6, libc6 (<< 2.0).  Closes: #27442.
+  * objdump-info collection script now handles UPX binaries (closes: #113497)
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Tue, 25 Sep 2001 15:40:30 -0700
+
+lintian (1.20.15) unstable; urgency=low
+
+  * the "collecting unemployment and have time to code" release
+  * no longer use syscall to exit from pipeline handler, now uses POSIX::_exit
+    Closes: #112205.
+  * Accept Joy's NMU patch (he applied it as 1.20.14.1).
+    Closes: #110991, #109244.
+  * Warn if the copyright file contains dh-perl-make boilerplate as suggested
+    by James Troup.  In the process debmake-templates-in-copyright became
+    helper-templates-in-copyright.  Closes: #110337.
+  * Oops, used the same argument name (-s) twice.  Reverted back to -s meaning
+    "source".  Updated manpage and source to reflect this.  Closes: #109631.
+  * added a warning when hardlinks are used.  Closes: #103893, #97518.
+    I am closing #97518 here as well which asked that I warn about hard links
+    that link to files in another directory.  Since I warn about hardlinks
+    existing adding a separate check for where they link seems silly.
+  * applied Edward Betts patch to detect .cvsignore and CVS/.  Closes: #74684.
+  * applied Daniel Schleper's patch for Build-Depends v. Build-Depends-Indep.
+    Closes: #92472.
+  * applied Edward Betts patch for detecting a misspelling in common-licenses.
+  * added 'debain' to list of spelling errors.  Closes: #112083.
+  * applied Steve Kowalik's patch that adds out-of-date-standards-version.
+    This will be defined as the policy shipped with the last stable release.
+    Closes: #112043.
+  * Made doc-base-references-usr-doc inform which file is the culprit.
+    Closes: #111020.
+  * Applied Steve M. Robbins' patch for improved handling of ldconfig checks
+    in maintainer scripts.  Closes: #110465, #113285.
+  * do not complain about static binaries if they are called "foo.static".
+    Closes: #98288.
+  * testset/runtests now calls dpkg-buildpackage with a '-d' so build-depends
+    are not checked.
+  * oops I left 'debian' in the spelling check list.
+  * backed out Gergely Nagy's suggestion for checking for 'Author(s)'.  That
+    is just overly pedantic and lame.  Reopens: #107815, tagged wontfix.
+  * checks/etcfiles now complains about ANY file found in /etc that is not a
+    conffile.  The finer grain checks have been removed.  Closes: #103940.
+    Added a new testset 'etcfiles' to go along with the test.
+  * debconf check now looks for the 'seen' flag and gives an error if the
+    package does not have a versioned dependency on debconf 0.5.00.
+    Closes: #113164.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Mon, 24 Sep 2001 12:20:00 -0700
+
+lintian (1.20.14.1) unstable; urgency=low
+
+  * Another non-maintainer upload blessed by the maintainer, to clean up
+    after the last such NMU. :)
+  * Fixed spurious postinst-has-useless-call-to-ldconfig warnings, patch
+    from Colin Watson, closes: #109721. Also fixed the silly error in
+    shared-libs which broke shlib-missing-in-control-file.
+  * Fixed checking for /var/lib/games, patch from Andrew Suffield, amended
+    by me not to warn for the files but just that dir, closes: #109970.
+  * Have debian-changelog-file-contains-user-emacs-settings checked only
+    at the start of the line (wonder if Emacs allows indentation in there?),
+    closes: #109971.
+  * Force LANG=C because of a bug in debiandoc-sgml, closes: #110891.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Sat,  1 Sep 2001 21:01:30 +0200
+
+lintian (1.20.14) unstable; urgency=low
+
+  * Non-maintainer upload blessed by the maintainer. Kudos to Colin Watson
+    and Steve Kowalik for helping in the preparation of this upload.
+  * Skip shared objects which aren't in %ldso_dir in some shlib checks,
+    as per changes in Policy 3.5.5, finally closes: #42399, #41613.
+  * Fixed Policy section in package-contains-upstream-install-documentation,
+    closes: #94267.
+  * Added Adrian Bunk's patch for pike/pike7 stuff, along with pike7 stuff
+    in checks/scripts.desc so it's consistent, closes: #94902.
+  * Added an error for leaving files generated by autoconf in the source
+    package, patch from Colin Watson, closes: #107679, #94316.
+    This pulled in renaming checks/debian-cruft* to cruft*, logically.
+  * Added checks/infofiles* for everything related to info files, moved
+    parts of checks/menus* in it and added compression related errors,
+    closes: #95785.
+  * Added Brendan O'Dea's patch for checking Perl module directories,
+    and for not checking the source for each matching file in a !$is_python
+    package, closes: #96350.
+  * Removed lc() from checks on whether a debconf field value is valid,
+    closes: #106324.
+  * Improved binary-or-shlib-defines-rpath description, closes: #94901.
+  * Fixed the references to /usr/doc in the manual page using the patch
+    from Stephen Stafford, closes: #103177.
+  * Added debconf's "config" among %maintainer_scripts in
+    checks/control-files, closes: #108123.
+  * Added "Debian/GNU Linux" among the corrections in checks/spelling,
+    closes: #35761. It required some other modifications but oh well.
+  * Added a new warning, doc-base-file-references-usr-doc, closes: #46582.
+    This required adding collection/doc-base-files* and using that in
+    checks/menus*.
+  * Added a new error, debian-changelog-file-contains-user-emacs-settings,
+    closes: #84750. This required using collection/changelog-file in
+    checks/changelog-file (doh! :).
+  * Complains on manual pages located in /usr/(share|X11R6)/man instead of
+    man* subdirs, closes: #93056.
+  * Added php4 as a valid interpreter, closes: #94534.
+  * Fixed a little bug in checks/spelling.desc, it lacked a comma in its
+    Needs-Info field.
+  * Added a warning when there's common-licenses and not
+    /usr/share/common-licenses/ in the copyright file, closes: #99886.
+  * Added a warning when there's "Upstream Author(s)" in the copyright file,
+    closes: #107815.
+  * Removed -v from command(1) invocation check, patch from Colin Watson,
+    closes: #96227.
+  * Mention the language in select-with-translated-default-field and
+    partially-translated-question, patch from Colin Watson, closes: #95795.
+    Also, fixed some thinkos in the code for the latter warning.
+  * No longer barfs on debhelper-generated safe ldconfig calls, patch from
+    Paul Martin, closes: #82479.
+  * Added the recent Policy versions up to 3.5.6 to standards-version,
+    and moved the threshold for ancient versions up to 3.2.0 because that
+    version was released a bit more than one year ago, closes: #104766.
+  * Added a new error, package-depends-on-an-x-font-package. The pattern
+    is ^xfont.*, that ought to work fine (xfntil2 et al will go undetected,
+    but that's obsolete).
+  * Colin tweaked lib/text_utils.pl to display indented and empty stuff in
+    Info: tags properly.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Sat, 18 Aug 2001 18:46:34 +0200
+
+lintian (1.20.13) unstable; urgency=low
+
+  * debhelper check for lacks #DEBHELPER# token now checks if -n was passed
+    to the dh_ script. Thanks Chip for pointing this out. (closes: #92624)
+  * list of debhelper programs that want to write to maintainer scripts updated
+  * now check for Build-Depends on essential or build-essential packages
+    (closes: #92372)
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu,  5 Apr 2001 16:00:10 -0700
+
+lintian (1.20.12) unstable; urgency=low
+
+  * 'farewell to Fabrizio Polacco' release
+  * checks/debhelper's dh-make-template check did not include the $type in
+    its output.
+  * removed spurious debug message from zero-byte-file check in checks/files
+  * lintian no longer runs its regression test when it builds (closes: #92192)
+  * unpack-src-l2 now ensures that we have sufficient permissions to later
+    remove the package (closes: #92224)
+  * bashism check now looks for bash style arrays, thanks Torsten Landschoff.
+    also added to testset.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Mon,  2 Apr 2001 12:30:20 -0700
+
+lintian (1.20.11) unstable; urgency=low
+
+  * 'where is my mind release'
+  * added science to list of known sections, Closes: #91798
+  * cleanup override handling, was using chop instead of chomp
+  * checks/binaries checks a binary for profiling symbols now, Closes: #91837
+  * removed false report of prerm failing to remove a doc link when there is
+    no doc dir, just a symlink to another package.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Mon, 26 Mar 2001 11:22:22 -0800
+
+lintian (1.20.10) unstable; urgency=low
+
+  * 'I think I remember perl' release
+  * checks/menu-format would die if the last line of a menu had a line
+    continuation character.  Seems the function was not getting called with
+    all 5 arguments.
+  * added a list of exempt paths for static binaries, currently only /boot
+    is listed.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Mon, 19 Mar 2001 14:14:41 -0800
+
+lintian (1.20.9) unstable; urgency=low
+
+  * 'rule monger' release
+  * checks/debhelper: make regex case insensitive, Closes: #89070
+  * checks/debhelper: modify search logic so it does not report false postives
+    when both Build-Depends and Build-Depends-Indep are defined, Closes: #89069
+  * Fix the decription for package-contains-upstream-install-documentation,
+    Closes: #89257
+  * dh_testversion is deprecated, patch applied.  Closes: #89624
+  * lintian now detects that the deb/dsc/changes file it was told to parse is
+    zero bytes and skips it.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri,  9 Mar 2001 14:16:24 -0800
+
+lintian (1.20.8) unstable; urgency=low
+
+  * 'wearing my "fuck redhat" shirt and loving it' release
+  * checks/menus, the check for whether or not the doc symlink is removed
+    fails for people who do not use the -f option to rm (or any other options)
+    thanks Oliver Elphick, Closes: #88182
+  * checks/scripts handles 'wish' better (I hope), Closes: #88333
+  * checks/debconf, the registry check is ignore if the package being tested
+    is debconf itself.  Closes: #88526
+  * frontend handles files that are referenced but do not exist better
+  * this is looking like one of the last releases for a while
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed,  7 Mar 2001 10:42:03 -0800
+
+lintian (1.20.7) unstable; urgency=low
+
+  * 'test everything' release
+  * updated architecture list -- hppa, ia64, mips, mipsel, s390, sh added
+  * added 'Enhances' to list of known fields
+  * removed libwraster2 from list of obsolete packages, Closes: #85584
+  * Colin Watson's debconf checks added, still need a testset though,
+    Closes: #85876, #84759
+  * checks/menus now checks for proper use of install-info,
+    Closes: #25823, #30192
+    need a testset for this too
+  * checks/files.desc now points to the FHS in /usr/share/doc/debian-policy
+  * applied Joey Hess' app-defaults patch.  This allows app-defaults to be
+    conffiles as well as adding a check for app-defaults in old dirs.
+    Closes: #86707, #76811
+  * lintian now knows more about 3.5.x's X policy in 12.8.  Added check for
+    Xresources file but no conflicts on xbase (<< 3.3.2.3a-2).  Closes: #63542
+  * applied Joey Hess's perl patch.  Now know that pm's in /usr/share have
+    no need for the +x bit.  Closes: #86709
+  * check for INSTALL in /usr/share/doc now knows about INSTALL\..+ (i.e.
+    INSTALL.gz)
+  * checks/standards-version has an error for packages which declare a source
+    relation (ie Build-Depends) but are not at least policy 3.1.x.
+    Closes: #86711
+  * checks/fields now checks that the arch definition in source relations
+    follows policy.  Closes: #86710
+  * added wish8.3 to list of known interpreters in checks/scripts
+  * warning description cleanups, Closes: #87528
+  * added more bashism checks -- '|&', '$[foo]', '${parm:len[:offset]}',
+    '${parm/pat[/str]}', '${parm//pat[/str]}'
+    Closes: #32113 (the suiregister stuff happened a release or three ago)
+    you guessed it, need a testset
+  * bashism check now tells you what it thinks the bashism was.
+    Closes: #81738
+  * bashism checks now ignore here documents, Closes: #87527
+    teset/maintainer-scripts now has a here document in a script and extended
+    bash triggers.
+    Also, various other bashism test cleanups and improvements.
+  * typo in scripts fixed, now I really do work on python2, thanks Jerome.
+    Closes: #87772
+  * hmm, versioned-provides message was often wrong, made it better and it
+    reports the perceived relation, i.e. foo (= 4).
+  * removed the -w and strict from reporting/ scripts
+  * update-menus checks enhanced with knowledge about wm-menu-config.
+  * added 'asmodule' to list of known menu tags
+  * depends-on-essential-package-without-using-version now is only reported
+    for actual depends or pre-depends.
+  * interpreter checking handles arbitrary whitespace now
+  * fixed scripts check for ocaml, now know about ocamlrun.
+  * unusual-interpreter messages were being caused by not prepending '.' to
+    the interpreter name when checking %executables in checks/scripts.
+  * still more fun with ++ )-:  menus is now even more paranoid with
+    quotemeta().
+  * ensure $setuid, $setgid is set in checks/files, thanks to the luxman
+    package for triggering the perl oops.
+  * collections/scripts handles files that only contain '#!'.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed, 14 Feb 2001 08:55:09 -0800
+
+lintian (1.20.6) unstable; urgency=low
+
+  * 'people who depend on side effects should be flogged' release
+  * lintian had code which set a variable to undef, then used it.  Without
+    -w and use strict, this silently became a zero, but now it causes errors.
+    So, since it obviously was meant to be zero, I set it to zero instead of
+    undef.  Closes: #85326
+    Fun part was this only happened when run on more than one version of a
+    single package i.e. lintian foo_1.changes foo_2.changes.
+  * checks/scripts updated to deal with python2.x and there being two versions
+    of python.  Closes: #85441
+    while doing this, collections/scripts was updated to support the use of
+    /usr/bin/env.  I probably added bugs here )-:
+    added a scripts testset, very early still.
+  * my modification to checks/menus to support /usr/share/doc/package -> other
+    had a problem with special chars.  Now calls quotemeta().  Annoying because
+    I have a ++ package name but it did not trigger this particular case.
+    So, I added a package to foo++ which links to foo++.  Closes: #85530
+  * added a TODO to the private dir.
+  * left off a closes in the big perl closings 2 revisions ago, Closes: #80192
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Sat, 10 Feb 2001 14:28:19 -0800
+
+lintian (1.20.5) unstable; urgency=low
+
+  * 'people who name a lib libfoo-X.X.so should be shot' release
+  * checks/shared-libs handles libraries of the form 'libfoo-X.X.so' now
+  * the virtual package check I added in the last release failed to check
+    the field it was testing, so errors were reported on fields other than
+    Depends.  Ooops.  The description also should have referred to packaging
+    not policy.  Closes: #85225
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed,  7 Feb 2001 13:55:10 -0800
+
+lintian (1.20.4) unstable; urgency=low
+
+  * 'why would you ever do THAT?' release
+  * lintian-info sets $ENV{'LINTIAN_ROOT'} if it is not set
+  * added a check to checks/files for packages which ship the upstream INSTALL
+    document.  This is almost always useless for users of a package.
+    testset/binary now includes such a file
+    Closes: #81970
+  * checks/menus -- the walk over package contents now has logic to run file
+    tests on files, link tests on links, etc.
+  * checks/menus -- if there is a /usr/share/doc/$pkg symlink, assume it links
+    to a package it depends on and do not warn about setting the usr/doc
+    symlink.  There is code in checks/copyright-file that makes sure policy is
+    followed with regards to what is actually linked against.  Closes: #48048
+  * checks/fields is now less strict about Section: non-US handling
+  * added debconf files to list of known control files in checks/control-files
+    Closes: #46863
+  * perl mistakes are no longer checked for. Closes: #47076, #75889
+  * FHS 2.1 cleanups, Closes: #75878
+  * lintian will not complain if you symlink your doc directory to an essential
+    package and leave off the depends, because since it is essential you must
+    not depend on it.  Closes: #48296
+  * lintian now gives and error when a package declares a depends on an
+    essential package without using a versioned depends.  Closes: #33250
+  * extra-license-file is not given if the file is just a symlink.
+    Closes: #35224
+  * checks/fields: now complain if a package declares a depends on a virtual
+    package without first depending on a real packages as an alternative.
+    Required adding a known_virtual_packages list to checks/common_data.pl.
+    Also removed redundant info/registered-virtual-packages file.
+    Closes: #70673
+  * added a library (mostly empty right now) and non-us testset
+  * runtests now runs the tests in alphabetical order
+  * lintian's --version info is being updated automagically again
+  * moved some hashes around in checks/ to common_data.pl
+  * checks/changelog-file reorganized so it knows the size of the files.  Now
+    it can check that the changelog is sufficiently large to require
+    compressing.  Also modified the desc file to reflect this. Closes: #84400
+  * --info now outputs all info.  Silly bug in how I used split and defined.
+    Closes: #82970
+  * added a testset/check_info.pl script.  It verifies that every lintian
+    check referenced in a desc also has an info section.  runtests now runs
+    this test as well.
+  * suidregister warning is now an error.
+  * checks/menus: fixed the if link case pattern match -- one more perl erro
+    down, 3 billion hidden ones to go.
+  * Following items thanks to Colin Watson
+  * updated checks/standards-version so it does not give perl errors when it
+    encounters a newer standards version than it knows about. Closes: #84083
+  * updated references to policy for policy 3.5.0. Closes: #84088, #83969
+  * Added a warning for packages containing a link to undocumented(7) as
+    suggested on debian-policy list.  Also includes a testset (manpages)
+    addition.
+    Closes: #83188
+  * At the moment checks/copyright-file just tests for a slash in the link;
+    I've changed it here to test for an initial / or ../, and then after that
+    check it strips off everything from the first slash on, so that tests on
+    the package name work correctly when people link to subdirectories of
+    other /usr/share/doc directories.  Closes: #84066
+  * It was unpacking to level 2 even though I had Unpack-Level: 1 and no
+    associated collection scripts. Of course, it wanted override files from
+    /usr/share/lintian/overrides/$pkg. Fair enough - except that if I said
+    --no-override it wanted the override file information anyway, and still
+    unpacked to level 2.  No obeys non-overrides.  Closes: #84722
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Tue, 30 Jan 2001 14:26:04 -0800
+
+lintian (1.20.3) unstable; urgency=low
+
+  * 'Does the pain ever end?' release
+  * oops, lintian can not create a static lab due to an error check too
+    early in the code.  While fixing this I also added a static lab check in
+    testset/runtests. Closes: #83411
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed, 24 Jan 2001 14:36:35 -0800
+
+lintian (1.20.2) unstable; urgency=low
+
+  * 'Where or where did my changes go' release
+  * fixed --help option to not show escaped chars
+  * changed regression test to also do a run with --info on
+  * seems lintian always used the lintian-info script from the path, changed
+    to look in LINTIAN_ROOT if passed
+  * perl problems cleaned up, Closes: #82970
+  * removed randomization of output strings when refering to policy documents,
+    not only is this silly but it makes regression tests impossible
+  * moved manual_refs.pl list of policy manuals to an external file.  This will
+    allow automated updating when releases occur.  It also removes the perl
+    warnings (-:
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Sat, 20 Jan 2001 12:21:30 -0800
+
+lintian (1.20.1) unstable; urgency=low
+
+  * the change hurts release
+  * every perl script now calls use strict and passes -w to perl
+    The long road of bug tracking because of this has begun.  Thanks Joey H.
+  * testset/filenames now has a lengthy-symlink bug to show how that code works
+  * typo in checks/control-files in a bashism check, the correct POSIX call
+    is 'read foo' however the code was checking for the existance of whitespace
+    before the call, not the existance of the variable to read into due to a
+    mixed up regex.  Thanks Adam Heath for pointing this out. Closes: #81453
+  * checks/control-files, the check for whether '.' takes more than one
+    argument did not take into account things like 'and'.  It does now.
+    Closes: #81737
+  * fixed interpreter check code to hand a space between the #! and the
+    interpreter (really), also allows bash,ksh,ash as valid sh shells. Also
+    knows to look for an ELF header and stop parsing the script. Thanks
+    Colin Watson.  Closes: #80348, #82541
+  * testet/binary-1 added.  This is a small C program to test lintian's
+    handling of binary files.  See the changelog in this directory for info
+  * fixed message for 'manpage-has-wrong-extension', Closes: #82452
+  * 'N: Unknown interpreter' message now only printed once per script,
+    Closes: #81644
+  * added equivalent file-directly-in-usr-share-doc messages (et al.),
+    Closes: #82654
+  * added new message: suidregister-used-in-maintainer-script. this replaces
+    the old messages suidregister-used-in-maintainer-script-other-than-postinst
+    and suidunregister-not-called-in-postrm due to suidregister being phased
+    out of Debian.  Closes: #81868
+  * binary-has-unneeded-section upgradeed from info to warning
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed,  3 Jan 2001 13:04:20 -0800
+
+lintian (1.11.15) unstable; urgency=low
+
+  * Hack Hack
+  * checks/perl disabled until it can be improved
+  * fixed typo in checks/description: s/%type/$type/
+  * fixed mental typo in checks/*: $foo == 'string' is not the same as
+    $foo eq 'string', Closes: #80813
+  * Added Colin Watson's patches, Closes: #80373, #80376, #80377
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri, 22 Dec 2000 16:02:58 -0800
+
+lintian (1.11.14) unstable; urgency=low
+
+  * more fun with interpreter checking, seems a space is allowed between bang
+    and the interp path.  So, fixed the regex (again).  Also store the name
+    of the interpreter in $interp and use that rather than $is_sh, this will
+    allow for other interpreter checks later.  Closes: #80348
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri, 22 Dec 2000 15:51:10 -0800
+
+lintian (1.11.13) unstable; urgency=low
+
+  * (Joy) fixed a typo in binaries.desc
+  * (Joy) checks/debhelper now passes $type with the lintian message
+  * (Joy) libs/text_utils.pl, reporting/html_reports fix maintainer name
+  * checks/control-files now checks if the postrm calls update-alternatives
+    with the --remove option, this is considered harmful, Closes: #80255
+    checks/control-files.desc explains the problem in detail
+  * fixed checks/menus setting of is_sh, $foo = split() sets foo to the number
+    of items, not the first item -- duh (-:  How did this make it thru testing?
+    added a maintainer-scripts testset to help catch this in the future
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu, 21 Dec 2000 10:34:43 -0800
+
+lintian (1.11.12) unstable; urgency=low
+
+  * new command line option: --show-overrides, displays tags even if
+    they have been overriden, marked 'O: .....'
+  * shared-libs.desc text changed to give more info when a shared library is
+    present, but the SONAME is not set or set improperly, Closes: #78277
+  * removed references to libtool-workarounds.txt (it never died ....),
+    Closes: #78420
+  * my reformat of the code in checks/menu-format changed the regex from
+    m/^#/ to m/^       #/, I changed it back (kind of).  The test is now
+    m/^\s*\#/ just in case a space snuck in.  Also modified the code so it
+    does a if (m//) { next;} rather than if (! m//) { ........ }.
+    Closes: #78532
+  * checks/menus now checks which interpreter the maint script uses and varies
+    its checks accordingly -- works for sh and perl currently, Closes: #78880
+    Updated menus.desc while I was at it.
+  * fixed typo in scripts.desc, pike error message should have referred to pike
+    not to make, Closes: #79744
+  * killed use of \b in bashism checks, now uses (^|\s+), Closes: #80122
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu, 21 Dec 2000 10:20:30 -0800
+
+lintian (1.11.11) unstable; urgency=low
+
+  * Finally, lintian's version number is automagically set
+  * lintian.sgml updated to document per package overrides info.
+  * the /usr/share/lintian/overrides/<package> actually works now (-:
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu, 16 Nov 2000 14:19:22 -0800
+
+lintian (1.11.10) unstable; urgency=low
+
+  * Dammit, + sign in package name problems again
+    added a regression test for a foo++ package. Closes: #77216
+  * removed the libtool text in the rpath message, libtool no longer sets rpath
+    the upstream finally saw the light.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu, 16 Nov 2000 09:02:50 -0800
+
+lintian (1.11.9) unstable; urgency=low
+
+  * Moved the override files from /usr/share/doc/<package> to
+    /usr/share/lintian/overrides/<package>
+    also added a check to catch override files in the old directory
+  * Removed calls to defined in checks/perl, Closes: #76339
+  * copyright-file-is-gpl renamed to copyright-file-contains-full-gpl-license
+  * magicfilter should be in /usr/sbin, not /usr/bin, Closes: #76686
+  * modified testset/empty.  dpkg-genchanges now requires a Maintainer
+    field.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu,  9 Nov 2000 12:23:43 -0800
+
+lintian (1.11.8) unstable; urgency=low
+
+  * Fixed Description too long message, Closes: #75570
+  * removed description-may-be-too-long
+  * Fixed description of package-uses-debhelper-but-lacks-build-depends,
+    I left the 's' off of lacks
+  * zero-byte-file-in-usr-doc changed to zero-byte-file-in-doc-directory
+  * added documentation for zero-byte-file-in-doc-directory, Closes: #75744
+  * renamed package-source-contains-debian/files to
+    debian-files-list-in-source, Closes: #75746
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri, 27 Oct 2000 16:09:09 -0700
+
+lintian (1.11.7) unstable; urgency=low
+
+  * Fixed lintian's handling of autouse, Closes: #75115
+    Thanks Stefan Hornburg for helping me with this
+  * Fixed silly manpage filename parsing bug, Closes: #75246
+  * Removed now out of date libtool-workarounds.txt, Closes: #75324
+  * unpack-srcpkg-l2 used a silly regex to parse dpkg-source output, this
+    has been fixed to simply read some string of non-whitespace, Closes: #58943
+  * checks/spelling should now work with high ascii chars, Closes: #70974
+  * added debiandoc-sgml Build-Depends-Indep, Closes: #74751
+  * added checks/debian-cruft.  Checks for the debian/files file, Closes: #38710
+  * fixed checks/debhelper -- it actually works now.
+  * added tixwish to list of known interpreters, Closes: #47775
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Tue, 24 Oct 2000 15:29:14 -0700
+
+lintian (1.11.6) unstable; urgency=low
+
+  * Fixed manpages check to handle oddly named files, now uses
+    File::Basename
+  * fixed debhelper check so it will detect a need for Build-Depends even if
+    a script which needs to modify maintainer scripts is not used.
+  * lintian-info now outputs info for source messages too, Closes: #51811
+  * used a different syntax in checks/perl rather than set $2, Closes: #54710
+  * if dh_testversion is called by a package, ensure that the package uses a
+    versioned Build-Depends
+  * Maintainer Upload (with Darren's blessing)
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Mon,  9 Oct 2000 13:23:51 -0700
+
+lintian (1.11.5) unstable; urgency=low
+
+  * /etc/pam.d are now checked to ensure they are conffiles, Closes: #50293
+  * fixed the typo in checks/copyright-file, Closes: #53626
+  * fixed description, lintian is at policy 3.2.0.0, Closes: #55083
+  * fixed checks/standards-version, knows about policy version 3.2.0,
+    Closes: #68655
+  * check for zero byte length files in /usr/share/doc/<package>,
+    Closes: #59508
+  * added a fail function to frontends/lintian, Closes: #69259
+  * checks/files.desc now refers to FHS 2.1, Closes: #69422
+  * ran ispell on checks/*.desc files, Closes: #69423
+  * added checks for suidregister and suidunregister, Closes: #29444
+  * lintian now checks the length of the short description, Closes: #33411
+  * lintian now verifies that /etc/cron.{d,daily,monthly,weekly} files are
+    marked as conffiles, Closes: #46332
+  * Description: is checked to make sure it is not a dh_make template,
+    Closes: #59141
+  * fixed URL in README, Closes: #59733
+  * added magicfilter to list of interpreters, Closes: #60361
+  * added check if debhelper is used by a package, it is included in
+    Build-Depends, Closes: #70438
+  * for menu files, if the menu needs=foo and foo is the package name, assume
+    this is ok.  Also, sections that match the package name are also assumed
+    to be ok.  This affects mostly window managers.  Closes: #64674
+  * Checks whether the icon used in a menu file is in xpm format.
+  * added {g,k,p,y}forth as valid interpreters, Closes: #51778
+  * More checks/ dir cleanups
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed, 27 Sep 2000 15:31:38 -0700
+
+lintian (1.11.4) unstable; urgency=low
+
+  * Brought lintian.sgml up to date
+  * cleaned up the layout of frontend/lintian
+  * Dep::implies did not parse Depend: foo | bar | baz correctly, this is why
+    things like wmakerconf gave bogus errors.  This is duct taped, real fix
+    some day.
+  * Closes: #43706
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed,  6 Sep 2000 19:13:20 -0700
+
+lintian (1.11.3) unstable; urgency=low
+
+  * Added 'Format' field to dsc file checks
+    New dpkg versions seem to write a Format version to dsc files, lintian
+    flagged them as an unknown field.
+  * lintian failed lintian (-:
+    changed copyright to point at /usr/share/common-licenses/GPL
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri,  1 Sep 2000 15:35:03 -0700
+
+lintian (1.11.2) unstable; urgency=low
+
+  * Official maintainer change
+  * Package specified overrides
+  * Fixed perl dep check bug
+  * Added perl modules: (#46118) (#51457) (thanks ardo)
+  * Added interpreter ocaml (#50933)
+  * Cleaned up some overrides -hopefully not yours (#48703, #48769)
+  * SUID allowed for packages named *-suid
+  * Applied Frank Belew's patches (#39832 #48794)
+  * Added checks for /usr/[share/]doc/copyrights references in copyright
+    file
+  * Added change in directory checks based on changes by the Great X
+    Reorganization
+  * Added check for text version of changelog no matter what
+  * Added check for /var/lib/games
+  * Added checks for Build-* source-depends fields
+  * Updated standards-version to accept 3.1.0 and made anything 2.x ancient
+
+ -- Darren Benham <gecko@debian.org>  Fri, 24 Sep 1999 09:59:35 -0700
+
+lintian (1.10) unstable; urgency=low
+
+  * Richard's changes:
+  * Darren's changes:
+    + changed rm of /usr/doc link to look for rm and rm -f (closes: #46740)
+    + changed numerous overrides to account for tar (closes: #46903)
+    + added doc-base override (closes: #45999)
+    + changed of URI:: functions liburi-perl (closes: #45770)
+    + added recognition of HTML::SimpleParse (closes: #45081)
+    + added "hints" to the known menu tags (closes: #47248)
+    + changed example checks to include ./ (closes: #44897)
+    + moved data/dumper to perl|perl5 (closes: #42036)
+    + changed perl|perl5 check to allow perl5|perl (ver) (closes: #44425)
+    + caused lintian to skip many file related checks for the files in
+      directories /hurd and /server (closes: #36680)
+
+ -- Darren Benham <gecko@debian.org>  Fri, 24 Sep 1999 09:59:35 -0700
+
+lintian (1.9.1) unstable; urgency=low
+
+  * Richard's changes:
+  * Darren's changes:
+    + Added a check for /etc/pam.conf.  Precursor for reserved
+      /etc/* files
+    + Added a check of postinst and prerm for /usr/doc symlink manipulation
+    + Added the /usr/doc symlink to lintians scripts
+
+ -- Darren Benham <gecko@debian.org>  Mon, 13 Sep 1999 22:06:07 -0700
+
+lintian (1.8.2) unstable; urgency=low
+
+  * Richard's changes:
+  * Darren's changes:
+    + Added /var/lib to the FHS check
+    + Fix for the new tar
+    + Make libraster2, not libraster1 obsolete
+
+ -- Darren Benham <gecko@debian.org>  Thu,  5 Aug 1999 00:13:28 -0700
+
+lintian (1.7) unstable; urgency=low
+
+  * Richard's changes:
+  * Darren's changes:
+    + This time.. added Help as a valid root level menu option
+    + Changed FSSTND directory Infos to Josip's suggested wording.
+    + Removed /var/lib from the FSSTND check
+    + Fixed non-US/section check
+    + Added text about bashism checks perfromed to N: tag
+    + Fixed bad-link-to-undocumented.man.page N: tag
+
+ -- Darren Benham <gecko@debian.org>  Thu, 29 Jul 1999 15:54:37 -0700
+
+lintian (1.6) unstable; urgency=low
+
+  * Richard's changes:
+  * Darren's changes:
+    + Added some bashism checks from Shalah
+    + Added /usr/share/doc as valid directory
+    + Added /usr/share/man as valid directory
+    + Set warning for FSSTND directories
+    + Added Help and App/Databases to valid menu entries
+    + Added patch from Steve Haslam to recognise /etc/menu-methods and
+      check for update-menus calls
+    + Added overrieds for dh_make requested by C. Small
+    + Added patch from Roderick Schertler to skip comments/blank lines at
+      top of menu files.
+    + Changed the relative shared-library check to look for either
+      rela.text or rel.text, not just rel.text.  This is needed for PowerPC
+      and other non-i386 architectures.
+    + Added ruby as a valid interpreter
+    + Added notice when unrecogized file format is found that it might be
+      due to a missing package: binutils-multiarch
+
+ -- Darren Benham <gecko@debian.org>  Sun, 11 Jul 1999 17:15:40 -0700
+
+lintian (1.5) unstable; urgency=low
+
+  * Richard's changes:
+  * Darren's changes:
+     + Changed file error message to indicate it's file's
+       fault(closes: #37259)
+     + Changed perl depends to perl | perl5 to cover both
+          Also added perl-5.004 and perl-5.005 since they are valid perls
+          (closes: #41041, closes: #39835)
+     + Remove a undefine causing spurious unknown-tag error (close: #40699)
+     + Ancient-ized standards-version 2.4.0 and 2.4.1
+     + Added policy 2.5.1 to the accepted number for standards-version
+     + Check for use of /etc/nntpserver.  Only major change in policy v2.5.1
+     + Added perl-5.005 and perl-5.004 as valid interpreters (close: #39834)
+
+ -- Darren Benham <gecko@debian.org>  Mon,  5 Jul 1999 11:46:53 -0700
+
+lintian (1.4-1) unstable; urgency=low
+
+  * Richard's changes:
+     + When reporting errors in .changes files, report filenames the way
+       they were listed, rather than as absolute pathnames.
+     + Don't exit with code 1 for errors that were overridden.
+       This fixes bug#37353, reported by Wichert Akkerman.
+     + Correctly handle escaped characters in menu items (bug pointed
+       out by Raphael Herzog).
+     + bltwish scripts should now depend on blt, not blt8.0.
+       This fixes bug#38092, reported by Gordon Russell.
+  * Darren's changes:
+     + override requested by christian kurz for ppp.  Several of the
+       files/dirs have non-standard permissions.
+     + override requested by adam kleine for gtk-engines-gtkstep.  Contains
+       libraries not meant to be linked.
+        + override requested by Manoj Srivastava for latex2html.  Fixes
+       bug#38098.
+     + hugs added to the list of interpreters.  Fixes bug#37668 reported by
+       Antti-Juhani Kaijanaho.
+
+ -- Darren Benham <gecko@debian.org>  Tue, 11 May 1999 13:24:27 -0700
+
+lintian (1.3-1) unstable; urgency=low
+
+  * Richard's changes:
+    + For install-docs, accept --remove as well as -r.  Fixes bug#35664,
+      reported by James Van Zandt.
+    + In explanatory text for prerm-does-not-call-installdocs, give a
+      correct example for the prerm (not the postinst).  Fixes bug#35665,
+      reported by James Van Zandt.
+    + List gmp2 as obsolete package (replaced by libgmp2).
+    + Don't generate depends-on-obsolete-package for -dev and -dbg packages
+      that depend on their library.
+  * Darren's changes:
+    + override requested by julian gilbey for menu.  Menu can't call
+      update-menus in postrm since it won't exist then.
+    + added requested override for vtwm update menus.  Fixes bug#36457
+      reported by Branden Robinson
+    + override requested by Oliver Elphick for postgresql-pl.  Has shared
+      libraries not loaded by ld.so
+
+ -- Darren Benham <gecko@debian.org>  Mon, 05 Apr 1999 16:00:05 -0800
+
+lintian (1.2-1) unstable; urgency=low
+
+  * Darren's changes:
+       + added the -1 to denote purely packaging changes
+       + added fvwmother to menu needs= check (fixes bug#35057)
+  * Richard's changes:
+    + Added new tag package-installs-packlist.
+               This closes wishlist bug#33827, reported by Joey Hess.
+    + Mark all versions of libgtk1.1 as obsolete for
+               depends-on-obsolete-package tag.
+    + For tag arch-indep-package-contains-binary-or-object,
+               tighten up regexp that detects "ELF".  This fixes bug#35237,
+               reported by Mark Brown.
+
+ -- Darren Benham <gecko@debian.org>  Mon, 29 Mar 1999 16:31:05 -0800
+
+lintian (1.1) unstable; urgency=low
+
+  * Zapped compiled-with-bad-libc check.
+  * Corrected spelling error in spelling check (it flagged "interchangeable"
+    as a bad word; this should have been "interchangable").  This fixes
+    bug#33252, reported by Santiago Vila.
+  * Silenced non-standard-dir-in-usr check about /usr/$arch-linuxlibc1/,
+    which will go away at some point and is not worth moving now.
+    I'll file a policy proposal for it at some point.  This fixes
+    bug#33114, reported by Marcus Brinkmann, and bug#33374, reported
+    by James Troup
+  * Silenced non-standard-dir-in-var check about /var/www/, since it's
+    Debian policy to use it.
+
+ -- Richard Braakman <dark@xs4all.nl>  Thu, 25 Feb 1999 14:43:27 +0100
+
+lintian (1.0) unstable; urgency=low
+
+  * New tags:
+      E: non-standard-toplevel-dir
+      W: non-standard-dir-in-usr
+      W: non-standard-dir-in-var
+      W: file-in-unusual-dir
+      E: dir-or-file-in-mnt
+      E: binary-in-etc
+      E: use-of-compat-symlink
+      E: subdir-in-bin
+    These cover much of the FSSTND and FHS.
+
+  * No longer emit executable-in-usr-doc for scripts.  It's just too
+    controversial.  I've added an info-level tag script-in-usr-doc
+    for people who are interested.  This closes bug#28560, by
+    Stephane Bortzmeyer.
+
+  * Only emit compiled-with-bad-libc if the register_frame symbols
+    are UNdefined.  This closes bug#31867, submitted by Michael Meskes.
+
+  * Don't emit compiled-with-bad-libc for binaries linked to
+    libgnustep_base.so.0, which also defines __register_frame_info.
+    This closes bug#31004, submitted by Matthias Klose.
+
+  * Changed a lot of "error:" messages to "internal error:", to make
+    clear that they are errors in Lintian's execution, not in the package
+    being checked.  This closes bug#31013, submitted by James Troup.
+
+  * (frontend/lintian) Select STDOUT again after closing OUTPUT_PIPE.
+    This fixes bug#31574, reported by Julian Gilbey.  Thanks for the patch!
+
+  * (checks/copyright-file) Lintian was confused by "libident(=0.22-1)",
+    i.e. without separating whitespace.  Fixed.  This closes bug#31821,
+    reported by Paul Slootman.
+
+  * Man page fix: mention that lintian can be run on .changes files.
+  * Depcheck pages: fixed version comparison bug.
+
+ -- Richard Braakman <dark@xs4all.nl>  Wed, 27 Jan 1999 14:43:15 +0100
+
+lintian (0.9.5) unstable; urgency=low
+
+  * Do not abort when run as root; print a warning instead.
+    --allow-root still overrides the warning.
+
+  * Only generate non-standard-file-permissions-for-etc-init.d-script
+    tag for regular files.  Reported by Martin Schulze.
+
+  * Corrected libtool-workaround sample configure.in snippet:
+    Look for *-*-linux-gnu, not *-pc-linux-gnu.
+    Fixes bug#30756, reported by James Troup.
+
+  * Made lintian abort with an error message when objdump can't handle
+    a binary's file format.  Also made lintian Suggest binutils-multiarch.
+
+  * New error tag: arch-dependent-file-in-usr-share
+    This closes bug#30742, reported by Matthias Klose.
+
+  * Added gnuplot as a known interpreter.  Suggestion by Rafael Laboissiere.
+
+ -- Richard Braakman <dark@xs4all.nl>  Sun, 20 Dec 1998 18:05:46 +0100
+
+lintian (0.9.4) unstable; urgency=low
+
+  * New features (summary):
+    - 112 new spelling corrections.
+    - Minor efficiency improvements.
+    - Checks __register_frame_info problems.
+    - Updated to policy 2.5.0
+
+  * (lib/util.pl) Exit with code 2 when failing, like the manpage says.
+  * (checks/files) Print octal permissions in
+    bad-permissions-for-etc-cron.d-script, not decimal.
+  * (checks/files)
+    Ignore .xpm extensions too when hunting for extra license files.
+  * (checks/conffiles, checks/conffiles.desc)
+    Renamed -may-not-be- tags to -must-not-be-, for clarity.
+
+  * Replaced most bash scripts with perl scripts, for faster startup times
+    and fewer subprocesses.  This speeds up lintian by some 30% on my machine.
+  * (collection/objdump-info)
+    Add -T flag, to collect dynamic symbols table too.
+  * (checks/binaries)
+    Look for __register_frame_info and __unregister_frame_info.
+    New tag: compiled-with-bad-libc
+
+  * (checks/*.desc) Use new (2.5.0) section numbering for policy references.
+  * (checks/changelog-file) Accept changelog.html.gz files.
+  * (checks/standards-version) newer-standards-version is warning, not error.
+    This fixes bug#29366, reported by Julian Gilbey <jdg@maths.qmw.ac.uk>.
+  * (checks/standards-version) Updated to standards-version 2.5.0.
+
+  * (info/overrides) New overrides.
+    Fixes bug#29449 reported by Marcus Brinkmann (libc5 overrides)
+
+  * (checks/standards-version.desc) Remove the link to the upgrading-checklist,
+    which I can no longer find and which is probably not maintained anymore.
+
+  * (checks/control-files) Fix check for mknod-in-maintainer script:
+    pipes are made with p, not -p.
+
+  * (debian/control) In the package description, mention which policy
+    version Lintian checks.
+
+ -- Richard Braakman <dark@xs4all.nl>  Mon, 23 Nov 1998 14:46:32 +0100
+
+lintian (0.9.3) unstable; urgency=low
+
+  * (checks/binaries) Warn if a package with ELF binaries does not have
+    a Depends line.  New tag: missing-depends-line.
+    (Suggested by Charles Briscoe-Smith)
+
+  * (checks/menus) Don't warn about /usr/lib/menu/README.
+    (Noted by joost witteveen)
+
+  * (checks/binaries.desc, checks/binaries, checks/shared-libs.desc)
+    Renamed "shlib-without-dependency-information" to
+    "shared-lib-without-dependency-information", to avoid confusion with
+    the shlibs control file.  (Suggested by Branden Robinson)
+    Also moved the tag info from shared-libs.desc to binaries.desc, where
+    it belongs.
+
+  * (checks/shared-libs)
+    Suppress "shlib-with-executable-bit" error if a library has an
+    INTERP header.  This catches the libraries (such as libc or libm)
+    that print a little banner when executed.
+
+  * (checks/fields)
+    Report maintainer addresses that have no dots in the domain part.
+    (Suggestion by James Troup)
+  * Teach fields check about non-us.
+
+  * (info/perl-modules)  Updated modules info.
+  * (lib/deplib.pl)  Fixed handling of versioned dependencies.
+
+  * (checks/files.desc)  In executable-in-usr-doc tag, suggest examples
+    directory as a place for executables.
+    (Suggestion by Stephane Bortzmeyer)
+
+  * (checks/fields, checks/fields.desc)
+    New tag: depends-on-obsolete-package, to flag dependencies on
+    old libraries.
+
+ -- Richard Braakman <dark@xs4all.nl>  Tue, 27 Oct 1998 12:59:43 +0100
+
+lintian (0.9.2) unstable; urgency=low
+
+  * Look for more misspellings:
+      dependant -> dependent, dependancy -> dependency,
+      definate -> definite, definately -> definitely.
+  * (checks/scripts) Correctly deal with the terminating newline when
+    parsing dependency lines.  Fixed bug#27694, reported by Rob Tillotson.
+  * (checks/menu-format) Added Apps/Technical and Apps/Hamradio as sections.
+  * (checks/copyright-file)
+    Don't report copyright-file-is-gpl unless it is GPL version 2.
+    This fixes bug#27793, reported by Milan Zamazal.
+  * (checks/menus) Add newline after bad-menu-file-name tag!
+  * (lib/manual_refs.pl) Update urls to manual sections, so that
+    they refer to www.debian.org.  Regenerate index of devref sections.
+
+ -- Richard Braakman <dark@xs4all.nl>  Thu, 15 Oct 1998 14:06:26 +0200
+
+lintian (0.9.1) unstable; urgency=low
+
+  * Added overrides for imap daemons being sgid mail.
+  * Updated info/perl-modules from new Contents file.
+  * (lib/read_pkglist.pl) Don't fail on 0-size package lists.
+    This fixes bug#27121, reported by Adam P. Harris.
+
+ -- Richard Braakman <dark@xs4all.nl>  Wed, 30 Sep 1998 18:16:14 +0200
+
+lintian (0.9) unstable; urgency=low
+
+  * (frontend/lintian, reporting/html_reports, checks/*, collection/*)
+    Make rigorous distinction between source and binary packages.
+    Pass "source" or "binary" as second argument to check scripts.
+    Report source package tags with "pkg source:" instead of just "pkg:".
+    Binary package tags stay the same.
+    (The check scripts always report "pkg type:", and the frontend strips
+     the type again if it's "binary").
+    This involves several changes in the web-report scripts as well.
+
+  * Add command-line options for the things that could only be set via
+    environment variables or the configuration file.  (--cfg, --root,
+    --lab, --dist, --arch).
+
+  * Really rename obsolete-ldconfig-call-in-postinst to
+    postinst-has-useless-call-to-ldconfig.
+  * Really rename changelog-file-missing-in-native-debian-package to
+    changelog-file-missing-in-native-package
+
+  * (checks/scripts) bltwish now lives in blt8.0, not blt4.2.
+
+ -- Richard Braakman <dark@xs4all.nl>  Sun, 20 Sep 1998 16:34:38 +0200
+
+lintian (0.8.3) unstable; urgency=low
+
+  * (checks/menu-format) Added "sort" as a known tag; it's documented in
+    the menu package.  This fixes bug#26373, reported by Marcelo E. Magallon.
+
+  * (checks/scripts, checks/scripts.desc)  Added /usr/bin/js as a known
+    interpreter (in ngs-js), as suggested by Brian Bassett.
+
+  * (checks/shared-libs)  Brian Bassett reported inaccuracies in detection
+    of "ldconfig" calls in maintainer scripts.  Fixed.
+
+  * (checks/menu-format)  Skip checks on "section" if the "needs" tag had an
+    unknown value.  This deals with bug#26375, reported by Marcelo E. Magallon.
+
+  * (checks/manpages)  Fixed: check for links to "undocumented" manpage
+    should not react to link destinations like "ilu-undocumented".
+
+  * changelog-file-missing-in-native-debian-package shortened to
+    changelog-file-missing-in-native-package
+  * wrong-name-for-changelog-file-of-native-debian-package shortened to
+    wrong-name-for-changelog-of-native-package.
+
+ -- Richard Braakman <dark@xs4all.nl>  Thu, 10 Sep 1998 12:55:45 +0200
+
+lintian (0.8.2) unstable; urgency=low
+
+  * Ignore common programming-language extensions when looking for
+    extra-license-files.  (Fixes bug#26252, reported by Manoj Srivastava,
+    who had a file vm-license.el).
+
+  * Use -z flag for tar, rather than piping through gzip -dc explicitly.
+    This allows tar to detect and pass on errors reported by gzip.
+
+ -- Richard Braakman <dark@xs4all.nl>  Tue,  1 Sep 1998 11:57:53 +0200
+
+lintian (0.8.1) unstable; urgency=low
+
+  * Added /usr/bin/guile and /usr/bin/scsh as known interpreters.
+    (This fixes bug#26093, reported by Karl M. Hegbloom <karlheg@debian.org>)
+
+  * Renamed tags:
+       postinst-contains-obsolete-call-to-updatemenus
+    to postinst-has-useless-call-to-update-menus
+       postrm-contains-obsolete-call-to-updatemenus
+    to postrm-has-useless-call-to-update-menus
+       postinst-contains-obsolete-call-to-installdocs
+    to postinst-has-useless-call-to-install-docs
+       postrm-contains-obsolete-call-to-installdocs
+    to postrm-has-useless-call-to-install-docs
+       obsolete-ldconfig-call-in-postinst
+    to postinst-has-useless-call-to-ldconfig
+    The first two are also downgraded from error to warning.
+    (This fixes bug#26118, reported by Wichert Akkerman <wakkerma@debian.org>)
+
+  * Renamed tag use-of-killall-in-maintainer-script to killall-is-dangerous.
+
+  * More overrides.
+
+ -- Richard Braakman <dark@xs4all.nl>  Thu, 27 Aug 1998 18:56:03 +0200
+
+lintian (0.8) unstable; urgency=low
+
+  * (checks/perl) Don't emit warnings for perl scripts in /usr/doc.
+    This closed bug#25728, reported by Manoj Srivastava.
+
+  * (info/overrides) Change the non-standard-*-perm overrides to match
+    the new format of those tags.  (was changed in 0.7.5)
+
+  * (checks/control-files)
+    "possibly-insecure-handling-of-tmp-files-in-maintainer-script" now knows
+    about mkdir.
+    New tag: W: possible-bashism-in-maintainer-script (Suggestion by Joey Hess)
+
+  * (testset/filenames-2)  Don't rely on installer's umask for testset.
+
+  * (collection/menu-files, collection/menu-files.desc,
+     checks/menu-format, checks/menu-format.desc)
+    New check for correct syntax in "menu" files, written by Joey Hess.
+    New tags:
+      E: old-format-menu-file
+      E: whitespace-after-continuation-character
+      E: bad-test-in-menu-item
+      E: unparsable-menu-item
+      W: incorrect-package-test
+      W: duplicated-tag-in-menu-item
+      W: menu-item-missing-important-tag
+      W: menu-item-contains-unknown-tag
+      W: menu-item-uses-icon-none
+      W: menu-item-needs-tag-has-unknown-value
+      E: menu-item-adds-to-root-menu
+      W: menu-item-uses-apps-games-section
+      W: menu-item-creates-new-section
+      E: menu-item-creates-new-root-section
+    The check follows current practice on two sections:
+      Window-managers -> WindowManagers
+      Screen/Screen-saver -> Screen/Save
+    The menu docs will be updated to match.
+
+  * (lib/pipeline.pl) Bugfix: Use syscall SYS_exit when exiting from
+    children that failed to exec, because the perl function exit() would
+    run END blocks and such.
+
+  * (checks/standards-version) By now, 2.2.0.0 is more than one year old;
+    mark it as 'ancient'.
+
+  * (reporting/html_reports) Bugfix: Apply quotehtml() to the tag text
+    *before* adding links to bug pages.
+
+  * Many small adjustments to checks:
+  * (checks/scripts) Be less picky about package names when checking
+    dependencies.  (The check was confused by the package blt4.2)
+  * (checks/description) Ignore case when looking for synopsis lines
+    that start with the package name.
+  * (checks/files) Don't give executable-in-usr-doc error for executables
+    in /usr/doc/examples/, since that directory does contain examples, and
+    it's already flagged by old-style-example-dir.
+  * (checks/control-files) Don't warn about references to "/tmp" unless the
+    full filename is "/tmp" or "/var/tmp".
+  * (checks/binaries) Split tag "binary-not-linked-against-libc" into
+    "program" and "library" tags.
+  * (checks/files, checks/scripts) New tag "executable-manpage", which
+    replaces "executable-not-elf-or-script" for manpages.
+  * (checks/files) Shortened file-directly-in-usr-share-not-in-a-sub-directory
+    and file-directly-in-usr-doc-not-in-a-sub-directory to just
+    file-directly-in-usr-share and file-directly-in-usr-doc.
+  * (checks/md5sums) Added md5sums-control-file-is-empty tag, to avoid
+    spewing many file-missing-in-md5sums errors in that case.
+  * (checks/scripts) Suppress interpreter-not-absolute tag if the
+    filename ends in .in and the interpreter looks like #!@PERL@
+  * (checks/control-files) Suppress mknod-in-maintainer-script tag if
+    mknod was called with -p.
+  * (checks/shared-libs) Emit no-shlibs-control-file tag for each shared lib
+    found, rather than just once.
+  * (checks/files) Emit old-style-example-dir only for directories, not for
+    every file.
+  * (checks/perl) perl-script-needs-dependency
+    Bugfix: realize that a package does not need to depend on itself.
+  * (checks/description) possible-unindented-list-in-extended-description:
+    Only emit this tag if there are at least two things that look like
+    list items.
+  * (checks/scripts) List /usr/bin/env as a known interpreter.
+  * (checks/binaries) unstripped-binary-or-object:
+    Instead of an exception for /lib/modules specifically, suppress this
+    tag for all .o files.
+  * (checks/control-files) Bugfix: check for == bashism works now.
+  * (checks/files) Introduced new tag lengthy-symlink, which supersedes
+    and corrects the relative-symlink-enters-same-toplevel-directory tag.
+
+  * (man/lintian.1) Document the check and collection scripts added to
+    lintian in the last few months. (oops)
+
+  * (collection/perlmods, checks/perl)
+    Refined scanner so that fewer spurious perl-script-uses-unknown-module
+    tags are emitted.
+    Perl tags are no longer 'Experimental'.
+
+ -- Richard Braakman <dark@xs4all.nl>  Mon, 24 Aug 1998 18:01:40 +0200
+
+lintian (0.7.5) unstable; urgency=low
+
+  * (checks/perl) Exchanged order of arguments in
+    perl-script-needs-dependency tag, for clarity.
+  * (info/perl-modules) Added some module dependencies.
+
+  * (info/overrides) More overrides.
+
+  * (checks/shared-libs, checks/shared-libs.desc)
+    Fixed: erroneous shlib-missing-in-control-file if a shared library
+    had more than one symlink to it.
+  * Renamed obsolete-shlib-entry-in-control-file to
+    unused-shlib-entry-in-control-file.
+
+  * (checks/copyright-file) Changed size-requirement for copyright-file-is-gpl
+    tag from 17000 to 12000 bytes, because some packages (casio) extracted
+    only the "TERMS AND CONDITIONS" part, which is shorter.
+
+  * (reporting/html_reports) Count packages as well as tags, in tag index.
+
+  * (checks/control-files, checks/control-files.desc)
+    New tag: W: mknod-in-maintainer-script
+
+  * (checks/files, checks/files.desc)
+    New tags:
+       W: package-installs-into-etc-rc.boot   (rc.boot is obsolete)
+       W: extra-license-file                  (for COPYING files, etc)
+
+  * (checks/shared-libs, frontend/lintian)
+    Get rid of dependency on File::Basename; use a simple regexp instead.
+
+ -- Richard Braakman <dark@xs4all.nl>  Fri, 14 Aug 1998 17:33:37 +0200
+
+lintian (0.7.4) unstable; urgency=low
+
+  * (collection/perlmods)
+    Fixed: perl script scanner is now POD-aware.
+    This should cut down on the number of spurious warnings.
+
+  * (doc/CREDITS)
+    Install credits file.  My apologies if I have forgotten anyone.
+    There were far more people than I would have guessed -- Thanks to all! :-)
+
+  * (checks/perl)
+    Skip 'autouse' keyword when parsing use and require directives.
+
+  * (frontend/lintian)
+    When processing a .changes file, turn md5sum checks OFF by default.
+    A new -m flag is provided to turn them back on.
+    The .dsc file is still always checked.
+
+  * (frontend/lintian)
+    Saner interrupt handling.  Lintian now dies immediately if ^C is hit,
+    and does remove the temporary lab (if any).  This is mostly a side
+    effect of avoiding system() (in favour of the new functions in
+    lib/pipeline.pl), but did involve some tinkering about with perl's
+    signal handling.  Thanks to Ruud de Rooij and Graydon Hoare for
+    their help.  This closes bug#24975, reported by Yann Dirson.
+
+  * (checks/copyright)
+    Fixed copyright-is-gpl tag so that it actually works.
+
+  * (lib/dep.pl, checks/perl, checks/perl.desc, info/perl-modules)
+    Much smarter perl module analysis.  Lintian now has a list of
+    perl modules and the packages that provide them (in info/perl-modules),
+    and a dependency processor (in lib/dep.pl), and uses these to
+    check "use" and "require" lines in perl scripts.
+    New tags:
+      W: perl-script-needs-dependency  (Experimental)
+      W: perl-script-uses-unknown-module  (Experimental)
+    Tag "script-needs-full-perl" has been dropped.
+
+ -- Richard Braakman <dark@xs4all.nl>  Mon, 10 Aug 1998 19:02:53 +0200
+
+lintian (0.7.3) unstable; urgency=low
+
+  * (frontend/lintian)
+    Fixed: --display-infotags option wasn't working.
+
+  * (reporting/harness, reporting/html_reports)
+    Have the archive check generate infotags but not display them on the
+    web pages.  This way they are still available in the log file.
+
+  * (checks/fields, checks/fields.desc)
+    New tag: W: doc-package-depends-on-main-package
+
+  * (checks/menus, checks/menus.desc)
+    New tag: E: bad-menu-file-name
+    This is emitted for packages that install "/usr/lib/menu/menu", which
+    overlaps with the menu package.  (I've seen it happen a couple of times).
+
+  * (checks/binaries, checks/binaries.desc)
+    Allow unstripped-binary-or-object for any package with "debug" in its
+    name.  (This is in addition to the exeption already made for "-dbg").
+    Allow binary-not-linked-against-libc for libc itself :-)
+
+  * (lib/pipeline.pl)
+    New helper functions for starting pipelines from perl scripts, without
+    involving the shell.  This makes it easier to pass filenames literally,
+    and often saves a shell invocation.
+  * (collection/diffstat, frontend/lintian, unpack/*)
+    Use the new pipeline functions.
+
+  * (checks/description, checks/description.desc)
+    New tag:
+      E: description-is-debmake-template
+
+  * (reporting/html_reports)
+    Quote < and > in displayed tags (such as occurs in email addresses).
+    This fixes the maintainer-name-missing tag output.
+
+  * (checks/copyright-file, checks/copyright-file.desc)
+    New tag:
+      E: copyright-file-is-gpl
+    Generated for copyright files that contain the complete GPL text.
+
+ -- Richard Braakman <dark@xs4all.nl>  Thu,  6 Aug 1998 23:39:18 +0200
+
+lintian (0.7.2) unstable; urgency=low
+
+  * (unpack/unpack-srcpkg-l1, unpack/unpack-binpkg-l1, unpack/unpack-binpkg-l2)
+    Speedup: replaced system("mkdir ...") with mkdir() calls.
+  * (unpack/unpack-binpkg-l1)
+    Speedup: avoid extracting control info twice.
+    More speedups are possible here.
+  * (unpack/unpack-binpkg-l1, unpack/unpack-binpkg-l2)
+    Speedup: avoid using dpkg-deb to unpack debs; construct a pipeline
+    with ar, gzip, and tar instead.  It turns out to be far faster.
+  * Together, these changes made for a speed increase of some 30%
+    when checking packages that have to be unpacked.
+
+ -- Richard Braakman <dark@xs4all.nl>  Wed,  5 Aug 1998 19:18:44 +0200
+
+lintian (0.7.1) unstable; urgency=low
+
+  * (reporting/html_reports)
+    Fixed: Print bug number with tags that were reported as bugs.
+
+  * (checks/scripts, checks/scripts.desc)
+    Added /usr/bin/expect (provided by expect) as known interpreter.
+
+  * (unpack/unpack-srcpkg-l2)
+    Fixed: chmod -R the right directory when unpacking a source package.
+
+  * (collection/diffstat, collection/diffstat.desc)
+    New collection script that runs diffstat on the Debian diff.
+  * (debian/control)
+    Depend on diffstat, version >= 1.27-1 so that it can parse Debian diffs.
+  * (checks/debdiff, checks/debdiff.desc)
+    New check that look at the filenames included in the Debian diff.
+    New tag:
+      W: patch-failure-file-in-diff foo.rej
+
+  * (checks/control-files, checks/control-files.desc)
+    New tag:
+      W: dpkg-print-architecture-in-maintainer-script
+    (dpkg --print-installation-architecture should be used there)
+
+ -- Richard Braakman <dark@xs4all.nl>  Wed,  5 Aug 1998 14:58:02 +0200
+
+lintian (0.7) unstable; urgency=low
+
+  * (reporting/html_reports)
+    - Rewritten (more modular).
+    - Create a page for each different tag, which gives the lintian-info
+      for that tag and then lists all occurrences of that tag, with each
+      tag line also being a link back to the page for the package in
+      which it occurs.
+      This closes bug#21390, reported by Gregory S. Stark <gsstark@mit.edu>.
+    - Instead of listing the lintian-info text with every different tag
+      in every package, make every tag a link to the page for that tag
+      (which will have the lintian-info for it at the top).
+      This should make the reports a lot smaller, and also more readable.
+    - Make a "Sorted by tag types" page and link to it from the index page.
+  * (doc/TODO) Entries [L3] and [L4] now complete.
+
+  * (checks/spelling, checks/spelling.desc)
+    Check README.Debian file as well, since we now collect it anyway
+    for the readme-debian-is-debmake-template tag.
+    New tag:
+       E: spelling-error-in-readme-debian
+
+  * (checks/fields) Added hurd-i386 to the list of known architectures, at
+    the request of Marcus Brinkmann <brinkmds@rz.ruhr-uni-bochum.de>.
+
+  * (checks/scripts, checks/scripts.desc)
+    Added trs to the list of known interpreters, as /usr/bin/trs provided
+    by konwert.  Suggestion by Yann Dirson <dirson@debian.org>.  This
+    closed bug#24998.
+
+  * (checks/files)
+    - Fixed: tags dir-in-user-local and file-in-usr-local did not print
+      the filename involved.
+    - Fixed: some tags were erroneously output as "setuid-gid-binary"
+      even though only one of suid or sgid was set.
+
+  * (checks/fields)
+    - Fixed: change a few cases of "maintainer-address-malformed"
+      to "maintainer-name-missing".
+
+ -- Richard Braakman <dark@xs4all.nl>  Tue,  4 Aug 1998 19:45:47 +0200
+
+lintian (0.6.1) unstable; urgency=low
+
+  * Inserted GPL boilerplate text in every file whose format allowed comments.
+
+  * (doc/lintian.sgml) Use new <url> tag.
+
+  * (info/overrides) New override for the file in kbd-data with the strange
+    name.  Having lintian handle that file correctly would be too expensive.
+    This "closes" bug#25107.
+
+  * (checks/control-files, checks/control-files.desc)
+    New tag: use-of-killall-in-maintainer-script (experimental)
+    Added at the recommendation of Santiago Vila <sanvila@unex.es>.
+    This closes bug#22206.
+
+  * (depcheck/deppages.pl, reporting/html_reports)
+    Added arm and hurd-i386 to the list of architectures to check.
+
+  * (doc/libtool-rpath-workaround.txt, checks/binaries.desc)
+    Revamped doc file at Rob Browning's suggestion, and renamed it to
+    doc/libtool-workarounds.txt because it describes both -rpath and -lc
+    workarounds.  Updated the info for the tags binary-not-linked-against-libc
+    and binary-or-shlib-defines-rpath to refer to the new file.
+
+  * (doc/desc-files)  Moved from private/DESC.
+    Briefly describes the meanings of the fields used in lintian's .desc files.
+
+  * (doc/TODO)
+    Updated and restructured version of what used to be in private/TODO,
+    various bugreports and mailed suggestions.  This will become the
+    central place for potential improvements to lintian.  I hope that
+    having it in /usr/doc/lintian will inspire some people to help.
+
+ -- Richard Braakman <dark@xs4all.nl>  Mon,  3 Aug 1998 16:07:54 +0200
+
+lintian (0.6.0) unstable; urgency=low
+
+  * (checks/shared-libs)
+    Corrected bug that made lintian complain about shared modules without
+    version info (thus ending in ".so") with a "non-dev-pkg-with-shlib-symlink"
+    warning.
+
+  * (info/overrides)  Added overrides:
+    libtricks is like fakeroot; nothing is compiled with it.
+      libtricks: no-shlibs-control-file
+    slrnpull has been split off from slrn, and shares some of its overrides.
+      slrnpull: non-standard-dir-perm var/spool/slrnpull/ 2755
+      This fixes bug#24668, reported by Joey Hess.
+
+  * (collection/perlmods)
+    Collector script that greps perl scripts for use and require directives.
+  * (checks/perl, checks/perl.desc)
+    New check script that checks perl "use" and "require" directives.
+    New tags:
+       E: script-needs-perl-version   (Experimental)
+       W: script-needs-full-perl      (Experimental)
+       I: cannot-parse-perl-directive
+
+  * (frontend/lintian)
+    New flag --print-version that prints the unadorned version number.
+  * (reporting/config, reporting/html_reports)
+    Instead of requiring $LINTIAN_VERSION in the config file, query the
+    lintian frontend for the version number.
+
+ -- Richard Braakman <dark@xs4all.nl>  Sun, 19 Jul 1998 16:41:39 +0200
+
+lintian (0.5.2) unstable; urgency=low
+
+  * (reporting/html_reports)
+    Lintian web pages now use dists/unstable/main in the path for
+    "Getting Lintian", rather than hamm/hamm, where it doesn't exist anymore.
+    (Pointed out by Ruud de Rooij)
+
+  * (checks/scripts)
+    Add /usr/sbin/install-fvwmgenmenu as a known interpreter.
+    This fixes bug#23783, reported by Joost Kooij.
+
+  * (checks/binaries, checks/changelog-file, checks/manpages)
+    [speedup] Don't skip blank lines in file-info file, since there
+    shouldn't be any.
+
+  * (checks/manpages.desc)
+    - Added note to manpage-in-wrong-directory info that only
+      sections 1 through 9 should be used.  Refer to policy 5.1.
+    I had a rewrite of the manpages check in the works, but I deferred
+    it to a later lintian version.
+
+  * (info/overrides)
+    New override from Joel Klecker: binutils: no-shlibs-control-file.
+    Added overrides supplied by Joey Hess, in bugreport #24425.
+
+  * (checks/changelog-file)
+    Corrected regexp used for changelog-file-not-compressed;
+    This really fixes bug#23683, reported by Joey Hess.
+
+  * (checks/files)
+    New warning: package-installs-perllocal-pod, inspired by
+    Manoj Srivasta's recent bugreports about such files.
+
+  * (checks/fields.desc)
+    No longer experimental:
+      E: alternates-not-allowed
+      E: versioned-provides
+      E: bad-version-in-relation
+
+ -- Richard Braakman <dark@xs4all.nl>  Sun, 12 Jul 1998 22:04:04 +0200
+
+lintian (0.5.1) unstable; urgency=low
+
+  * Added overrides supplied by Ray Dassen.
+
+  * (frontend/lintian-info)
+    Made lintian-info aware of X (experimental) tags.  (oops)
+  * (lib/read_taginfo.pl)
+    Add a paragraph to the info output for experimental tags that explains
+    what experimental status means.
+
+  * Added test package "relationships" to test weird dependency lines.
+
+  * (frontend/lintian)
+    Instead of specifying /usr/bin/lintian-info, use just lintian-info
+    and let the path search find the script.
+
+ -- Richard Braakman <dark@xs4all.nl>  Tue,  7 Jul 1998 16:27:56 +0200
+
+lintian (0.5.0) unstable; urgency=low
+
+  * (checks/menus) The menu package doesn't need to check for the
+    existence of update-menus :-)
+
+  * (testset/runtests) A harness for running regression tests on Lintian.
+  * (testset/*) A collection of broken packages on which to test Lintian.
+    Currently, only an empty package is provided for testing.
+  * (debian/rules) Run the tests in the build target.
+  * (checks/*.desc) Added "Tested: empty" to tags that are tested for
+    with the "empty" testpackage.
+
+  * (collection/file-info) Use a better parser for the index file, so
+    that weird filenames are handled correctly.  This fixes bug#24079.
+  * (collection/md5sums) Adapt index-file parser from file-info collector,
+    this saves a "find" operation on the unpacked tree.
+  * New test package filenames-1, which contains various evil filenames.
+
+  * (checks/shared-libs, checks/menus, checks/manpages, checks/files,
+     checks/control-files)
+    Handle filenames that contain spaces correctly.
+
+  * (frontend/lintian, reporting/config)
+    Update version number.  This fixes bug #23555, reported by Yann Dirson.
+    These will have to be kept in sync manually, because the lintian
+    source package has to be directly usable by the lintian web page
+    generator.
+
+  * (checks/changelog-file)
+    Allow the upstream changelog to be a symbolic link.
+    As a side-effect, allow it for the Debian changelog too.
+    This handles bug#23300, reported by Manoj Srivastava.
+
+  * (checks/changelog-file, checks/changelog-file.desc)
+    The wrong-name tags are now warnings, not errors, because the
+    relevant section of policy uses "should usually".
+    This fixes bug#23757, reported by Gregory S. Stark.
+
+  * (checks/changelog-file)
+    Limited the changelog-file-not-compressed tag to only complain
+    about changelog and changelog.Debian, because policy 5.8 does not
+    mention other changelogs.  (These would fall under section 5.3, I guess.)
+    This fixes bug#23683, reported by Joey Hess.
+
+ -- Richard Braakman <dark@xs4all.nl>  Sat,  4 Jul 1998 15:33:31 +0200
+
+lintian (0.4.8) unstable; urgency=low
+
+  * (checks/fields)
+    New error tag: "multiline-field" flags control fields that span multiple
+    lines when they shouldn't.  (According to the Packaging manual,
+    "Except where otherwise stated only a single line of data is allowed").
+
+  * (checks/fields)
+    Check dependency relationship fields as well.
+    New tags:
+      E: alternates-not-allowed
+           (generated for use of | in Provides, Conflicts, and Replaces fields)
+      E: versioned-provides
+           (generated for Provides fields that use a versioned package name)
+      W: obsolete-relation-form
+           (generated for use of < and > in versioned relationships)
+      W: bad-version-in-relation
+           (generated if the version number in a versioned relation
+            is not syntactically correct)
+      E: bad-relation
+           (generated if lintian cannot parse an element of a dependency line)
+      W: package-relation-with-self
+
+  * (checks/fields)
+    Bugfix to maintainer-not-full-name tag, it works now.
+    Added maintainer-address-looks-weird warning for obscure cases.
+    I doubt anyone will ever see it.
+
+  * (checks/fields)
+    Added new-essential-package warning, to highlight such packages.
+
+  * (checks/fields.desc) Descriptions of new tags.
+
+ -- Richard Braakman <dark@xs4all.nl>  Sun,  7 Jun 1998 17:58:19 +0200
+
+lintian (0.4.7) unstable; urgency=low
+
+  * Removed Christian's name wherever it appeared as a contact address.
+
+  * (depcheck/buglist) Entered newly reported bug numbers for dependency
+    problems.
+
+  * (checks/menus) Distinguish between install-docs and install-docs -r.
+    (closes #23049).
+
+  * (checks/files) Added new tag backup-file-in-package.  This warns
+    about emacs-style backup files that got installed in a package.
+
+  * (frontend/lintian) Allow I: tags to be overridden just like any other.
+
+  * (frontend/lintian) Add support for "Experimental" tags.  These are
+    handled like other tags, but an "Experimental: yes" flag in the tag
+    description tells lintian to output them with "X:" rather than "E:"
+    or "W:" or "I:".  This is used for new tags that might still misbehave.
+
+  * (doc/lintian.sgml) Add a paragraph to explain the new tag type.
+    "The displayed message is one of types listed above, but has been
+     flagged as `experimental' by the Lintian maintainers.  This means
+     that the code that generates this message is not as well tested as
+     the rest of Lintian, and might still give surprising results.  Feel
+     free to ignore Experimental messages that do not seem to make sense,
+     though of course bug reports are always welcomed."
+
+ -- Richard Braakman <dark@xs4all.nl>  Sat,  6 Jun 1998 20:30:36 +0200
+
+lintian (0.4.6) unstable; urgency=low
+
+  * (debian/control)
+    Lintian now depends on perl, since perl-base is not enough. It already
+    uses Text::Wrap, which is only in perl, and soon it will also use
+    Getopt::Long.
+
+  * (reporting/html_reports)
+    Report all dates in GMT, in rfc822 format.
+
+  * (debian/rules)
+    In clean target, delete byte-compiled python files (*.pyc) as well.
+
+  * (depcheck/dependencies.py)
+    Check "Cannot satisfy without packages in base" before checking
+    "Cannot satisfy with required packages", because a dependency will
+    be listed in only one category, and the former is more important
+    to flag.
+
+  * (frontent/lintian)
+    Rewrote option handling to use Getopt::Long, thus allowing nifty
+    features like bundling of single-character options.  Closes wishlist
+    bug#22566.
+
+ -- Richard Braakman <dark@xs4all.nl>  Fri, 29 May 1998 11:25:31 +0200
+
+lintian (0.4.5) unstable; urgency=low
+
+  * (depcheck/) New directory, containing scripts for generating reports
+    about broken dependency relationships in the main distribution.
+    These are not installed by the lintian deb, they are intended for
+    use by the lintian web pages, which use the source package directly.
+  * (reports/harness) Added hooks to call the depcheck scripts to generate
+    the depcheck page.
+  * (reports/html_reports) Add links from the lintian root page to the
+    depcheck page.
+
+  * (checks/menus) A tag was still generating "existance" while its
+    description had been corrected to "existence"; the html report
+    generator complained about that.  Fixed.
+
+  * (unpack/list-binpkg) Bugfix in lintian --setup-lab.  Instead of
+    looking for files in binary-$arch and binary-all, look only in
+    binary-$arch and follow the symlinks.
+
+  * (lib/text_utils.pl) Changed "&maint;" name from Christian Schwarz
+    to Richard Braakman, and changed mail address to lintian-maint@debian.org.
+
+  * (checks/standards-version) If checking a package with a Standards-Version
+    that is newer than the one lintian is written for, warn that lintian
+    should be upgraded.  (closes: #22919).
+  * (checks/standards-version.dsc)
+    New tag: newer-standards-version
+
+  * (checks/debian-readme) New check: at James Troup's suggestion,
+    scan for unmodified deb-make templates in README.Debian files.
+    New tags:
+      readme-debian-is-debmake-template
+      readme-debian-contains-debmake-template
+  * (checks/debian-readme.desc) Describe new tags.
+  * (collection/debian-readme) New collection script for README.Debian file.
+  * (man/lintian.1) Describe new check and collection script.
+
+  * (doc/libtool-rpath-workaround.txt) Explain how to achieve the same
+    result without touching configure.in and rerunning autoconf, provided
+    certain conditions hold.
+
+  * (lib/text_utils.pl, frontend/lintian-info, reporting/html_reports)
+    Do not split words that are longer than a line.  This fixes the
+    "Poli cy" bug in the lintian HTML reports.
+
+  * (checks/standards-version.desc) Corrected the URL to Christian's
+    policy upgrading checklist, which seems to have changed from
+    "upgrading.html" to "upgrading-checklist.html".
+
+  * (info/override) Removed another *.pm warning, I missed it the last time.
+
+ -- Richard Braakman <dark@xs4all.nl>  Thu, 28 May 1998 15:51:37 +0200
+
+lintian (0.4.4) unstable; urgency=low
+
+  * (checks/scripts) Suppress script-not-executable warnings for files
+    in /usr/lib that match *.pm.  These are perl modules, which often
+    have a #!/usr/bin/perl line at the top but are not intended to be
+    executed directly.
+  * (info/override) Removed now-suppressed warnings from the overrides file.
+
+  * (info/override) Added more overrides.  (closes #21028).
+
+  * (checks/scripts) At Oliver Elphick's suggestion, do not emit
+    *-script-but-no-*-dep tags or csh-considered-harmful tags for
+    scripts that are not executable.  (These already produce a
+    script-not-executable warning).
+
+  * (checks/binaries) At Yann Dirson's suggestion, added a tag for
+    stripped binaries that still have the .comment and .note sections.
+    This tag is info-level, thus not normally displayed.
+    dh_strip and install -s have been patched to strip these sections,
+    but most of the distribution has not been recompiled with the patched
+    versions.
+  * (checks/binaries.desc) Described the new tag.
+    (closes #22495).
+
+  * (man/lintian.1) Documented the options that were added in lintian 0.4.3.
+
+  * (checks/fields) Produce informational tags no-section-field and
+    no-priority-field.  These were removed in a previous version, because
+    nearly all packages do not pass -isp to dpkg-gencontrol when building
+    packages, but the new handling of info-level tags makes them useful again.
+
+ -- Richard Braakman <dark@xs4all.nl>  Sat, 16 May 1998 14:10:30 +0200
+
+lintian (0.4.3) unstable; urgency=low
+
+  * Christian added more overrides.
+  * debian/control: New maintainer.
+  * debian/copyright: Mention that lintian has no separate upstream source.
+  * debian/rules: Got rid of 'dirs' file.
+  * Moved manpages from doc/ to man/ in source package.
+  * debian/rules: Restyled :-)
+  * New overrides, read all about them in /usr/share/lintian/info/overrides.
+    (closes #22001)
+  * Corrected typo in frontend, added --allow-root option at Johnie Ingram's
+    suggestion to override lintian's refusal to run as root.  (closes #22162).
+  * Ran ispell over .desc files, fixing lots of typos, including the
+    word "existance" which occurs in several tags.
+  * checks/files: At the advice of the python maintainer, added a warning
+    against files installed in /usr/lib/python1.5 that are not in the
+    site-packages subdirectory.  (closes #22236)
+  * checks/fields: Reduced unknown-field-in-dsc and unknown-field-in-control
+    tags from "warning" to "info", because such fields can only be
+    introduced deliberately anyway.  ("info" tags are not normally reported,
+    but can be queried when someone is interested.)  (closes #20521)
+  * Made the above comment about info tags true, by adding a --display-info
+    option.
+
+ -- Richard Braakman <dark@xs4all.nl>  Mon,  4 May 1998 17:31:34 +0200
+
+lintian (0.4.2) unstable; urgency=low
+
+  * This release contains updates for Policy 2.4.1
+
+  * Fixed `changelog' check:
+    - don't report not-max-compression tag if changelog file is a symbolic
+      link (thanks to Santiago for noticing that! fixes:bug#20842)
+
+  * Improved `description' check:
+    - recognize if extended description is `Missing'
+      (fixes:bug#21091)
+
+  * Changed `files' check:
+    - symbolic links within /etc and /var have to be relative!
+
+  * Fixed `scripts' check:
+    - package name is "blt4.2", not "btl4.2" :)
+
+  * Updated `shared-libraries' check:
+    - check if postinst calls ldconfig if shared libraries are installed
+      in a directory controlled by ld.so
+      (fixes:bug#20414)
+    [2 new tags]
+
+  * Changed `standards-version' check:
+    - added Standards-Version 2.4.1
+    - only check first there digits of Standards-Version field
+
+  * Changes to the `lintian' frontend:
+    - unused overrides are displayed per package
+    - display `Processing changes file...'
+    - use $TMPDIR environment variable for creation of the temporary lab
+      (fixes:bug#21092)
+    - clean up lab if C-C is pressed
+
+  * Added more overrides
+
+ -- Christian Schwarz <schwarz@debian.org>  Wed, 15 Apr 1998 19:57:09 +0200
+
+lintian (0.4.1) unstable; urgency=low
+
+  * Fixed `changelog-file' check:
+    - don't treat "NEWS" files as changelog files
+      (thanks to Manoj for pointing this out! fixes:bug#20787)
+
+  * internal: small changes to the reporting harness
+
+ -- Christian Schwarz <schwarz@debian.org>  Tue,  7 Apr 1998 21:42:51 +0200
+
+lintian (0.4.0) unstable; urgency=low
+
+  * Changes which make it possible to check the whole archive with Lintian
+    each day without having to check all packages all the time:
+    - Reworked creation and handling of info/{binary,source}-packages files:
+      - the list files contain a version number now, which allows checking
+        for old file formats
+      - each entry has a timestamp now
+      - don't remove $LAB/info/ directory on --setup-lab
+      - just process changed packages when doing --setup-lab
+    - added command line option: `-p X' makes lintian only process all
+      packages which are listed in file X
+    - changed meaning of command line option `-U': specifies info to
+      collect _in addition to_ the usual info (necessary to extract
+      the changelog files on master--see below)
+
+  * Improved `binaries' check:
+    - objects and binaries in a *-dbg package may be unstripped
+    - libraries in lib/profile or lib/debug may not be stripped
+      (suggested by Fabrizio)
+    [1 new tag]
+
+  * Added new `changelog' check
+    (thanks to Juan Cespedes for the idea! fixes:bug#19695)
+
+  * Improved `control-files' check:
+    - improved RE that searches maintainer scripts for /tmp security bugs
+
+  * Improved `description' check:
+    - fixed RE to check for description-starts-with-package-name
+      (thanks to Roderick Schertler)
+
+  * Fixed `fields' check:
+    - internal: check for source pkg using "-l dsc" instead of "-e dsc"
+
+  * Fixed `files' check:
+    - disabled possible-name-space-pollution tag since policy is not
+      defined yet
+
+  * Improved `manpages' check:
+    - fixed silly typo in binary-without-manpage tag info
+      (thanks to Robert Edmonds for noticing that!)
+    - disabled tag binary-without-manpage for `versioned binaries'
+      (thanks to Dirk for the suggestion! fixes:bug#20186)
+
+  * Fixed `menu' check:
+    - report maintainer-script-does-not-check... tag only once per package
+      and maintainer script
+    - recognize `$(which update-menus)' as valid check for the existance
+      of update-menus; same for install-docs
+      (thanks to Fabrizio for pointing this out!)
+    - recognize `command -v update-menus' as valid check for the existance
+      of update-menus; same for install-docs
+      (thanks to Adam P. Harris for pointing this out! fixes:bug#20759)
+    - fixed tag infos
+      (thanks to Adam P. Harris for the input! fixes:bug#19810)
+
+  * Improved `scripts' check:
+    - added new interpreters:
+        nawk, pike, rexx, regina, burlap, wish8.0, bltwish
+      (fixes:bug#20223)
+
+  * Improved `shared-libs' check:
+    - added check if shared libraries contain non-pic code
+      (thanks to Gregory S. Stark for the idea and the patch!
+       fixes:bug#19249)
+    [1 new tag]
+
+  * Added `changelog' collector script
+    This makes it possible for Lintian to extract all changelog files
+    on master for use by Apt (fixes:bug#20546)
+
+  * Incremented LAB_FORMAT version to 3 because of
+    incompatible changes in the objdump-info collector script
+
+  * Internal: fixed bug in read_dpkg_control() utility function: empty
+    tags have not been handled correctly
+
+  * Internal: html-reporting tool: don't chop of text after hash (#)
+
+  * Added a lot new overrides and removed unused overrides
+    (fixes:bug#20017,bug#20082,bug#19562)
+
+ -- Christian Schwarz <schwarz@debian.org>  Mon,  6 Apr 1998 21:58:42 +0200
+
+lintian (0.3.4) unstable; urgency=low
+
+  * Bug fix release:
+    - check if lab in /tmp already exists (fixes security bug#19799)
+      Thanks to James Troup for noticing this and thanks to Joey Hess
+      for providing a patch!
+
+  * Added one override entry
+
+ -- Christian Schwarz <schwarz@debian.org>  Tue, 17 Mar 1998 23:28:38 +0100
+
+lintian (0.3.3) unstable; urgency=low
+
+  * Bug fix release:
+    - `unknown-control-file du' message disappeared
+    - fixed `executable-in-usr-doc' to not display files in
+      /usr/doc/<pkg>/example
+    - fixed tag parameters for
+        bad-owner-for-doc-file
+        dir-or-file-in-opt
+
+  * Added overrides
+
+ -- Christian Schwarz <schwarz@debian.org>  Mon, 16 Mar 1998 08:44:34 +0100
+
+lintian (0.3.2) unstable; urgency=low
+
+  * This is (intentionally) an `unstable' upload--we've decided to not
+    include the lintian package in `frozen' since it doesn't make sense to
+    maintain a `stable' and `unstable' version of a package in such an
+    early state. The maintainers should get Lintian from the `unstable'
+    distribution to check `frozen' uploads though.
+
+  * Added `menus' check. This check checks for common mistakes WRT
+    /usr/lib/menu and /usr/share/doc-base files.
+    [16 new tags]
+
+  * Fixed `shared-libs' check:
+    - removed `shared-library-uses-its-soname' check since this produced
+      way too many false alarms (thanks to David Engel for the input!)
+
+  * Fixed `binaries' check:
+    - skip `unstripped-binary-or-object' check for kernel modules
+      (thanks to Michael Meskes for noticing that!)
+    - fixed pattern which parses the `file' command's output to be able
+      to handle files without info text correctly
+      (thanks to James R. Van Zandt for pointing this out!)
+    - mention in tag info that shared libs should be stripped with
+      `--strip-unneeded' options (thanks to Brian for pointing this out!)
+
+  * Improved `manpages' check:
+    - check if manual pages are compressed with gzip -9
+      (thanks to Holger Rusch for the idea!)
+      [2 new tags]
+
+  * Improved `files' check:
+    - for files in /usr/doc:
+      - executables may only be in /usr/doc/<something>/examples
+      - files should be owned by root.root (thanks to Joey)
+      - files should not be directly placed into /usr/doc/
+       (fixes:bug#19485)
+    - no files may be installed into /tmp and /var/tmp
+    - renamed file-directly-in-usr-share to
+      file-directly-in-usr-share-not-in-a-sub-directory
+      (thanks to Santiago)
+    - fix tag info for "symlink-should-be-absolute"
+    [3 new tags]
+
+  * Improved `description' check:
+    - lists (starting with a dash or asterisk) have to be indented
+      (thanks to cpb4@ukc.ac.uk for the idea and the patch!
+      fixes:bug#19481)
+    [1 new tag]
+
+  * Fixed `scripts' check:
+    - packages with python scripts might depend on python or python-base
+      (thanks to Gregor Hoffleit for pointing this out and to Richard for
+      the patch! fixes:bug#19162)
+    - remove wrong policy quotation for `script-not-executable' tag
+
+  * Fixed `init.d' check:
+    - ignore update-rc.d calls in preinst and postinst scripts, if
+      "remove" option is specified (thanks to Roman Hodek and Herbert Xu
+      for pointing this out--this change also removes a lot of other false
+      alarms WRT update-rc.d calls)
+
+  * Improved `control-files' check:
+    - scan maintainer scripts for references to /tmp or TMPFILE since this
+      might be insecure (thanks to Topi Miettinen for the help!)
+    [1 new tag]
+
+  * Improved `copyright-file' to issue a special error message if a
+    symbolic link /usr/doc/foo refers to a directory outside of /usr/doc
+    (thanks to Darren for pointing this out!)
+    [1 new tag]
+
+  * Fixed `fields' check:
+    - added architecture `arm' (thanks to Roman Hodek)
+
+  * Fixed `lintian' frontend:
+    - run lintian scripts with LC_ALL=C
+      (thanks to Yann for pointing this out! fixes:bug#19166)
+    - changed handling of `#' comments: for comments in the overrides
+      file, the hash (#) has to be in the first column
+    - changed all tags which used `#' for comments
+
+  * Fixed `lintian-info':
+    - multiple HTML tags haven't been converted into text format in all
+      cases
+    - preformatted text is now handled correctly
+    - merged with code that produced the HTML reports
+    - code much cleaner now
+
+  * Improved Lintian's documentation:
+    - fixed libtool/rpath workaround file: don't wrap long line
+      (Thanks to Yann for pointing this out!)
+    - stress in docs that the "lintian-maint@debian.org" address should
+      be used to contact the lintian authors (thanks to Adrian Bridgett
+      for pointing this out!)
+
+  * Added more overrides (fixes:bug#19163)
+
+ -- Christian Schwarz <schwarz@debian.org>  Sun, 15 Mar 1998 23:00:31 +0100
+
+lintian (0.3.1) unstable; urgency=low
+
+  * Added `scripts' checks and collector, written by Richard. This check
+    checks the #! lines of scripts in a package.
+    [40 new tags]
+
+  * Added `spelling' checks, written by Richard. This check searches
+    the "Description:" field and the "copyright" file for common spelling
+    errors (typos).
+    [2 new tags]
+
+  * Improved `files' check: No package should install files directly into
+    /usr/share.
+    New tag:
+      file-directly-in-usr-share
+
+  * Fixed `files' check WRT files in /usr/lib/sgml and
+    /etc/emacs/site-start.d:
+      -        ignore directories and symbolic links when checking for correct
+        file permissions
+      - display permissions in octal format
+    (fixes:bug#18866,#19026)
+
+  * Fixed `control-files' check: really ignore `control' control file
+
+  * Improved `lintian' frontend:
+      - parse command line parameters before reading the configuration
+        file. With that, `lintian -h' even works if the cfg file has
+        errors.  (fixes:bug#19031)
+      - issue a warning and ignore `-all' option if packages are specified
+        at the same time (in older versions, this make lintian abort with
+        an error message)
+      - really check all packages listed in a .changes file
+        (fixes:bug#18851)
+
+  * Fixed `md5sums' check to handle file names with spaces correctly
+
+  * Put conffile /etc/lintianrc back in (fixes:bug#19031)
+
+  * Include information about libtool/rpath workaround by Yann Dirson
+    (Thanks Yann!)
+
+  * Added more overrides
+
+  * Internal changes:
+      - Each error tag has a (bug) `Severity' field now which can be used
+        to file bug reports with the correct severity
+      - Each helper script has an `Author' field now
+      - Fixed `unused overrides' report
+
+ -- Christian Schwarz <schwarz@debian.org>  Sat,  7 Mar 1998 18:46:31 +0100
+
+lintian (0.3.0) unstable; urgency=low
+
+  * Lintian now also works without a configuration file and without
+    a static laboratory!  (Since Lintian is so easy to use now, there
+    are no excuses for not using it! ;-)
+
+  * Changed handling of lab:
+      - if no lab is specified, it is created dynamically by the
+        `lintian' command (the average use does not have to worry
+        about the lab anymore)
+      - since the dynamically created lab is placed in /tmp, several
+        users can run lintian at the same time without having to know
+        of each other
+      - the commands `lintian-setup' and `lintian-remove' have been
+        removed (fixes: bug#18707).
+      - a `static' laboratory can be created/updated or removed by
+        specifying the `--setup-lab' or `--remove-lab' options for the
+        `lintian' command
+      - added a lot of sanity checks to make removal of lab less risky :)
+
+  * Changed handling of configuration file:
+      - configuration file is not necessary anymore
+      - changed search path for the configuration file to:
+          $LINTIAN_CFG/lintianrc
+          $LINTIAN_ROOT/lintianrc
+          $HOME/.lintianrc
+          /etc/lintianrc
+      - all configuration variables have reasonable defaults and can
+        be overwritten by environment variables of the same name
+      - removed configuration file /etc/lintianrc--the file is now
+        installed as /usr/doc/lintian/lintianrc.example
+      - renamed all configuration variables to LINTIAN_xxxx
+      - relaxed syntax of configuration file. It's now also possible
+        to use `~' and `$HOME' in the configuration file (fixes:
+        bug#18559)
+      - added LINTIAN_ARCH configuration variable so that Lintian
+        handles distribution directories correctly if these contain
+        several architectures
+
+  * Changed parsing of command line arguments:
+      - if a package name is specified (instead of a file), look for
+        this package in the distribution directory and in the lab (in
+        earlier version, only the distribution directory was searched
+        for packages)
+      - added `--all' option to check the whole distribution
+        (in earlier version, this was the default operation)
+      - removed buggy `-n' command line option (this option wasn't
+        really useful anyways)
+      - the `-h' option displays a short description of all available
+        options now
+      - debug option `-d' can be specified several times to increase
+        the verbosity level
+      - recognize `--' as the end of options on the command line
+
+  * Improved overrides handling:
+      - the override files does not include the leading `[EW]:'
+        anymore
+      - the parameters of an error tag may be omitted to disable
+        a certain tag for a whole package
+      - when checking the full distribution, unused overrides are
+        displayed
+      - cleaned up overrides file and added/removed a few overrides
+
+  * Improved documentation:
+      - there is now a `Lintian User's Manual' which explains how to
+        setup and use Lintian to check ones packages, and which gives
+        insight on the design issues behind Lintian
+      - added a manual page for lintian-info (has been split off
+        from lintian(1))
+      - updated the documentation files and the example lintianrc file
+      - merged QUICKSTART file into the README
+
+  * Improved `binaries' check: check if a binary or shared library
+    defines RPATH
+    (Thanks to Ray Dassen for the suggestion! fixes: bug#18519)
+    New tag:
+      binary-or-shlib-defines-rpath
+
+  * Improved `files' check:
+     WRT symbolic links:
+      - issue errors instead of warnings
+      - links between different top-level directories should always be
+        absolute
+      - check for relative links which contain to many `../' segments
+      - check for symbolic links which contain segments like `foo/../bar'
+        (Thanks to Manoj for the patch and the ideas!)
+     general:
+      - some additional checks for wrong file permissions
+    New tags:
+      symlink-has-too-many-up-segments
+      relative-symlink-enters-same-toplevel-directory
+      symlink-contains-up-and-down-segments
+      bad-permissions-for-etc-cron.d-script (renamed)
+      bad-permissions-for-etc-emacs-script
+      executable-in-usr-lib-sgml
+
+  * Fixed `control-files' check: check file permissions correctly;
+    also check file owners of control files
+    New tag:
+      control-file-has-bad-owner
+
+  * Fixed `copyright' check: check for package dependencies correctly
+    (fixes: bug#18611)
+
+  * Improved `conffiles' check: files in /var/lib/games should not be
+    tagged as conffile, in general.
+    New tag:
+      score-file-may-not-be-conffile
+
+  * Improved `manpages' check: files in /usr/X11R6/man/man6 usually
+    indicate X11 games in the wrong directory.
+    New tag:
+      x11-games-should-be-in-usr-games
+
+  * Fixed `init.d' check: skip comments in init.d file
+    (Thanks to Joey for pointing this out!)
+
+      - don't collect info for unselected collector scripts (internal bug)
+
+  * Internal changes:
+      - don't refer to package `ftp.debian.org' for bugs in the
+        $LINTIAN_DIST directory--refer to package `general' instead
+      - made list-binpkg and list-srcpkg more verbose
+      - made lintian-info less verbose (don't give detailed info more
+        than once)
+      - create control-index file which lists all files in control.tar.gz
+      - fix permissions in the lab after a package has been unpacked
+      - chdir to lab dir before running the checker and collection
+        scripts (this makes it easier to write checks in awk or even sh)
+      - pass vars to helpers via environment
+      - don't link static info/* files into lab
+      - implemented dpkg_read_control to parse all controls
+      - don't use dpkg-deb to get control information about a .deb
+      - collection and checking scripts `registry' is now done dynamically
+      - move tag descriptions from collector and checker scripts into
+        separate `.desc' files
+      - each base directory in the lab has a .lintian-status file now, which
+        can be used to detect incompatible lab changes, for example
+      - moved unused files and internal documents into a private/ directory
+        of the source package
+      - cleaned up code
+
+ -- Christian Schwarz <schwarz@debian.org>  Sun,  1 Mar 1998 23:16:15 +0100
+
+lintian (0.2.4) unstable; urgency=low
+
+  * Added `fields' check for control fields. (That's the first check
+    written by Richard--and it's all Perl!!! ;-)
+    [32 new tags]
+
+  * Added `binaries' check.
+    [6 new tags]
+
+  * Improved `shared-libraries' check:
+      - use objdump instead of ldd and ldconfig
+      - this should fix all problems where Lintian couldn't check
+        python/perl dynamic objects, etc.
+      - allow cross-checking of packages, e.g., to check non-i386 .debs
+        on a i386 system (note, that this requires a multi-arch objdump)
+      - recognize if the shared library uses its SONAME
+    New tag:
+      shared-library-uses-its-soname
+
+  * Improved `control-files' check:
+      - Don't check the `control' control file for correct
+        permissions, because dpkg doesn't care and this file isn't
+        installed on the systems anyways
+
+  * Improved `files' check:
+      - Games are allowed to be setgid games
+      - svgalib programs are allowed to be setuid root
+      - usually, files in /usr/doc/foo should not be executable
+    New tag:
+      executable-in-usr-doc
+
+  * Fix bug in `manpages' check: symlinks in /usr/bin, etc. also need
+    a manual page! (Thanks to Joey Hess for pointing this out!)
+
+  * Use `.' instead of `source' in lintian-{remove,setup} /bin/sh scripts
+    (fixes bug#18421)
+
+  * Define default values for configuration variables in
+    lintian-{remove,setup} scripts (fixes bug#18354)
+
+  * Fix bug in `copyright-file' check: Don't report
+    usr-doc-symlink-to-foreign-package if we don't know whether the
+    referenced package comes from the same source or not.
+    (Thanks to James A. Treacy for pointing this out!)
+
+  * Internal change:
+      - process source packages before binary packages so that a binary
+        package check can use info from the source packages (if these
+        are unpacked, too)
+
+  * Added more override entries--and removed a few obsolete entries
+    (the checks are smarter now! :)
+
+  * Added "Depends: binutils" for `objdump'
+
+  * Changed maintainer email address to lintian-maint@debian.org
+
+ -- Christian Schwarz <schwarz@debian.org>  Sat, 21 Feb 1998 22:39:46 +0100
+
+lintian (0.2.3) unstable; urgency=low
+
+  * Fixed manual-pages check: Check for the `undocumented' symbolic
+    link failed on X11 manual pages (fixes #18343).
+
+  * Improved files check. New tag:
+      etc-cron.d-script-tagged-executable
+
+  * Improved control-files check:
+      - the `du' control file is not allowed anymore
+      - check file permissions of control files
+    New tags:
+      control-file-has-bad-permissions
+
+  * Fixed bug: ldd-info collection script stopped when ldd failed
+
+  * Fixed (internal) bugs:
+      - collect data for collection scripts too
+      - don't collect init.d data every time again
+
+  * Error handling code improved again :)
+
+  * The lintian frontend script checks if it has root permissions and
+    aborts if this is the case. (Running it as root is unnecessary and
+    simply too dangerous.)
+
+  * Added one override entry
+
+ -- Christian Schwarz <schwarz@debian.org>  Wed, 18 Feb 1998 21:50:16 +0100
+
+lintian (0.2.2) unstable; urgency=low
+
+  * Fixed bug in lintian-setup: don't try to create $LAB if it already
+    exists (fixes bug#18227, bug#18252)
+
+  * Added "Depends: file" (oops!)
+
+  * Rewrote package "Description:"
+
+  * Added a lot more override entries (thanks to all that told me about
+    overrides!)
+
+ -- Christian Schwarz <schwarz@debian.org>  Wed, 18 Feb 1998 12:55:58 +0100
+
+lintian (0.2.1) unstable; urgency=low
+
+  * Fixed bug in ldconfig collection script: script aborted without
+    error message if a shared library had errors (thanks to Kai!)
+
+  * Fixed bug: `standards-version' check didn't collect necessary data
+    (actually, this was a more general bug--thanks to Joey Hess!)
+
+  * Fixed bug: init.d checker script didn't notice if several of the
+    required options (start, stop, etc.) have been included on a single
+    line (thanks to Joey Hess!)
+
+  * Don't check duplicated packages more than once (thanks to Joey Hess!)
+
+  * Error handling code improved once more
+
+  * Added more overrides (Thanks to Joey Hess!)
+
+  * Mentioned Lintian's home page in the README file
+
+  * Set package priority to `optional' (requested by several developers)
+
+ -- Christian Schwarz <schwarz@debian.org>  Sun, 15 Feb 1998 11:44:32 +0100
+
+lintian (0.2.0) unstable; urgency=low
+
+  * First public release
+
+  * Fixed bug in shlibs check: Sometimes, ldconfig doesn't install any
+    symbolic links at all (e.g., for `acroread' package).
+
+  * Changed lintian-setup: Don't remove the whole lab if it already
+    exists--just remove the info/ directory.
+
+  * Changed handling of critical Lintian errors (abort on error)
+
+  * Built package using fakeroot (first time i tried fakeroot--it's great!!)
+
+  * Checked package with latest Lintian :)
+
+ -- Christian Schwarz <schwarz@debian.org>  Sat, 14 Feb 1998 21:49:10 +0100
+
+lintian (0.1.3) unstable; urgency=low
+
+  * Next beta release (hopefully the last one :-)
+
+  * The lintian-info script is available now! You can either pipe the output
+    of lintian through it, or specify the `-i' option when calling lintian.
+
+  * Lintian can check .changes files now! New tags:
+      bad-distribution-in-changes-file
+      file-size-mismatch-in-changes-file
+      md5sum-mismatch-in-changes-file
+      bad-section-in-changes-file
+
+  * Lintian now detects if packages have been changed, even if they
+    have the same version number as before.
+
+  * Improved shlibs check (this fixes the "error: bad ldconfig-info file"
+    bug). New tags:
+      ldconfig-symlink-referencing-wrong-file
+      ldconfig-symlink-is-not-a-symlink
+
+  * Improved files check! New tags:
+      package-installs-into-etc-rc.d
+      non-standard-file-permissions-for-etc-init.d-script
+
+  * New check for /etc/init.d scripts! Tags:
+      duplicate-updaterc.d-calls-in-postinst
+      output-of-updaterc.d-not-redirected-to-dev-null
+      preinst-calls-updaterc.d
+      duplicate-updaterc.d-calls-in-postrm
+      prerm-calls-updaterc.d
+      postrm-does-not-call-updaterc.d-for-init.d-script
+      postrm-contains-additional-updaterc.d-calls
+      file-in-etc-rc.d-marked-as-conffile
+      init.d-script-not-marked-as-conffile
+      init.d-script-does-not-implement-required-option
+      init.d-script-not-included-in-package
+      unregistered-script-in-etc-init.d
+
+  * Fixed manpages check: Subdirectories of /usr/bin (e.g., /usr/bin/mh)
+    have not been handled correctly.
+
+  * Added new override entries
+
+  * Cleaned up Lintian's source code
+
+  * Updated documentation
+
+  * Lots of small changes
+
+ -- Christian Schwarz <schwarz@debian.org>  Fri, 13 Feb 1998 23:24:51 +0100
+
+lintian (0.1.2) unstable; urgency=low
+
+  * Beta release
+  * Two major bugs have been fixed
+  * Debugging info increased
+
+ -- Christian Schwarz <schwarz@debian.org>  Fri, 13 Feb 1998 11:20:51 +0100
+
+lintian (0.1.1) unstable; urgency=low
+
+  * Beta release
+
+ -- Christian Schwarz <schwarz@debian.org>  Thu, 12 Feb 1998 23:45:51 +0100
+
+lintian (0.1.0) unstable; urgency=low
+
+  * First release
+
+ -- Christian Schwarz <schwarz@debian.org>  Wed, 11 Feb 1998 23:15:51 +0100
+
+vim: et
diff --git a/nokia-lintian/debian/compat b/nokia-lintian/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/nokia-lintian/debian/control b/nokia-lintian/debian/control
new file mode 100644 (file)
index 0000000..1550e9f
--- /dev/null
@@ -0,0 +1,39 @@
+Source: lintian
+Section: devel
+Priority: optional
+Maintainer: Debian Lintian Maintainers <lintian-maint@debian.org>
+Uploaders: Josip Rodin <joy-packages@debian.org>,
+ Jeroen van Wolffelaar <jeroen@wolffelaar.nl>,
+ Frank Lichtenheld <djpig@debian.org>,
+ Marc 'HE' Brockschmidt <he@debian.org>,
+ Colin Watson <cjwatson@debian.org>, Russ Allbery <rra@debian.org>
+Build-Depends: debhelper (>= 5)
+Build-Depends-Indep: debiandoc-sgml, sed (>= 4.1-4), dpatch
+Standards-Version: 3.8.0
+Vcs-Git: git://git.debian.org/git/lintian/lintian.git
+Vcs-Browser: http://git.debian.org/?p=lintian/lintian.git
+
+Package: lintian
+Architecture: all
+Depends: perl, libdigest-md5-perl | perl (>> 5.8), dpkg-dev (>= 1.13.17),
+ file, binutils, diffstat (>= 1.27-1), man-db (>= 2.3.20-1), gettext (>= 0.16),
+ intltool-debian, libdigest-sha-perl, libparse-debianchangelog-perl (>= 0.6),
+ libtimedate-perl, liburi-perl
+Suggests: binutils-multiarch, libtext-template-perl, man-db (>= 2.5.1-1)
+Description: Debian package checker
+ Lintian dissects Debian packages and reports bugs and policy
+ violations. It contains automated checks for many aspects of Debian
+ policy as well as some checks for common errors.
+ .
+ It uses an archive directory, called laboratory, in which it stores
+ information about the packages it examines.  It can keep this
+ information between multiple invocations in order to avoid repeating
+ expensive data-collection operations. This makes it possible to check the
+ complete Debian archive for bugs, in a reasonable time.
+ .
+ This package is useful for all people who want to check Debian 
+ packages for compliance with Debian policy. Every Debian maintainer
+ should check packages with this tool before uploading them to the
+ archive.
+ .
+ This version of Lintian is calibrated for policy version 3.8.0.
diff --git a/nokia-lintian/debian/copyright b/nokia-lintian/debian/copyright
new file mode 100644 (file)
index 0000000..13c6b03
--- /dev/null
@@ -0,0 +1,52 @@
+This is the Debian package of Lintian, the Debian package checker.
+The latest version of Lintian can always be found at:
+       http://lintian.debian.org/
+
+Lintian was designed and written by Christian Schwarz and Richard Braakman.
+The package was previously maintained by Darren Benham,
+Sean 'Shaleh' Perry and Josip Rodin.
+It is now maintained by a group of people, namely:
+ Josip Rodin <joy-packages@debian.org>
+ Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+ Frank Lichtenheld <djpig@debian.org>
+ Marc 'HE' Brockschmidt <he@debian.org>
+ Colin Watson <cjwatson@debian.org>
+ Russ Allbery <rra@debian.org>
+ Thijs Kinkhorst <thijs@debian.org>
+ Adam D. Barratt <adam@adam-barratt.org.uk>
+Contact address is <lintian-maint@debian.org>.
+
+Lintian is maintained in git.  The current development version may
+be checked out from:
+       git://git.debian.org/git/lintian/lintian.git
+
+Copyright (C) 1998 Christian Schwarz and Richard Braakman
+Portions Copyright (C) 1998-1999 Joey Hess
+Portions Copyright (C) 1999 Darren Benham
+Portions Copyright (C) 2000 Sean 'Shaleh' Perry
+Portions Copyright (C) 2001 Colin Watson
+Portions Copyright (C) 2001-2002 Josip Rodin
+Portions Copyright (C) 2002-2004 Denis Barbier
+Portions Copyright (C) 2004 Marc Brockschmidt
+Portions Copyright (C) 2004-2008 Frank Lichtenheld
+Portions Copyright (C) 2004 Jeroen van Wolffelaar
+Portions Copyright (C) 2005 René van Bevern
+Portions Copyright (C) 2006 Adeodato Simó
+Portions Copyright (C) 2007, 2008 Russ Allbery
+Portions Copyright (C) 2008 Patrick Schoenfeld
+
+This program is free software; you may redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This is distributed in the hope that it will be useful, but without
+any warranty; without even the implied warranty of merchantability or
+fitness for a particular purpose. See the GNU General Public License
+for more details.
+
+A copy of the GNU General Public License version 2 is available as
+/usr/share/common-licenses/GPL-2 in the Debian GNU/Linux distribution
+or at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+You can also obtain it by writing to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/nokia-lintian/debian/dirs b/nokia-lintian/debian/dirs
new file mode 100644 (file)
index 0000000..ea49a65
--- /dev/null
@@ -0,0 +1,4 @@
+etc
+usr/bin
+usr/share/lintian
+var/spool/lintian
diff --git a/nokia-lintian/debian/doc-base b/nokia-lintian/debian/doc-base
new file mode 100644 (file)
index 0000000..71ad202
--- /dev/null
@@ -0,0 +1,15 @@
+Document: lintian
+Title: Lintian User's Manual
+Author: Christian Schwarz, Richard Braakman, Sean 'Shaleh' Perry
+Abstract: This manual describes Lintian, the Debian package checker.
+Section: Debian
+
+Format: debiandoc-sgml
+Files: /usr/share/doc/lintian/lintian.sgml.gz
+
+Format: HTML
+Index: /usr/share/doc/lintian/lintian.html/index.html
+Files: /usr/share/doc/lintian/lintian.html/*.html
+
+Format: text
+Files: /usr/share/doc/lintian/lintian.txt.gz
diff --git a/nokia-lintian/debian/docs b/nokia-lintian/debian/docs
new file mode 100644 (file)
index 0000000..b5c5aac
--- /dev/null
@@ -0,0 +1,6 @@
+doc/lintian.html
+doc/CREDITS
+doc/README
+doc/desc-files
+doc/lintian.sgml
+doc/lintian.txt
diff --git a/nokia-lintian/debian/patches/00list b/nokia-lintian/debian/patches/00list
new file mode 100644 (file)
index 0000000..8d8f9cb
--- /dev/null
@@ -0,0 +1,19 @@
+#500-backport-1.23.21-checks
+#500-backport-1.23.22-checks-binaries
+#500-backport-1.23.22-frontend
+#500-backport-1.23.22-tar-wildcard
+#500-backport-1.23.23-tilda-bts-381965
+#800-allow-architecture-armel
+800-allow-comments-in-debian-control
+800-allow-relocatable-objects
+#800-correct-perm2oct
+800-implement-tag-override
+801-allow-dynamic-loaders
+801-implement-check-tag
+801-implement-dbg-checks
+802-implement-overridedir
+#803-ignore-unknown-elf-format
+#804-xargs-fix-bts-399322
+805-add-known-maemo-sections
+806-binary-check-fix
+807-correspondent-docs-to-devs-check
diff --git a/nokia-lintian/debian/patches/500-backport-1.23.21-checks.dpatch b/nokia-lintian/debian/patches/500-backport-1.23.21-checks.dpatch
new file mode 100755 (executable)
index 0000000..4c4ddc1
--- /dev/null
@@ -0,0 +1,3860 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 500-backport-1.23.21-checks.dpatch by Alexander Kanevskiy <alexander.kanevskiy@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Backported checks from lintian 1.23.21
+
+@DPATCH@
+diff -urNad lintian-1.23.8/checks/binaries.desc lintian-1.23.21/checks/binaries.desc
+--- lintian-1.23.8/checks/binaries.desc        2005-01-14 21:06:37.000000000 +0000
++++ lintian-1.23.21/checks/binaries.desc       2006-07-18 11:42:35.000000000 +0000
+@@ -61,11 +61,14 @@
+  Please contact &debdev; if you have questions about this.
+ Tag: binary-has-unneeded-section
+-Type: warning
++Type: info
+ Info: The binary or shared library is stripped, but still contains a
+- section that is not useful.  The utilities (<tt>install -s</tt>
+- and <tt>dh_strip</tt>) are patched to remove the <tt>.note</tt> and
+- <tt>.comment</tt> sections.
++ section that is not useful.  You should call strip with
++ <tt>--remove-section=.comment --remove-section=.note</tt> to remove the
++ <tt>.note</tt> and <tt>.comment</tt> sections.
++ .
++ <tt>dh_strip</tt> will do this automatically for you, but
++ <tt>install -s</tt> not because it calls strip without any arguments.
+ Tag: missing-depends-line
+ Type: warning
+@@ -121,3 +124,24 @@
+ Info: There is no CXXABI_* mark in the objdump output on this file,
+  and it is linked against a libstdc++, meaning it's likely linking to
+  an obsolete version of the C++ library.
++
++Tag: several-sonames-in-same-package
++Type: info
++Info: There are several shared libraries in this package and they
++ have different sonames. This is usually discouraged because it is
++ inherently error-prone.
++
++Tag: package-name-doesnt-match-sonames
++Type: warning
++Info: The package name of a library package should usually reflect
++ the soname of the included library. The package name can determined
++ from the library file name with the following code snippet:
++ .
++  $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | sed -e's/\([0-9]\)\.so\./\1-/; s/\.so\.//'
++Ref: Library Packaging guide 5
++
++Tag: binary-with-bad-dynamic-table
++Type: error
++Info: This appears to be an ELF file but objdump -T cannot parse it.
++ If it is external debugging symbols for another file, it should be
++ installed under /usr/lib/debug.
+diff -urNad lintian-1.23.8/checks/common_data.pm lintian-1.23.21/checks/common_data.pm
+--- lintian-1.23.8/checks/common_data.pm       2005-01-14 17:19:55.000000000 +0000
++++ lintian-1.23.21/checks/common_data.pm      2006-07-18 11:50:09.000000000 +0000
+@@ -7,14 +7,43 @@
+          %known_obsolete_fields %known_essential %known_build_essential
+          %known_obsolete_packages %known_virtual_packages
+          %known_libstdcs %known_tcls %known_tclxs %known_tks %known_tkxs
+-         %known_libpngs
++         %known_libpngs %known_x_metapackages
++         %non_standard_archs %all_cpus %all_oses
++         %known_doc_base_formats
+           );
+ # simple defines for commonly needed data
++# From /usr/share/dpkg/archtable, included here to make lintian results
++# consistent no matter what dpkg one has installed.
+ %known_archs = map { $_ => 1 }
+-    ('alpha', 'amd64', 'arm', 'hppa', 'hurd-i386', 'i386', 'ia64', 'mips',
+-       'mipsel', 'm68k', 'powerpc', 's390', 'sh', 'sparc', 'any', 'all');
++    ('i386', 'ia64', 'alpha', 'amd64', 'arm', 'hppa', 'm68k', 'mips',
++     'mipsel', 'powerpc', 's390', 'sparc', 'hurd-i386', 'any', 'all');
++
++# From /usr/share/dpkg/cputable, included here to make lintian results
++# consistent no matter what dpkg one has installed.
++%all_cpus = map { $_ => 1 }
++    ('i386', 'ia64', 'alpha', 'amd64', 'armeb', 'arm', 'hppa', 'm32r', 'm68k',
++     'mips', 'mipsel', 'powerpc', 'ppc64', 's390', 's390x', 'sh3', 'sh3eb',
++     'sh4', 'sh4eb', 'sparc');
++
++# From /usr/share/dpkg/ostable, included here to make lintian results
++# consistent no matter what dpkg one has installed.
++%all_oses = map { $_ => 1 }
++    ('linux', 'darwin', 'freebsd', 'kfreebsd', 'knetbsd', 'netbsd', 'openbsd',
++     'hurd');
++
++# Yes, this includes combinations that are rather unlikely to ever exist, like
++# hurd-sh3, but the chances of those showing up as errors are rather low and
++# this reduces the necessary updating.
++#
++# For right now, linux-* are non-standard architectures.  This probably isn't
++# strictly correct and will need to be revisited later.
++%non_standard_archs = map { $_ => 1 }
++    grep { !$known_archs{$_} }
++        (keys %all_cpus,
++         map { my $os = $_; map { "$os-$_" } keys %all_cpus } keys %all_oses);
++
+ %known_sections = map { $_ => 1 }
+     ('admin', 'base', 'comm', 'devel', 'doc', 'editors', 'electronics',
+@@ -66,7 +95,7 @@
+ %known_obsolete_packages = map { $_ => 1 }
+     ('libstdc++2.8', 'ncurses3.4', 'slang0.99.38', 'newt0.25', 'mesag2',
+      'libjpegg6a', 'gmp2', 'libgtop0', 'libghttp0', 'libpgsql', 'tk4.2',
+-     'tcl7.6', 'libpng0g', 'xbase');
++     'tcl7.6', 'libpng0g', 'xbase', 'xlibs-dev', 'debmake', 'gcc-2.95' );
+ # Used only (at least lintian 1.23.1) for giving a warning about a
+ # virtual-only dependency
+@@ -98,6 +127,7 @@
+ %known_libstdcs = map { $_ => 1 }
+     ('libstdc++2.9-glibc2.1', 'libstdc++2.10', 'libstdc++2.10-glibc2.2',
+      'libstdc++3', 'libstdc++3.0', 'libstdc++4', 'libstdc++5',
++     'libstdc++6', 'lib64stdc++6',
+     );
+ %known_tcls = map { $_ => 1 }
+@@ -115,4 +145,12 @@
+ %known_libpngs = map { $_ => 1 }
+     ( 'libpng12-0', 'libpng2', 'libpng3', );
++%known_x_metapackages = map { $_ => 1 }
++    ( 'x-window-system', 'x-window-system-dev', 'x-window-system-core',
++      'xorg', 'xorg-dev', );
++
++# Supported documentation formats for doc-base files.
++%known_doc_base_formats = map { $_ => 1 }
++    ( 'html', 'text', 'pdf', 'postscript', 'info', 'dvi', 'debiandoc-sgml' );
++
+ 1;
+diff -urNad lintian-1.23.8/checks/conffiles lintian-1.23.21/checks/conffiles
+--- lintian-1.23.8/checks/conffiles    2004-07-04 12:18:33.000000000 +0000
++++ lintian-1.23.21/checks/conffiles   2006-07-18 11:42:35.000000000 +0000
+@@ -1,4 +1,4 @@
+-# conffiles -- lintian check script
++# conffiles -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::conffiles;
+ use strict;
+@@ -47,15 +47,11 @@
+       tag "duplicate-conffile", "$_";
+     }
+-    if (m,^/?var/lib/games/,o) {
+-      tag "score-file-must-not-be-conffile", "$_";
+-    }
+-
+     if (m,^/?usr/,o) {
+       tag "file-in-usr-marked-as-conffile", "$_";
+     } else {
+-      unless (m,^/?etc/,o or m,^/?var/,o) {
+-          tag "non-etc-or-var-file-marked-as-conffile", "$_";
++      unless (m,^/?etc/,o) {
++          tag "non-etc-file-marked-as-conffile", "$_";
+       }
+     }
+diff -urNad lintian-1.23.8/checks/conffiles.desc lintian-1.23.21/checks/conffiles.desc
+--- lintian-1.23.8/checks/conffiles.desc       2005-01-14 20:58:38.000000000 +0000
++++ lintian-1.23.21/checks/conffiles.desc      2006-07-18 11:42:35.000000000 +0000
+@@ -14,10 +14,11 @@
+  administrator would not have a chance to modify this configuration
+  file.
+-Tag: non-etc-or-var-file-marked-as-conffile
++Tag: non-etc-file-marked-as-conffile
+ Type: warning
+-Info: A file installed in some other directory than <tt>/etc</tt> or
+- <tt>/var</tt> is marked as conffile.
++Info: A file installed in some other directory than <tt>/etc</tt>
++ is marked as conffile. A conffile typically implies a configuration file, and
++ policy mandates such files to be in /etc
+ Status: untested
+ Ref: policy 10.7.2
+@@ -27,10 +28,6 @@
+ Info: All entries in the conffile control file should have an absolute
+  path specification.
+-Tag: score-file-must-not-be-conffile
+-Type: error
+-Info: Game score and data files should not be marked as conffiles.
+-
+ Tag: duplicate-conffile
+ Type: error
+ Info: The file is listed more than once in your <tt>debian/conffiles</tt> file.
+diff -urNad lintian-1.23.8/checks/control-file lintian-1.23.21/checks/control-file
+--- lintian-1.23.8/checks/control-file 2004-05-17 21:49:43.000000000 +0000
++++ lintian-1.23.21/checks/control-file        2006-07-18 11:42:35.000000000 +0000
+@@ -1,4 +1,4 @@
+-# control-file -- lintian check script
++# control-file -- lintian check script -*- perl -*-
+ #
+ # Copyright (C) 2004 Marc Brockschmidt
+ # 
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::control_file;
+ use strict;
+@@ -28,12 +28,36 @@
+ my $pkg = shift;
+ my $type = shift;
++if (-l "debfiles/control") {
++    tag "debian-control-file-is-a-symlink", "";
++}
++
+ # check that control is UTF-8 encoded
+ my $line = file_is_encoded_in_non_utf8("debfiles/control", $type, $pkg);
+ if ($line) {
+     tag "debian-control-file-uses-obsolete-national-encoding", "at line $line"
+ }
++# Check that each field is only used once:
++my $seen_fields = {};
++open (CONTROL, "debfiles/control") or fail "Couldn't read debfiles/control: $!";
++while (<CONTROL>) {
++      s/\s*\n$//;
++
++      #Reset seen_fields if we enter a new section:
++      $seen_fields = {} if /^$/;
++
++      #line with field:
++      if (/^(\S+):/) {
++              my $field = lc ($1);
++              if ($seen_fields->{$field}) {
++                      tag "debian-control-with-duplicate-fields", "$field: $$seen_fields{$field}, $.";
++              }
++              $seen_fields->{$field} = $.; 
++      }
++}
++close CONTROL;
++
+ my ($header, @binary_controls) = read_dpkg_control("debfiles/control");
+ for my $binary_control (@binary_controls) {
+diff -urNad lintian-1.23.8/checks/control-file.desc lintian-1.23.21/checks/control-file.desc
+--- lintian-1.23.8/checks/control-file.desc    2004-11-24 22:44:10.000000000 +0000
++++ lintian-1.23.21/checks/control-file.desc   2006-07-18 11:42:35.000000000 +0000
+@@ -25,3 +25,17 @@
+  `Build-Conflicts' or `Build-Conflicts-Indep' field in a binary
+  section.  These specify source package relationships, and should be in
+  the source section of the control file.
++
++Tag: debian-control-with-duplicate-fields
++Type: error
++Info: One of the paragraphs of your debian/control contains the same
++ field more than once. This can lead to an unexpected behaviour of dpkg
++ and apt.
++
++Tag: debian-control-file-is-a-symlink
++Type: warning
++Info: The <tt>debian/control</tt> file is a symlink rather than a regular
++ file. Using symlinks for required source package files is unnecessary and
++ makes package checking and manipulation more difficult. If the control
++ file should be available in the source package under multiple names, make
++ <tt>debian/control</tt> the real file and the other names symlinks to it.
+diff -urNad lintian-1.23.8/checks/copyright-file lintian-1.23.21/checks/copyright-file
+--- lintian-1.23.8/checks/copyright-file       2004-10-12 21:56:46.000000000 +0000
++++ lintian-1.23.21/checks/copyright-file      2006-07-18 11:42:35.000000000 +0000
+@@ -1,4 +1,4 @@
+-# copyright-file -- lintian check script
++# copyright-file -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::copyright_file;
+ use strict;
+@@ -162,8 +162,9 @@
+     $wrong_directory_detected = 1;
+ }
+-# lame check for old FSF zip code
+-if (m/02139/) {
++# Lame check for old FSF zip code.  Try to avoid false positives from other
++# Cambridge, MA addresses.
++if (m/(Free\s*Software\s*Foundation.*02139|02111-1307)/s) {
+     tag "old-fsf-address-in-copyright-file", "";
+ }
+@@ -186,9 +187,15 @@
+     tag "copyright-does-not-refer-to-common-license-file", "$1";
+ }
++# This check is a bit prone to false positives, since some other licenses
++# mention the GPL.  Also exclude any mention of the GPL following what looks
++# like mail headers, since sometimes e-mail discussions of licensing are
++# included in the copyright file but aren't referring to the license of the
++# package.
+ if (m/(GNU General Public License|GPL)/ && !m,/usr/share/common-licenses,
+     && !m/Zope Public License/ && !m/LICENSE AGREEMENT FOR PYTHON 1.6.1/
+     && !m/LaTeX Project Public License/ && !m/GNU Free Documentation License/
++    && !m/(^From:.*^To:|^To:.*^From:).*(GNU General Public License|GPL)/ms
+     && !$wrong_directory_detected) {
+     tag "copyright-should-refer-to-common-license-file-for-gpl", "";
+ }
+diff -urNad lintian-1.23.8/checks/copyright-file.desc lintian-1.23.21/checks/copyright-file.desc
+--- lintian-1.23.8/checks/copyright-file.desc  2004-07-06 19:05:37.000000000 +0000
++++ lintian-1.23.21/checks/copyright-file.desc 2006-07-18 11:42:35.000000000 +0000
+@@ -15,7 +15,6 @@
+ Tag: no-copyright-file
+ Type: error
+-Severity: Important
+ Info: Each binary package has to include a plain file
+  /usr/share/doc/<i>pkg</i>/copyright
+ Ref: policy 12.5
+@@ -84,16 +83,15 @@
+ Ref: policy 12.5
+ Tag: old-fsf-address-in-copyright-file
+-Type: error
++Type: warning
+ Info: The /usr/share/doc/<i>pkg</i>/copyright file refers to the old postal
+  address of the Free Software Foundation (FSF). The new address is:
+  .
+-   Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-   MA 02111-1307, USA.
++   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++   MA 02110-1301, USA.
+ Tag: helper-templates-in-copyright
+ Type: error
+-Severity: Important
+ Info: The /usr/share/doc/<i>pkg</i>/copyright file still contains the template
+  contents from a packaging helper. Please include the actual license and
+  download information about the package.
+@@ -134,8 +132,10 @@
+ Tag: copyright-should-refer-to-common-license-file-for-gpl
+ Type: error
+ Ref: policy 12.5
+-Info: Packages distributed under the GNU GPL must make reference to
+- /usr/share/common-licenses as the location of the GPL on Debian systems.
++Info: The string "GNU General Public License" or "GPL" appears in the
++ copyright file for this package, but the copyright file does not
++ reference <tt>/usr/share/common-licenses</tt> as the location of the GPL
++ on Debian systems.
+ Tag: copyright-lists-upstream-authors-with-dh_make-boilerplate
+ Type: warning
+diff -urNad lintian-1.23.8/checks/cruft lintian-1.23.21/checks/cruft
+--- lintian-1.23.8/checks/cruft        2004-05-17 21:56:40.000000000 +0000
++++ lintian-1.23.21/checks/cruft       2006-07-18 11:42:35.000000000 +0000
+@@ -18,8 +18,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::cruft;
+ use strict;
+@@ -76,6 +76,12 @@
+           tag "source-contains-CVS-dir", "$name";
+       } elsif ($name =~ m,^(.+/)?\.svn$,) {
+           tag "source-contains-svn-control-dir", "$name";
++      } elsif ($name =~ m,^(.+/)?\.bzr$,) {
++          tag "source-contains-bzr-control-dir", "$name";
++      } elsif ($name =~ m,^(.+/)?\{arch\}$,) {
++          tag "source-contains-arch-control-dir", "$name";
++      } elsif ($name =~ m,^(.+/)?\.arch-ids$,) {
++          tag "source-contains-arch-control-dir", "$name";
+       }
+     }
+@@ -86,6 +92,8 @@
+       tag "svn-commit-file-in-source", "$name";
+     } elsif ($name =~ m,^(.+/)?\.cvsignore$,) {
+       tag "cvsignore-file-in-source", "$name";
++    } elsif ($name =~ m,^(.+/)?\.arch-inventory$,) {
++      tag "arch-inventory-file-in-source", "$name";
+     } elsif ($name =~ m,^(.+/)?\.\#(.+?)\.\d+(\.\d+)*$,) {
+       tag "source-contains-cvs-conflict-copy", "$name";
+     } elsif ($name =~ m,^(.+/)?(.+?)\.(r\d+|mine)$,) {
+diff -urNad lintian-1.23.8/checks/cruft.desc lintian-1.23.21/checks/cruft.desc
+--- lintian-1.23.8/checks/cruft.desc   2004-05-17 21:59:53.000000000 +0000
++++ lintian-1.23.21/checks/cruft.desc  2006-07-18 11:42:35.000000000 +0000
+@@ -56,12 +56,30 @@
+  distributed normally. However, since upstream tarball often still contain
+  those, it's only an informational tag.
++Tag: arch-inventory-file-in-source
++Type: info
++Info: Package contains a '.arch-inventory' file.  It may have been included by
++ accident. It is Version Control System metadata that should not be
++ distributed normally.
++
+ Tag: source-contains-svn-control-dir
+ Type: warning
+ Info: Source contains a .svn directory. It was most likely included by
+  accident, since Subversion version control directories usually don't belong
+  in packages. Export from subversion rather than checkout.
++Tag: source-contains-bzr-control-dir
++Type: warning
++Info: Source contains a .bzr directory. It was most likely included by
++ accident, since bazaar-ng version control directories usually don't belong
++ in packages.
++
++Tag: source-contains-arch-control-dir
++Type: warning
++Info: Source contains a {arch} or .arch-ids directory. It was most likely
++ included by accident, since Arch version control directories usually don't
++ belong in packages.
++
+ Tag: source-contains-CVS-dir
+ Type: warning
+ Info: Package contains a CVS directory. It was most likely included by
+diff -urNad lintian-1.23.8/checks/debdiff lintian-1.23.21/checks/debdiff
+--- lintian-1.23.8/checks/debdiff      2004-07-04 12:18:33.000000000 +0000
++++ lintian-1.23.21/checks/debdiff     2006-07-18 11:42:35.000000000 +0000
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::debdiff;
+ use strict;
+@@ -50,6 +50,9 @@
+     $file = $1;
+     tag_warn("patch-failure-file-in-diff", $file)
+       if ($file =~ m/\.(orig|rej)$/);
++
++    tag_warn("diff-contains-substvars", $file)
++      if ($file =~ m%^debian/substvars$%);
+ }
+ close(STAT) or fail("error reading diffstat file: $!");
+diff -urNad lintian-1.23.8/checks/debdiff.desc lintian-1.23.21/checks/debdiff.desc
+--- lintian-1.23.8/checks/debdiff.desc 2004-05-02 01:30:44.000000000 +0000
++++ lintian-1.23.21/checks/debdiff.desc        2006-07-18 11:42:35.000000000 +0000
+@@ -24,6 +24,14 @@
+  the reason is the location of the original source tarball. dpkg-source
+  searches for this in ../package_upstream-version.orig.tar.gz.
++Tag: diff-contains-substvars
++Type: warning
++Info: Lintian found a substvars file in the Debian diff for this source 
++ package. The debian/substvars file is usually generated and modified
++ dynamically by debian/rules targets, in which case it must be removed by
++ the clean target.
++Ref: policy 4.9
++
+ Tag: source-tar-is-posix-tar
+ Type: error
+ Info: The source tar archive of this package is made with tar --posix. This
+diff -urNad lintian-1.23.8/checks/debhelper lintian-1.23.21/checks/debhelper
+--- lintian-1.23.8/checks/debhelper    2004-11-24 22:44:10.000000000 +0000
++++ lintian-1.23.21/checks/debhelper   2006-07-18 11:42:35.000000000 +0000
+@@ -1,4 +1,4 @@
+-# debhelper format -- lintian check script
++# debhelper format -- lintian check script -*- perl -*-
+ # Copyright (C) 1999 by Joey Hess
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::debhelper;
+ use strict;
+@@ -39,6 +39,14 @@
+ my $needversiondepends = '';
+ my $seenversiondepends = '0';
+ my $compat = '';
++my $usescdbs = '';
++
++# If there is no debian/compat file present but cdbs is being used, cdbs will
++# create one automatically.  Currently it always uses compatibility level 4.
++# It may be better to look at what version of cdbs the package depends on and
++# from that derive the compatibility level....
++
++my $cdbscompat = 4;
+ # Parse the debian/rules file, and try to figure out if debhelper commands
+ # are run in it that like to modify maintainer scripts. Those debhelper
+@@ -57,6 +65,7 @@
+                          dh_installmenu
+                          dh_installmime
+                          dh_installmodules
++                         dh_installtexfonts
+                          dh_installwm
+                          dh_installxfonts
+                          dh_installxmlcatalogs
+@@ -68,6 +77,7 @@
+                          );
+ open(RULES, "debfiles/rules") or fail("cannot read debian/rules: $!");
++my $dhcompatvalue;
+ while (<RULES>) {
+     if (m/^\s+(dh_\w+)/) {
+         my $dhcommand = $1;
+@@ -87,8 +97,21 @@
+       }
+       $seencommand = 1;
+       $needbuilddepends = 1;
+-    } elsif (/^\s*export\s+DH_COMPAT\s*=\s*(\d+)/) {
++    } elsif (m,^include\s+/usr/share/cdbs/1/rules/debhelper.mk,) {
++      $seencommand = 1;
++      $needbuilddepends = 1;
++      $needtomodifyscripts = 1;
++
++      # CDBS sets DH_COMPAT but doesn't export it.  It does, however, create
++      # a debian/compat file if none was found; that logic is handled later.
++      $dhcompatvalue = $cdbscompat;
++      $usescdbs = 1;
++    } elsif (/^\s*export\s+DH_COMPAT\s*:?=\s*(\d+)/) {
+       $needversiondepends = $1;
++    } elsif (/^\s*export\s+DH_COMPAT/) {
++      $needversiondepends = $dhcompatvalue if $dhcompatvalue;
++    } elsif (/^\s*DH_COMPAT\s*:?=\s*(\d+)/) {
++      $dhcompatvalue = $1;
+     }
+ }
+ close RULES;
+@@ -140,7 +163,7 @@
+       if ($compat) {
+           chomp $compat;
+           if ($needversiondepends) {
+-              tag "declares-possibly-conflicting-debhelper-compat-versions", "$needversiondepends $compat";
++              tag "declares-possibly-conflicting-debhelper-compat-versions", "rules=$needversiondepends compat=$compat";
+           } else {
+               $needversiondepends = $compat;
+           }
+@@ -173,8 +196,16 @@
+ }
+ closedir(DEBIAN);
+-if ($needversiondepends and ($needversiondepends > 1) and ! Dep::versions_lte($needversiondepends, $seenversiondepends)) {
+-    tag "package-lacks-versioned-build-depends-on-debhelper", "$needversiondepends";
++if ($usescdbs and not $needversiondepends) {
++    $needversiondepends = $cdbscompat;
++}
++$needversiondepends ||= 1;
++if ($needversiondepends < 4) {
++    tag "package-uses-deprecated-debhelper-compat-version", $needversiondepends;
++}
++
++if ($needversiondepends > 4 and ! Dep::versions_lte($needversiondepends, $seenversiondepends)) {
++    tag "package-lacks-versioned-build-depends-on-debhelper", $needversiondepends;
+ }
+ }
+diff -urNad lintian-1.23.8/checks/debhelper.desc lintian-1.23.21/checks/debhelper.desc
+--- lintian-1.23.8/checks/debhelper.desc       2004-05-02 01:30:44.000000000 +0000
++++ lintian-1.23.21/checks/debhelper.desc      2006-07-18 11:42:35.000000000 +0000
+@@ -36,10 +36,11 @@
+ Tag: dh_testversion-is-deprecated
+ Type: warning
++Ref: dh_testversion(1)
+ Info: This package calls dh_testversion in its <tt>debian/rules</tt> file.
+- As dh_testversion.1 says, dh_testversion is deprecated. Packages
+- using debhelper should use versioned build dependencies to ensure
+- that the correct version of debhelper is installed.
++ dh_testversion is deprecated. Packages using debhelper should use
++ versioned build dependencies to ensure that the correct version of
++ debhelper is installed.
+ Tag: dh_dhelp-is-deprecated
+ Type: warning
+@@ -53,22 +54,31 @@
+ Tag: dh_suidregister-is-obsolete
+ Type: warning
++Ref: dh_suidregister(1)
+ Info: suidregister is obsoleted by dpkg-statoverride, so registration of
+  files in with dh_suidregister is unnecessary, and even harmful.
+- .
+- Please refer to the dh_suidregister(1) manual page for more information.
+ Tag: debhelper-compat-file-is-empty
+ Type: error
++Ref: debhelper(7)
+ Info: The source package has an empty debian/compat file. This is an error,
+  the compat level of debhelper should be in there.
+- .
+- Please refer to the debhelper(7) manual page for more information.
+ Tag: declares-possibly-conflicting-debhelper-compat-versions
+ Type: error
++Ref: debhelper(7)
+ Info: The source package declares the debhelper compatibility version
+- both in the debian/control file and in the rules file. If these ever
++ both in the debian/compat file and in the rules file. If these ever
+  get out of synchronisation, the package may not build as expected.
++
++Tag: package-uses-deprecated-debhelper-compat-version
++Type: warning
++Ref: debhelper(7)
++Info: The debhelper compatibility version used by this package is marked
++ as deprecated by the debhelper developer. You should really consider
++ using a newer compatibility version.
+  .
+- Please refer to the debhelper(7) manual page for more information.
++ The compatibility version can be set in (preferred)
++ <tt>debian/compat</tt> or by setting and exporting DH_COMPAT in
++ <tt>debian/rules</tt>.  If it is not set in either place, debhelper
++ defaults to the deprecated compatibility version 1.
+diff -urNad lintian-1.23.8/checks/description lintian-1.23.21/checks/description
+--- lintian-1.23.8/checks/description  2005-01-14 23:32:36.000000000 +0000
++++ lintian-1.23.21/checks/description 2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# description -- lintian check script
++# description -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::description;
+ use strict;
+@@ -68,7 +68,7 @@
+     if ($synopsis =~ m/^\s*missing\s*$/i) {
+       tag "description-is-debmake-template", "" unless $template++;
+     } elsif ($synopsis =~ m/<insert up to 60 chars description>/) {
+-      tag "description-is-dh_make-template", "";
++      tag "description-is-dh_make-template", "" unless $template++;
+     }
+ }
+@@ -80,7 +80,7 @@
+     if ($lines == 0) {
+       my $firstline = lc $_;
+       my $lsyn = lc $synopsis;
+-      if ($firstline =~ /^\Q$lsyn\E/) {
++      if ($firstline =~ /^\Q$lsyn\E$/) {
+           tag "description-synopsis-is-duplicated", "";
+       } else {
+           $firstline =~ s/[^a-zA-Z0-9]+//g;
+@@ -113,7 +113,7 @@
+       if (m/^\s*missing\s*$/oi) {
+           tag "description-is-debmake-template", "" unless $template++;
+       } elsif (m/<insert long description, indented with spaces>/) {
+-          tag "description-is-dh_make-template", "";
++          tag "description-is-dh_make-template", "" unless $template++;
+       }
+     }
+diff -urNad lintian-1.23.8/checks/description.desc lintian-1.23.21/checks/description.desc
+--- lintian-1.23.8/checks/description.desc     2005-01-14 23:32:48.000000000 +0000
++++ lintian-1.23.21/checks/description.desc    2006-07-18 11:44:07.000000000 +0000
+@@ -24,7 +24,7 @@
+ Type: error
+ Info: The description contains a line starting with a dot (.). This is
+  not allowed.
+-Ref: policy 5.6.12
++Ref: policy 5.6.13
+ Tag: description-too-long
+ Type: error
+@@ -46,7 +46,7 @@
+ Tag: description-contains-tabs
+ Type: error
+ Info: The package "Description:" must not contain tab characters.
+-Ref: policy 5.6.12
++Ref: policy 5.6.13
+ Tag: description-starts-with-leading-spaces
+ Type: warning
+@@ -60,7 +60,7 @@
+  starts with a dash (-) or asterisk (*). If this was meant to be a
+  list of items these lines need to be indented (dselect would
+  word-wrap these lines otherwise).
+-Ref: policy 5.6.12
++Ref: policy 5.6.13
+ Tag: description-is-debmake-template
+ Type: error
+diff -urNad lintian-1.23.8/checks/fields lintian-1.23.21/checks/fields
+--- lintian-1.23.8/checks/fields       2004-12-25 23:40:20.000000000 +0000
++++ lintian-1.23.21/checks/fields      2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# fields -- lintian check script (rewrite)
++# fields -- lintian check script (rewrite) -*- perl -*-
+ #
+ # Copyright (C) 2004 Marc Brockschmidt
+ #
+@@ -19,21 +19,74 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::fields;
+ use strict;
+ use lib "$ENV{'LINTIAN_ROOT'}/checks/";
+ use common_data;
++use Dep;
+ use Tags;
+ use Util;
++# Certain build tools must be listed in Build-Depends even if there are no
++# arch-specific packages because they're required in order to run the clean
++# rule.  (See Policy 7.6.)  The following is a list of package dependencies;
++# regular expressions that, if they match anywhere in the debian/rules file,
++# say that this package is allowed (and required) in Build-Depends; and
++# optional tags to use for reporting the problem if some information other
++# than the default is required.
++my @global_clean_depends = (
++      [ cdbs => '^include\s+/usr/share/cdbs/' ],
++      [ dbs => '^include\s+/usr/share/dbs/' ],
++      [ debhelper => '^include\s+/usr/share/cdbs/1/rules/debhelper.mk' ],
++      [ dpatch => '^include\s+/usr/share/cdbs/1/rules/dpatch.mk' ],
++      [ quilt => '^include\s+/usr/share/cdbs/1/rules/patchsys-quilt.mk' ],
++      [ dpatch => '^include\s+/usr/share/dpatch/' ],
++      [ 'quilt (>= 0.40)' => '^include\s+/usr/share/quilt/' ]
++);
++
++# These are similar, but the resulting dependency is only allowed, not
++# required.
++my @global_clean_allowed = (
++      [ patchutils => '^include\s+/usr/share/cdbs/1/rules/dpatch.mk' ],
++      [ patchutils => '^include\s+/usr/share/cdbs/1/rules/patchsys-quilt.mk' ],
++      [ patchutils => '^include\s+/usr/share/cdbs/1/rules/simple-patchsys.mk' ],
++);
++
++# The allowed Python dependencies currently.  This is the list of alternatives
++# that, either directly or through transitive dependencies that can be relied
++# upon, ensure /usr/bin/python will exist for the use of dh_python.
++my $python_depend = 'python | python-dev | python-all-dev';
++
++# A list of packages; regular expressions that, if they match anywhere in the
++# debian/rules file, this package must be listed in either Build-Depends or
++# Build-Depends-Indep as appropriate; and optional tags as above.
++my @global_depends = (
++        [ $python_depend => '/usr/share/cdbs/1/class/python-distutils.mk' ],
++        [ $python_depend => '^\t\s*dh_python\s', 'missing-dh_python-build-dependency' ],
++        [ 'debhelper (>= 5.0.31)' => '^\t\s*dh_installxfonts', 'missing-dh_installxfonts-build-dependency' ],
++);
++
++# Similarly, this list of packages, regexes, and optional tags say that if the
++# regex matches in one of clean, build-arch, binary-arch, or a rule they
++# depend on, this package is allowed (and required) in Build-Depends.
++my @rule_clean_depends = (
++      [ debhelper => '^\t\s*dh_.+' ],
++      [ dpatch => '^\t\s*dpatch\s' ],
++      [ patch => '^\t\s*(?:perl debian/)?yada\s+unpatch' ],
++      [ perl => '^\t\s*perl\s' ],
++      [ $python_depend => '^\t\s*python\s' ],
++      [ yada => '^\t\s*yada\s' ],
++);
++
+ sub run {
+ my $pkg = shift;
+ my $type = shift;
+ my $version;
++my $arch_indep;
+ local $/ = undef; #Read everything in one go
+@@ -105,8 +158,10 @@
+       }
+       for my $arch (@archs) {
+-              unless ($known_archs{$arch}) {
+-                      tag "unknown-architecture", "";
++              if ($non_standard_archs{$arch}) {
++                      tag "non-standard-architecture", "$arch";
++              } elsif (! $known_archs{$arch}) {
++                      tag "unknown-architecture", "$arch";
+               }
+       }
+@@ -114,6 +169,9 @@
+               tag "too-many-architectures", "" if (@archs > 1);
+               tag "arch-any-in-binary-pkg", "" if (grep { $_ eq "any" } @archs);
+       }
++
++      # Used for later tests.
++      $arch_indep = 1 if (@archs == 1 && $archs[0] eq 'all');
+ }
+ #---- Subarchitecture (udeb)
+@@ -135,6 +193,8 @@
+               my $maintainer = <FH>;
+               close FH;
++              # Note, not expected to hit on uploaders anymore, as dpkg now strips
++              # newlines for the .dsc, and the newlines don't hurt in debian/control
+               unfold($f, \$maintainer);
+               $maintainer =~ s/^\s*(.+?)\s*$/$1/; #Remove leading and trailing whitespace
+@@ -212,6 +272,8 @@
+           } elsif (scalar @parts > 1) {
+               tag "unknown-section", "$section" unless $known_archive_parts{$parts[0]};
+               tag "unknown-section", "$section" unless $known_sections{$parts[1]};
++          } elsif ($parts[0] eq 'unknown') {
++              tag "section-is-dh_make-template";
+           } else {
+               tag "unknown-section", "$section" unless $known_sections{$parts[0]};
+           }
+@@ -251,14 +313,31 @@
+ #---- Package relations (binary package)
++# Check whether the package looks like a meta-package, used for later
++# dependency checks.  We consider a package to possibly be a meta-package if
++# it is a binary package, arch: all, with no files outside of /usr/share/doc.
++my $metapackage = 0;
++if ($type eq 'binary' && $arch_indep) {
++      $metapackage = 1;
++      open IN, "index" or fail("cannot open index file index: $!");
++      local $_;
++      local $/ = "\n";
++      while (<IN>) {
++              my ($mode, $file) = (split(' ', $_, 6))[0,5];
++              next unless $file;
++              $metapackage = 0 unless ($mode =~ /^d/ || $file =~ m%^\./usr/share/doc/%);
++      }
++      close IN;
++}
+ if (($type eq "binary") || ($type eq 'udeb')) {
+-      my %deps;
++      my (%deps, %fields);
+       for my $field (qw(depends pre-depends recommends suggests conflicts provides replaces)) {
+               if (open(FH, "fields/$field")) {
+                       #Get data and clean it
+                       my $data = <FH>;
+                       unfold($field, \$data);
+                       $data =~ s/^\s*(.+?)\s*$/$1/;
++                      $fields{$field} = $data;
+                       my (@seen_libstdcs, @seen_tcls, @seen_tclxs, @seen_tks, @seen_tkxs, @seen_libpngs);
+@@ -298,7 +377,7 @@
+                                           if ($d_version && grep { $d_version->[0] eq $_ } ("<", ">"));
+                                       tag "bad-version-in-relation", "$field: $part_d_orig"
+-                                          if ($d_version->[0] && ! (_valid_version($d_version->[1]))[1]);
++                                          if ($d_version->[0] && ! defined((_valid_version($d_version->[1]))[1]));
+                                       
+                                       tag "package-relation-with-self", "$field: $part_d_orig"
+                                           if ($pkg eq $d_pkg) && ($field ne 'conflicts');
+@@ -309,11 +388,14 @@
+                                       tag "depends-on-obsolete-package", "$field: $part_d_orig"
+                                           if ($known_obsolete_packages{$d_pkg} && &$is_dep_field($field));
++                                      tag "depends-on-x-metapackage", "$field: $part_d_orig"
++                                          if ($known_x_metapackages{$d_pkg} && ! $metapackage && &$is_dep_field($field));
++
+                                       tag "depends-on-essential-package-without-using-version", "$field: $part_d_orig"
+                                           if ($d_pkg ne "coreutils" && $known_essential{$d_pkg} && ! $d_version->[0] && &$is_dep_field($field));
+                                       tag "package-depends-on-an-x-font-package", "$field: $part_d_orig"
+-                                          if ($field =~ /^(pre-)?depends$/ && $d_pkg =~ /^xfont.*/);
++                                          if ($field =~ /^(pre-)?depends$/ && $d_pkg =~ /^xfont.*/ && $d_pkg ne 'xfonts-utils' && $d_pkg ne 'xfongs-encodings');
+                                       tag "needlessly-depends-on-awk", "$field"
+                                           if ($d_pkg eq "awk" && ! $d_version->[0] && &$is_dep_field($field));
+@@ -321,6 +403,9 @@
+                                       tag "depends-on-libdb1-compat", "$field"
+                                           if ($d_pkg eq "libdb1-compat" && $pkg !~ /^libc(6|6.1|0.3)/ && $field =~ /^(pre-)depends$/);
++                                      tag "depends-on-python-minimal", "$field",
++                                          if ($d_pkg eq "python-minimal" && &$is_dep_field($field));
++
+                                       tag "doc-package-depends-on-main-package", "$field"
+                                           if ("$d_pkg-doc" eq $pkg && $field =~ /^(pre-)depends$/);
+                               }
+@@ -340,6 +425,19 @@
+               }
+       }
++      # If Conflicts is set, make sure it's not inconsistent with the other
++      # dependency fields.
++      if ($fields{conflicts}) {
++              for my $field (qw(depends pre-depends recommends suggests)) {
++                      next unless $fields{$field};
++                      my $depend = Dep::parse($fields{$field});
++                      for my $conflict (split /\s*,\s*/, $fields{conflicts}) {
++                              tag "conflicts-with-dependency", $conflict
++                                  if Dep::implies($depend, Dep::parse($conflict));
++                      }
++              }
++      }
++
+       for my $d_pkg_name (keys %deps) {
+               my $d_pkg = $deps{$d_pkg_name};
+               if (scalar @$d_pkg > 1) {
+@@ -392,48 +490,62 @@
+                               $arch_dep_packages++;
+                       }
+               }
+-      } 
+-
+-      if (-e "fields/build-depends" && $arch_dep_packages == 0) {
+-              if (not open(BD, "fields/build-depends")) {
+-                      fail("Can't open fields/build-depends");
+-              } else {
+-                      my $build_depends = <BD>;
+-                      close BD;
++      }
+-                      my $uses_dh = 0;
+-                      if (not open (RULES, "debfiles/rules")) {
+-                              fail("cannot read debfiles/rules: $!");
+-                      } else {
+-                              my $target = "none";
+-                              local $/ = "\n"; #Read this linewise                            
+-                              while (<RULES>) {
+-                                      $target = $1 if (/^(\S+):/);
+-                                      if (/^\s+dh_.+/ && grep ($_ eq $target, qw(clean binary-arch build-arch)) or
+-                                                      m#^include\s+/usr/share/cdbs/1/rules/debhelper.mk#) {
+-                                              $uses_dh = "yes";
+-                                              last
+-                                      }
+-                              }
+-                              close RULES;
++      # Search through rules and determine which dependencies are required.
++      # The keys in %needed and %needed_clean are the dependencies; the
++      # values are the tags to use or the empty string to use the default
++      # tag.
++      my (%needed, %needed_clean, %allowed_clean);
++      open (RULES, "debfiles/rules") or fail("cannot read debfiles/rules: $!");
++      my $target = "none";
++      local $/ = "\n";        # Read this linewise
++      my @rules = qw(clean binary-arch build-arch);
++      while (<RULES>) {
++              for my $rule (@global_clean_depends) {
++                      if ($_ =~ /$rule->[1]/) {
++                              $needed_clean{$rule->[0]} = $rule->[2] || $needed_clean{$rule->[0]} || '';
+                       }
+-                      unless ($build_depends =~ /^\s*debhelper(?:\s+\((.+?)\))?(?:\s+(\[.+?\]))?\s*$/ && $uses_dh){
+-                              tag "build-depends-without-arch-dep", ""
++              }
++              for my $rule (@global_clean_allowed) {
++                      if ($_ =~ /$rule->[1]/) {
++                              $allowed_clean{$rule->[0]} = 1;
++                      }
++              }
++              for my $rule (@global_depends) {
++                      if ($_ =~ /$rule->[1]/) {
++                              $needed{$rule->[0]} = $rule->[2] || $needed{$rule->[0]} || '';
++                      }
++              }
++              if (/^(\S+):(.*)/) {
++                      $target = $1;
++                      if (grep ($_ eq $target, @rules)) {
++                              push (@rules, split (' ', $2));
++                      }
++              }
++              if (grep ($_ eq $target, @rules)) {
++                      for my $rule (@rule_clean_depends) {
++                              if ($_ =~ /$rule->[1]/) {
++                                      $needed_clean{$rule->[0]} = $rule->[2] || $needed_clean{$rule->[0]} || '';
++                              }
+                       }
+               }
+       }
++      close RULES;
+       tag "build-depends-indep-without-arch-indep", ""
+               if (-e "fields/build-depends-indep" && $arch_indep_packages == 0);
+       my $is_dep_field = sub { grep { $_ eq $_[0] } qw(build-depends build-depends-indep) };
+-      
++
++      my %depend;
+       for my $field (qw(build-depends build-depends-indep build-conflicts build-conflicts-indep)) {
+               if (open(FH, "fields/$field")) {
+                       #Get data and clean it
+                       my $data = <FH>;
+                       unfold($field, \$data);
+                       $data =~ s/^\s*(.+?)\s*$/$1/;
++                      $depend{$field} = $data;
+                       for my $dep (split /\s*,\s*/, $data) {
+                               my @alternatives;
+@@ -446,8 +558,11 @@
+                                       my ($d_pkg, $d_version, $d_arch, $rest, $part_d_orig) = @$part_d;
+                                       for my $arch (@{$d_arch->[0]}) {
+-                                              tag "invalid-arch-string-in-source-relation", "$arch [$field: $part_d_orig]"
+-                                                  unless ($known_archs{$arch} || $arch eq "any" || $arch eq "all");
++                                              if ($non_standard_archs{$arch}) {
++                                                      tag "non-standard-arch-in-source-relation", "$arch [$field: $part_d_orig]";
++                                              } elsif (!$known_archs{$arch} && $arch ne "any" && $arch ne "all") {
++                                                      tag "invalid-arch-string-in-source-relation", "$arch [$field: $part_d_orig]"
++                                              }
+                                       }
+                                       tag "depends-on-build-essential-package-without-using-version", "$d_pkg [$field: $part_d_orig]"
+@@ -455,6 +570,11 @@
+                                       tag "build-depends-on-essential-package-without-using-version", "$field: $part_d_orig"
+                                           if ($d_pkg ne "coreutils" && $known_essential{$d_pkg} && ! $d_version->[0]);
++                                      tag "build-depends-on-obsolete-package", "$field: $part_d_orig"
++                                          if ($known_obsolete_packages{$d_pkg} && &$is_dep_field($field));
++
++                                      tag "build-depends-on-x-metapackage", "$field: $part_d_orig"
++                                          if ($known_x_metapackages{$d_pkg} && &$is_dep_field($field));
+                                       tag "bad-relation", "$field: $part_d_orig"
+                                           if $rest;
+@@ -462,6 +582,55 @@
+                       }
+               }
+       }
++      $depend{'build-depends'} = Dep::parse($depend{'build-depends'} || '');
++      $depend{'build-depends-indep'} = Dep::parse($depend{'build-depends-indep'} || '');
++
++      # Make sure build dependencies and conflicts are consistent.
++      for ($depend{'build-conflicts'}, $depend{'build-conflicts-indep'}) {
++              next unless $_;
++              for my $conflict (split /\s*,\s*/, $_) {
++                      if (Dep::implies($depend{'build-depends'}, Dep::parse($conflict))
++                          || Dep::implies($depend{'build-depends-indep'}, Dep::parse($conflict))) {
++                              tag "build-conflicts-with-build-dependency", $conflict;
++                      }
++              }
++      }
++
++      # Make sure that all the required build dependencies are there.  Don't
++      # issue missing-build-dependency errors for debhelper, since there's
++      # another test that does that and it would just be a duplicate.
++      for my $package (keys %needed_clean) {
++              my $dep = Dep::parse($package);
++              my $tag = $needed_clean{$package} || 'missing-build-dependency';
++              unless (Dep::implies($depend{'build-depends'}, $dep)) {
++                      if (Dep::implies($depend{'build-depends-indep'}, $dep)) {
++                              tag "build-depends-indep-should-be-build-depends", $package;
++                      } else {
++                              tag $tag, $package if $package ne 'debhelper';
++                      }
++              }
++      }
++      for my $package (keys %needed) {
++              my $dep = Dep::parse($package);
++              my $tag = $needed{$package} || 'missing-build-dependency';
++              unless (Dep::implies($depend{'build-depends'}, $dep)) {
++                      unless (Dep::implies($depend{'build-depends-indep'}, $dep)) {
++                              tag $tag, $package;
++                      }
++              }
++      }
++      if (-e "fields/build-depends" && $arch_dep_packages == 0) {
++              open(FH, "fields/build-depends") or fail("cannot read fields/build-depends: $!");
++              my $build_depends = <FH>;
++              close FH;
++              my @packages = split /\s*,\s*/, $build_depends;
++              foreach my $pkg (@packages) {
++                      my ($name) = ($pkg =~ /^(\S+)/);
++                      unless (defined $needed_clean{$name} || defined $allowed_clean{$name}) {
++                              tag "build-depends-without-arch-dep", $name;
++                      }
++              }
++      }
+ }
+ #----- Origin
+diff -urNad lintian-1.23.8/checks/fields.desc lintian-1.23.21/checks/fields.desc
+--- lintian-1.23.8/checks/fields.desc  2004-12-25 23:40:20.000000000 +0000
++++ lintian-1.23.21/checks/fields.desc 2006-07-18 11:44:07.000000000 +0000
+@@ -1,7 +1,7 @@
+ Check-Script: fields
+ Author: Marc 'HE' Brockschmidt <marc@marcbrockschmidt.de>
+ Abbrev: fld
+-Standards-Version: 3.6.1
++Standards-Version: 3.6.2
+ Type: binary, udeb, source
+ Unpack-Level: 1
+ Needs-Info: debfiles
+@@ -18,12 +18,12 @@
+ Info: A package name should be at least two characters long, must consist
+  of the alphanumerics and `+' `-' and `.', and must start with an
+  alphanumeric character.
+-Ref: policy 5.6.6
++Ref: policy 5.6.7
+ Tag: package-not-lowercase
+ Type: error
+ Info: New packages should not use uppercase characters in their names.
+-Ref: policy 5.6.6
++Ref: policy 5.6.7
+ Tag: no-version-field
+ Type: error
+@@ -33,12 +33,12 @@
+ Tag: bad-version-number
+ Type: error
+ Info: The version number fails one of the syntactic requirements of dpkg.
+-Ref: policy 5.6.11
++Ref: policy 5.6.12
+ Tag: upstream-version-not-numeric
+ Type: error
+ Info: The upstream version number should start with a digit. 
+-Ref: policy 5.6.11
++Ref: policy 5.6.12
+ Tag: debian-revision-not-well-formed
+ Type: warning
+@@ -64,27 +64,35 @@
+ Type: error
+ Info: The special architecture values `all' and `any' only make sense if
+  they occur alone.
+-Ref:  policy 5.6.7
++Ref:  policy 5.6.8
+ Tag: unknown-architecture
+ Type: warning
+ Info: In addition to the special values `all' and `any', the architecture
+- names alpha, amd64, arm, hppa, hurd-i386, i386, ia64, m68k, mips, mipsel,
+- powerpc, s390, sh, and sparc are currently in use.  The special value
+- `source' is only used in .changes files and does not make sense in a binary
+- package or a .dsc file.
++ names alpha, arm, hppa, hurd-i386, i386, ia64, m68k, mips, mipsel, powerpc,
++ s390, and sparc are currently in use.  The special value `source' is only 
++ used in .changes files and does not make sense in a binary package or a 
++ .dsc file.
++
++Tag: non-standard-architecture
++Type: info
++Info: In addition to the special values `all', `any' and the names of the
++ architectures already in the archive (alpha, arm, hppa, hurd-386, i386, 
++ ia64, m68k, mips, mipsel, powerpc, s390, sparc), there are some 
++ architectures still waiting to be included in the archive. Examples
++ include kfreebsd-i386 and ppc64.
+ Tag: too-many-architectures
+ Type: error
+ Info: A binary package should list exactly one architecture (the one it is
+  compiled for), or the special value `all' if it is architecture-independent.
+-Ref: policy 5.6.7
++Ref: policy 5.6.8
+ Tag: arch-any-in-binary-pkg
+ Type: error
+ Info: The special architecture value `any' does not make sense in a binary
+  package.
+-Ref: policy 5.6.7
++Ref: policy 5.6.8
+ Tag: no-maintainer-field
+ Type: error
+@@ -102,7 +110,7 @@
+ Type: error
+ Info: The maintainer field should contain the package maintainer's name and
+  email address, with the name followed by the address inside angle
+- brackets (&lt; and &rt;).  The address seems to be missing.
++ brackets (&lt; and &gt;).  The address seems to be missing.
+ Ref: policy 5.6.2
+ Tag: maintainer-address-malformed
+@@ -137,7 +145,7 @@
+ Type: error
+ Info: The uploader field should contain the package uploader's name and
+  email address, with the name followed by the address inside angle
+- brackets (&lt; and &rt;).  The address seems to be missing.
++ brackets (&lt; and &gt;).  The address seems to be missing.
+ Ref: policy 5.6.2
+ Tag: uploader-address-malformed
+@@ -199,18 +207,18 @@
+ Tag: essential-in-source-package
+ Type: error
+ Info: This field should only appear in binary packages.
+-Ref: policy 5.6.8
++Ref: policy 5.6.9
+  
+ Tag: essential-no-not-needed
+ Type: error
+ Info: Having `Essential: no' is the same as not having the field at all,
+  so it just makes the Packages file longer with no benefit.
+-Ref: policy 5.6.8
++Ref: policy 5.6.9
+ Tag: unknown-essential-value
+ Type: error
+ Info: The only valid values for the Essential field are yes and no.
+-Ref: policy 5.6.8
++Ref: policy 5.6.9
+ Tag: no-section-field
+ Type: warning
+@@ -235,6 +243,14 @@
+  is in the contrib distribution.
+ Ref: policy 2.4
++Tag: section-is-dh_make-template
++Type: error
++Info: The `Section:' field in this package's control file is set to
++ unknown.  This is not a valid section, and usually means a dh_make
++ template control file was used and never modified to set the correct
++ section.
++Ref: policy 2.4
++
+ Tag: wrong-section-for-udeb
+ Type: warning
+ Info: udeb packages should have `Section: debian-installer'.
+@@ -301,7 +317,7 @@
+  instead.
+ Tag: bad-version-in-relation
+-Ref: policy 5.6.11
++Ref: policy 5.6.12
+ Type: error
+ Info: The version number used in this relationship does not match the
+  defined format of a version number.
+@@ -342,6 +358,28 @@
+ Type: error
+ Info: The package depends on a package that has been superseded.
++Tag: build-depends-on-obsolete-package
++Type: error
++Info: The package build-depends on a package that has been superseded.
++
++Tag: depends-on-x-metapackage
++Type: error
++Info: Packages that are not themselves metapackages must not depend on X
++ Window System metapackages.
++ .
++ The metapackages xorg, xorg-dev, x-window-system, x-window-system-dev, and
++ x-window-system-core exist only for the benefit of users and dependencies
++ for other metapackages and should not be used in regular package
++ dependencies.
++
++Tag: build-depends-on-x-metapackage
++Type: error
++Info: Packages must not build-depend on X Window System metapackages.
++ .
++ The metapackages xorg, xorg-dev, x-window-system, x-window-system-dev, and
++ x-window-system-core exist only for the benefit of users and should not
++ be used in package build dependencies.
++
+ Tag: depends-on-essential-package-without-using-version
+ Type: error
+ Ref: policy 3.5
+@@ -371,11 +409,16 @@
+ Tag: invalid-arch-string-in-source-relation
+ Type: error
+-Ref: policy 5.6.7
++Ref: policy 5.6.8
+ Info: The architecture string in the source relation does not follow policy.
+  A common cause of this is a comma in the arch, i.e. [i386, m68k], it should
+  be [i386 m68k].
++Tag: non-standard-arch-in-source-relation
++Type: info
++Info: The architecture string in the source relation is one of the
++ architectures still waiting to be included in the archive.
++
+ Tag: depends-on-build-essential-package-without-using-version
+ Type: error
+ Info: The package declares a depends on a build essential package without
+@@ -403,13 +446,46 @@
+ Tag: build-depends-without-arch-dep
+ Type: warning
+ Ref: policy 7.6
+-Info: The control file specifies source relations for architecture-dependent
+- packages, but no architecture-dependent packages are built. There are some
+- exceptions, e.g. build dependencies that have to be satisfied while calling
+- the "clean" target of debian/rules, the most common case of which is a
+- Build-Depends: debhelper if you use dh_clean in the "clean" target.
+- In other cases, you most likely need to change Build-Depends to
+- Build-Depends-Indep.
++Info: The control file lists the given package in Build-Depends, but no
++ architecture-dependent packages are built. If all the packages built are
++ architecture-independent, the only packages that should be listed in
++ Build-Depends are those required to run the clean target (such as
++ debhelper if you use dh_clean). Other build dependencies should be listed
++ in Build-Depends-Indep instead.
++
++Tag: build-depends-indep-should-be-build-depends
++Type: error
++Ref: policy 7.6
++Info: The specified package is required to run the clean target of
++ <tt>debian/rules</tt> and therefore must be listed in Build-Depends, even
++ if no architecture-dependent packages are built.
++
++Tag: missing-build-dependency
++Type: error
++Ref: policy 4.2
++Info: The package doesn't specify a build dependency on a package that is
++ used in <tt>debian/rules</tt>.
++
++Tag: missing-dh_python-build-dependency
++Type: error
++Ref: dh_python(1)
++Info: The package runs dh_python in <tt>debian/rules</tt> but doesn't
++ build-depend on python or python-dev. dh_python requires
++ <tt>/usr/bin/python</tt> to run, so packages using dh_python must
++ build-depend on python (or python-dev or python-all-dev, which in turn
++ depend on python), even if they don't otherwise need Python to build.
++
++Tag: missing-dh_installxfonts-build-dependency
++Type: error
++Info: dh_installxfonts prior to debhelper 5.0.31 does not correctly handle
++ the paths and dependencies for the X.Org 7 modular tree.  Any package
++ using dh_installxfonts must depend on at least debhelper (>= 5.0.31).
++
++Tag: build-conflicts-with-build-dependency
++Type: error
++Ref: policy 7.6
++Info: The package build-conflicts with a package that it also
++ build-depends on.
+ Tag: package-has-a-duplicate-relation
+ Type: warning
+@@ -472,6 +548,20 @@
+  glibc 2.0 or 2.1. There is intentionally no corresponding development
+  package. Do not link new applications against this library!
++Tag: depends-on-python-minimal
++Type: error
++Info: The python-minimal package exists only to possibly become an
++ Essential package.  Depending on it is always an error since it should
++ never be installed without python.  If it becomes Essential, there is no
++ need to depend on it, and until then, packages that require Python must
++ depend on python.
++
++Tag: conflicts-with-dependency
++Type: error
++Ref: 7.3
++Info: The package seems to conflict with one of its dependencies,
++ recommendations, or suggestions.
++
+ Tag: bad-menu-item
+ Type: error
+ Info: The field Installer-Menu-Item should only contain positive integer
+diff -urNad lintian-1.23.8/checks/files lintian-1.23.21/checks/files
+--- lintian-1.23.8/checks/files        2005-01-14 21:34:52.000000000 +0000
++++ lintian-1.23.21/checks/files       2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# files -- lintian check script
++# files -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz and Richard Braakman
+ #
+@@ -15,11 +15,12 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::files;
+ use strict;
++use Dep;
+ use Tags;
+ use Util;
+@@ -70,6 +71,9 @@
+ }
+ close(SCRIPTS);
++# We only want to warn about this once.
++my $warned_x11_predepends = 0;
++
+ # Read package contents...
+ open(IN,"index") or fail("cannot open index file index: $!");
+ while (<IN>) {
+@@ -229,17 +233,43 @@
+           tag "old-app-defaults-directory", "$file";
+       }
+-      #----------------- /usr/{lib,bin,include}/X11/
+-      elsif ($file =~ m,^usr/(?:lib|bin|include)/X11/,) {
+-          tag "package-installs-file-to-usr-something-x11", "$file";
++      #----------------- /usr/{include,lib}/X11/
++      # Packages installing files here must pre-depend on x11-common
++      # so that the symlinks will be sorted out first.
++      elsif ($file =~ m,^usr/(?:include|lib)/X11/, && !$warned_x11_predepends) {
++          if (open (FH, "fields/package")) {
++              my $name = <FH>;
++              close FH;
++              $name =~ s/\n//g;
++              if ($name ne 'x11-common') {
++                  my $pre_depends = '';
++                  if (open (FH, "fields/pre-depends")) {
++                      $pre_depends = <FH>;
++                      close FH;
++                      $pre_depends =~ s/\n//g;
++                  }
++                  $pre_depends = Dep::parse($pre_depends);
++                  tag "file-in-usr-something-x11-without-pre-depends", "$file"
++                      unless Dep::implies($pre_depends, Dep::parse('x11-common (>= 1:7.0.0)'));
++              }
++          }
++
++          # Always set this so that we don't redo the check, even if we
++          # didn't warn.  If the first instance didn't warn, none will.
++          $warned_x11_predepends = 1;
+       }
++
+       #----------------- /usr/X11R6/
++      elsif ($file =~ m,^usr/X11R6/bin,) {
++          tag "package-installs-file-to-usr-x11r6-bin", "$file";
++      }
++      elsif ($file =~ m,^usr/X11R6/lib/X11/fonts,) {
++          tag "package-installs-font-to-usr-x11r6", "$file";
++      }
+       elsif ($file =~ m,^usr/X11R6/, and
+-             $file !~ m,^usr/X11R6/lib/X11/fonts, and #font packages are allowed
+-             $perm !~ m,^l, and #links to FHS locations are encouraged
+-             $source_pkg ne "xfree86") { #The X Window System is allowed to do anything
+-          tag "packages-installs-file-to-usr-x11r6", "$file";
++             $perm !~ m,^l,) { #links to FHS locations are allowed
++          tag "package-installs-file-to-usr-x11r6", "$file";
+       }
+       # ---------------- /usr/lib/sgml
+@@ -277,11 +307,14 @@
+           }
+       }
+       # ---------------- /usr/share/man and /usr/X11R6/man
+-      elsif ($file =~ m,^usr/X11R6/man/\S+, or m,^usr/share/man/\S+, ) {
++      elsif ($file =~ m,^usr/X11R6/man/\S+, or $file =~ m,^usr/share/man/\S+,) {
+           if ($type eq 'udeb') {
+               tag "documentation-file", "$file";
+           }
+-          if ($perm =~ m/^-.*[xt]/) {
++          if ($perm =~ m/^d/) {
++              tag "stray-directory-in-manpage-directory", "$file"
++                  if ($file !~ m,^usr/(X11R6|share)/man/(?:[^/]+/)?(man\d/)?$,);
++          } elsif ($perm =~ m/^-.*[xt]/) {
+               tag "executable-manpage", "$file";
+           }
+       }
+@@ -303,7 +336,11 @@
+               tag "FSSTND-dir-in-usr", "$file";
+           }
+           # FHS dirs
+-          elsif ( $file !~ m,^usr/(X11R6|X386|bin|games|include|lib|local|sbin|share|src|spool|tmp)/, ) {
++          elsif ( $file !~ m,^usr/(X11R6|X386|
++                                   bin|games|include|
++                                   lib|lib32|lib64|
++                                   local|sbin|share|
++                                   src|spool|tmp)/,x ) {
+               tag "non-standard-dir-in-usr", "$file";
+           } elsif ( $file =~ m,^usr/share/doc, ) {
+               tag "uses-FHS-doc-dir", "$file";
+@@ -368,7 +405,7 @@
+     }
+     # ---------------- FHS directory?
+     elsif ($file =~ m,^[^/]+/$, and $file ne './' and
+-         $file !~ m,^(bin|boot|dev|etc|home|lib|mnt|opt|root|sbin|tmp|usr|var)/,) { # Make an exception for the base-files package here, because it
++         $file !~ m,^(bin|boot|dev|etc|home|lib(64|32)?|mnt|opt|root|sbin|tmp|usr|var)/,) { # Make an exception for the base-files package here, because it
+       # installs a slew of top-level directories for setting up the
+       # base system.  (Specifically, /cdrom, /floppy, /initrd, and /proc
+       # are not mentioned in the FHS).
+@@ -380,7 +417,7 @@
+     # ---------------- compatibility symlinks should not be used
+     if ($file =~ m,^usr/(spool|tmp)/, or
+-      $file =~ m,^usr/(doc|bin|lib|include)/X11/, or
++      $file =~ m,^usr/(doc|bin)/X11/, or
+       $file =~ m,^var/adm/,) {
+       tag "use-of-compat-symlink", "$file";
+     }
+@@ -393,8 +430,10 @@
+     # ---------------- any files
+     if ($perm !~ m/^d/) {
+       unless ($type eq 'udeb' or
+-              $file =~ m,^usr/(bin|dict|doc|games|include|info|lib|man|sbin|share|src|X11R6)/, or
+-              $file =~ m,^lib/(modules/|libc5-compat/)?, or
++              $file =~ m,^usr/(bin|dict|doc|games|
++                               include|info|lib(32|64)?|
++                               man|sbin|share|src|X11R6)/,x or
++              $file =~ m,^lib(32|64)?/(modules/|libc5-compat/)?, or
+               $file =~ m,^var/(games|lib|www|named)/, or
+               $file =~ m,^(bin|boot|dev|etc|sbin)/, or
+               # non-FHS, but still usual
+@@ -449,7 +488,7 @@
+       # because a package had a HTML form for licenses called like that.
+       # Another exception is made for various picture formats since
+       # those are likely to just be simply pictures.
+-      and not $file =~ m/\.(el|c|h|py|cc|pl|pm|html|php|xpm|png)$/
++      and not $file =~ m/\.(el|c|h|py|cc|pl|pm|html|php|xpm|png|jpe?g|gif|svg)$/
+         and not defined $link) {
+       tag "extra-license-file", "$file";
+     }
+@@ -468,11 +507,21 @@
+           tag "cvsignore-file-in-package", "$file";
+       }
++      # ---------------- arch-inventory files
++      if ($file =~ m/\.arch-inventory$/) {
++          tag "arch-inventory-file-in-package", "$file";
++      }
++
+       # ---------------- subversion commit message backups
+       if ($file =~ m/svn-commit.*\.tmp$/) {
+           tag "svn-commit-file-in-package", "$file";
+       }
++      # ---------------- executables with language extensions
++      if ($file =~ m,^(usr/)?(s?bin|games)/[^/]+\.(pl|sh|py)$,) {
++          tag "script-with-language-extension", "$file";
++      }
++
+       # ---------------- general: setuid/setgid files!
+       if ($perm =~ m/s/) {
+           my ($setuid, $setgid) = ("","");
+@@ -486,14 +535,11 @@
+           $setuid = $user if ($operm & 04000);
+           $setgid = $group if ($operm & 02000);
+-          $wanted_operm = 0755;
+-
+           # 1st special case: program is using svgalib:
+           if (exists $linked_against_libvga{$file}) {
+               # setuid root is ok, so remove it
+               if ($setuid eq 'root') {
+                   undef $setuid;
+-                  $wanted_operm |= 04000;
+               }
+           }
+@@ -502,25 +548,30 @@
+               # setgid games is ok, so remove it
+               if ($setgid eq 'games') {
+                   undef $setgid;
+-                  $wanted_operm |= 02000;
+               }
+           }
+-          #allow anything with suid in the name
++          # 3rd special case: allow anything with suid in the name
+           if ($pkg =~ m,-suid,) {
+               undef $setuid;
+-              $wanted_operm |= 04000;
+           }
++          # Check for setuid and setgid that isn't expected.
+           if ($setuid and $setgid) {
+               tag "setuid-gid-binary", $file, sprintf("%04o $owner",$operm);
+           } elsif ($setuid) {
+               tag "setuid-binary", $file, sprintf("%04o $owner",$operm);
+           } elsif ($setgid) {
+               tag "setgid-binary", $file, sprintf("%04o $owner",$operm);
+-          } elsif ($operm != $wanted_operm) {
+-              tag "non-standard-executable-perm",
+-                  sprintf("$file %04o != %04o",$operm,$wanted_operm);
++          }
++
++          # Check for permission problems other than the setuid status.
++          if (($operm & 0444) != 0444) {
++              tag "executable-is-not-world-readable", $file,
++                  sprintf("%04o",$operm);
++          } elsif ($operm != 04755 && $operm != 02755 && $operm != 06755 && $operm != 04754) {
++              tag "non-standard-setuid-executable-perm", $file,
++                  sprintf("%04o",$operm);
+           }
+       }
+       # ---------------- general: executable files
+@@ -528,14 +579,17 @@
+           # executable
+           if ($owner =~ m,root/games,) {
+               if ($operm != 2755) {
+-                  tag "non-standard-executable-perm", $file,
++                  tag "non-standard-game-executable-perm", $file,
+                       sprintf("%04o != 2755",$operm);
+               }
+           } else {
+-              if ($operm != 0755) {
++              if (($operm & 0444) != 0444) {
++                  tag "executable-is-not-world-readable", $file,
++                      sprintf("%04o != 0755",$operm);
++              } elsif ($operm != 0755) {
+                   tag "non-standard-executable-perm", $file,
+                       sprintf("%04o != 0755",$operm);
+-              }
++              }
+           }
+       }
+       # ---------------- general: normal (non-executable) files
+@@ -549,6 +603,8 @@
+               # Ada library information files should be read-only
+               # since GNAT behaviour depends on that
+               # everything is ok
++          } elsif ($operm == 0600 and $file =~ m,etc/backup.d/,) {
++              # backupninja expects configurations files to be 0600
+           } elsif ($operm != 0644) {
+               tag "non-standard-file-perm", $file,
+                   sprintf("%04o != 0644",$operm);
+@@ -574,6 +630,13 @@
+       if ($file =~ m,/\.svn/?$,) {
+           tag "package-contains-svn-control-dir", "$file";
+       }
++      if ($file =~ m,/\.bzr/?$,) {
++          tag "package-contains-bzr-control-dir", "$file";
++      }
++      if (($file =~ m,/\.arch-ids/?$,)
++          || ($file =~ m,/\{arch\}/?$,)) {
++          tag "package-contains-arch-control-dir", "$file";
++      }
+       if ($file =~ m,/.xvpics/?$,) {
+           tag "package-contains-xvpics-dir", "$file";
+       }
+diff -urNad lintian-1.23.8/checks/files.desc lintian-1.23.21/checks/files.desc
+--- lintian-1.23.8/checks/files.desc   2005-01-14 21:34:51.000000000 +0000
++++ lintian-1.23.21/checks/files.desc  2006-07-18 11:44:07.000000000 +0000
+@@ -1,7 +1,7 @@
+ Check-Script: files
+ Author: Christian Schwarz <schwarz@debian.org>
+ Abbrev: fil
+-Standards-Version: 3.5.0
++Standards-Version: 3.7.0
+ Type: binary, udeb
+ Unpack-Level: 1
+ Needs-Info: objdump-info, scripts
+@@ -23,22 +23,55 @@
+  this prevents X from replacing it with a compatability symlink.
+ Ref: policy 11.8.6
+-Tag: package-installs-file-to-usr-something-x11
++Tag: package-installs-font-to-usr-x11r6
+ Type: error
+-Info: Packages must not provide or install files into the directories 
+- /usr/bin/X11/, /usr/include/X11/ or /usr/lib/X11/.
++Info: The standard location for X fonts has moved to /usr/share/fonts/X11.
++ Packages providing X fonts must install them into the new path.  Fonts
++ installed into the old /usr/X11R6/lib/X11/fonts path may not be seen by
++ the X server.
++ .
++ If the package uses imake, it must build-depend on xutils-dev (>=
++ 1:1.0.2-2) for the correct paths. If it uses dh_installxfonts to handle X
++ font installation, it must build-depend on debhelper (>= 5.0.31).
++Ref: policy 11.8.5
++
++Tag: package-installs-file-to-usr-x11r6-bin
++Type: error
++Info: Debian has switched to the modular X tree which now uses the regular
++ FHS paths, and all packages must follow. All packages installing binaries
++ must install them into /usr/bin (or some other appropriate location)
++ instead of /usr/X11R6/bin.
++ .
++ The x11-common package attempts to change /usr/X11R6/bin into a symlink
++ to /usr/bin, so if this migration has already occurred, a package
++ installing files into /usr/X11R6/bin may appear to install
++ successfully. However, such a package will be left in an inconsistent
++ state and may orphan files when the compatibility link goes away.
++ .
++ If the package uses imake, it must build-depend on xutils-dev (>=
++ 1:1.0.2-2) for the correct paths.
+ Ref: policy 11.8.7
+-Tag: packages-installs-file-to-usr-x11r6
+-Type: warning
++Tag: file-in-usr-something-x11-without-pre-depends
++Type: error
++Info: Packages that install files into /usr/include/X11 or /usr/lib/X11
++ must pre-depend on at least x11-common (>= 1:7.0.0).  These directories
++ used to be symlinks and installing files in them while they are still
++ symlinks will put files in the wrong locations and cause stranded files
++ and other problems.  x11-common is responsible for converting the
++ symlinks to regular directories.
++Ref: policy 11.8.7
++
++Tag: package-installs-file-to-usr-x11r6
++Type: error
+ Info: Packages using the X Window System should not be configured to install
+- files under the /usr/X11R6/ directory unless they use imake. The /usr/X11R6/
+- directory hierarchy should be regarded as deprecated for all packages except
+- the X Window System itself.
++ files under the /usr/X11R6/ directory. Debian has switched to the modular
++ X tree which now uses regular FHS paths and all packages should follow.
+  .
+- Programs that use GNU autoconf and automake are usually easily configured at
+- compile time to use /usr/ instead of /usr/X11R6/, and this should be done
+- whenever possible.
++ Programs that use GNU autoconf and automake are usually easily configured
++ at compile time to use /usr/ instead of /usr/X11R6/.  Packages that use
++ imake must build-depend on xutils-dev (>= 1:1.0.2-2) for the correct
++ paths.
+ Ref: policy 11.8.7
+ Tag: config-file-reserved $file
+@@ -57,19 +90,18 @@
+ Type: error
+ Info: As of policy version 3.0.0.0, Debian no longer follows the FSSTND.  
+  .
+- Instead, the Filesystem Hierarchy Standard (FHS), version 2.1, is
++ Instead, the Filesystem Hierarchy Standard (FHS), version 2.3, is
+  used. You can find it in /usr/share/doc/debian-policy/fhs/ .
+ Tag: FSSTND-dir-in-var
+ Type: error
+ Info: As of policy version 3.0.0.0, Debian no longer follows the FSSTND.  
+  .
+- Instead, the Filesystem Hierarchy Standard (FHS), version 2.1, is
++ Instead, the Filesystem Hierarchy Standard (FHS), version 2.3, is
+  used. You can find it in /usr/share/doc/debian-policy/fhs/ .
+ Tag: package-installs-into-etc-rc.d
+ Type: error
+-Severity: Important
+ Info: The package installs files into the <tt>/etc/rc.d</tt> or
+  <tt>/etc/rc?.d</tt> which is not allowed.
+ Ref: policy 9.3.3
+@@ -95,23 +127,27 @@
+ Tag: file-in-usr-local
+ Type: error
+-Severity: Important
+ Info: The package installs a file in <tt>/usr/local/...</tt> which is
+  not allowed.
+ Ref: policy 9.1.2
+ Tag: file-in-opt
+ Type: error
+-Severity: Important
+ Info: The package installs a file in <tt>/opt/...</tt> which is not allowed.
++Tag: stray-directory-in-manpage-directory
++Type: error
++Info: This package installs a directory under <tt>/usr/share/man</tt> or
++ <tt>/usr/X11R6/man</tt> that isn't a manual section directory or locale
++ directory.
++Ref: fhs 4.11.5
++
+ Tag: executable-manpage
+ Type: error
+ Info: Manual pages are not meant to be executed.
+ Tag: dir-in-usr-local
+ Type: error
+-Severity: Important
+ Info: The package installs a directory in <tt>/usr/local/...</tt> which is
+  not allowed.
+  .
+@@ -134,40 +170,68 @@
+ Type: warning
+ Info: The directory has a mode different from 0755, and it's not one of the
+  known exceptions.
++Ref: policy 10.9
+-Tag: non-standard-game-executable-perm
++Tag: executable-is-not-world-readable
+ Type: warning
+-Info: The file has a mode different from 2755 or 0755. In some cases this 
+- is intentional, but in other cases this is a bug.
++Info: All executabless should be readable by any user.  Since anyone can
++ download the Debian package and obtain a copy of the executable, no
++ security is gained by making the executable unreadable even for setuid
++ binaries.  If only members of a certain group may execute this file,
++ remove execute permission for world, but leave read permission.
++Ref: policy 10.9
+ Tag: non-standard-executable-perm
+ Type: warning
+-Info: The file has a mode different from 0755. In some cases this is
+- intentional, but in other cases this is a bug.
++Info: Executables that are not setuid or setgid should always have a mode
++ of 0755.  Since anyone can obtain the executable by downloading the
++ Debian package and extracting it, restricting access serves little
++ purpose.
++Ref: policy 10.9
++
++Tag: non-standard-game-executable-perm
++Type: warning
++Info: The file is owned by the games group but is not mode 2755.  If a
++ game does not have to be setgid games, it should be owned by the root
++ group like any other executable.  This executable is either owned by the
++ wrong group or is not setgid when it should be.
++
++Tag: non-standard-setuid-executable-perm
++Type: warning
++Info: The file is setuid or setgid and has a mode different from any of
++ 2755, 4755, 4754, or 6755.  Any other permissions on setuid executables
++ is probably a bug.  In particular, removing root write privileges serves
++ no purpose, group-writable setuid or setgid executables are probably bad
++ ideas, and setgid executables that are not world-executable serve little
++ purpose.
++Ref: policy 10.9
+ Tag: setuid-binary
+ Type: warning
+-Info: The file is tagged SETUID. In some cases this is
+- intentional, but in other cases this is a bug.
++Info: The file is tagged SETUID. In some cases this is intentional, but in
++ other cases this is a bug. If this is intentional, please add a lintian
++ override to document this fact.
+ Tag: setgid-binary
+ Type: warning
+-Info: The file is tagged SETGID. In some cases this is
+- intentional, but in other cases this is a bug.
++Info: The file is tagged SETGID. In some cases this is intentional, but in
++ other cases this is a bug. If this is intentional, please add a lintian
++ override to document this fact.
+ Tag: setuid-gid-binary
+ Type: warning
+ Info: The file is tagged SETUID and SETGID. In some cases this is
+- intentional, but in other cases this is a bug.
++ intentional, but in other cases this is a bug. If this is intentional,
++ please add a lintian override to document this fact.
+ Tag: non-standard-file-perm
+ Type: warning
+ Info: The file has a mode different from 0644. In some cases this is
+  intentional, but in other cases this is a bug.
++Ref: policy 10.9
+ Tag: special-file
+ Type: error
+-Severity: Important
+ Info: The package contains a <i>special</i> file (e.g., a device file).
+  This is forbidden by current policy. If your program needs this device,
+  you should create it by calling <tt>makedev</tt> from the postinst
+@@ -434,6 +498,18 @@
+  accident, since Subversion version control directories usually don't belong
+  in packages.
++Tag: package-contains-bzr-control-dir
++Type: warning
++Info: Package contains a .bzr directory. It was most likely installed by
++ accident, since bazaar-ng version control directories usually don't belong
++ in packages.
++
++Tag: package-contains-arch-control-dir
++Type: warning
++Info: Package contains a {arch} or .arch-ids directory. It was most likely
++ installed by accident, since Arch version control directories usually don't
++ belong in packages.
++
+ Tag: package-contains-xvpics-dir
+ Type: error
+ Info: Package contains a .xvpics directory. It was most likely installed by
+@@ -444,6 +520,11 @@
+ Info: Package contains a '.cvsignore' file.  It may have been installed by
+  accident.
++Tag: arch-inventory-file-in-package
++Type: warning
++Info: Package contains a '.arch-inventory' file.  It may have been installed by
++ accident.
++
+ Tag: svn-commit-file-in-package
+ Type: warning
+ Info: Package contains a 'svn-commit(.NNN).tmp' file.  This file is almost
+@@ -495,3 +576,22 @@
+  files that are intended to create a menu should be placed in 
+  <tt>/usr/share/applications/</tt>, and no longer in
+  <tt>/usr/share/gnome/apps</tt> or <tt>/usr/share/applnk</tt>
++
++Tag: file-in-usr-lib-cgi-bin
++Type: warning
++Info: Packages shipping web server CGI files should install them in
++ <tt>/usr/lib/cgi-lib</tt>, not in <tt>/usr/lib/cgi-bin</tt>.  This is
++ done to avoid conflicts with the cgi-bin script alias, which is reserved
++ for the local use of webmasters.  Web servers should include /cgi-lib/ as
++ a standard ScriptAlias pointing to that directory.
++Ref: policy 11.5
++
++Tag: script-with-language-extension
++Type: warning
++Info: When scripts are installed into a directory in the system PATH, the
++ script name should not include an extension such as <tt>.sh</tt> or
++ <tt>.pl</tt> that denotes the scripting language currently used to
++ implement it.  The implementation language may change; if it does,
++ leaving the name the same would be confusing and changing it would be
++ disruptive.
++Ref: policy 10.4
+diff -urNad lintian-1.23.8/checks/infofiles lintian-1.23.21/checks/infofiles
+--- lintian-1.23.8/checks/infofiles    2004-05-11 23:31:10.000000000 +0000
++++ lintian-1.23.21/checks/infofiles   2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# infofiles -- lintian check script
++# infofiles -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz
+ # Copyright (C) 2001 Josip Rodin
+@@ -16,8 +16,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::infofiles;
+ use strict;
+@@ -116,7 +116,8 @@
+     tag "install-info-not-called-with-quiet-option", ""
+       unless $postinst{'calls-install-info-quiet'};
+     tag "install-info-not-called-with-section-option", ""
+-      unless $postinst{'calls-install-info-section'};
++      unless ( $postinst{'calls-install-info-section'}
++               || $postinst{'calls-install-info-remove'} ) ;
+ }
+ if ($prerm{'calls-install-info'}) {
+     # it must use the --quiet option
+@@ -175,6 +176,8 @@
+                   $pres->{'calls-install-info-quiet'} = 1;
+               } elsif ($piece eq '--section') {
+                   $pres->{'calls-install-info-section'} = 1;
++              } elsif ($piece eq '--remove') {
++                  $pres->{'calls-install-info-remove'} = 1;
+               }
+           }
+       }
+diff -urNad lintian-1.23.8/checks/init.d lintian-1.23.21/checks/init.d
+--- lintian-1.23.8/checks/init.d       2004-10-12 22:16:58.000000000 +0000
++++ lintian-1.23.21/checks/init.d      2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# init.d -- lintian check script
++# init.d -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::init_d;
+ use strict;
+@@ -38,12 +38,18 @@
+ my %initd_postrm;
+ my %conffiles;
++my $opts_r = qr/-\S+\s*/;
++my $name_r = qr/[\w.-]+/;
++my $action_r = qr/\w+/;
++my $exclude_r = qr/if\s+\[\s+-x\s+\S*update-rc\.d/;
++
+ # read postinst control file
+ if (open(IN,$postinst)) {
+     while (<IN>) {
+-      next if m/if\s+\[\s+-x\s+\S*update-rc\.d/o;
++      next if /$exclude_r/o;
+       s/\#.*$//o;
+-      next unless /^(?:.+;)?\s*update-rc\.d\s+(?:-\S+\s*)*(\S+)\s+(\S+)/;
++      next unless /^(?:.+;)?\s*update-rc\.d\s+
++          (?:$opts_r)*($name_r)\s+($action_r)/xo;
+       my ($name,$opt) = ($1,$2);
+       next if $opt eq 'remove';
+       if ($initd_postinst{$name}++ == 1) {
+@@ -60,9 +66,9 @@
+ # read preinst control file
+ if (open(IN,$preinst)) {
+     while (<IN>) {
+-      next if m/if\s+\[\s+-x\s+\S*update-rc\.d/o;
++      next if /$exclude_r/o;
+       s/\#.*$//o;
+-      next unless m/update-rc\.d\s+(?:-\S+\s*)*(\S+)\s+(\S+)/o;
++      next unless m/update-rc\.d\s+(?:$opts_r)*($name_r)\s+($action_r)/o;
+       my ($name,$opt) = ($1,$2);
+       next if $opt eq 'remove';
+       tag "preinst-calls-updaterc.d", "$name";
+@@ -73,9 +79,9 @@
+ # read postrm control file
+ if (open(IN,$postrm)) {
+     while (<IN>) {
+-      next if m/if\s+\[\s+-x\s+\S*update-rc\.d/o;
++      next if /$exclude_r/o;
+       s/\#.*$//o;
+-      next unless m/update-rc\.d\s+(-\S+\s*)*(\S+)/;
++      next unless m/update-rc\.d\s+($opts_r)*($name_r)/o;
+       if ($initd_postrm{$2}++ == 1) {
+           tag "duplicate-updaterc.d-calls-in-postrm", "$2";
+           next;
+@@ -90,9 +96,9 @@
+ # read prerm control file
+ if (open(IN,$prerm)) {
+     while (<IN>) {
+-      next if m/if\s+\[\s+-x\s+\S*update-rc\.d/o;
++      next if /$exclude_r/o;
+       s/\#.*$//o;
+-      next unless m/update-rc\.d\s+(-\S+\s*)*(\S+)/;
++      next unless m/update-rc\.d\s+($opts_r)*($name_r)/o;
+       tag "prerm-calls-updaterc.d", "$2";
+     }
+     close(IN);
+diff -urNad lintian-1.23.8/checks/manpages lintian-1.23.21/checks/manpages
+--- lintian-1.23.8/checks/manpages     2004-12-25 23:40:20.000000000 +0000
++++ lintian-1.23.21/checks/manpages    2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# manpages -- lintian check script
++# manpages -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::manpages;
+ use strict;
+@@ -200,8 +200,8 @@
+           my ($i, $first) = (0, "");
+           do {
+               $first = $manfile[$i++] || ""; 
+-          } while ($first =~ /^\.\\"/ && $manfile[$i]);
+-          
++          } while ($first =~ /^\.\\"/ && $manfile[$i]); #");
++
+           unless ($first) {
+               tag "empty-manual-page", "$file";
+           } elsif ($first =~ /^\.so\s+(.+)?$/) {
+@@ -235,10 +235,49 @@
+       # negatives. When man-db is fixed, this limitation should be
+       # removed.
+       if ($path =~ m,/man/man\d/,) {
+-          if (system("lexgrog unpacked/\Q$file\E >/dev/null 2>&1")) {
+-              tag "manpage-has-bad-whatis-entry", "$file";
++          if (system_env("lexgrog unpacked/\Q$file\E >/dev/null 2>&1")) {
++              tag "manpage-has-bad-whatis-entry", "$file";
+           }
+       }
++      # If it's not a .so link, run it through "man" to check for errors.
++      # If it is in a directory with the standard man layout, cd to the
++      # parent directory before running man so that .so directives are
++      # processed properly.  (Yes, there are man pages that include other
++      # pages with .so but aren't simple links; rbash, for instance.)
++      my $cmd;
++      if ($file =~ m,^(.*)/(man\d/.*)$,) {
++          $cmd = "cd unpacked/\Q$1\E && man -l \Q$2\E";
++      } else {
++          $cmd = "man -l unpacked/\Q$file\E";
++      }
++      my $pid = open MANERRS, '-|';
++      if (not defined $pid) {
++          fail("cannot run man -l: $!");
++      } elsif ($pid == 0) {
++          my %newenv = (LANG => 'C', PATH => $ENV{PATH});
++          undef %ENV;
++          %ENV = %newenv;
++          exec "($cmd >/dev/null) 2>&1"
++              or fail("cannot run man -l: $!");
++      }
++      while (<MANERRS>) {
++          # ignore progress information from man
++          next if /^Reformatting/;
++          next if /^\s*$/;
++          # ignore errors from gzip, will be dealt with at other places
++          next if /^(man|gzip)/;
++          # ignore 8bit character errors on localized man pages
++          if ($lang ne "") {
++              next if /warning: can\'t find numbered character/;
++              next if /warning \[.*\]: cannot adjust line/;
++              next if /warning \[.*\]: can\'t break line/;
++          }
++          chomp;
++          s/^[^:]+://o;
++          tag "manpage-has-errors-from-man", "$file", "$_";
++          last;
++      }
++      close(MANERRS);
+       # Now we search through the whole man page for some common errors
+       my $lc = 0;
+       my $hc = 0;
+@@ -248,7 +287,7 @@
+           next if $line =~ /^\.\\\"/o; # comments .\"
+           if ($line =~ /^\.TH\s/) { # header
+               require Text::ParseWords;
+-              my ($th_command, $th_title, $th_section, $th_date ) = 
++              my ($th_command, $th_title, $th_section, $th_date ) =
+                   Text::ParseWords::parse_line( '\s+', 0, $line);
+               if ($th_section && (lc($fn_section) ne lc($th_section))) {
+                   tag "manpage-section-mismatch", "$file:$lc $fn_section != $th_section";
+diff -urNad lintian-1.23.8/checks/manpages.desc lintian-1.23.21/checks/manpages.desc
+--- lintian-1.23.8/checks/manpages.desc        2004-12-25 23:40:20.000000000 +0000
++++ lintian-1.23.21/checks/manpages.desc       2006-07-18 11:44:07.000000000 +0000
+@@ -9,7 +9,6 @@
+ Tag: bad-link-to-undocumented-manpage
+ Type: error
+-Severity: Important
+ Info: The symbolic link should reference
+  `<tt>../man[237]/undocumented.[237].gz</tt>' for manual pages in
+  <tt>/usr/share/man</tt> or
+@@ -95,6 +94,27 @@
+  See also groff_man(7) and groff_mdoc(7) for general information on writing
+  manual pages.
++Tag: manpage-has-errors-from-man
++Type: warning
++Info: This man page provokes warnings or errors from man.
++ .
++ "cannot adjust" or "can't break" are trouble with paragraph filling,
++ usually related to long lines.  Adjustment can be helped by left
++ justifying, breaks can be helped with hyphenation, see "Manipulating
++ Filling and Adjusting" and "Manipulating Hyphenation" in the manual.
++ .
++ "can't find numbered character" usually means latin1 etc in the input, and
++ this warning indicates characters will be missing from the output.  You can
++ change to escapes like \[:a] described on the groff_char man page.
++ .
++ Other warnings are often formatting typos, like missing quotes around a
++ string argument to .IP.  These are likely to result in lost or malformed
++ output.  See the groff_man (or groff_mdoc if using mdoc) man page for
++ information on macros.
++ .
++ At worst, warning messages can be disabled with the .warn directive, see
++ "Debugging" in the groff manual.
++
+ Tag: manpage-for-x11-binary-in-wrong-directory
+ Type: error
+ Info: Manual pages for binaries which are located in <tt>/usr/X11R6/bin</tt>
+diff -urNad lintian-1.23.8/checks/nmu lintian-1.23.21/checks/nmu
+--- lintian-1.23.8/checks/nmu  2004-10-12 21:22:43.000000000 +0000
++++ lintian-1.23.21/checks/nmu 2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# nmu -- lintian check script
++# nmu -- lintian check script -*- perl -*-
+ # Copyright (C) 2004 Jeroen van Wolffelaar
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::nmu;
+ use strict;
+@@ -31,6 +31,15 @@
+ my $changelog_mentions_qa = 0;
+ my $uploader = undef;
++# This isn't really an NMU check, but right now no other check looks at
++# debian/changelog in source packages.  Catch a debian/changelog file that's a
++# symlink.  If it was a symlink to a file we didn't unpack, bail rather than
++# abort.
++if (-l "debfiles/changelog") {
++    tag "changelog-is-symlink", "";
++    return 0 unless -f "debfiles/changelog";
++}
++
+ open CHANGELOG, "debfiles/changelog" or fail("Failed opening changelog");
+ <CHANGELOG>;
+ my $firstline = 1;
+diff -urNad lintian-1.23.8/checks/nmu.desc lintian-1.23.21/checks/nmu.desc
+--- lintian-1.23.8/checks/nmu.desc     2005-01-26 12:01:32.000000000 +0000
++++ lintian-1.23.21/checks/nmu.desc    2006-07-18 11:44:07.000000000 +0000
+@@ -49,3 +49,14 @@
+  Maybe you didn't intend this upload to be a NMU, in that case, please
+  doublecheck that the most recent entry in the changelog is byte-for-byte
+  identical to the maintainer or one of the uploaders.
++
++Tag: changelog-is-symlink
++Type: warning
++Info: The file <tt>debian/changelog</tt> is a symlink instead of a regular
++ file. This is unnecessary and makes package checking and manipulation
++ more difficult. If the changelog should be available in the source
++ package under multiple names, make <tt>debian/changelog</tt> the real
++ file and the other names symlinks to it.
++ .
++ This problem may have prevented lintian from performing other checks,
++ leading to undetected changelog errors.
+diff -urNad lintian-1.23.8/checks/scripts lintian-1.23.21/checks/scripts
+--- lintian-1.23.8/checks/scripts      2005-01-14 17:19:55.000000000 +0000
++++ lintian-1.23.21/checks/scripts     2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# scripts -- lintian check script
++# scripts -- lintian check script -*- perl -*-
+ #
+ # This is probably the right file to add a check for the use of
+ # set -e in bash and sh scripts.
+@@ -19,8 +19,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::scripts;
+ use strict;
+@@ -40,21 +40,27 @@
+                         'csh' => '/bin/csh',
+                         'dash' => '/bin/dash',
+                         'expect' => '/usr/bin/expect',
++                        'expectk' => '/usr/bin/expectk',
++                        'fish' => '/usr/bin/fish',
+                         'gawk' => '/usr/bin/gawk',
++                        'gbx' => '/usr/bin/gbx',
++                        'gbx2' => '/usr/bin/gbx2',
+                         'gforth' => '/usr/bin/gforth',
+                         'gnuplot' => '/usr/bin/gnuplot',
+                         'guile' => '/usr/bin/guile',
+-                        'install-fvwmgenmenu' => '/usr/sbin/install-fvwmgenmenu',
+-                        'install-menu' => '/usr/sbin/install-menu',
++                        'install-menu' => '/usr/bin/install-menu',
+                         'js' => '/usr/bin/js',
+                         'kforth' => '/usr/bin/kforth',
+                         'ksh' => '/bin/ksh',
++                        'lefty' => '/usr/bin/lefty',
++                        'lua50' => '/usr/bin/lua50',
+                         'magicfilter' => '/usr/sbin/magicfilter',
+                         'make' => '/usr/bin/make',
+                         'mawk' => '/usr/bin/mawk',
+                         'nawk' => '/usr/bin/nawk',
+                         'ocaml' => '/usr/bin/ocamlrun',
+                         'ocamlrun' => '/usr/bin/ocamlrun',
++                        'parrot' => '/usr/bin/parrot',
+                         'perl' => '/usr/bin/perl',
+                         'perl-5.005' => '/usr/bin/perl-5.005',
+                         'perl-5.004' => '/usr/bin/perl-5.004',
+@@ -70,6 +76,7 @@
+                         'python2.2' => '/usr/bin/python2.2',
+                         'python2.3' => '/usr/bin/python2.3',
+                         'python2.4' => '/usr/bin/python2.4',
++                        'python2.5' => '/usr/bin/python2.5',
+                         'rexx' => '/usr/bin/rexx',
+                         'regina' => '/usr/bin/regina',
+                         'rc' => '/usr/bin/rc',
+@@ -82,6 +89,8 @@
+                         'scsh' => '/usr/bin/scsh',
+                         'sed' => '/bin/sed',
+                         'sh' => '/bin/sh',
++                        'slsh' => '/usr/bin/slsh',
++                        'speedy' => '/usr/bin/speedy',
+                         'tcl' => '/usr/bin/tcl',
+                         'tclsh' => '/usr/bin/tclsh',
+                         'tclsh8.3' => '/usr/bin/tclsh8.3',
+@@ -94,7 +103,7 @@
+                         'wish8.3' => '/usr/bin/wish8.3',
+                         'wish8.4' => '/usr/bin/wish8.4',
+                         'yforth' => '/usr/bin/yforth',
+-                        'zsh' => '/usr/bin/zsh'
++                        'zsh' => '/bin/zsh'
+                        );
+ my %interpreter_dependencies = (
+@@ -104,17 +113,24 @@
+                               'csh' => 'c-shell',
+                               'dash' => 'dash',
+                               'expect' => 'expect',
++                              'expectk' => 'expectk',
++                              'fish' => 'fish',
+                               'gawk' => 'gawk',
++                              'gbx' => 'gambas-runtime',
++                              'gbx2' => 'gambas2-runtime',
+                               'gforth' => 'gforth',
+                               'gnuplot' => 'gnuplot',
+                               'guile' => 'guile',
+                               'js' => 'ngs-js',
+                               'kforth' => 'kforth',
+                               'ksh' => 'pdksh',
++                              'lefty' => 'graphviz',
++                              'lua50' => 'lua50',
+                               'magicfilter' => 'magicfilter',
+-                              'make' => 'make',
++                              'make' => 'make,build-essential',
+                               'mawk' => 'mawk',
+                               'ocaml' => 'ocaml',
++                              'parrot' => 'parrot',
+                               'perl-5.005' => 'perl-5.005',
+                               'perl-5.004' => 'perl-5.004',
+                               'pforth' => 'pforth',
+@@ -129,7 +145,9 @@
+                               'runhugs1.4' => 'hugs',
+                               'runhugs98' => 'hugs98',
+                               'scsh' => 'scsh',
+-                              'tcl' => 'tcl',
++                              'slsh' => 'slsh',
++                              'speedy' => 'speedy-cgi-perl',
++                              'tcl' => 'tclx8.3',
+                               'tclsh' => 'tclsh',
+                               'tclsh8.3' => 'tcl8.3',
+                               'tclsh8.4' => 'tcl8.4',
+@@ -140,6 +158,16 @@
+                               'zsh' => 'zsh'
+                              );
++# Appearance of one of these regexes in a maintainer script means that there
++# must be a dependency (or pre-dependency) on the given package.  The tag
++# reported is maintainer-script-needs-depends-on-%s, so be sure to update
++# scripts.desc when adding a new rule.
++my @depends_needed = (
++        [ adduser => '\badduser\b' ],
++        [ netbase => '\bupdate-inetd\b' ],
++        [ ucf => '\bucf\s' ],
++);
++
+ my %executable = ();
+ my %suid = ();
+ my %ELF = ();
+@@ -231,7 +259,8 @@
+       unless ($executable{$filename} or
+               $filename =~ m,usr/(lib|share)/.*\.pm, or
+               $filename =~ m,\.in$, or
+-              $filename =~ m,etc/menu-methods,);
++              $filename =~ m,etc/menu-methods, or
++              $filename =~ m,etc/X11/Xsession.d,);
+     if (exists $valid_interpreters{$base}) {
+       unless ($interpreter eq $valid_interpreters{$base} or
+@@ -240,27 +269,33 @@
+           if ($base =~ /^(ruby|python)(?:\d\.\d)?$/) {
+               tag_error("wrong-path-for-$1", $filename, "#!$interpreter");
+           } else {
+-              tag_error("wrong-path-for-$base", $filename, "#!$interpreter");
++              tag_error("wrong-path-for-interpreter",
++                        "#!$interpreter != $valid_interpreters{$base}",
++                        "($filename)");
+           }
+       }
+-      
++
+       # Do not complain about dependencies for non-executable scripts.
+       if ($executable{$filename}) {
+           if (exists $interpreter_dependencies{$base}) {
+-              my $dep = $interpreter_dependencies{$base};
+-              tag_error("$base-script-but-no-$dep-dep", $filename)
+-                  unless ($deps{$dep});
++              my @deps = split(/,/,$interpreter_dependencies{$base});
++              if ($base =~ /^(php\d?|(m|g)awk)/) {
++                  tag_error("$base-script-but-no-$deps[0]-dep", $filename)
++                      unless (scalar map { $deps{$_}?$_:() } @deps);
++              } else {
++                  tag_error("missing-dep-for-interpreter",
++                            "$base => $deps[0]", "($filename)")
++                      unless (scalar map { $deps{$_}?$_:() } @deps);
++              }
+           } elsif ($base =~ /^python(\d.\d)?$/) {
+               my $ver = $1 ? $1 : "";
+               tag_error("python-script-but-no-python-dep", $filename)
+-                  unless ($deps{"python$ver"});
++                  unless ($deps{"python$ver"}
++                          || $deps{"python${ver}-minimal"});
+           } elsif ($base =~ /^ruby(\d.\d)?$/) {
+               my $ver = $1 ? $1 : "";
+               tag_error("ruby-script-but-no-ruby-dep", $filename)
+                   unless ($deps{"ruby$ver"});
+-            } elsif ($base eq 'pike') {
+-                tag_error("pike-script-but-no-pike-dep", $filename)
+-                    unless ($deps{'pike'} or $deps{'pike7'});
+           } elsif ($base eq 'perl' && $suid{$filename}) {
+               tag_error("suid-perl-script-but-no-perl-suid-dep", $filename)
+                   unless ($deps{'perl-suid'});
+@@ -293,10 +328,15 @@
+     tag_warn("csh-considered-harmful", $filename)
+         if (($base eq 'csh' or $base eq 'tcsh') and $executable{$filename});
++    # Don't syntax-check scripts in /usr/src that end in .dpatch.  bash -n
++    # doesn't stop checking at exit 0 and goes on to blow up on the patch
++    # itself.
+     if ($base =~ /^(?:(?:b|d)?a|k|z)?sh$/) {
+       if (-x "$interpreter" && ! script_is_evil_and_wrong("unpacked/$filename")) {
+-          if (system("$interpreter -n unpacked/$filename >/dev/null 2>&1")) {
+-              tag_error("shell-script-fails-syntax-check", $filename);
++          if ($filename !~ m,^./usr/src/.*\.dpatch$,) {
++              if (check_script_syntax($interpreter, "unpacked/$filename")) {
++                  tag_error("shell-script-fails-syntax-check", $filename);
++              }
+           }
+       }
+       next;
+@@ -350,10 +390,10 @@
+                   or $base eq 'perl');
+       
+       if (exists $interpreter_dependencies{$base}) {
+-          my $dep = $interpreter_dependencies{$base};
++          my @deps = split(/,/,$interpreter_dependencies{$base});
+           tag_error("interpreter-without-predep", $filename,
+                     "#!$interpreter")
+-              unless (exists $deps{$dep} and $deps{$dep} eq 'pre-depends');
++              unless (scalar map { ($deps{$_} && $deps{$_} eq 'pre-depends')?$_:() } @deps);
+       } elsif ($base eq 'python') {
+           tag_error("interpreter-without-predep", $filename,
+                     "#!$interpreter")
+@@ -381,7 +421,7 @@
+         # perhaps just do it when $base eq "sh" instead?
+       $checkbashisms = $base eq "sh" ? 1 : 0;
+       if (-x $valid_interpreters{$base}) {
+-          if (system("$interpreter -n $filename >/dev/null 2>&1")) {
++          if (check_script_syntax($interpreter, $filename)) {
+               tag_error("maintainer-shell-script-fails-syntax-check", $file);
+           }
+       }
+@@ -396,30 +436,41 @@
+     open C, "$filename"
+       or fail("cannot open maintainer script $filename for reading: $!");
+-    my ($warned_tmp, $warned_killall);
++    my %warned;
++    my ($saw_init, $saw_invoke);
+     my $cat_string = "";
+     while (<C>) {
+       next if m,^\s*\#,; # skip comment lines
+       s/\#.*$//;         # eat comments
+       chomp();
+-      if (m,\W(/var)?/tmp\b, and not m/\bmktemp\b/ and not m/\btempfile\b/ and not m/\bmkdir\b/) {
++      if (m,[^\w=](/var)?/tmp\b, and not m/\bmktemp\b/ and not m/\btempfile\b/ and not m/\bmkdir\b/) {
+           tag "possibly-insecure-handling-of-tmp-files-in-maintainer-script", "$file:$."
+-              unless $warned_tmp;
+-          $warned_tmp = 1;
++              unless $warned{tmp};
++          $warned{tmp} = 1;
+       }
+       if (m/^\s*killall(?:\s|$)/) {
+           tag "killall-is-dangerous", "$file:$."
+-              unless $warned_killall;
+-          $warned_killall = 1;
+-      }
+-      if (m/^\s*dpkg\s+--print-architecture\b/) {
+-          tag "dpkg-print-architecture-in-maintainer-script", "$file:$.";
++              unless $warned{killall};
++          $warned{killall} = 1;
+       }
+       if (m/^\s*mknod(?:\s|$)/ and not m/\sp\s/) {
+           tag "mknod-in-maintainer-script", "$file:$.";
+       }
++      # Collect information about init script invocations to catch running
++      # init scripts directory rather than through invoke-rc.d.  Since the
++      # script is allowed to run the init script directly if invoke-rc.d
++      # doesn't exist, only tag direct invocations where invoke-rc.d is
++      # never used in the same script.  Lots of false negatives, but
++      # hopefully not many false positives.
++      if (m%^\s*/etc/init.d/(\S+)\s+[\"\']?(\S+)[\"\']?%) {
++          $saw_init = $.;
++      }
++      if (m%^\s*invoke-rc.d\s+%) {
++          $saw_invoke = $.;
++      }
++
+       if ($shellscript) {
+           if (m/^\s*cat\s*\<\<\s*(\w+)/) {
+               $cat_string = $1;
+@@ -431,37 +482,45 @@
+           if (m,(^|\s+)((/usr)?/bin/)?((b|d)?a|k|z|t?c)sh\s+-c\s*.+,) {
+               $within_another_shell = 1;
+           }
++          #Don't use chown foo.bar:
++          if (m{(chown\s+[-_A-Za-z0-9]+\.[-_A-Za-z0-9]+)\s+}) {
++              tag "deprecated-chown-usage", "$file:$. \'$1\'";
++          }
+           # if cat_string is set, we are in a HERE document and need not
+           # check for things
+           if ($cat_string eq "" and $checkbashisms and !$within_another_shell) {
+               my $found = 0;
++              my $found_strict = 0;
+               my $match = '';
++              my @bashism_string_regexs = (
++                '\$\[\w+\]',                 # arith not allowed
++                '\$\{\w+\:\d+(?::\d+)?\}',   # ${foo:3[:1]}
++                '\$\{\w+(/.+?){1,2}\}',      # ${parm/?/pat[/str]}
++                '\$\{\#?\w+\[[0-9\*\@]+\]\}',# bash arrays, ${name[0|*|@]}
++              );
+               my @bashism_regexs = (
+                 'function \w+\(\s*\)',       # function is useless
+-                                             # should be '.', not 'source'
++                                             # should be '.', not 'source'
+                 '(?:^|\s+)source\s+(?:\.\/|\/|\$)[^\s]+',
+                 '(\[|test|-o|-a)\s*[^\s]+\s+==\s', # should be 'b = a'
+-                '\s\|\&',                    # pipelining is not POSIX
+-                '\$\[\w+\]',                 # arith not allowed
+-                '\$\{\w+\:\d+(?::\d+)?\}',   # ${foo:3[:1]}
+-                '\$\{\w+(/.+?){1,2}\}',      # ${parm/?/pat[/str]}
+-                '[^\\\]\{([^\s]+?,)+[^\\\}\s]+\}',     # brace expansion
++                '\s(\|\&)',                  # pipelining is not POSIX
++                '[^\\\]\{([^\s]+?,)+[^\\\}\s]+\}', # brace expansion
+                 '(?:^|\s+)\w+\[\d+\]=',      # bash arrays, H[0]
+-                '\$\{\#?\w+\[[0-9\*\@]+\]\}',   # bash arrays, ${name[0|*|@]}
+-                '(?:^|\s+)(read\s*(?:;|$))'  # read without variable
++                '(?:^|\s+)read\s*(?:;|$)',   # read without variable
++                '(?:^|\s+)kill\s+-[^sl]\w*', # kill -[0-9] or -[A-Z]
++                '(?:^|\s+)trap\s+["\']?.*["\']?\s+.*[1-9]', # trap with signal numbers
++                '\&>',                       # cshism
++                '\[\[(?!:)',                 # alternative test command
+               );
++              my @strict_posix_regexs = (
++                '((?:test|\[)\s+.+\s-[ao])\s',# test/[ -a/-o binary operators
++                '(?:^\s*)local\s',        # local scoping of variables
++                                         );
+-              for my $re (@bashism_regexs) {
+-                  if (m/($re)/) {
+-                      $found = 1;
+-                      $match = $1;
+-                      last;
+-                  }
+-              }
+               # since this test is ugly, I have to do it by itself
+               # detect source (.) trying to pass args to the command it runs
+               if (not $found and m/^\s*(\.\s+[^\s]+\s+([^\s]+))/) {
+-                  if ($2 eq '&&' || $2 eq '||') {
++                  if ($2 =~ /^(\&|\||\d?>|<)/) {
+                       # everything is ok
+                       ;
+                   } else {
+@@ -469,7 +528,46 @@
+                       $match = $1;
+                   }
+               }
+-              unless ($found == 0) {
++
++              # Ignore anything inside single quotes; it could be an
++              # argument to grep or the like.
++                my $line = $_;
++              $line =~ s/([^\\](?:\\\\)*)\'(?:\\.|[^\\\'])+\'/$1''/g;
++
++              for my $re (@bashism_string_regexs) {
++                  if ($line =~ m/($re)/) {
++                      $found = 1;
++                        ($match) = m/($re)/;
++                      last;
++                  }
++              }
++
++              # We've checked for all the things we still want to notice in
++              # double-quoted strings, so now remove those strings as well.
++              unless ($found) {
++                  $line =~ s/([^\\](?:\\\\)*)\"(?:\\.|[^\\\"])+\"/$1""/g;
++                  for my $re (@bashism_regexs) {
++                      if ($line =~ m/($re)/) {
++                          $found = 1;
++                          ($match) = m/($re)/;
++                          last;
++                      }
++                  }
++              }
++              unless ($found) {
++                  for my $re (@strict_posix_regexs) {
++                      if ($line =~ m/($re)/) {
++                          $found = 1;
++                          $found_strict = 1;
++                          ($match) = m/($re)/;
++                          last;
++                      }
++                  }
++              }
++
++              if ($found && $found_strict) {
++                  tag "possible-non-posix-code-in-maintainer-script", "$file:$. \'$match\'";
++              } elsif ($found) {
+                   tag "possible-bashism-in-maintainer-script", "$file:$. \'$match\'";
+               }
+           }
+@@ -481,9 +579,27 @@
+           if (m,update\-alternatives \-\-remove,) {
+               tag "update-alternatives-remove-called-in-postrm", "";
+           }
++      } else {
++          for my $rule (@depends_needed) {
++              my ($package, $regex) = @$rule;
++              if (/$regex/ && ! $warned{$package}) {
++                  my $type = $deps{$package};
++                  unless ($type and ($type eq 'depends' or $type eq 'pre-depends')) {
++                      tag "maintainer-script-needs-depends-on-$package", "$file";
++                      $warned{$package} = 1;
++                  }
++              }
++          }
++      }
++      if (/invoke-rc.d.*\|\| exit 0/) {
++          tag "maintainer-script-hides-init-failure", "$file:$.";
+       }
+     }
++    if ($saw_init && ! $saw_invoke) {
++      tag "maintainer-script-calls-init-script-directly", "$file:$saw_init";
++    }
++
+     close C;
+ }
+@@ -524,10 +640,13 @@
+     my $ret = 0;
+     open IN, $filename or fail("cannot open $filename: $!");
+     my $i = 0;
++    local $_;
+     while (<IN>) {
+-        last if (++$i > 20);
+         chomp;
+-        if (/^\s*exec\s*.+\s*.?\$0.?\s*(--\s*)?(\${1\+)?.?\$\@/) {
++      next if /^#/o;
++      next if /^$/o;
++        last if (++$i > 20);
++        if (/(^\s*|\beval\s*\'|;)?exec\s*.+\s*.?\$0.?\s*(--\s*)?(\${1\+)?.?\$\@/o) {
+             $ret = 1;
+             last;
+         }
+@@ -536,6 +655,24 @@
+     return $ret;
+ }
++# Given an interpretor and a file, run the interpretor on that file with the
++# -n option to check syntax, discarding output and returning the exit status.
++sub check_script_syntax {
++    my ($interpreter, $script) = @_;
++    my $pid = fork;
++    if (!defined $pid) {
++      fail("cannot fork: $!");
++    } elsif ($pid == 0) {
++      open STDOUT, '>/dev/null' or fail("cannot reopen stdout: $!");
++      open STDERR, '>&STDOUT' or fail("cannot reopen stderr: $!");
++      exec $interpreter, '-n', $script
++          or fail("cannot exec $interpreter: $!");
++    } else {
++      waitpid $pid, 0;
++    }
++    return $?;
++}
++
+ 1;
+ # vim: syntax=perl ts=8 sw=4
+diff -urNad lintian-1.23.8/checks/scripts.desc lintian-1.23.21/checks/scripts.desc
+--- lintian-1.23.8/checks/scripts.desc 2005-01-14 21:09:42.000000000 +0000
++++ lintian-1.23.21/checks/scripts.desc        2006-07-18 11:44:07.000000000 +0000
+@@ -1,7 +1,7 @@
+ Check-Script: scripts
+ Author: Richard Braakman <dark@xs4all.nl>
+ Abbrev: scr
+-Standards-Version: 3.2.0
++Standards-Version: 3.7.0
+ Type: binary
+ Unpack-Level: 2
+ Info: This script checks the #! lines of scripts in a package.
+@@ -68,18 +68,6 @@
+  Please do not add a pre-dependency without following the policy for doing so.
+  (Policy section 3.5).
+-Tag: wrong-path-for-awk
+-Type: error
+-Info: Awk is installed as /usr/bin/awk on Debian systems.
+-
+-Tag: wrong-path-for-nawk
+-Type: error
+-Info: nawk is installed as /usr/bin/nawk on Debian systems.
+-
+-Tag: wrong-path-for-gawk
+-Type: error
+-Info: GNU awk is installed as /usr/bin/gawk on Debian systems.
+-
+ Tag: gawk-script-but-no-gawk-dep
+ Type: error
+ Info: Packages that use gawk scripts must depend on the gawk package.
+@@ -89,10 +77,6 @@
+  In some cases a weaker relationship, such as Suggests or Recommends, will
+  be more appropriate.
+-Tag: wrong-path-for-mawk
+-Type: error
+-Info: Mawk is installed as /usr/bin/mawk on Debian systems.
+-
+ Tag: mawk-script-but-no-mawk-dep
+ Type: error
+ Info: Packages that use mawk scripts must depend on the mawk package.
+@@ -102,34 +86,14 @@
+  In some cases a weaker relationship, such as Suggests or Recommends, will
+  be more appropriate.
+-Tag: wrong-path-for-burlap
+-Type: error
+-Info: burlap is installed as /usr/bin/burlap on Debian systems.
+-
+-Tag: burlap-script-but-no-felt-dep
+-Type: error
+-Info: Packages that use burlap scripts must depend on the felt package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-csh
+-Type: error
+-Info: Csh is installed as /bin/csh on Debian systems.
+-Ref: policy 10.4
+-
+-Tag: wrong-path-for-tcsh
+-Type: error
+-Info: Tcsh is installed as /usr/bin/tcsh on Debian systems.
+-
+-Tag: csh-script-but-no-c-shell-dep
++Tag: missing-dep-for-interpreter
+ Type: error
+-Info: Packages that use csh scripts must depend on the virtual package c-shell,
+- which is provided by csh and tcsh.
++Info: You used an interpreter for a script that is not in an essential
++ package. In most cases you will need to add a Dependency on the
++ package that contains the interpreter.
+  .
+  In some cases a weaker relationship, such as Suggests or Recommends, will
+  be more appropriate.
+-Ref: policy 10.4
+ Tag: csh-considered-harmful
+ Type: warning
+@@ -137,138 +101,6 @@
+  and tcsh as scripting languages.
+ Ref: policy 10.4
+-Tag: wrong-path-for-ash
+-Type: error
+-Info: Ash is installed as /bin/ash on Debian systems.
+-
+-Tag: ash-script-but-no-ash-dep
+-Type: error
+-Info: Packages that use ash scripts must depend on the ash package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-dash
+-Type: error
+-Info: Dash is installed as /bin/dash on Debian systems.
+-
+-Tag: dash-script-but-no-dash-dep
+-Type: error
+-Info: Packages that use dash scripts must depend on the dash package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-sh
+-Type: error
+-Info: The Bourne shell is installed as /bin/sh on Debian systems.
+-
+-Tag: wrong-path-for-bash
+-Type: error
+-Info: Bash is installed as /bin/bash on Debian systems.
+-
+-Tag: wrong-path-for-ksh
+-Type: error
+-Info: Ksh is installed as /bin/ksh on Debian systems.
+-
+-Tag: ksh-script-but-no-pdksh-dep
+-Type: error
+-Info: Packages that use ksh scripts must depend on the pdksh package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-env
+-Type: error
+-Info: env is installed as /usr/bin/env on Debian systems.
+-
+-Tag: wrong-path-for-expect
+-Type: error
+-Info: Wish is installed as /usr/bin/expect on Debian systems.
+-
+-Tag: expect-script-but-no-expect-dep
+-Type: error
+-Info: Packages that use expect scripts must depend on the virtual
+- package expect.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-gnuplot
+-Type: error
+-Info: gnuplot is installed as /usr/bin/gnuplot on Debian systems.
+-
+-Tag: gnuplot-script-but-no-gnuplot-dep
+-Type: error
+-Info: Packages that use gnuplot scripts must depend on the gnuplot package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-guile
+-Type: error
+-Info: guile is installed as /usr/bin/guile on Debian systems.
+-
+-Tag: guile-script-but-no-guile-dep
+-Type: error
+-Info: Packages that use guile scripts must depend on the virtual package
+- `guile'.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-install-menu
+-Type: error
+-Info: Install-menu is installed as /usr/sbin/install-menu.
+-
+-Tag: wrong-path-for-install-fvwmgenmenu
+-Type: error
+-Info: install-fvwmgenmenu is installed as /usr/sbin/install-fvwmgenmenu.
+-
+-Tag: wrong-path-for-js
+-Type: error
+-Info: js is installed as /usr/bin/js on Debian systems.
+-
+-Tag: js-script-but-no-ngs-js-dep
+-Type: error
+-Info: Packages that use js scripts must depend on the package ngs-js,
+- which provides the interpreter.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-make
+-Type: error
+-Info: Make is installed as /usr/bin/make on Debian systems.
+-
+-Tag: make-script-but-no-make-dep
+-Type: error
+-Info: Packages that use make scripts must depend on the make package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-perl
+-Type: error
+-Info: Perl is installed as /usr/bin/perl on Debian systems.
+-Ref: policy 10.4
+-
+-Tag: perl-5.004-script-but-no-perl-5.004-dep
+-Type: error
+-Info: Packages that use perl-5.004 scripts must depend on the perl-5.004
+- package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: perl-5.005-script-but-no-perl-5.005-dep
+-Type: error
+-Info: Packages that use perl-5.005 scripts must depend on the perl-5.005
+- package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+ Tag: suid-perl-script-but-no-perl-suid-dep
+ Type: error
+ Info: Packages that use perl scripts that are suid must depend on the
+@@ -277,10 +109,6 @@
+  In some cases a weaker relationship, such as Suggests or Recommends, will
+  be more appropriate.
+-Tag: wrong-path-for-php
+-Type: error
+-Info: PHP can be called as /usr/bin/php on Debian systems.
+-
+ Tag: php-script-but-no-php4-cli-dep
+ Type: error
+ Info: Packages that use PHP scripts with /usr/bin/php as interpreter must
+@@ -291,10 +119,6 @@
+  In some cases a weaker relationship, such as Suggests or Recommends, will
+  be more appropriate.
+-Tag: wrong-path-for-php4
+-Type: error
+-Info: PHP4 is installed as /usr/bin/php4 on Debian systems.
+-
+ Tag: php4-script-but-no-php4-cli-dep
+ Type: error
+ Info: Packages that use PHP4 scripts must depend on the php4-cli package. Note
+@@ -304,28 +128,6 @@
+  In some cases a weaker relationship, such as Suggests or Recommends, will
+  be more appropriate.
+-Tag: wrong-path-for-pike
+-Type: error
+-Info: Pike is installed as /usr/bin/pike on Debian systems.
+-
+-Tag: pike-script-but-no-pike-dep
+-Type: error
+-Info: Packages that use Pike scripts must depend on pike or pike7.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-pike7
+-Type: error
+-Info: Pike7 is installed as /usr/bin/pike7 on Debian systems.
+-
+-Tag: pike7-script-but-no-pike7-dep
+-Type: error
+-Info: Packages that use Pike7 scripts must depend on pike7.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+ Tag: wrong-path-for-python
+ Type: error
+ Info: Python is installed as /usr/bin/python on Debian systems.
+@@ -338,6 +140,10 @@
+  .
+  Specific Ruby versions are installed as /usr/bin/rubyX.Y
++Tag: wrong-path-for-interpreter
++Type: error
++Info: The interpreter you used is installed at another location on Debian systems.
++
+ Tag: python-script-but-no-python-dep
+ Type: error
+ Info: Packages with scripts that are executed with python must depend on the
+@@ -364,154 +170,6 @@
+  In some cases a weaker relationship, such as Suggests or Recommends, will
+  be more appropriate.
+-Tag: wrong-path-for-rc
+-Type: error
+-Info: The rc shell is installed as /usr/bin/rc on Debian systems.
+-
+-Tag: rc-script-but-no-rc-dep
+-Type: error
+-Info: Packages that use rc scripts must depend on the rc package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-regina
+-Type: error
+-Info: regina is installed as /usr/bin/regina on Debian systems.
+-
+-Tag: regina-script-but-no-regina-rexx-dep
+-Type: error
+-Info: Packages that use regina scripts must depend on the regina-rexx package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-rexx
+-Type: error
+-Info: rexx is installed as /usr/bin/rexx on Debian systems.
+-
+-Tag: rexx-script-but-no-regina-rexx-dep
+-Type: error
+-Info: Packages that use rexx scripts must depend on the regina-rexx package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-runhugs
+-Type: error
+-Info: Hugs is installed as /usr/bin/runhugs on Debian systems.
+-
+-Tag: wrong-path-for-runhugs1.4
+-Type: error
+-Info: Hugs is installed as /usr/bin/runhugs or /usr/bin/runhugs1.4 on Debian 
+- systems.
+-
+-Tag: wrong-path-for-runhugs98
+-Type: error
+-Info: Hugs is installed as /usr/bin/runhugs or /usr/bin/runhugs98 on Debian 
+- systems.
+-
+-Tag: runhugs1.4-script-but-no-hugs-dep
+-Type: error
+-Info: Packages that use runhugs scripts must depend on the hugs package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: runhugs98-script-but-no-hugs98-dep
+-Type: error
+-Info: Packages that use runhugs98 scripts must depend on the hugs98 package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-scsh
+-Type: error
+-Info: scsh is installed as /usr/bin/scsh on Debian systems.
+-
+-Tag: scsh-script-but-no-scsh-dep
+-Type: error
+-Info: Packages that use scsh scripts must depend on the scsh package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-sed
+-Type: error
+-Info: sed is installed as /bin/sed on Debian systems.
+-
+-Tag: wrong-path-for-trs
+-Type: error
+-Info: trs is installed as /usr/bin/trs on Debian systems.
+-
+-Tag: trs-script-but-no-konwert-dep
+-Type: error
+-Info: Packages that use trs scripts must depend on the konwert package,
+- which provides that interpreter.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-tcl
+-Type: error
+-Info: Tcl is installed as /usr/bin/tcl on Debian systems.
+-
+-Tag: tcl-script-but-no-tcl-dep
+-Type: error
+-Info: Packages that use tcl scripts must depend on the virtual package tcl.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-tclsh
+-Type: error
+-Info: Tclsh is installed as /usr/bin/tclsh on Debian systems.
+-
+-Tag: wrong-path-for-tclsh8.3
+-Type: error
+-Info: Tclsh 8.3 is installed as /usr/bin/tclsh8.3 on Debian systems.
+-
+-Tag: wrong-path-for-tclsh8.4
+-Type: error
+-Info: Tclsh 8.4 is installed as /usr/bin/tclsh8.4 on Debian systems.
+-
+-Tag: tclsh-script-but-no-tclsh-dep
+-Type: error
+-Info: Packages that use tclsh scripts must depend on the virtual package tclsh.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: tclsh8.3-script-but-no-tcl8.3-dep
+-Type: error
+-Info: Packages that use tclsh8.3 scripts must depend on the package tcl8.3.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: tclsh8.4-script-but-no-tcl8.4-dep
+-Type: error
+-Info: Packages that use tclsh8.4 scripts must depend on the package tcl8.4.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-bltwish
+-Type: error
+-Info: bltwish is installed as /usr/bin/bltwish on Debian systems.
+-
+-Tag: bltwish-script-but-no-blt-dep
+-Type: error
+-Info: Packages that use bltwish scripts must depend on the blt package.
+- It has superseded the blt8.0 package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-wish
+-Type: error
+-Info: Wish is installed as /usr/bin/wish on Debian systems.
+-
+ Tag: wish-script-but-no-wish-dep
+ Type: error
+ Info: Packages that use wish scripts must depend on the virtual package wish.
+@@ -519,28 +177,6 @@
+  In some cases a weaker relationship, such as Suggests or Recommends, will
+  be more appropriate.
+-Tag: wrong-path-for-wish8.0
+-Type: error
+-Info: wish8.0 is installed as /usr/bin/wish8.0 on Debian systems.
+-
+-Tag: wish8.0-script-but-no-tk8.0-dep
+-Type: error
+-Info: Packages that use wish8.0 scripts must depend on the tk8.0 package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+-Tag: wrong-path-for-zsh
+-Type: error
+-Info: Zsh is installed as /usr/bin/zsh on Debian systems.
+-
+-Tag: zsh-script-but-no-zsh-dep
+-Type: error
+-Info: Packages that use zsh scripts must depend on the zsh package.
+- .
+- In some cases a weaker relationship, such as Suggests or Recommends, will
+- be more appropriate.
+-
+ Tag: calls-suidperl-directly
+ Type: error
+ Info: Since perl version 5.8.3-3, /usr/bin/suidperl shouldn't be called directly
+@@ -580,21 +216,11 @@
+  processes.  Most uses of <tt>killall</tt> should use
+  <tt>start-stop-daemon</tt> instead.
+-Tag: dpkg-print-architecture-in-maintainer-script
+-Type: warning
+-Info: The maintainer script seems to call "<tt>dpkg --print-architecture</tt>".
+- This invokes <tt>gcc</tt>, and returns the <em>build</em> architecture
+- (which may not be the installation architecture if the system is configured
+- for cross-compiling).
+- .
+- The script should probably use "<tt>dpkg --print-installation-architecture</tt>"
+- instead.
+-
+ Tag: mknod-in-maintainer-script
+-Type: warning
++Type: error
+ Ref: policy 10.6
+-Info: Maintainer scripts should not create device files directly.  They
+- should call makedev instead.
++Info: Maintainer scripts must not create device files directly.  They
++ should call MAKEDEV instead.
+ Tag: possible-bashism-in-maintainer-script
+ Type: warning
+@@ -610,12 +236,41 @@
+   '. command args', passing arguments to commands via 'source' is not supported
+   '{foo,bar}' instead of 'foo bar'
++Tag: possible-non-posix-code-in-maintainer-script
++Type: info
++Ref: policy 10.4
++Info: This script is marked as running under <tt>/bin/sh</tt>, but it seems
++ to use a shell feature that is not defined in the POSIX standard. The
++ feature is so common in current shells that this isn't currently
++ considered an release critical bug and there are discussion wether
++ policy should be amended to specifically allow the use of the feature.
++ .
++ Examples:
++  '-a' and '-o' as operators of 'test'. You can use shell conditionals
++  (&& and ||) instead.
++  'local' scoping of variables.
++
+ Tag: suidregister-used-in-maintainer-script
+ Type: error
+ Info: This script calls suidregister which is no longer needed, a new
+  command 'dpkg-statoverride' gives admins more flexibility.  Please see
+  the documentation of suidmanager and dpkg-statoverride for details.
++Tag: maintainer-script-needs-depends-on-netbase
++Type: warning
++Info: This script calls update-inetd, but the package does not depend or
++ pre-depend on netbase, which provides it.
++
++Tag: maintainer-script-needs-depends-on-adduser
++Type: warning
++Info: This script calls adduser, but the package does not depend or
++ pre-depend on the adduser package.
++
++Tag: maintainer-script-needs-depends-on-ucf
++Type: warning
++Info: This script calls ucf, but the package does not depend or pre-depend
++ on the ucf package.
++
+ Tag: update-alternatives-remove-called-in-postrm
+ Type: warning
+ Info: 'update-alternatives --remove &lt;alternative&gt; foo' is called in the
+@@ -629,3 +284,30 @@
+  run by hand.
+  .
+  update-alternatives --remove should be called in the prerm instead.
++
++Tag: deprecated-chown-usage
++Type: warning
++Info: 'chown user.group' is called in one of the maintainer scripts.
++ This should be avoided, as the correct syntax is 'chown user:group'.
++ Using "." as a separator is still supported by the GNU tools, but it will
++ fail as soon as a system uses the "." in user or group names.
++
++Tag: maintainer-script-hides-init-failure
++Type: warning
++Info: This script calls invoke-rc.d to run an init script but then, if the
++ init script fails, exits successfully (using || exit 0).  If the init
++ script fails, the maintainer script should probably fail.
++ .
++ The most likely cause of this problem is that the package was built with
++ a debhelper version suffering from Bug#337664 that inserted incorrect
++ invoke-rc.d code in the generated maintainer script. The package needs to
++ be reuploaded (could be bin-NMUd, no source changes needed).
++
++Tag: maintainer-script-calls-init-script-directly
++Type: error
++Info: This script apparently runs an init script directly rather than
++ using invoke-rc.d.  The use of invoke-rc.d to invoke the /etc/init.d/*
++ initscripts instead of calling them directly is required.  Maintainer
++ scripts may call the init script directly only if invoke-rc.d is not
++ available.
++Ref: policy 9.3.3.2
+diff -urNad lintian-1.23.8/checks/shared-libs lintian-1.23.21/checks/shared-libs
+--- lintian-1.23.8/checks/shared-libs  2004-10-12 23:36:08.000000000 +0000
++++ lintian-1.23.21/checks/shared-libs 2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# shared-libs -- lintian check script
++# shared-libs -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::shared_libs;
+ use strict;
+@@ -28,7 +28,11 @@
+ my %ldso_dir = map { $_ => 1 }
+     qw( lib
++      lib32
++      lib64
+         usr/lib
++      usr/lib32
++      usr/lib64
+         usr/lib/libg++-dbg
+         usr/X11R6/lib/Xaw3d
+         usr/local/lib
+@@ -37,6 +41,19 @@
+         lib/libc5-compat
+       );
++# The following architectures should always have a STACK setting in shared
++# libraries to disable executable stack.  Other architectures don't always add
++# this section and therefore can't be checked.
++my %stack_arches = map { $_ => 1 }
++    qw( alpha
++      amd64
++      i386
++      m68k
++      powerpc
++      s390
++      sparc
++      );
++
+ my $file;
+ my $must_call_ldconfig;
+ my $postrm = "control/postrm";
+@@ -46,6 +63,7 @@
+ my $shlibs_control_file = "control/shlibs";
+ my %SONAME;
+ my %INTERP;
++my %STACK;
+ my %objsomething;
+ my %sharedobject;
+ my %index_info;
+@@ -72,12 +90,19 @@
+     } elsif (m/^\s*SONAME\s+(\S+)/o) {
+       $SONAME{$file} = $1;
+     } elsif (m/^\s*TEXTREL\s/o) {
+-      tag "shlib-with-non-pic-code", "$file"
+-          if exists $ldso_dir{dirname($file)};
++      tag "shlib-with-non-pic-code", "$file";
+     } elsif (m/^\s*INTERP\s/) {
+       $INTERP{$file} = 1;
++    } elsif (m/^\s*STACK\s/) {
++      $STACK{$file} = 0;
+     } else {
+-        $objsomething{$file} = 1;
++        if (defined $STACK{$file} and $STACK{$file} eq 0) {
++          m/\sflags\s+(\S+)/o;
++          $STACK{$file} = $1;
++      }
++      else {
++          $objsomething{$file} = 1;
++      }
+     }
+ }
+ close(IN);
+@@ -151,6 +176,23 @@
+           # yes! so postinst must call ldconfig
+           $must_call_ldconfig = $real_file;
+       }
++
++      # executable stack.  We can only warn about a missing section on some
++      # architectures.  Only warn if there's an Architecture field; if
++      # that's missing, we'll already be complaining elsewhere.
++      if (exists $objsomething{$cur_file}) {
++          if (not defined $STACK{$cur_file}) {
++              if (open(FH, "fields/architecture")) {
++                  my $arch = <FH>;
++                  close FH;
++                  chomp $arch;
++                  tag "shlib-without-PT_GNU_STACK-section", $cur_file
++                      if $stack_arches{$arch};
++              }
++          } elsif ($STACK{$cur_file} ne "rw-") {
++              tag "shlib-with-executable-stack", $cur_file;
++          }
++      }
+     } elsif (exists $objsomething{$cur_file} &&
+            exists $ldso_dir{dirname($cur_file)} &&
+            exists $sharedobject{$cur_file}) {
+@@ -250,11 +292,14 @@
+       while (<SHLIBS>) {
+           chop;
+           next if m/^\s*$/ or /^#/;
++          my $udeb="";
++          $udeb = "udeb: " if s/^udeb:\s+//o;
+           @words = split(/\s+/o,$_);
+-          if ($shlibs_control{$words[0]}) {
+-              tag "duplicate-entry-in-shlibs-control-file", "$words[0]";
++          my $shlibs_string = $udeb.$words[0].' '.$words[1];
++          if ($shlibs_control{$shlibs_string}) {
++              tag "duplicate-entry-in-shlibs-control-file", $shlibs_string;
+           } else {
+-              $shlibs_control{$words[0]} = 1;
++              $shlibs_control{$shlibs_string} = 1;
+           }
+       }
+       close(SHLIBS);
+@@ -262,24 +307,23 @@
+       for my $shlib (@shlibs) {
+           $shlib_name = $SONAME{$shlib};
+           # libfoo.so.X.X
+-          if ($shlib_name =~ m/(.+)\.so\..*$/) {
+-              $shlib_name = $1;
++          if ($shlib_name =~ m/(.+)\.so\.(.*)$/) {
++              $shlib_name = "$1 $2";
+           # libfoo-X.X.so
+-          } elsif ($shlib_name =~ m/(.+)\-\w[\w\.]*\.so$/) {
+-              $shlib_name = $1;
++          } elsif ($shlib_name =~ m/(.+)\-(\w[\w\.]*)\.so$/) {
++              $shlib_name = "$1 $2";
+           }
+-          if (exists $shlibs_control{$shlib_name}) {
+-              # ok, have entry in shlibs control file
+-              $shlibs_control_used{$shlib_name} = 1;
+-          } else {
++          $shlibs_control_used{$shlib_name} = 1;
++          $shlibs_control_used{"udeb: ".$shlib_name} = 1;
++          unless (exists $shlibs_control{$shlib_name}) {
+               # skip it if it's not a public shared library
+               next unless defined $ldso_dir{dirname($shlib)};
+               # no!!
+-              tag "shlib-missing-in-control-file", "$shlib_name $shlib";
++              tag "shlib-missing-in-control-file", $shlib_name, 'for', $shlib;
+           }
+       }
+       for $shlib_name (keys %shlibs_control) {
+-          tag "unused-shlib-entry-in-control-file", "$shlib_name"
++          tag "unused-shlib-entry-in-control-file", $shlib_name
+               unless $shlibs_control_used{$shlib_name};
+       }
+     }
+@@ -293,19 +337,26 @@
+     }
+ }
++my $we_call_postinst=0;
+ if (-f $postinst) {
+     local $_ = slurp_entire_file($postinst);
+     # Decide if we call ldconfig
+     if (/^[^\#]*\bldconfig\b/m) {
+-      tag "postinst-has-useless-call-to-ldconfig", ""
+-          unless $must_call_ldconfig;
+-    } else {
+-      tag "postinst-must-call-ldconfig", "$must_call_ldconfig"
+-          if $must_call_ldconfig;
++      $we_call_postinst=1;
+     }
+ }
++if ($type eq 'udeb') {
++    tag "udeb-postinst-must-not-call-ldconfig"
++      if $we_call_postinst;
++} else {
++    tag "postinst-has-useless-call-to-ldconfig", ""
++      if $we_call_postinst and not $must_call_ldconfig;
++    tag "postinst-must-call-ldconfig", "$must_call_ldconfig"
++      if not $we_call_postinst and $must_call_ldconfig;
++}
++
+ if (-f $prerm) {
+     local $_ = slurp_entire_file($prerm);
+     if (/^[^\#]*\bldconfig\b/m) {
+diff -urNad lintian-1.23.8/checks/shared-libs.desc lintian-1.23.21/checks/shared-libs.desc
+--- lintian-1.23.8/checks/shared-libs.desc     2005-01-14 20:54:26.000000000 +0000
++++ lintian-1.23.21/checks/shared-libs.desc    2006-07-18 11:44:07.000000000 +0000
+@@ -1,7 +1,7 @@
+ Check-Script: shared-libs
+ Author: Christian Schwarz <schwarz@debian.org>
+ Abbrev: shl
+-Standards-Version: 3.2.0
++Standards-Version: 3.7.2
+ Type: binary, udeb
+ Unpack-Level: 1
+ Needs-Info: file-info, objdump-info
+@@ -25,11 +25,14 @@
+  separately from the static libraries with the -fPIC option. 
+  .
+  Another common mistake that causes this problem is linking with 
+- ``gcc -Wl,-shared'' instead of ``gcc -shared''.
++ <tt>gcc -Wl,-shared</tt> instead of <tt>gcc -shared</tt>.
++ .
++ In some cases, exceptions to this rule are warranted. If this is such a
++ case, follow the procedure outlined in Policy and then please document
++ the exception by adding a lintian override to this package.
+ Tag: ldconfig-symlink-missing-for-shlib
+ Type: error
+-Severity: Important
+ Info: The package should not only include the shared library itself, but also
+  the symbolic link which ldconfig would produce. (This is necessary, so 
+  that the link gets removed by dpkg automatically when the package
+@@ -39,7 +42,6 @@
+ Tag: ldconfig-symlink-before-shlib-in-deb
+ Type: error
+-Severity: Important
+ Info: In the package contents list, the shared library has to come before
+  any symbolic links referencing the shared library.
+ Ref: policy 8.1
+@@ -138,6 +140,11 @@
+  installed in a directory controlled by the dynamic library loader.
+ Ref: policy 8.1.1
++Tag: udeb-postinst-must-not-call-ldconfig
++Type: error
++Info: The postinst script calls ldconfig, which is an error in udebs.
++ ldconfig is not available and not needed in debian-installer
++
+ Tag: postrm-has-useless-call-to-ldconfig
+ Type: warning
+ Info: The postrm script calls ldconfig even though no shared libraries are
+@@ -167,3 +174,22 @@
+  SONAMEs are set with something like <tt>gcc -Wl,-soname,libfoo.so.0</tt>,
+  where 0 is the major version of the library. If your package uses libtool,
+  then libtool invoked with the right options should be doing this.
++
++Tag: shlib-without-PT_GNU_STACK-section
++Type: error
++Info: The listed shared libraries lacks a PT_GNU_STACK section. This forces
++ the dynamic linker to make the stack executable.
++ .
++ The shared lib is linked either with a non-GNU linker or a linker which is
++ older than two years. This problem can be fixed with a rebuild.
++
++Tag: shlib-with-executable-stack
++Type: warning
++Info: The listed shared libraries declares the stack as executable.
++ .
++ Executable stack is usualy an error as it is only needed if the code
++ contains GCC trampolines or similar constructs which uses code on the
++ stack. One possible source for false positives are object files built
++ from assembler files which don't define a proper .note.GNU-stack
++ section.
++
+diff -urNad lintian-1.23.8/checks/standards-version lintian-1.23.21/checks/standards-version
+--- lintian-1.23.8/checks/standards-version    2004-12-25 23:40:20.000000000 +0000
++++ lintian-1.23.21/checks/standards-version   2006-07-18 11:44:07.000000000 +0000
+@@ -1,4 +1,4 @@
+-# standards-version -- lintian check script
++# standards-version -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz and Richard Braakman
+ # 
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::standards_version;
+ use strict;
+@@ -29,11 +29,15 @@
+ # 2 means old
+ # 3 means ancient
+ my %valid_standard = (
+-                 '3.6.1', 1,
++                 '3.7.2', 1,
++                 '3.7.1', 2,
++                 '3.7.0', 2,
++                 '3.6.2', 2,
++                 '3.6.1', 2,
+                  '3.6.0', 2,
+                  '3.5.10', 2,
+                  '3.5.9', 2,
+-                 '3.5.8', 2,
++                 '3.5.8', 3,
+                  '3.5.7', 3,
+                  '3.5.6', 3,
+                  '3.5.5', 3,
+@@ -66,8 +70,8 @@
+ # version lintian is programmed for. ($valid_standard[0]?)
+ my $MAJOR = 3;
+-my $MINOR = 6;
+-my $PATCH = 1;
++my $MINOR = 7;
++my $PATCH = 2;
+ my $pkg = shift;
+ my $type = shift;
+@@ -103,17 +107,17 @@
+     if (($major > $MAJOR) or
+       ($major == $MAJOR and $minor > $MINOR) or
+       ($major == $MAJOR and $minor == $MINOR and $patch > $PATCH)) {
+-      tag "newer-standards-version", "$_";
++      tag "newer-standards-version", "$_ (current is $MAJOR.$MINOR.$PATCH)";
+     } else {
+       # invalid standard
+       tag "invalid-standards-version", "$_";
+     }
+ } elsif ($valid_standard{$stdver} == 2) {
+     # old standard
+-    tag "out-of-date-standards-version", "$_";
++    tag "out-of-date-standards-version", "$_ (current is $MAJOR.$MINOR.$PATCH)";
+ } elsif ($valid_standard{$stdver} == 3) {
+     # OK, now this is ancient.
+-    tag "ancient-standards-version", "$_";
++    tag "ancient-standards-version", "$_ (current is $MAJOR.$MINOR.$PATCH)";
+ } else { # looks valid ......
+     if (($major == 3 and $minor == 0) or $major < 3) {
+       if (-f "fields/build-depends" or
+diff -urNad lintian-1.23.8/collection/changelog-file lintian-1.23.21/collection/changelog-file
+--- lintian-1.23.8/collection/changelog-file   2004-04-18 00:54:35.000000000 +0000
++++ lintian-1.23.21/collection/changelog-file  2006-07-18 11:44:29.000000000 +0000
+@@ -16,8 +16,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ use strict;
+@@ -36,7 +36,7 @@
+              "unpacked/usr/share/doc/$pkg/changelog.debian",
+              "unpacked/usr/share/doc/$pkg/changelog.gz",
+              "unpacked/usr/share/doc/$pkg/changelog",
+-           "unpacked/usr/doc/$pkg/changelog.Debian.gz",
++             "unpacked/usr/doc/$pkg/changelog.Debian.gz",
+              "unpacked/usr/doc/$pkg/changelog.Debian",
+              "unpacked/usr/doc/$pkg/changelog.debian.gz",
+              "unpacked/usr/doc/$pkg/changelog.debian",
+diff -urNad lintian-1.23.8/collection/objdump-info lintian-1.23.21/collection/objdump-info
+--- lintian-1.23.8/collection/objdump-info     2004-04-18 00:54:35.000000000 +0000
++++ lintian-1.23.21/collection/objdump-info    2006-07-18 11:44:29.000000000 +0000
+@@ -16,8 +16,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ set -e
+@@ -30,6 +30,7 @@
+     exit 2
+ fi
++CDPATH=
+ cd unpacked
+ rm -f ../objdump-info
+@@ -46,7 +47,23 @@
+     if head $bin | grep -q 'packed.*with.*UPX'; then
+       echo "objdump: $bin: Packed with UPX" >> ../objdump-info
+     else
+-      objdump --headers --private-headers -T $bin >> ../objdump-info 2>&1
++      # readelf is for interpreter information only; ignore failure.
++      readelf -l "$bin" >> ../objdump-info 2>&1 || true
++
++      # The main data of interest.
++      if objdump --headers --private-headers -T $bin >> ../objdump-info 2>&1 ; then
++          # everything is ok
++          :
++      else
++          # If the objdump error is "Invalid operation", we handle it later
++          # in the check script, since this is the expected output (for now)
++          # on detached debugging information in /usr/lib/debug.
++          if objdump -T $bin 2>&1 | grep -q 'Invalid operation$' ; then
++              :
++          else
++              exit 1
++          fi
++      fi
+     fi
+ done
+diff -urNad lintian-1.23.8/lib/Checker.pm lintian-1.23.21/lib/Checker.pm
+--- lintian-1.23.8/lib/Checker.pm      2004-07-06 19:05:32.000000000 +0000
++++ lintian-1.23.21/lib/Checker.pm     2006-07-18 11:45:09.000000000 +0000
+@@ -1,5 +1,5 @@
+ # Checker -- Perl checker functions for lintian
+-# $Id: Checker.pm 311 2004-07-02 13:47:58Z djpig $
++# $Id: Checker.pm 495 2005-09-21 21:27:05Z djpig $
+ # Copyright (C) 2004 Jeroen van Wolffelaar
+ #
+@@ -16,8 +16,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Checker;
+ use strict;
+@@ -62,9 +62,6 @@
+       # require has a anti-require-twice cache
+       require "$LINTIAN_ROOT/checks/$name";
+-      $Tags::prefix = $type eq 'binary' ? $pkg : "$pkg $type";
+-      #Tags::reset();
+-
+       #print STDERR "Now running $name...\n";
+       $name =~ s/[-.]/_/g;
+       eval { &{'Lintian::'.$name.'::run'}($pkg, $type) };
+diff -urNad lintian-1.23.8/lib/Dep.pm lintian-1.23.21/lib/Dep.pm
+--- lintian-1.23.8/lib/Dep.pm  2004-04-18 00:54:33.000000000 +0000
++++ lintian-1.23.21/lib/Dep.pm 2006-07-18 11:45:09.000000000 +0000
+@@ -36,15 +36,20 @@
+                 \s* (.*?)                   # do not attempt to parse version
+                 \s* \)                      # closing parenthesis
+             )?                            # end of optional part
++              (?:                           # start of optional architecture
++                \s* \[                      # open bracket for architecture
++                \s* (.*?)                   # don't parse architectures now
++                \s* \]                      # closing bracket
++              )?                            # end of optional architecture
+           /x;
+-    return ['PRED', $1] if not defined $2;
++    return ['PRED', $1, undef, undef, $4] if not defined $2;
+     my $two = $2;
+     if ($two eq '<') {
+       $two = '<<';
+     } elsif ($two eq '>') {
+       $two = '>>';
+     }
+-    return ['PRED', $1, $two, $3];
++    return ['PRED', $1, $two, $3, $4];
+ }
+ sub Or { return ['OR', @_]; }
+@@ -180,9 +185,70 @@
+     # If the names don't match, there is no relationship between them.
+     return undef if $$p[1] ne $$q[1];
+-    # If the names match, then the only difference is in the version clauses.
+-    # The implication is true if p's clause is stronger than q's, or is
+-    # equivalent.
++    # If the names match, then the only difference is in the architecture or
++    # version clauses.  First, check architecture.  The architectures for p
++    # must be a superset of the architectures for q.
++    my @p_arches = split(' ', $$p[4] || '');
++    my @q_arches = split(' ', $$q[4] || '');
++    if (@p_arches || @q_arches) {
++        my $p_arch_neg = @p_arches && $p_arches[0] =~ /^!/;
++        my $q_arch_neg = @q_arches && $q_arches[0] =~ /^!/;
++
++        # If p has no arches, it is a superset of q and we should fall through
++        # to the version check.
++        if (not @p_arches) {
++            # nothing
++        }
++
++        # If q has no arches, it is a superset of p and there are no useful
++        # implications.
++        elsif (not @q_arches) {
++            return undef;
++        }
++
++        # Both have arches.  If neither are negated, we know nothing useful
++        # unless q is a subset of p.
++        elsif (not $p_arch_neg and not $q_arch_neg) {
++            my %p_arches = map { $_ => 1 } @p_arches;
++            my $subset = 1;
++            for my $arch (@q_arches) {
++                $subset = 0 unless $p_arches{$arch};
++            }
++            return undef unless $subset;
++        }
++
++        # If both are negated, we know nothing useful unless p is a subset of
++        # q (and therefore has fewer things excluded, and therefore is more
++        # general).
++        elsif ($p_arch_neg and $q_arch_neg) {
++            my %q_arches = map { $_ => 1 } @q_arches;
++            my $subset = 1;
++            for my $arch (@p_arches) {
++                $subset = 0 unless $q_arches{$arch};
++            }
++            return undef unless $subset;
++        }
++
++        # If q is negated and p isn't, we'd need to know the full list of
++        # arches to know if there's any relationship, so bail.
++        elsif (not $p_arch_neg and $q_arch_neg) {
++            return undef;
++        }
++
++        # If p is negated and q isn't, q is a subset of p iff none of the
++        # negated arches in p are present in q.
++        elsif ($p_arch_neg and not $q_arch_neg) {
++            my %q_arches = map { $_ => 1 } @q_arches;
++            my $subset = 1;
++            for my $arch (@p_arches) {
++                $subset = 0 if $q_arches{substr($arch, 1)};
++            }
++            return undef unless $subset;
++        }
++    }
++
++    # Now, down to version.  The implication is true if p's clause is stronger
++    # than q's, or is equivalent.
+     # If q has no version clause, then p's clause is always stronger.
+     return 1 if not defined $$q[2];
+diff -urNad lintian-1.23.8/lib/Read_taginfo.pm lintian-1.23.21/lib/Read_taginfo.pm
+--- lintian-1.23.8/lib/Read_taginfo.pm 2004-04-18 00:54:33.000000000 +0000
++++ lintian-1.23.21/lib/Read_taginfo.pm        2006-07-18 11:45:09.000000000 +0000
+@@ -16,8 +16,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'} || '/usr/share/lintian';
+ my $debug = $ENV{'LINTIAN_DEBUG'} || 0;
+@@ -105,6 +105,8 @@
+           } elsif (exists $url{$man}) {
+               $foo[$u] = "<a href=\"$url{$man}\">$foo[$u]</a>";
+           }
++      } elsif ($foo[$u] =~ m,\s*([\w_-]+\(\d+\w*\))\s*$,i) {
++          $foo[$u] = "the $foo[$u] manual page";
+       }
+     }
+       
+diff -urNad lintian-1.23.8/lib/Text_utils.pm lintian-1.23.21/lib/Text_utils.pm
+--- lintian-1.23.8/lib/Text_utils.pm   2004-04-18 00:54:32.000000000 +0000
++++ lintian-1.23.21/lib/Text_utils.pm  2006-07-18 11:45:09.000000000 +0000
+@@ -16,8 +16,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ use strict;
+@@ -136,7 +136,7 @@
+               push(@o,"</pre>");
+               $pre=0;
+           }
+-          push(@o,"$_<p>\n");
++          push(@o,"<p>$_\n");
+       }
+     }
+     if ($pre) {
+diff -urNad lintian-1.23.8/lib/Util.pm lintian-1.23.21/lib/Util.pm
+--- lintian-1.23.8/lib/Util.pm 2004-07-06 19:05:33.000000000 +0000
++++ lintian-1.23.21/lib/Util.pm        2006-07-18 11:46:20.000000000 +0000
+@@ -16,8 +16,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Util;
+ use strict;
+@@ -31,7 +31,8 @@
+       slurp_entire_file
+       get_file_md5
+       file_is_encoded_in_non_utf8
+-      fail);
++      fail
++      system_env);
+ use FileHandle;
+ use Pipeline;
+@@ -207,6 +208,23 @@
+       return 0;
+ }
++# Just like system, except cleanses the environment first to avoid any strange
++# side effects due to the user's environment.
++sub system_env {
++    my @whitelist = qw(PATH INTLTOOL_EXTRACT);
++    my %newenv = map { exists $ENV{$_} ? ($_ => $ENV{$_}) : () } @whitelist;
++    my $pid = fork;
++    if (not defined $pid) {
++      return -1;
++    } elsif ($pid == 0) {
++      %ENV = %newenv;
++      exec @_ or die("exec of $_[0] failed: $!\n");
++    } else {
++      waitpid $pid, 0;
++      return $?;
++    }
++}
++
+ # ------------------------
+ sub fail {
diff --git a/nokia-lintian/debian/patches/500-backport-1.23.22-checks-binaries.dpatch b/nokia-lintian/debian/patches/500-backport-1.23.22-checks-binaries.dpatch
new file mode 100755 (executable)
index 0000000..8d97658
--- /dev/null
@@ -0,0 +1,122 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 500-backport-1.23.22-checks-binaries.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Backported checks from lintian 1.23.22.
+
+@DPATCH@
+diff -urNad lintian-1.23.8~/checks/binaries lintian-1.23.8/checks/binaries
+--- lintian-1.23.8~/checks/binaries    2004-07-07 20:17:54.000000000 +0000
++++ lintian-1.23.8/checks/binaries     2006-07-18 13:33:57.000000000 +0000
+@@ -1,4 +1,4 @@
+-# binaries -- lintian check script
++# binaries -- lintian check script -*- perl -*-
+ # Copyright (C) 1998 Christian Schwarz and Richard Braakman
+ #
+@@ -15,8 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Lintian::binaries;
+ use strict;
+@@ -38,6 +38,8 @@
+ my %NEEDED;
+ my %CXXABI;
+ my %OCAML;
++my %SONAME;
++my %KLIBC;
+ # read architecture file
+ if (open(IN,"fields/architecture")) {
+@@ -92,6 +94,9 @@
+           push @{$NEEDED{$file}}, $1;
+       } elsif (m/^\s*RPATH\s*(\S+)/o) {
+           $RPATH{$file} = $1;
++      } elsif (m/^\s*SONAME\s*(\S+)/o) {
++          $SONAME{$1} ||= [];
++          push @{$SONAME{$1}}, $file;
+       } elsif (m/^\s*\d+\s+\.comment\s+/o) {
+           $COMMENT{$file} = 1;
+       } elsif (m/^\s*\d+\s+\.note\s+/o) {
+@@ -102,13 +107,57 @@
+           fail("file format not recognized for $1\nif you are checking non-i386 binaries, you'll need to install binutils-multiarch\n");
+       } elsif (m/^objdump: \.(.*?): Packed with UPX$/) {
+           tag "binary-file-compressed-with-upx", "$1";
++      } elsif (m/^objdump: \.(.*?): Invalid operation$/) {
++          tag "binary-with-bad-dynamic-table", "$file" unless $file =~ m%^\./usr/lib/debug/%;
+       } elsif (m/CXXABI/) {
+           $CXXABI{$file} = 1;
++      } elsif (m%Requesting program interpreter:\s+/lib/klibc-\S+\.so%) {
++          $KLIBC{$file} = 1;
+       }
+     }
+ }
+ close(IN);
++# For the package naming check, filter out SONAMEs where all the files are
++# at paths other than /lib, /usr/lib, or /usr/X11R6/lib.  This avoids false
++# positives with plugins like Apache modules, which may have their own
++# SONAMEs but which don't matter for the purposes of this check.
++sub lib_soname_path {
++    my (@paths) = @_;
++    foreach my $path (@paths) {
++      return 1 if $path =~ m%^(\.?/)?lib/[^/]+$%;
++      return 1 if $path =~ m%^(\.?/)?usr/lib/[^/]+$%;
++      return 1 if $path =~ m%^(\.?/)?usr/X11R6/lib/[^/]+$%;
++    }
++    return 0;
++}
++my @sonames = grep { lib_soname_path (@{$SONAME{$_}}) } keys %SONAME;
++tag "several-sonames-in-same-package", "@sonames" if @sonames > 1;
++
++# try to identify transition strings
++my $base_pkg = $pkg;
++$base_pkg =~ s/c102\b//o;
++$base_pkg =~ s/c2a?\b//o;
++$base_pkg =~ s/\dg$//o;
++$base_pkg =~ s/-udeb$//o;
++$base_pkg =~ s/^lib64/lib/o;
++
++my $match_found = 0;
++foreach my $expected_name (@sonames) {
++    $expected_name =~ s/([0-9])\.so\./$1-/;
++    $expected_name =~ s/\.so(\.|$)//o;
++    $expected_name =~ s/_/-/o;
++
++    if ((lc($expected_name) eq $pkg)
++      || (lc($expected_name) eq $base_pkg)) {
++      $match_found = 1;
++      last;
++    }
++}
++
++tag "package-name-doesnt-match-sonames", "@sonames"
++    if @sonames && !$match_found;
++
+ # process all files in package
+ open(IN,"file-info") or fail("cannot find file-info for $type package $pkg");
+ while (<IN>) {
+@@ -175,13 +224,14 @@
+     my %libc5_binary;
+     my @needed;
+     if (!exists($NEEDED{$file}) && !defined($NEEDED{$file})) {
+-      if ($info =~ m/shared object/o) {
++      if ($info =~ m/shared object/o && $file !~ m#^\./usr/lib/debug/#) {
+           tag "shared-lib-without-dependency-information", "$file";
+       } else {
+           # Some exceptions: files in /boot, /usr/lib/debug/*, named *-static or
+           # *.static, or *-static as package-name.
+-          use File::Basename;
+-          next if (dirname($file) eq './boot');
++          next if ($file =~ m#^./boot/#);
++          # klibc binaries appear to be static.
++          next if ($KLIBC{$file});
+           # Location of debugging symbols:
+           next if ($file =~ m#^./usr/lib/debug/#);
+           next if ($file =~ /(\.|-)static$/);
diff --git a/nokia-lintian/debian/patches/500-backport-1.23.22-frontend.dpatch b/nokia-lintian/debian/patches/500-backport-1.23.22-frontend.dpatch
new file mode 100755 (executable)
index 0000000..f99e93a
--- /dev/null
@@ -0,0 +1,672 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 500-backport-1.23.22-frontend.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Backported frontends from lintian 1.23.22
+
+@DPATCH@
+diff -urNad lintian-1.23.8/frontend/lintian lintian-1.23.22/frontend/lintian
+--- lintian-1.23.8/frontend/lintian    2005-01-02 00:29:42.000000000 +0000
++++ lintian-1.23.22/frontend/lintian   2006-07-19 11:57:17.000000000 +0000
+@@ -17,8 +17,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ # }}}
+ # {{{ libraries and such
+@@ -64,6 +64,8 @@
+ my $LINTIAN_CFG = "";         #config file to use
+ our $LINTIAN_ROOT;            #location of the lintian modules
++my $experimental_output_opts = undef;
++
+ my @packages;
+ my $action;
+@@ -72,7 +74,7 @@
+ my $unpack_info;
+ my $cwd;
+ my $cleanup_filename;
+-my $exit_code;
++my $exit_code = 0;
+ my $LAB;
+ my %collection_info;
+@@ -258,6 +260,9 @@
+              "unpack-info|U=s" => \&record_unpack_info,
+              "md5sums|m" => \$check_md5sums,
+              "allow-root" => \$allow_root,
++             # Note: Ubuntu has (and other derivatives might gain) a
++             # -D/--debian option to make lintian behave like in Debian, that
++             # is, to revert distribution-specific changes
+              # ------------------ configuration options
+              "cfg=s" => \$LINTIAN_CFG,
+@@ -274,6 +279,9 @@
+              "source|s" => \&record_pkgmode,
+              "udeb" => \&record_pkgmode,
+              "packages-file|p=s" => \$packages_file,
++
++             # ------------------ experimental
++             "exp-output:s" => \$experimental_output_opts,
+             );
+ # init commandline parser
+@@ -385,7 +393,7 @@
+ # LINTIAN_ARCH must have a value.
+ unless (defined $LINTIAN_ARCH) {
+     if ($LINTIAN_DIST) {
+-      chop($LINTIAN_ARCH=`dpkg --print-installation-architecture`);
++      chop($LINTIAN_ARCH=`dpkg --print-architecture`);
+     } else {
+       $LINTIAN_ARCH = 'any';
+     }
+@@ -475,7 +483,14 @@
+ import Util;
+ import Pipeline;
+-# }}} 
++require Tags;
++import Tags;
++
++my @l_secs = read_dpkg_control("$LINTIAN_ROOT/checks/lintian.desc");
++shift(@l_secs);
++map Tags::add_tag($_), @l_secs;
++
++# }}}
+ # {{{ No clue why this code is here...
+@@ -607,6 +622,7 @@
+               next;
+           }
++          Tags::set_pkg( $arg, $arg_name, "", "", 'binary' );
+           # check distribution field
+           if (! (($data->{'distribution'} eq 'stable')
+                 or ($data->{'distribution'} eq 'testing')
+@@ -616,7 +632,8 @@
+                 or ($data->{'distribution'} =~ /\w+-security/))
+                ) {
+               # bad distribution entry
+-              print "E: $arg_name: bad-distribution-in-changes-file $data->{'distribution'}\n";
++              tag("bad-distribution-in-changes-file",
++                  $data->{'distribution'});
+           }
+           # process all listed `files:'
+@@ -636,7 +653,7 @@
+               if (-s $filename ne $size) {
+                   print "N: size is $size, argname is $arg_name, filename is $filename\n";
+-                  print "E: $arg_name: file-size-mismatch-in-changes-file $file\n";
++                  tag( "file-size-mismatch-in-changes-file", $file );
+               }
+       
+               # check md5sums
+@@ -644,13 +661,13 @@
+                   my $real_md5sum = get_file_md5($filename);
+                   if ($real_md5sum ne $md5sum) {
+-                      print "E: $arg_name: md5sum-mismatch-in-changes-file $file\n";
++                      tag( "md5sum-mismatch-in-changes-file", $file );
+                   }
+               }
+       
+               # check section
+               if (($section eq 'non-free') or ($section eq 'contrib')) {
+-                  print "E: $arg_name: bad-section-in-changes-file $file $section\n";
++                  tag( "bad-section-in-changes-file", $file, $section );
+               }
+       
+               # process file?
+@@ -668,6 +685,14 @@
+                                    $info->{'version'}, $filename);
+               }
+           }
++
++          unless ($exit_code) {
++              my $stats = Tags::get_stats( $arg );
++              if ($stats->{severity}{4}) {
++                  $exit_code = 1;
++              }
++          }
++
+       } else {
+           fail("bad package file name $arg (neither .deb, .udeb or .dsc file)");
+       }
+@@ -850,10 +875,22 @@
+ # {{{ Now we're ready to load info about checks & tags
+-require Tags;
+-import Tags;
++no warnings 'once';
++if (defined $experimental_output_opts) {
++    $Tags::output_formatter = \&Tags::print_tag_new;
++    my %opts = map { split(/=/) } split( /,/, $experimental_output_opts );
++    foreach (keys %opts) {
++      if ($_ eq 'format') {
++          if ($opts{$_} eq 'colons') {
++              require Tags::ColonSeparated;
++              $Tags::output_formatter = \&Tags::ColonSeparated::print_tag;
++          }
++      }
++      no strict 'refs';
++      ${"Tags::$_"} = $opts{$_};
++    }
++}
+-no warnings;
+ $Tags::show_info = $display_infotags;
+ $Tags::show_overrides = $show_overrides;
+ use warnings;
+@@ -920,10 +957,10 @@
+           }
+       }
++      shift(@secs);
++      map Tags::add_tag($_), @secs;
+     } # end: if ne lintian
+-    shift(@secs);
+-    map Tags::add_tag($_), @secs;
+ }
+ closedir(CHECKDIR);
+@@ -1056,8 +1093,6 @@
+     printf "N: Selected checks: %s\n",join(',',keys %checks);
+ }
+-$exit_code = 0;
+-
+ require Checker;
+ # for each package (the `reverse sort' is to make sure that source packages are
+@@ -1203,7 +1238,7 @@
+     }
+     if ($action eq 'check') {         # read override file
+-      Tags::pkg_reset($long_type eq 'binary' ? $pkg : "$pkg $long_type");
++      Tags::set_pkg( $file, $pkg, "", "", $long_type );
+       unless ($no_override) 
+@@ -1259,21 +1294,25 @@
+               print "N: Skipping $action of $long_type package $pkg\n";
+               next PACKAGE;
+           }
++
++      }
++      unless ($exit_code) {
++          my $stats = Tags::get_stats( $file );
++          if ($stats->{severity}{4}) {
++              $exit_code = 1;
++          }
+       }
+       # report unused overrides
+-#     if (not $no_override and $verbose) {
+-#         my $ppkg = $type eq 'b' ? quotemeta($pkg) : quotemeta("$pkg $long_type");
+-#         for my $o (sort keys %overridden) {
+-#             next unless $o =~ /^$ppkg:/;
+-#             next if $overridden{$o};
+-#
+-#             print "I: $pkg: unused-override $o\n";
+-#
+-#             # mark override entry as used
+-#             $overridden{$o} = 99999;
+-#         }
+-#     }
++      if (not $no_override and $verbose) {
++          my $overrides = Tags::get_overrides( $file );
++
++          for my $o (sort keys %$overrides) {
++              next if $overrides->{$o};
++
++              tag( "unused-override", $o );
++          }
++      }
+     }
+     # chdir to lintian root directory (to unlock $base so it can be removed below)
+diff -urNad lintian-1.23.8/frontend/lintian-info lintian-1.23.22/frontend/lintian-info
+--- lintian-1.23.8/frontend/lintian-info       2004-11-24 22:44:09.000000000 +0000
++++ lintian-1.23.22/frontend/lintian-info      2006-07-19 11:57:17.000000000 +0000
+@@ -17,8 +17,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ use strict;
+@@ -48,6 +48,7 @@
+     my ($type, $pkg, @pieces) = split(/:\s+/);
+     if ($type =~ m/^[OEWIX]$/) {
+       $tag = shift @pieces;
++      next if not defined $tag;
+       ($tag) = split(/\s+/, $tag, 2);
+       next if not exists $tag_info{$tag} or $already_displayed{$tag}++;
+diff -urNad lintian-1.23.8/lib/Tags/ColonSeparated.pm lintian-1.23.22/lib/Tags/ColonSeparated.pm
+--- lintian-1.23.8/lib/Tags/ColonSeparated.pm  1970-01-01 00:00:00.000000000 +0000
++++ lintian-1.23.22/lib/Tags/ColonSeparated.pm 2006-07-19 11:58:28.000000000 +0000
+@@ -0,0 +1,55 @@
++# Tags::ColonSeparated -- Perl tags functions for lintian
++# $Id: Tags.pm 489 2005-09-17 00:06:30Z djpig $
++
++# Copyright (C) 2005 Frank Lichtenheld <frank@lichtenheld.de>
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, you can find it on the World Wide
++# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
++
++package Tags::ColonSeparated;
++use strict;
++use warnings;
++
++sub quote_char {
++    my ( $char, @items ) = @_;
++
++    foreach (@items) {
++      s/\\/\\\\/go;
++      s/\Q$char\E/\\$char/go;
++    }
++
++    return @items;
++}
++
++sub print_tag {
++    my ( $pkg_info, $tag_info, $information ) = @_;
++
++    my $extra = "@$information";
++
++    print join(':', quote_char( ':',
++                              $tag_info->{severity},
++                              $tag_info->{significance},
++                              @{$tag_info->{overridden}}{'override',
++                                                         'severity',
++                                                         'significance'},
++                              @{$pkg_info}{'pkg','version','arch','type'},
++                              $tag_info->{tag},
++                              $extra,
++                              ))."\n";
++}
++
++1;
++
+diff -urNad lintian-1.23.8/lib/Tags.pm lintian-1.23.22/lib/Tags.pm
+--- lintian-1.23.8/lib/Tags.pm 2006-07-18 13:39:52.000000000 +0000
++++ lintian-1.23.22/lib/Tags.pm        2006-07-19 11:57:40.000000000 +0000
+@@ -1,7 +1,8 @@
+ # Tags -- Perl tags functions for lintian
+-# $Id: Tags.pm 364 2004-11-13 21:07:48Z djpig $
++# $Id: Tags.pm 510 2005-10-14 00:19:49Z djpig $
+ # Copyright (C) 1998-2004 Various authors
++# Copyright (C) 2005 Frank Lichtenheld <frank@lichtenheld.de>
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+@@ -16,30 +17,30 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ package Tags;
+ use strict;
+-
+-use Util;
++use warnings;
+ use Exporter;
+ our @ISA = qw(Exporter);
+ our @EXPORT = qw(tag);
+-my $LINTIAN_ROOT = $::LINTIAN_ROOT;
+-
+-# Can also be more precise later on (only verbose with lab actions) but for
+-# now this will do --Jeroen
+-my $verbose = $::verbose;
+-my $debug = $::debug;
+-
+-# What to print between the "E:" and the tag, f.e. "package source"
+-our $prefix = undef;
++# configuration variables and defaults
++our $verbose = $::verbose;
++our $debug = $::debug;
+ our $show_info = 0;
++our $show_overrides = 0;
++our $output_formatter = \&print_tag;
++our $min_severity = 1;
++our $max_severity = 99;
++our $min_significance = 1;
++our $max_significance = 99;
+-# The master hash with all tag info. Key is a hash too, with these stuff:
++# The master hash with all tag info. Key is the tag name, value another hash
++# with the following keys:
+ # - tag: short name
+ # - type: error/warning/info/experimental
+ # - info: Description in HTML
+@@ -47,53 +48,265 @@
+ # - experimental: experimental status (possibly undef)
+ my %tags;
+-our $show_overrides;
+-# in the form overrides->tag or full thing
+-my %overrides;
++# Statistics per file. Key is the filename, value another hash with the
++# following keys:
++# - overrides
++# - tags
++# - severity
++# - significance
++my %stats;
+-my $codes = { 'error' => 'E' , 'warning' => 'W' , 'info' => 'I' };
++# Info about a specific file. Key is the the filename, value another hash
++# with the following keys:
++# - pkg: package name
++# - version: package version
++# - arch: package architecture
++# - type: one of 'binary', 'udeb' or 'source'
++# - overrides: hash with all overrides for this file as keys
++my %info;
++# Currently selected file (not package!)
++my $current;
+-# TODO
+-# - override support back in --> just the unused reporting
+-# - be able to return whether any errors were there, better, full stats
++# Compatibility stuff
++my %codes = ( 'error' => 'E' , 'warning' => 'W' , 'info' => 'I' );
++our %type_to_sev = ( error => 4, warning => 2, info => 0 );
++our @sev_to_type = qw( info warning warning error error );
+-# Call this function to add a certain tag, by supplying the info as a hash
++my @sig_to_qualifier = ( '??', '?', '', '!' );
++my @sev_to_code = qw( I W W E E );
++
++# Add a new tag, supplied as a hash reference
+ sub add_tag {
+       my $newtag = shift;
+-      fail("Duplicate tag: $newtag->{'tag'}")
+-              if exists $tags{$newtag->{'tag'}};
+-      
++      if (exists $tags{$newtag->{tag}}) {
++          warn "Duplicate tag: $newtag->{tag}\n";
++          return 0;
++      }
++
++      # smooth transition
++      $newtag->{type} = $sev_to_type[$newtag->{severity}]
++          unless $newtag->{type};
++      $newtag->{significance} = 2 unless exists $newtag->{significance};
++      $newtag->{severity} = $type_to_sev{$newtag->{type}}
++          unless exists $newtag->{severity};
+       $tags{$newtag->{'tag'}} = $newtag;
++      return 1;
+ }
+-# Used to reset the matched tags data
+-sub pkg_reset {
+-      $prefix = shift;
+-      %overrides = ();
++# Add another file, will fail if there is already stored info about
++# the file
++sub set_pkg {
++    my ( $file, $pkg, $version, $arch, $type ) = @_;
++
++    if (exists $info{$file}) {
++      warn "File $file was already processed earlier\n";
++      return 0;
++    }
++
++    $current = $file;
++    $info{$file} = {
++      pkg => $pkg,
++      version => $version,
++      arch => $arch,
++      type => $type,
++      overrides => {},
++    };
++    $stats{$file} = {
++      severity => {},
++      significance => {},
++      tags => {},
++      overrides => {},
++    };
++
++    return 1;
+ }
+-# Add an override, string tag, string rest
++# select another file as 'current' without deleting or adding any information
++# the file must have been added with add_pkg
++sub select_pkg {
++    my ( $file ) = @_;
++
++    unless (exists $info{$file}) {
++      warn "Can't select package $file";
++      return 0;
++    }
++
++    $current = $file;
++    return 1;
++}
++
++# only delete the value of 'current' without deleting any stored information
++sub reset_pkg {
++    undef $current;
++    return 1;
++}
++
++# delete all the stored information (including tags)
++sub reset {
++    undef %stats;
++    undef %info;
++    undef %tags;
++    undef $current;
++    return 1;
++}
++
++# Add an override. If you specifiy two arguments, the first will be taken
++# as file to add the override to, otherwise 'current' will be assumed
+ sub add_override {
+-      my $tag = shift;
+-      $overrides{$tag} = 0;
++    my ($tag, $file) = ( "", "" );
++    if (@_ > 1) {
++      ($file, $tag) = @_;
++    } else {
++      ($file, $tag) = ($current, @_);
++    }
++
++    unless ($file) {
++      warn "Don't know which package to add override $tag to";
++      return 0;
++    }
++
++    $info{$file}{overrides}{$tag} = 0;
++
++    return 1;
++}
++
++sub get_overrides {
++    my ($file) = @_;
++
++    unless ($file) {
++      warn "Don't know which package to get overrides from";
++      return undef;
++    }
++
++    return $info{$file}{overrides};
++}
++
++# Get the info hash for a tag back as a reference. The hash will be
++# copied first so that you can edit it safely
++sub get_tag_info {
++    my ( $tag ) = @_;
++    return { %{$tags{$tag}} } if exists $tags{$tag};
++    return undef;
++}
++
++sub check_range {
++    my ( $x, $min, $max ) = @_;
++
++    return -1 if $x < $min;
++    return 1 if $x > $max;
++    return 0;
++}
++
++# check if a certain tag has a override for the 'current' package
++sub check_overrides {
++    my ( $tag_info, $information ) = @_;
++
++    my $extra = '';
++    $extra = " @$information" if @$information;
++    $extra = '' if $extra eq ' ';
++    if( exists $info{$current}{overrides}{$tag_info->{tag}}) {
++      $info{$current}{overrides}{$tag_info->{tag}}++;
++      return $tag_info->{tag};
++    } elsif( exists $info{$current}{overrides}{"$tag_info->{tag}$extra"} ) {
++      $info{$current}{overrides}{"$tag_info->{tag}$extra"}++;
++      return "$tag_info->{tag}$extra";
++    }
++
++    return '';
++}
++
++# sets all the overridden fields of a tag_info hash correctly
++sub check_need_to_show {
++    my ( $tag_info, $information ) = @_;
++    $tag_info->{overridden}{override} = check_overrides( $tag_info,
++                                                       $information );
++    my $min_sev = $show_info ? 0 : $min_severity; # compat hack
++    $tag_info->{overridden}{severity} = check_range( $tag_info->{severity},
++                                                   $min_sev,
++                                                   $max_severity );
++    $tag_info->{overridden}{significance} = check_range( $tag_info->{significance},
++                                                       $min_significance,
++                                                       $max_significance );
+ }
++# records the stats for a given tag_info hash
++sub record_stats {
++    my ( $tag_info ) = @_;
++
++    for my $k (qw( severity significance tag )) {
++      $stats{$current}{$k}{$tag_info->{$k}}++
++          unless $tag_info->{overridden}{$k};
++    }
++    for my $k (qw( severity significance override )) {
++      $stats{$current}{overrides}{$k}{$tag_info->{overridden}{$k}}++
++          if $tag_info->{overridden}{$k};
++    }
++}
++
++# get the statistics for a file (one argument) or for all files (no argument)
++sub get_stats {
++    my ( $file ) = @_;
++
++    return $stats{$file} if $file;
++    return \%stats;
++}
++
++sub print_tag {
++    my ( $pkg_info, $tag_info, $information ) = @_;
++
++    my $extra = '';
++    $extra = " @$information" if @$information;
++    $extra = '' if $extra eq ' ';
++    my $code = $codes{$tag_info->{type}};
++    $code = 'O' if $tag_info->{overridden}{override};
++    my $type = '';
++    $type = " $pkg_info->{type}" if $pkg_info->{type} ne 'binary';
++
++    print "$code: $pkg_info->{pkg}$type: $tag_info->{tag}$extra\n";
++}
++
++sub print_tag_new {
++    my ( $pkg_info, $tag_info, $information ) = @_;
++
++    my $extra = '';
++    $extra = " @$information" if @$information;
++    $extra = '' if $extra eq ' ';
++    my $code = $sev_to_code[$tag_info->{severity}];
++    $code = 'O' if $tag_info->{overridden}{override};
++    my $qualifier = $sig_to_qualifier[$tag_info->{significance}];
++    $qualifier = '' if $code eq 'O';
++    my $type = '';
++    $type = " $pkg_info->{type}" if $pkg_info->{type} ne 'binary';
++
++    print "$code$qualifier: $pkg_info->{pkg}$type: $tag_info->{tag}$extra\n";
++
++}
+ sub tag {
+-      my $tag = shift;
+-      my $info = $tags{$tag};
+-      return if not $show_info and $info->{'type'} eq 'info';
+-      my $extra = '';
+-      $extra = ' '.join(' ', @_) if $#_ >=0;
+-      $extra = '' if $extra eq ' ';
+-      my $code = $codes->{$info->{'type'}};
+-      if (exists $overrides{$tag} or exists $overrides{"$tag$extra"}) {
+-              return unless $show_overrides or $verbose;
+-              $code = 'O';
+-      }
++    my ( $tag, @information ) = @_;
++    unless ($current) {
++      warn "Tried to issue tag $tag without setting package\n";
++      return 0;
++    }
+-      print "$code: $prefix: $tag$extra\n";
++    my $tag_info = get_tag_info( $tag );
++    unless ($tag_info) {
++      warn "Tried to issue unknown tag $tag\n";
++      return 0;
++    }
++    check_need_to_show( $tag_info, \@information );
++
++    record_stats( $tag_info );
++
++    return 1 if
++      $tag_info->{overridden}{severity} != 0
++      || $tag_info->{overridden}{significance} != 0
++      || ( $tag_info->{overridden}{override} &&
++           !$show_overrides);
++
++    &$output_formatter( $info{$current}, $tag_info, \@information );
++    return 1;
+ }
+ 1;
diff --git a/nokia-lintian/debian/patches/500-backport-1.23.22-tar-wildcard.dpatch b/nokia-lintian/debian/patches/500-backport-1.23.22-tar-wildcard.dpatch
new file mode 100755 (executable)
index 0000000..b5d7135
--- /dev/null
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 500-backport-1.23.22-tar-wildcard.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Pass the --wildcards option to tar, now required by a change in the
+## DP: default tar semantics.
+
+@DPATCH@
+diff -urNad lintian-1.23.8/lib/Util.pm lintian-1.23.22/lib/Util.pm
+--- lintian-1.23.8/lib/Util.pm 2006-07-18 12:04:27.000000000 +0000
++++ lintian-1.23.22/lib/Util.pm        2006-07-18 12:05:25.000000000 +0000
+@@ -139,7 +139,7 @@
+     my $CONTROL = FileHandle->new;
+     pipeline_open($CONTROL,
+                 (sub { exec 'ar', 'p', $file, 'control.tar.gz' }),
+-                (sub { exec 'tar', 'xfzO', '-', '*control' }))
++                (sub { exec 'tar', '--wildcards', '-xzO', '-f', '-', '*control' }))
+       or fail("cannot fork to unpack $file: $!\n");
+     my @data = parse_dpkg_control($CONTROL);
+     close($CONTROL) or fail("broken input pipe for unpacking $file: $!");
diff --git a/nokia-lintian/debian/patches/500-backport-1.23.23-tilda-bts-381965.dpatch b/nokia-lintian/debian/patches/500-backport-1.23.23-tilda-bts-381965.dpatch
new file mode 100755 (executable)
index 0000000..2455a58
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 500-backport-1.23.23-tilda-bts-381965.dpatch by Alexander Kanevskiy <alexander.kanevskiy@nokia.com>
+##
+## DP: Backport of BTS#381965
+
+--- lintian-1.23.22/checks/fields      2007-03-07 11:48:23.768122905 +0200
++++ lintian-1.23.23/checks/fields      2007-03-07 11:49:32.144002314 +0200
+@@ -709,7 +709,7 @@
+       # epoch check means nothing here... This check is only useful to detect
+       # weird characters in version (and to get the debian revision)
+-      if ($ver =~ m/^(\d+:)?([-\.+:A-Z0-9]+?)(-[\.+A-Z0-9]+)?$/i) {
++      if ($ver =~ m/^(\d+:)?([-\.+:~A-Z0-9]+?)(-[\.+~A-Z0-9]+)?$/i) {
+               return ($1, $2, $3);
+       } else {
+               return ();
diff --git a/nokia-lintian/debian/patches/800-allow-architecture-armel.dpatch b/nokia-lintian/debian/patches/800-allow-architecture-armel.dpatch
new file mode 100755 (executable)
index 0000000..b06b32f
--- /dev/null
@@ -0,0 +1,21 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 800-allow-architecture-armel.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Allow Architecture: armel
+
+@DPATCH@
+diff -urNad lintian-1.23.8~/checks/common_data.pm lintian-1.23.8/checks/common_data.pm
+--- lintian-1.23.8~/checks/common_data.pm      2006-06-25 03:35:57.000000000 +0000
++++ lintian-1.23.8/checks/common_data.pm       2006-07-13 08:38:10.000000000 +0000
+@@ -20,6 +20,10 @@
+     ('i386', 'ia64', 'alpha', 'amd64', 'arm', 'hppa', 'm68k', 'mips',
+      'mipsel', 'powerpc', 's390', 'sparc', 'hurd-i386', 'any', 'all');
++# Patch:
++# Allow Architecture: armel
++map { $known_archs{$_} = 1 } qw( armel );
++
+ # From /usr/share/dpkg/cputable, included here to make lintian results
+ # consistent no matter what dpkg one has installed.
+ %all_cpus = map { $_ => 1 }
diff --git a/nokia-lintian/debian/patches/800-allow-comments-in-debian-control.dpatch b/nokia-lintian/debian/patches/800-allow-comments-in-debian-control.dpatch
new file mode 100755 (executable)
index 0000000..d44ddf1
--- /dev/null
@@ -0,0 +1,43 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 800-allow-comments-in-debian-control.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Ignore comments while looking for duplicated fields in debian/control.
+## DP: Comments have been supported since dpkg 1.10.11.
+
+@DPATCH@
+diff -urNad lintian~/checks/control-file lintian/checks/control-file
+--- lintian~/checks/control-file       2006-09-21 15:06:59.000000000 +0300
++++ lintian/checks/control-file        2006-09-21 15:14:04.000000000 +0300
+@@ -46,6 +46,15 @@
+ open (CONTROL, '<', "debfiles/control")
+     or fail "Couldn't read debfiles/control: $!";
+ while (<CONTROL>) {
++      # Patch:
++      # Ignore comments.
++      if (/^#/) {
++              if (/^#\s*[Pp]ackage:\s*(\S*)/) {
++                      tag "debian-control-with-out-commented-binary-section", "Package $1";
++              }
++              next;
++      }
++
+       s/\s*\n$//;
+       next if /^\#/;
+diff -urNad lintian~/checks/control-file.desc lintian/checks/control-file.desc
+--- lintian~/checks/control-file.desc  2006-09-21 15:06:59.000000000 +0300
++++ lintian/checks/control-file.desc   2006-09-21 15:12:48.000000000 +0300
+@@ -25,6 +25,12 @@
+  section.  These specify source package relationships, and should be in
+  the source section of the control file.
++Tag: debian-control-with-out-commented-binary-section
++Type: warning
++Info: The Debian control file contains a binary section which is commented out.
++ The binary section is not used and should thus be removed from
++ the Debian control file.
++
+ Tag: debian-control-with-duplicate-fields
+ Type: error
+ Info: One of the paragraphs of your debian/control contains the same
diff --git a/nokia-lintian/debian/patches/800-allow-relocatable-objects.dpatch b/nokia-lintian/debian/patches/800-allow-relocatable-objects.dpatch
new file mode 100755 (executable)
index 0000000..2efd324
--- /dev/null
@@ -0,0 +1,18 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 800-allow-relocatable-objects.dpatch.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Allow relocatable objects even if they are not .o or .ko files.
+
+@DPATCH@
+
+--- lintian-1.24.2.orig/checks/binaries        2008-08-01 11:42:34.000000000 +0300
++++ lintian~/checks/binaries   2008-08-01 11:56:57.000000000 +0300
+@@ -216,6 +216,7 @@
+       # a kernel module, debugging symbols, or perhaps a debugging package?
+       # Ocaml executables are exempted, see #252695
+       unless ($file =~ m,\.k?o$, or $pkg =~ m/-dbg$/ or $pkg =~ m/debug/
++              or $info =~ /\bLSB relocatable\b/
+               or $file =~ m,/lib/debug/, or exists $OCAML{$file}) {
+           tag "unstripped-binary-or-object", "$file";
+       }
diff --git a/nokia-lintian/debian/patches/800-correct-perm2oct.dpatch b/nokia-lintian/debian/patches/800-correct-perm2oct.dpatch
new file mode 100755 (executable)
index 0000000..5473dd7
--- /dev/null
@@ -0,0 +1,231 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 800-correct-perm2oct.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix perm2oct to correctly detect set-{user,group}-ID and sticky bits.
+
+@DPATCH@
+diff -urNad lintian-1.23.8~/checks/control-files lintian-1.23.8/checks/control-files
+--- lintian-1.23.8~/checks/control-files       2006-07-18 12:12:55.000000000 +0000
++++ lintian-1.23.8/checks/control-files        2006-07-18 12:15:10.000000000 +0000
+@@ -20,6 +20,7 @@
+ package Lintian::control_files;
+ use strict;
++use PermModes;
+ use Tags;
+ sub run {
+@@ -104,30 +105,6 @@
+ } # </run>
+-# translate permission strings like `-rwxrwxrwx' into an octal number
+-sub perm2oct {
+-    my ($t) = @_;
+-
+-    my $o = 0;
+-
+-    $t =~ m/^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/o;
+-
+-    $o += 04000 if $3 eq 's'; # set-uid
+-    $o += 02000 if $6 eq 's'; # set-gid
+-    $o += 01000 if $9 eq 't'; # sticky bit
+-    $o += 00400 if $1 ne '-'; # owner read
+-    $o += 00200 if $2 ne '-'; # owner write
+-    $o += 00100 if $3 ne '-'; # owner execute
+-    $o += 00040 if $4 ne '-'; # owner read
+-    $o += 00020 if $5 ne '-'; # owner write
+-    $o += 00010 if $6 ne '-'; # owner execute
+-    $o += 00004 if $7 ne '-'; # owner read
+-    $o += 00002 if $8 ne '-'; # owner write
+-    $o += 00001 if $9 ne '-'; # owner execute
+-
+-    return $o;
+-}
+-
+ 1;
+ # vim: syntax=perl sw=4 ts=8
+diff -urNad lintian-1.23.8~/checks/files lintian-1.23.8/checks/files
+--- lintian-1.23.8~/checks/files       2006-07-18 12:14:48.000000000 +0000
++++ lintian-1.23.8/checks/files        2006-07-18 12:15:10.000000000 +0000
+@@ -21,6 +21,7 @@
+ package Lintian::files;
+ use strict;
+ use Dep;
++use PermModes;
+ use Tags;
+ use Util;
+@@ -763,30 +764,6 @@
+ }
+-# translate permission strings like `-rwxrwxrwx' into an octal number
+-sub perm2oct {
+-    my ($t) = @_;
+-
+-    my $o = 0;
+-
+-    $t =~ m/^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/;
+-
+-    $o += 04000 if $3 eq 's'; # set-uid
+-    $o += 02000 if $6 eq 's'; # set-gid
+-    $o += 01000 if $9 eq 't'; # sticky bit
+-    $o += 00400 if $1 ne '-'; # owner read
+-    $o += 00200 if $2 ne '-'; # owner write
+-    $o += 00100 if $3 ne '-'; # owner execute
+-    $o += 00040 if $4 ne '-'; # owner read
+-    $o += 00020 if $5 ne '-'; # owner write
+-    $o += 00010 if $6 ne '-'; # owner execute
+-    $o += 00004 if $7 ne '-'; # owner read
+-    $o += 00002 if $8 ne '-'; # owner write
+-    $o += 00001 if $9 ne '-'; # owner execute
+-
+-    return $o;
+-}
+-
+ 1;
+ # vim: syntax=perl ts=8 sw=4
+diff -urNad lintian-1.23.8~/checks/menus lintian-1.23.8/checks/menus
+--- lintian-1.23.8~/checks/menus       2006-07-18 12:12:55.000000000 +0000
++++ lintian-1.23.8/checks/menus        2006-07-18 12:16:29.000000000 +0000
+@@ -22,6 +22,7 @@
+ package Lintian::menus;
+ use strict;
++use PermModes;
+ use Tags;
+ use Util;
+@@ -207,30 +208,6 @@
+ # -----------------------------------
+-# translate permission strings like `-rwxrwxrwx' into an octal number
+-sub perm2oct {
+-    my ($t) = @_;
+-
+-    my $o = 0;
+-
+-    $t =~ /^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/o;
+-
+-    $o += 04000 if $3 eq 's'; # set-uid
+-    $o += 02000 if $6 eq 's'; # set-gid
+-    $o += 01000 if $9 eq 't'; # sticky bit
+-    $o += 00400 if $1 ne '-'; # owner read
+-    $o += 00200 if $2 ne '-'; # owner write
+-    $o += 00100 if $3 ne '-'; # owner execute
+-    $o += 00040 if $4 ne '-'; # owner read
+-    $o += 00020 if $5 ne '-'; # owner write
+-    $o += 00010 if $6 ne '-'; # owner execute
+-    $o += 00004 if $7 ne '-'; # owner read
+-    $o += 00002 if $8 ne '-'; # owner write
+-    $o += 00001 if $9 ne '-'; # owner execute
+-
+-    return $o;
+-}
+-
+ sub check_script {
+     my ($script,$pres) = @_;
+     my ($no_check_menu,$no_check_installdocs,$no_check_wmmenu,$calls_wmmenu);
+diff -urNad lintian-1.23.8~/checks/shared-libs lintian-1.23.8/checks/shared-libs
+--- lintian-1.23.8~/checks/shared-libs 2006-07-18 12:14:48.000000000 +0000
++++ lintian-1.23.8/checks/shared-libs  2006-07-18 12:15:10.000000000 +0000
+@@ -20,6 +20,7 @@
+ package Lintian::shared_libs;
+ use strict;
++use PermModes;
+ use Tags;
+ use File::Basename;
+ use Util;
+@@ -395,30 +396,6 @@
+ }
+-# translate permission strings like `-rwxrwxrwx' into an octal number
+-sub perm2oct {
+-    my ($t) = @_;
+-
+-    my $o = 0;
+-
+-    $t =~ m/^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/o;
+-
+-    $o += 04000 if $3 eq 's'; # set-uid
+-    $o += 02000 if $6 eq 's'; # set-gid
+-    $o += 01000 if $9 eq 't'; # sticky bit
+-    $o += 00400 if $1 ne '-'; # owner read
+-    $o += 00200 if $2 ne '-'; # owner write
+-    $o += 00100 if $3 ne '-'; # owner execute
+-    $o += 00040 if $4 ne '-'; # owner read
+-    $o += 00020 if $5 ne '-'; # owner write
+-    $o += 00010 if $6 ne '-'; # owner execute
+-    $o += 00004 if $7 ne '-'; # owner read
+-    $o += 00002 if $8 ne '-'; # owner write
+-    $o += 00001 if $9 ne '-'; # owner execute
+-
+-    return $o;
+-}
+-
+ # make /tmp/baz/baz.txt from /tmp/foo/../bar/../baz/baz.txt
+ sub abs_path {
+     my $path = shift;
+diff -urNad lintian-1.23.8~/lib/PermModes.pm lintian-1.23.8/lib/PermModes.pm
+--- lintian-1.23.8~/lib/PermModes.pm   1970-01-01 00:00:00.000000000 +0000
++++ lintian-1.23.8/lib/PermModes.pm    2006-07-18 12:15:10.000000000 +0000
+@@ -0,0 +1,52 @@
++# Hey emacs! This is a -*- Perl -*- script!
++# PermModes -- Perl file permission mode functions for lintian
++
++# Copyright (C) 2006 Nokia Corporation.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, you can find it on the World Wide
++# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
++
++package PermModes;
++use strict;
++use warnings;
++
++use Exporter;
++our @ISA    = qw( Exporter );
++our @EXPORT = qw(
++      perm2oct
++      );
++
++# translate permission strings like `-rwxrwxrwx' into an octal number
++sub perm2oct($)
++{
++      my @c = split "", shift, 11;
++      my $oct = 0;
++      $oct |= 04000 if $c[3] =~ /s/i;          # set-user-ID
++      $oct |= 02000 if $c[6] =~ /s/i;          # set-group-ID
++      $oct |= 01000 if $c[9] =~ /t/i;          # sticky
++      $oct |= 00400 if $c[1] eq 'r';           # user readable
++      $oct |= 00200 if $c[2] eq 'w';           # user writable
++      $oct |= 00100 if $c[3] =~ /[[:lower:]]/; # user executable
++      $oct |= 00040 if $c[4] eq 'r';           # group readable
++      $oct |= 00020 if $c[5] eq 'w';           # group writable
++      $oct |= 00010 if $c[6] =~ /[[:lower:]]/; # group executable
++      $oct |= 00004 if $c[7] eq 'r';           # world readable
++      $oct |= 00002 if $c[8] eq 'w';           # world writable
++      $oct |= 00001 if $c[9] =~ /[[:lower:]]/; # world executable
++      return $oct;
++}
++
++1;
diff --git a/nokia-lintian/debian/patches/800-implement-tag-override.dpatch b/nokia-lintian/debian/patches/800-implement-tag-override.dpatch
new file mode 100755 (executable)
index 0000000..f21234d
--- /dev/null
@@ -0,0 +1,53 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 800-implement-tag-override.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add support for overriding tag properties.
+
+@DPATCH@
+diff -urNad lintian-1.23.8~/lib/Tags.pm lintian-1.23.8/lib/Tags.pm
+--- lintian-1.23.8~/lib/Tags.pm        2006-07-19 12:21:09.000000000 +0000
++++ lintian-1.23.8/lib/Tags.pm 2006-07-19 14:18:46.000000000 +0000
+@@ -56,6 +56,7 @@
+ # - ref: Any references
+ # - experimental: experimental status (possibly undef)
+ my %tags;
++my @tag_overrides;
+ # Statistics per file. Key is the filename, value another hash with the
+ # following keys:
+@@ -94,6 +94,14 @@
+           return 0;
+       }
++      foreach my $o (@tag_overrides) {
++              next unless $newtag->{tag} =~ /^$o->{tag}$/s;
++              while ( my ($field,$val) = each %$o ) {
++                      next if $field eq 'tag';
++                      $newtag->{$field} = $val;
++              }
++      }
++
+       # smooth transition
+       $newtag->{type} = $sev_to_type[$newtag->{severity}]
+           unless $newtag->{type};
+@@ -104,6 +113,11 @@
+       return 1;
+ }
++sub add_tag_override {
++      push @tag_overrides, shift;
++      return 1;
++}
++
+ # Add another file, will fail if there is already stored info about
+ # the file
+ sub set_pkg {
+@@ -157,6 +171,7 @@
+     undef %stats;
+     undef %info;
+     undef %tags;
++    undef @tag_overrides;
+     undef $current;
+     return 1;
+ }
diff --git a/nokia-lintian/debian/patches/801-allow-dynamic-loaders.dpatch b/nokia-lintian/debian/patches/801-allow-dynamic-loaders.dpatch
new file mode 100755 (executable)
index 0000000..6e33e01
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 801-allow-dynamic-loaders.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Allow dynamic loaders with executable permissions.
+
+@DPATCH@
+diff -urNad lintian~/checks/shared-libs lintian/checks/shared-libs
+--- lintian~/checks/shared-libs        2006-09-21 15:28:04.000000000 +0300
++++ lintian/checks/shared-libs 2006-09-21 15:28:04.000000000 +0300
+@@ -169,8 +169,10 @@
+             if ($real_perm =~ m/x/) {
+                 # yes.  But if the library has an INTERP section, it's designed
+                 # to do something useful when executed, so don't report an error.
++                # Patch:
++                # Dynamic loaders must be executable.
+                 tag "shlib-with-executable-bit", $cur_file, sprintf("%04o",perm2oct($real_perm))
+-                    unless $INTERP{$real_file};
++                    unless $INTERP{$real_file} or $SONAME{$real_file} =~ /^ld-/os;
+             } elsif ($real_perm ne '-rw-r--r--') {
+                 # bad permissions
+                 tag "shlib-with-bad-permissions", $cur_file, sprintf("%04o",perm2oct($real_perm));
diff --git a/nokia-lintian/debian/patches/801-implement-check-tag.dpatch b/nokia-lintian/debian/patches/801-implement-check-tag.dpatch
new file mode 100755 (executable)
index 0000000..187238f
--- /dev/null
@@ -0,0 +1,201 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 801-implement-check-tag.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Implement --{,dont-}check-tag tag1,tag2,...
+
+@DPATCH@
+diff -urNad lintian-1.23.8~/frontend/lintian lintian-1.23.8/frontend/lintian
+--- lintian-1.23.8~/frontend/lintian   2006-09-13 14:55:10.000000000 +0300
++++ lintian-1.23.8/frontend/lintian    2006-09-13 14:55:11.000000000 +0300
+@@ -76,6 +76,8 @@
+ my $action;
+ my $checks;
+ my $dont_check;
++my $check_tags;
++my $dont_check_tags;
+ my $unpack_info;
+ my $cwd;
+ my $cleanup_filename;
+@@ -128,6 +130,8 @@
+     -c, --check               check packages (default action)
+     -C X, --check-part X      check only certain aspects
+     -X X, --dont-check-part X don\'t check certain aspects
++    -T X, --check-tag X       report only certain properties
++    -Y X, --dont-check-tag X  don\'t report certain properties
+     -u, --unpack              only unpack packages in the lab
+     -r, --remove              remove package from the lab
+ General options:
+@@ -183,7 +187,7 @@
+ # Record action requested
+ # Options: -S, -R, -c, -u, -r
+ sub record_action {
+-    if ($action) {
++    if ($action && $action ne $_[0]) {
+       die("too many actions specified: $_[0]");
+     }
+     $action = "$_[0]";
+@@ -192,35 +196,54 @@
+ # Record Parts requested for checking
+ # Options: -C|--check-part
+ sub record_check_part {
+-    if (defined $action and $action eq 'check' and $checks) {
+-      die("multiple -C or --check-part options not allowed");
+-    }
+     if ($dont_check) {
+       die("both -C or --check-part and -X or --dont-check-part options not allowed");
+     }
+-    if ($action) {
++    if ($action && $action ne 'check') {
+       die("too many actions specified: $_[0]");
+     }
+     $action = 'check';
+-    $checks = "$_[1]";
++    $checks .= "$_[1],";
+ }
+ # Record Parts requested not to check
+ # Options: -X|--dont-check-part X
+ sub record_dont_check_part {
+-    if (defined $action and $action eq 'check' and $dont_check) {
+-      die("multiple -x or --dont-check-part options not allowed");
+-    }
+     if ($checks) {
+       die("both -C or --check-part and -X or --dont-check-part options not allowed");
+     }
+-    if ($action) {
++    if ($action && $action ne 'check') {
+       die("too many actions specified: $_[0]");
+     }
+     $action = 'check';
+-    $dont_check = "$_[1]";
++    $dont_check .= "$_[1],";
+ }
++# Record tags requested for checking
++# Options: -T|--check-tag
++sub record_check_tag {
++    if ($dont_check_tags) {
++      die("both -T or --check-tag and -Y or --dont-check-tag options not allowed");
++    }
++    if ($action && $action ne 'check') {
++      die("too many actions specified: $_[0]");
++    }
++    $action = 'check';
++    $check_tags .= "$_[1],";
++}
++
++# Record Parts requested not to check
++# Options: -Y|--dont-check-tag X
++sub record_dont_check_tag {
++    if ($check_tags) {
++      die("both -T or --check-tag and -Y or --dont-check-tag options not allowed");
++    }    
++    if ($action && $action ne 'check') {
++      die("too many actions specified: $_[0]");
++    }
++    $action = 'check';
++    $dont_check_tags .= "$_[1],";
++}
+ # Process for -U|--unpack-info flag
+ sub record_unpack_info {
+@@ -245,6 +268,8 @@
+              "check|c" => \&record_action,
+              "check-part|C=s" => \&record_check_part,
+              "dont-check-part|X=s" => \&record_dont_check_part,
++             "check-tag|T=s" => \&record_check_tag,
++             "dont-check-tag|Y=s" => \&record_dont_check_tag,
+              "unpack|u" => \&record_action,
+              "remove|r" => \&record_action,
+@@ -516,6 +541,15 @@
+ require Tags;
+ import Tags;
++if ($check_tags) {
++    my $re = pattern_list_to_re($check_tags);
++    Tags::add_tag_override({ tag => qr/^(?!$re$).*/os, significance => -1 });
++}
++elsif ($dont_check_tags) {
++    my $re = pattern_list_to_re($dont_check_tags);
++    Tags::add_tag_override({ tag => qr/^$re$/os, significance => -1 });
++}
++
+ my @l_secs = read_dpkg_control("$LINTIAN_ROOT/checks/lintian.desc");
+ shift(@l_secs);
+ map Tags::add_tag($_), @l_secs;
+@@ -1691,6 +1725,25 @@
+ sub by_collection_order {
+     $collection_info{$a}->{'order'} <=> $collection_info{$b}->{'order'};
+ }
++
++sub pattern_list_to_re {
++    my $re =
++      join '|',
++      map {
++          s@([*]+)|([?])|([[]([!^]?)([]]?(?:[[]([=:.]).*?\6[]]|[^]])*)[]])|[\\]?(.)@
++              if    ( defined $1 ) { '.*' }
++              elsif ( defined $2 ) { '.'  }
++              elsif ( defined $3 ) {
++                  my $cl = '[' . ( $4 ? '^' : '' ) . $5 . ']';
++                  eval { qr/$cl/ } ? $cl : quotemeta $3
++              }
++              else { quotemeta $7 }
++              @gex;
++          $_;
++      }
++      split /,/, shift;
++    return qr/$re/o;
++}
+ # }}}
+ # {{{ Exit handler.
+diff -urNad lintian-1.23.8~/man/lintian.1 lintian-1.23.8/man/lintian.1
+--- lintian-1.23.8~/man/lintian.1      2004-08-18 11:00:40.000000000 +0300
++++ lintian-1.23.8/man/lintian.1       2006-09-13 14:55:43.000000000 +0300
+@@ -82,6 +82,21 @@
+ This is the default action.
+ .TP
++.BR \-u ", " \-\-unpack
++Unpack the specified packages up to the current unpack level.
++The default unpack level is 1 for this option.  See the UNPACK
++LEVELS section below.
++
++.TP
++.BR \-r ", " \-\-remove
++Clean up the lintian directory of the specified packages up to
++the current unpack level.  The default unpack level is 0 for
++this option.
++
++.PP
++Check options (these options imply \fB\-\-check\fP):
++
++.TP
+ .BR \-C " chk1,chk2,..., " \-\-check\-part " chk1,chk2,..."
+ Run only the specified checks.  You can either specify the
+ name of the check script or the abbreviation.
+@@ -94,16 +109,14 @@
+ For details, see the CHECKS section below.
+ .TP
+-.BR \-u ", " \-\-unpack
+-Unpack the specified packages up to the current unpack level.
+-The default unpack level is 1 for this option.  See the UNPACK
+-LEVELS section below.
++.BR \-T " tag1,tag2,..., " \-\-check\-tag " tag1,tag2,..."
++Report only the specified check tags.
++You can either specify the tag name or give a glob pattern.
+ .TP
+-.BR \-r ", " \-\-remove
+-Clean up the lintian directory of the specified packages up to
+-the current unpack level.  The default unpack level is 0 for
+-this option.
++.BR \-Y " tag1,tag2,..., " \-\-dont\-check\-part " tag1,tag2,..."
++Report all but the specified check tags.
++You can either specify the tag name or give a glob pattern.
+ .PP
+ General options:
diff --git a/nokia-lintian/debian/patches/801-implement-dbg-checks.dpatch b/nokia-lintian/debian/patches/801-implement-dbg-checks.dpatch
new file mode 100755 (executable)
index 0000000..5a448ac
--- /dev/null
@@ -0,0 +1,73 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 801-implement-dbg-checks.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Require <package>-dbg=<version> to declare dependency on
+## DP: <package>=<version>.
+
+@DPATCH@
+diff -urNad lintian~/checks/control-file lintian/checks/control-file
+--- lintian~/checks/control-file       2006-09-21 15:27:18.000000000 +0300
++++ lintian/checks/control-file        2006-09-21 15:27:18.000000000 +0300
+@@ -84,5 +84,9 @@
+       tag "build-info-in-binary-control-file-section", "Package ".$binary_control->{"package"}
+           if ($binary_control->{"build-depends"} || $binary_control->{"build-depends-indep"} ||
+               $binary_control->{"build-conflicts"} || $binary_control->{"build-conflicts-indep"});
++
++      tag "dbg-binary-control-file-section-lacks-strict-versioned-dependency", "Package ".$binary_control->{"package"}
++          if ($binary_control->{"package"} =~ /^(.*)-dbg$/ &&
++              ($binary_control->{"depends"}||'') !~ /(?:.*,\s*)?\Q$1\E\s*\(\s*=\s*\$\{(?:Source-Version|binary:Version|source:Version)\}\)/);
+ }
+diff -urNad lintian~/checks/control-file.desc lintian/checks/control-file.desc
+--- lintian~/checks/control-file.desc  2006-09-21 15:27:18.000000000 +0300
++++ lintian/checks/control-file.desc   2006-09-21 15:27:18.000000000 +0300
+@@ -31,6 +31,18 @@
+  The binary section is not used and should thus be removed from
+  the Debian control file.
++Tag: dbg-binary-control-file-section-lacks-strict-versioned-dependency
++Type: error
++Info: The dbg package section in the control file does not declare
++ dependency on the binary package of the exact same version.
++ .
++ Debugging symbols are specific to binaries from the same build configuration
++ thus dbg packages must declare dependency on the correcponding binary
++ packages of the exact same version.
++ .
++ Thus, the binary control file section of a package `util-dbg' must contain
++ a field `Depends: util (= ${Source-Version})'.
++
+ Tag: debian-control-with-duplicate-fields
+ Type: error
+ Info: One of the paragraphs of your debian/control contains the same
+diff -urNad lintian~/checks/fields lintian/checks/fields
+--- lintian~/checks/fields     2006-09-21 15:27:18.000000000 +0300
++++ lintian/checks/fields      2006-09-21 15:27:18.000000000 +0300
+@@ -555,6 +555,10 @@
+               }
+       }
++      tag "dbg-package-lacks-strict-versioned-dependency"
++          if ($version && $pkg =~ /^(.*)-dbg$/ &&
++              ($fields{depends}||'') !~ /(?:,\s*)?\Q$1\E\s*\(\s*=\s*\Q$version\E\)/);
++
+       tag "dbg-package-missing-depends", $debugbase
+               if ($debugpackage && !$debugfound);
+
+diff -urNad lintian~/checks/fields.desc lintian/checks/fields.desc
+--- lintian~/checks/fields.desc        2006-09-21 15:27:18.000000000 +0300
++++ lintian/checks/fields.desc 2006-09-21 15:27:18.000000000 +0300
+@@ -753,3 +753,12 @@
+ Info: This package has a name suggesting that it contains detached
+  debugging symbols.  If so, it should have priority "extra" since users
+  normally do not need such packages.
++
++Tag: dbg-package-lacks-strict-versioned-dependency
++Type: error
++Info: The dbg package does not declare dependency on the binary package of
++ the exact same version.
++ .
++ Debugging symbols are specific to binaries from the same build configuration
++ thus dbg packages must declare dependency on the correcponding binary
++ packages of the exact same version.
diff --git a/nokia-lintian/debian/patches/802-implement-overridedir.dpatch b/nokia-lintian/debian/patches/802-implement-overridedir.dpatch
new file mode 100755 (executable)
index 0000000..35f57a3
--- /dev/null
@@ -0,0 +1,117 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 802-implement-overridedir.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Implement --overridedir OVERRIDEDIR
+
+@DPATCH@
+diff -urNad lintian-1.23.8~/frontend/lintian lintian-1.23.8/frontend/lintian
+--- lintian-1.23.8~/frontend/lintian   2006-09-14 16:32:02.000000000 +0300
++++ lintian-1.23.8/frontend/lintian    2006-09-14 16:32:02.000000000 +0300
+@@ -60,6 +60,7 @@
+ my $OPT_LINTIAN_DIST = "";    #string for the --dist option
+ my $OPT_LINTIAN_ARCH = "";    #string for the --arch option
+ my $OPT_LINTIAN_SECTION = ""; #string for the --release option
++my $OPT_LINTIAN_OVERRIDEDIR = ""; #string for the --overridedir option
+ # These options can also be used via default or environment variables
+ my $LINTIAN_CFG = "";         #config file to use
+ our $LINTIAN_ROOT;            #location of the lintian modules
+@@ -93,6 +94,7 @@
+ my $LINTIAN_UNPACK_LEVEL = undef;
+ my $LINTIAN_ARCH = undef;
+ my $LINTIAN_SECTION = undef;
++my $LINTIAN_OVERRIDEDIR = undef;
+ # }}}
+ # {{{ Setup Code
+@@ -156,6 +158,7 @@
+     --dist DIST               scan packages in this distribution (e.g. sid)
+     --section RELEASE         scan packages in this section (e.g. main)
+     --arch ARCH               scan packages with architecture ARCH
++    --overridedir OVERRIDEDIR location of centrally managed override files
+     --root ROOTDIR            use ROOTDIR instead of /usr/share/lintian
+ Package selection options:
+     -a, --all                 process all packages in distribution
+@@ -296,6 +299,7 @@
+              "dist=s" => \$OPT_LINTIAN_DIST,
+              "section=s" => \$OPT_LINTIAN_SECTION,
+              "arch=s" => \$OPT_LINTIAN_ARCH,
++             "overridedir=s" => \$OPT_LINTIAN_OVERRIDEDIR,
+              "root=s" => \$LINTIAN_ROOT,
+              # ------------------ package selection options
+@@ -393,6 +397,8 @@
+           $LINTIAN_SECTION = $1;
+       } elsif (m/^\s*LINTIAN_ARCH\s*=\s*(.*\S)\s*$/i) {
+           $LINTIAN_ARCH = $1;
++      } elsif (m/^\s*LINTIAN_OVERRIDEDIR\s*=\s*(.*\S)\s*$/i) {
++          $LINTIAN_OVERRIDEDIR = $1;
+       } else {
+           fail("syntax error in configuration file: $_","(Note, that the syntax of the configuration file has been changed\nwith Lintian v0.3.0. In most cases, you don't need a configuration\nfile anymore -- just remove it.)");
+       }
+@@ -407,6 +413,7 @@
+ $LINTIAN_UNPACK_LEVEL = $ENV{'LINTIAN_UNPACK_LEVEL'} if $ENV{'LINTIAN_UNPACK_LEVEL'};
+ $LINTIAN_SECTION = $ENV{'LINTIAN_SECTION'} if $ENV{'LINTIAN_SECTION'};
+ $LINTIAN_ARCH = $ENV{'LINTIAN_ARCH'} if $ENV{'LINTIAN_ARCH'};
++$LINTIAN_OVERRIDEDIR = $ENV{'LINTIAN_OVERRIDEDIR'} if $ENV{'LINTIAN_OVERRIDEDIR'};
+ # command-line options override everything
+ $LINTIAN_LAB = $OPT_LINTIAN_LAB if $OPT_LINTIAN_LAB;
+@@ -414,6 +421,7 @@
+ $LINTIAN_DIST = $OPT_LINTIAN_DIST if $OPT_LINTIAN_DIST;
+ $LINTIAN_SECTION = $OPT_LINTIAN_SECTION if $OPT_LINTIAN_SECTION;
+ $LINTIAN_ARCH = $OPT_LINTIAN_ARCH if $OPT_LINTIAN_ARCH;
++$LINTIAN_OVERRIDEDIR = $OPT_LINTIAN_OVERRIDEDIR if $OPT_LINTIAN_OVERRIDEDIR;
+ # LINTIAN_ARCH must have a value.
+ unless (defined $LINTIAN_ARCH) {
+@@ -471,6 +479,12 @@
+     $ENV{'LINTIAN_ARCH'} = "";
+ }
++if ($LINTIAN_OVERRIDEDIR) {
++    $ENV{'LINTIAN_OVERRIDEDIR'} = $LINTIAN_OVERRIDEDIR;
++} else {
++    $ENV{'LINTIAN_OVERRIDEDIR'} = "";
++}
++
+ $ENV{'LINTIAN_DEBUG'} = $debug;
+ # determine requested unpack level
+@@ -1275,6 +1289,9 @@
+       Tags::set_pkg( $file, $pkg, "", "", $long_type );
+-      unless ($no_override) {
+-            if (open(O, '<', "$base/override")) {
++        for my $override (
++           $LINTIAN_OVERRIDEDIR ? "$LINTIAN_OVERRIDEDIR/$long_type/$pkg" : (),
++           $no_override ? () : "$base/override")
++            {
++               if ( open(O,$override) ) {
+                 while (<O>) {
+                     chomp;
+diff -urNad lintian-1.23.8~/man/lintian.1 lintian-1.23.8/man/lintian.1
+--- lintian-1.23.8~/man/lintian.1      2006-09-14 16:32:02.000000000 +0300
++++ lintian-1.23.8/man/lintian.1       2006-09-14 16:34:11.000000000 +0300
+@@ -243,6 +243,21 @@
+ environment variable and the configuration file entry of the same name.
+ .TP
++.BR \-\-overridedir " overridedir"
++Read additional overrides from
++.IR overridedir / type / package
++where
++.I type
++is either
++.BR binary ,
++.BR source
++or
++.BR udeb .
++This option overrides the
++.B LINTIAN_OVERRIDEDIR
++environment variable and the configuration file entry of the same name.
++
++.TP
+ .BR \-\-root " rootdir"
+ Look for
+ .BR lintian 's
diff --git a/nokia-lintian/debian/patches/803-ignore-unknown-elf-format.dpatch b/nokia-lintian/debian/patches/803-ignore-unknown-elf-format.dpatch
new file mode 100755 (executable)
index 0000000..ebcb878
--- /dev/null
@@ -0,0 +1,44 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 803-ignore-unknown-elf-format.dpatch by Alexander Kanevskiy <alexander.kanevskiy@nokia.com>>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Ignore errors for ARM binaries which binutils-multiarch can't parse
+
+@DPATCH@
+diff -urN lintian-1.23.8.org/checks/binaries lintian-1.23.8/checks/binaries
+--- lintian-1.23.8.org/checks/binaries 2006-11-19 13:00:11.574699515 +0200
++++ lintian-1.23.8/checks/binaries     2006-11-19 12:49:01.000000000 +0200
+@@ -104,7 +104,8 @@
+       } elsif (m/^DYNAMIC SYMBOL TABLE:/) {
+           $dynsyms = 1;
+       } elsif (m/^objdump: (.*?): File format not recognized$/) {
+-          fail("file format not recognized for $1\nif you are checking non-i386 binaries, you'll need to install binutils-multiarch\n");
++          #fail("file format not recognized for $1\nif you are checking non-i386 binaries, you'll need to install binutils-multiarch\n");
++          tag "binary-file-format-not-recognized", "$1";
+       } elsif (m/^objdump: \.(.*?): Packed with UPX$/) {
+           tag "binary-file-compressed-with-upx", "$1";
+       } elsif (m/^objdump: \.(.*?): Invalid operation$/) {
+diff -urN lintian-1.23.8.org/checks/binaries.desc lintian-1.23.8/checks/binaries.desc
+--- lintian-1.23.8.org/checks/binaries.desc    2006-11-19 13:00:11.460701400 +0200
++++ lintian-1.23.8/checks/binaries.desc        2006-11-19 12:50:40.000000000 +0200
+@@ -145,3 +145,8 @@
+ Info: This appears to be an ELF file but objdump -T cannot parse it.
+  If it is external debugging symbols for another file, it should be
+  installed under /usr/lib/debug.
++
++Tag: binary-file-format-not-recognized
++Type: warning
++Info: objdump can't recognize file format for that binary.
++
+diff -urN lintian-1.23.8.org/collection/objdump-info lintian-1.23.8/collection/objdump-info
+--- lintian-1.23.8.org/collection/objdump-info 2006-11-19 13:00:11.504700673 +0200
++++ lintian-1.23.8/collection/objdump-info     2006-11-19 12:43:09.000000000 +0200
+@@ -58,7 +58,7 @@
+           # If the objdump error is "Invalid operation", we handle it later
+           # in the check script, since this is the expected output (for now)
+           # on detached debugging information in /usr/lib/debug.
+-          if objdump -T $bin 2>&1 | grep -q 'Invalid operation$' ; then
++          if objdump -T $bin 2>&1 | grep -qE 'Invalid operation$|File format not recognized$' ; then
+               :
+           else
+               exit 1
diff --git a/nokia-lintian/debian/patches/804-xargs-fix-bts-399322.dpatch b/nokia-lintian/debian/patches/804-xargs-fix-bts-399322.dpatch
new file mode 100755 (executable)
index 0000000..972ba11
--- /dev/null
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 804-xargs-fix-bts-399322.dpatch by Alexander Kanevskiy <alexander.kanevskiy@nokia.com>>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Ignore errors for ARM binaries which binutils-multiarch can't parse
+
+@DPATCH@
+--- lintian/collection/file-info       2007-05-22 12:31:27.000000000 +0300
++++ lintian/collection/file-info       2007-03-10 08:55:49.000000000 +0200
+@@ -16,8 +16,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, you can find it on the World Wide
+ # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+-# MA 02111-1307, USA.
++# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
++# MA 02110-1301, USA.
+ use strict;
+@@ -44,7 +44,8 @@
+     chop;
+     $_ = (split(" ", $_, 6))[5];
+     s/ link to .*//;
+-    s/ -> .*//; 
++    s/ -> .*//;
++    s/(\G|[^\\](?:\\\\)*)\\(\d{3})/"$1" . chr(oct $2)/ge;
+     s/\\\\/\\/;
+     printf $XARGS "%s\0", $_;
+ }
diff --git a/nokia-lintian/debian/patches/805-add-known-maemo-sections.dpatch b/nokia-lintian/debian/patches/805-add-known-maemo-sections.dpatch
new file mode 100755 (executable)
index 0000000..e69b092
--- /dev/null
@@ -0,0 +1,43 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 805-add-known-maemo-sections.dpatch by  <rojkov@corin.research.nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add additional sections to conform Maemo policy
+
+@DPATCH@
+
+diff -ru lintian-1.24.2.orig/checks/common_data.pm lintian-1.24.2/checks/common_data.pm
+--- lintian-1.24.2.orig/checks/common_data.pm  2008-07-14 03:31:09.000000000 +0300
++++ lintian-1.24.2/checks/common_data.pm       2008-07-31 19:47:00.000000000 +0300
+@@ -6,6 +6,7 @@
+ our @EXPORT = qw
+ (
+    %known_archs %known_sections %known_non_us_parts %known_archive_parts
++   %known_maemo_parts
+    %known_prios %known_source_fields %known_binary_fields %known_udeb_fields
+    %known_obsolete_fields %known_essential %known_build_essential
+    %known_obsolete_packages %known_obsolete_emacs %known_virtual_packages
+@@ -68,6 +69,11 @@
+ %known_non_us_parts = map { $_ => 1 } ('non-free', 'contrib', 'main' );
++%known_maemo_parts = map { $_ => 1 } 
++    ('accessories', 'communication', 'games', 'multimedia', 'office',
++     'other', 'programming', 'support', 'themes', 'tools'
++    );
++
+ %known_archive_parts = map { $_ => 1 }
+     ('non-free', 'contrib', 'non-US', 'non-us' );
+diff -ru lintian-1.24.2.orig/checks/fields lintian-1.24.2/checks/fields
+--- lintian-1.24.2.orig/checks/fields  2008-07-14 03:31:09.000000000 +0300
++++ lintian-1.24.2/checks/fields       2008-07-31 19:54:06.000000000 +0300
+@@ -321,6 +321,8 @@
+               if ($parts[1] and not $known_non_us_parts{$parts[1]}) {
+                   tag "unknown-section", "$section";
+               }
++          } elsif ($parts[0] =~ /user/ and $parts[1]) {
++              tag "unknown-section", "$section" unless $known_maemo_parts{$parts[1]};
+           } elsif (scalar @parts > 1) {
+               tag "unknown-section", "$section" unless $known_archive_parts{$parts[0]};
+               tag "unknown-section", "$section" unless $known_sections{$parts[1]};
diff --git a/nokia-lintian/debian/patches/806-binary-check-fix.dpatch b/nokia-lintian/debian/patches/806-binary-check-fix.dpatch
new file mode 100644 (file)
index 0000000..060ea3c
--- /dev/null
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 806-binary-check-fix.dpatch by Dmitry Rozhkov <dmitry.rozhkov@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Import Lintian::Data module as it's needed for multi-arch binaries
+
+@DPATCH@
+
+Index: checks/binaries
+===================================================================
+--- lintian.old/checks/binaries        (revision 5847)
++++ lintian.new/checks/binaries        (working copy)
+@@ -24,6 +24,7 @@
+ use Util;
+ use File::Spec;
++use Lintian::Data;
+ sub run {
diff --git a/nokia-lintian/debian/patches/807-correspondent-docs-to-devs-check.dpatch b/nokia-lintian/debian/patches/807-correspondent-docs-to-devs-check.dpatch
new file mode 100755 (executable)
index 0000000..55c9cbe
--- /dev/null
@@ -0,0 +1,52 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 807_correspondent_docs_to_devs.dpatch by Dmitry Rozhkov <dmitry.rozhkov@nokia.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: An additional check for having doc packages for every dev package
+
+@DPATCH@
+
+Index: checks/control-file.desc
+===================================================================
+--- lintian.old/checks/control-file.desc       (revision 6821)
++++ lintian.new/checks/control-file.desc       (working copy)
+@@ -85,3 +85,9 @@
+  silently fix this problem by removing the dependency, but it may indicate
+  a more subtle bug (misspelling or cutting and pasting the wrong package
+  name).
++
++Tag: correspondent-doc-package-absent
++Type: warning
++Info: The given develepment package doesn't have a corresponding
++  documentation package which is supposed to describe the API
++  provided by the development package.
+Index: checks/control-file
+===================================================================
+--- lintian.old/checks/control-file    (revision 6821)
++++ lintian.new/checks/control-file    (working copy)
+@@ -135,8 +135,25 @@
+               if (!$category && $binary_control->{'section'} =~ m%^([^/]+)/% && $1 ne 'contrib');
+ }
++# Check that all -dev packages are submitted to repository together with 
++# correspondent -doc packages
++my (@dev_bins, %doc_bins);
++for my $binary_control (@binary_controls){
++      if ($binary_control->{'package'} =~ m/^([\w|-]+)-dev$/){
++              push @dev_bins, $1;
++      }
++      if ($binary_control->{'package'} =~ m/^([\w|-]+)-doc$/){
++              $doc_bins{$1} = 1;
++      }
+ }
++for my $dev_bin (@dev_bins){
++      if (! defined ($doc_bins{$dev_bin})){
++              tag "correspondent-doc-package-absent", "Package $dev_bin-dev";
++      }
++}
++}
++
+ 1;
+ # Local Variables:
diff --git a/nokia-lintian/debian/postrm b/nokia-lintian/debian/postrm
new file mode 100755 (executable)
index 0000000..183c845
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh -e
+
+# Try to purge the default lab if it looks like a lab.  If the user configured
+# a lab for some other location, currently we don't do anything about that.
+# Arguably we should parse lintianrc and remove that lab, but I'm not sure
+# that's a good idea.
+if [ "$1" = "purge" ]; then
+    if [ -d "/var/spool/lintian/binary" ]; then
+        rm -rf /var/spool/lintian/binary
+        rm -rf /var/spool/lintian/source
+        rm -rf /var/spool/lintian/udeb
+        rm -rf /var/spool/lintian/info
+    fi
+    rmdir --ignore-fail-on-non-empty /var/spool/lintian
+fi
+
+#DEBHELPER#
diff --git a/nokia-lintian/debian/rules b/nokia-lintian/debian/rules
new file mode 100755 (executable)
index 0000000..25f0952
--- /dev/null
@@ -0,0 +1,76 @@
+#!/usr/bin/make -f
+
+VER := $(shell head -1 debian/changelog | sed -e 's/^.*(//' -e 's/).*$$//')
+tmp := $(CURDIR)/debian/lintian
+usl := $(tmp)/usr/share/lintian
+neededfiles := debian/rules frontend/lintian
+allchecks := $(wildcard checks/*)
+allcollect := $(wildcard collection/*)
+tagfiles := $(wildcard testset/tags.*)
+onlyrun =
+
+runtests: $(neededfiles) $(allchecks) $(allcollect) $(tagfiles)
+       @echo .... running tests ....
+       [ -d debian/tests ] || mkdir debian/tests
+       LINTIAN_ROOT="" /usr/bin/perl testset/runtests -k testset debian/tests $(onlyrun)
+       touch $@
+
+build: $(neededfiles)
+       @echo .... running build ....
+       dh_testdir
+       cd doc && LANG=C debiandoc2html lintian.sgml
+       cd doc && LANG=C debiandoc2text lintian.sgml
+
+clean: $(neededfiles)
+       @echo .... cleaning ....
+       dh_testdir
+       dh_testroot
+       rm -f runtests
+       rm -rf doc/lintian.html/ doc/lintian.txt
+       rm -rf debian/tests
+       find -name "*.py?" -print0 | xargs -0r rm
+       dh_clean -Xtestset/diffs/binary.c~
+
+binary-indep: $(neededfiles) build
+       @echo .... binary-indep ....
+       dh_testdir
+       dh_testroot
+       dh_clean -k -Xtestset/diffs/binary.c~
+       dh_installdirs
+
+# frontends
+       @echo .... install frontends ....
+       install -m 755 frontend/lintian $(tmp)/usr/bin/
+       sed -i 's/<VERSION>/$(VER)/' $(tmp)/usr/bin/lintian
+       install -m 755 frontend/lintian-info $(tmp)/usr/bin/
+# library files
+       @echo .... install library files ....
+       find checks collection data lib unpack \
+           \( -path '*/CVS' -o -path '*/.svn' \) -prune -o -print \
+               | cpio -admp $(usl)
+# documentation
+       @echo .... install documentation ....
+       dh_installdocs
+       dh_installchangelogs
+# manual pages
+       @echo .... install manual pages ....
+       dh_installman man/*.1
+# config file
+       @echo .... install config file ....
+       install -m 644 doc/lintianrc.example $(tmp)/etc/lintianrc
+# control files
+       @echo .... fix things up and build packages ....
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary-arch:
+
+binary:        binary-indep binary-arch
+
+.PHONY: build binary binary-arch binary-indep clean
+.DELETE_ON_ERROR: runtests
+include debian/rules.OSSO
diff --git a/nokia-lintian/debian/rules.OSSO b/nokia-lintian/debian/rules.OSSO
new file mode 100644 (file)
index 0000000..2a74648
--- /dev/null
@@ -0,0 +1,53 @@
+FORCE =
+
+prepare:
+       $(MAKE) -f debian/rules.OSSO \
+               debian/changelog      \
+               debian/control        \
+               debian/patches/00list \
+               debian/rules          \
+               FORCE=FORCE
+
+debian/changelog: $(FORCE)
+       chmod 755 debian/scripts/*
+       umask 022 && debian/scripts/mergechangelogs $@ $@.OSSO >$@.new~
+       mv $@.new~ $@
+
+debian/control: $(FORCE)
+       sed \
+               -i \
+               -e '/^Build-Depends-Indep:/!b' \
+               -e 's/, dpatch$$//'            \
+               -e 's/$$/, dpatch/'            \
+               $@
+
+debian/patches/00list: $(FORCE)
+       umask 022 && \
+       cd debian/patches/ && \
+       LC_ALL=C ls [0-9][0-9][0-9]-*.dpatch | \
+       sed 's/[.]dpatch$$//' >00list
+
+debian/rules: $(FORCE)
+       line='include debian/rules.OSSO'; \
+       sed \
+               -i \
+               -e '$$a\'              \
+               -e "$$line"            \
+               -e '\:^'"$$line"'$$:d' \
+               $@
+
+clean: unpatch
+binary-indep: patch
+
+patch: patch-stamp
+patch-stamp:
+       dpatch apply-all
+       touch $@
+
+unpatch:
+       dpatch deapply-all
+       rm -fr patch-stamp debian/patched
+
+FORCE:
+
+.PHONY: prepare patch unpatch FORCE
diff --git a/nokia-lintian/debian/scripts/mergechangelogs b/nokia-lintian/debian/scripts/mergechangelogs
new file mode 100755 (executable)
index 0000000..976ecc6
--- /dev/null
@@ -0,0 +1,82 @@
+#! /usr/bin/perl
+# mergechangelogs -- Tool to merge Debian changelogs
+#
+# Copyright (C) 2006 Nokia
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use warnings;
+
+my @logs = ([]);
+
+# Read changelogs.
+foreach my $file ( @ARGV ) {
+       local $/;
+       open LOG,'<',$file or die;
+       push @logs, [
+               map { s/^\s*//s; s/\s*$/\n/s; $_; }
+               split /\n\n\b/, <LOG>
+               ];
+       close LOG;
+}
+
+# Merge changelogs.
+# If there are entries for the same version in multiple changelogs,
+# take the entry from the last changelog.
+while ( @logs >= 2 ) {
+       my (@entries,@vers,$index);
+       while ( @{$logs[0]} > 0 && @{$logs[1]} > 0 )  {
+               if ( $logs[0]->[0] eq $logs[1]->[0] ) {
+                       push @entries, $logs[1]->[0];
+                       shift @{$logs[0]};
+                       shift @{$logs[1]};
+                       next;
+               }
+               ($vers[0]) = $logs[0]->[0] =~ /^[^\n()]+ [(]([^()]+)[)]/s;
+               ($vers[1]) = $logs[1]->[0] =~ /^[^\n()]+ [(]([^()]+)[)]/s;
+               if ( defined $vers[0] && defined $vers[1] ) {
+                       if ( $vers[0] eq $vers[1] ) {
+                               push @entries, $logs[1]->[0];
+                               shift @{$logs[0]};
+                               shift @{$logs[1]};
+                               next;
+                       }
+                       my $status = system
+                               'dpkg',
+                               '--compare-versions',
+                               $vers[0], 'gt', $vers[1];
+                       $status == 0 || $status == 1 << 8 || die;
+                       $index = $status == 0 ? 0 : 1;
+               }
+               elsif ( defined $vers[0] ) {
+                       $index = 0;
+               }
+               elsif ( defined $vers[1] ) {
+                       $index = 1;
+               }
+               else {
+                       last;
+               }
+               push @entries, shift @{$logs[$index]};
+       }
+       push @entries, @{$logs[0]}, @{$logs[1]};
+       splice @logs, 0, 2, \@entries;
+}
+
+# Print the merges changelog.
+print join "\n", @{$logs[0]};
diff --git a/nokia-lintian/depcheck/buglist b/nokia-lintian/depcheck/buglist
new file mode 100644 (file)
index 0000000..07648bd
--- /dev/null
@@ -0,0 +1,7 @@
+22341 perl-base: pre-dependency libgdbmg1
+21039 libc5-dbg: dependency libc5-dev (= 5.4.38-1)
+12717 wm2: dependency xlib6 (>= 3.3-0)
+23436 vrwave: dependencies jdk1.1-runtime | jdk-shared | jdk-static, unzip (>= 5.20-3)
+25427 libzephyr2: dependency comerr2g
+25709 geomview: dependency libforms0.88
+25710 debian-cd: dependency unzip
diff --git a/nokia-lintian/depcheck/dependencies.py b/nokia-lintian/depcheck/dependencies.py
new file mode 100755 (executable)
index 0000000..3f86317
--- /dev/null
@@ -0,0 +1,153 @@
+#!/usr/bin/python
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+import string
+
+import package
+from relation import Virtual
+import version
+
+# Create a dictionary of the available packages, including provided
+# virtual packages.  The dictionary maps package names to versions.
+def packagedict(packages):
+    pkdict = {}
+    for pk in packages.values():
+       pkdict[pk['name']] = pk['version']
+       for provided in pk['provides']:
+           if not pkdict.has_key(provided):
+               pkdict[provided] = Virtual
+    return pkdict
+
+def satisfy(relations, pkdict):
+    failed = []
+    for rel in relations:
+       needs = rel.satisfied_by(pkdict)
+       if needs is None:
+           failed.append(rel)
+    return failed
+    # Future dreams: check if the depended-on packages don't conflict.
+
+def failure(name, rels, singular, plural):
+    use = singular
+    if len(rels) > 1:
+       use = plural
+    deps = string.join(map(str, rels), ', ')
+    return '%s: %s %s' % (name, use, deps)
+
+def delete_relations(pk, relation, deletions):
+    for rel in deletions:
+       pk[relation].remove(rel)
+
+def test_packages(packages):
+    pkdict = packagedict(packages)
+    warnings = []
+    for pk in packages.values():
+        if pk.has_key('depends'):
+           fl = satisfy(pk['depends'], pkdict)
+           if fl:
+               warnings.append(failure(pk['name'], fl, 'dependency', 'dependencies'))
+               delete_relations(pk, 'depends', fl)
+        if pk.has_key('recommends'):
+           fl = satisfy(pk['recommends'], pkdict)
+           if fl:
+               warnings.append(failure(pk['name'], fl, 'recommendation', 'recommendations'))
+               delete_relations(pk, 'recommends', fl)
+       if pk.has_key('pre-depends'):
+           fl = satisfy(pk['pre-depends'], pkdict)
+           if fl:
+               warnings.append(failure(pk['name'], fl, 'pre-dependency', 'pre-dependencies'))
+               delete_relations(pk, 'pre-depends', fl)
+    warnings.sort()
+    return warnings
+
+def tosubtract(warning):
+    return warning not in subtract
+
+def print_warnings(warnings, header):
+    warnings = filter(tosubtract, warnings)
+    if len(warnings):
+        print header + "\n"
+       for warning in warnings:
+           print "  " + warning
+        print ""
+
+
+def test(packagefile):
+    filter = ['package', 'version', 'depends', 'recommends', 'provides',
+             'pre-depends', 'priority', 'section']
+    allpackages = package.parsepackages(open(packagefile), filter)
+    priorities = {'required': {}, 'important': {}, 'standard': {},
+                 'optional': {}, 'extra': {}}
+    for pk in allpackages.values():
+       priorities[pk['priority']][pk['name']] = pk
+
+    packages = allpackages
+    print_warnings(test_packages(packages),
+                   "Cannot satisfy with packages in main:");
+
+    # packages-in-base check moved up to here, because otherwise some
+    # of them will show up as "Cannot satisfy with required packages".
+    for pk in packages.keys():
+       if packages[pk]['section'] != 'base':
+           del packages[pk]
+    print_warnings(test_packages(packages),
+                   "Cannot satisfy with packages in base:");
+
+    packages = priorities['required']
+    print_warnings(test_packages(packages),
+                   "Cannot satisfy with required packages:");
+
+    packages.update(priorities['important'])
+    print_warnings(test_packages(packages),
+                   "Cannot satisfy with important packages:");
+
+    packages.update(priorities['standard'])
+    print_warnings(test_packages(packages),
+                   "Cannot satisfy with standard packages:");
+
+    packages.update(priorities['optional'])
+    print_warnings(test_packages(packages),
+                   "Cannot satisfy with optional packages:");
+
+    packages.update(priorities['extra'])
+    print_warnings(test_packages(packages),
+                   "Cannot satisfy with extra packages:");
+
+    for pk in packages.keys():
+       if packages[pk]['section'] == 'oldlibs':
+           del packages[pk]
+    print_warnings(test_packages(packages),
+                   "Cannot satisfy without packages in oldlibs:");
+
+import sys
+
+if len(sys.argv) == 3:
+   subtract = []
+   for line in open(sys.argv[2]).readlines():
+     subtract.append(line[2:-1])
+else:
+   subtract = [];
+
+   
+
+if len(sys.argv) > 1:
+   test(sys.argv[1])
+else:
+   test("/var/lib/dpkg/methods/ftp/Packages.hamm_main")
diff --git a/nokia-lintian/depcheck/deppages.pl b/nokia-lintian/depcheck/deppages.pl
new file mode 100755 (executable)
index 0000000..48b4586
--- /dev/null
@@ -0,0 +1,197 @@
+#!/usr/bin/perl
+
+# Create HTML pages describing the results of dependency-integrity checks
+# over the Debian archive.
+#
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+require './config';
+
+# comes from './config'
+use vars qw( $LOG_DIR );
+
+# lintian binary will define these
+use vars qw($LINTIAN_DIST $HTML_TMP_DIR $LINTIAN_ARCHIVEDIR $LINTIAN_ROOT);
+
+my @archs = ('i386', 'alpha', 'm68k', 'powerpc', 'sparc', 'arm', 'hurd-i386');
+
+my @logfiles = map { "$LOG_DIR/Depcheck-" . $_ } @archs;
+system("savelog @logfiles >/dev/null") == 0
+    or die("cannot rotate logfiles");
+
+# this stuff is most likely broken
+my $BINARY = "$LINTIAN_ARCHIVEDIR/dists/$LINTIAN_DIST/main";
+
+my $libdir   = defined $LINTIAN_ROOT ? "$LINTIAN_ROOT/" : "";
+my $DEPCHECKDIR = "${libdir}depcheck";
+my $DEPCHECK    = "$DEPCHECKDIR/dependencies.py";
+
+$ENV{'PYTHONPATH'} = $DEPCHECKDIR;
+
+system("$DEPCHECK $BINARY/binary-i386/Packages >$LOG_DIR/Depcheck-i386") == 0
+    or die("depcheck failed for i386 architecture");
+
+for my $arch (@archs) {
+    next if $arch eq 'i386';
+
+    system("$DEPCHECK $BINARY/binary-$arch/Packages $LOG_DIR/Depcheck-i386 >$LOG_DIR/Depcheck-$arch") == 0
+       or die("depcheck failed for $arch architecture");
+}
+
+my %bug_used = ();
+my %bugs = ();
+
+open(BUGS, '<', "$LINTIAN_ROOT/depcheck/buglist") or die("buglist");
+while (<BUGS>) {
+    chop;
+    my $bugline = $_;
+    my @b;
+    while ($bugline =~ s/^(\d+)\s//) {
+       push(@b, &make_bugref($1));
+    }
+    $bugs{$bugline} = join(", ", @b);
+}
+close(BUGS);
+
+open(HTML, '>', "$HTML_TMP_DIR/depcheck.html") or die("depcheck.html");
+
+print HTML <<EOT;
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 2.0//EN">
+<HTML>
+<HEAD>
+  <TITLE>Debian: Dependency integrity check for the main distribution</TITLE>
+</HEAD>
+<BODY>
+<H1>Dependency checks</H1>
+This page summarizes the results of a scan that checks the following
+two bits of Debian policy:<P>
+<UL>
+<LI>From section 2.1.2: The main section<P>
+    <blockquote>
+    The packages in "main" must not require a package outside of
+    "main" for compilation or execution (thus, the package may not
+    declare a "Depends" or "Recommends" relationship on a non-main package).
+    </blockquote><P>
+<LI>From section 2.2: Priorities<P>
+    <blockquote>
+    Packages may not depend on packages with lower priority values.
+    If this should happen, one of the priority values will have to be
+    adapted.
+    </blockquote><P>
+</UL>
+
+The scan also looks for packages in the "base" section that depend on
+packages not in the "base" section, and for packages that depend on
+packages in "oldlibs" that are not themselves in "oldlibs".<P>
+
+The scan checks the Recommends, Depends, and Pre-Depends headers in
+all cases.<P>
+EOT
+
+for my $arch (@archs) {
+    genarch($arch);
+}
+
+close(HTML);
+
+for my $bug (keys %bugs) {
+    unless ($bug_used{$bug}) {
+       print STDERR "Unused bugnumber: $bug\n";
+    }
+}
+
+exit 0;
+
+sub genarch {
+    my $arch = shift;
+
+    print HTML "<HR>\n";
+    print HTML "<A NAME=$arch>\n";
+    print HTML "<H2>Dependency check for the $arch architecture</H2>\n\n";
+
+    print HTML "<P>This list was generated from the $arch Packages file,<BR>\n"
+       . "dated: " . &filetime("$BINARY/binary-$arch/Packages") . ".\n";
+
+    if ($arch ne 'i386') {
+       print HTML "<P>It excludes the checks which were already " .
+           "reported for the i386 architecture.\n";
+    }
+
+    print HTML "\n";
+
+    open(REPORT, '<', "$LOG_DIR/Depcheck-$arch") or die("Depcheck-$arch");
+    &genreport;
+    close(REPORT);
+}
+
+sub genreport {
+    my $inlist = 0;
+    my $brokendep;
+    my $bug;
+
+    while (<REPORT>) {
+       chop;
+       if (s/^\s+//) {
+           $brokendep = $_;
+           $bug = $bugs{$brokendep};
+           if (defined $bug) {
+               $bug_used{$brokendep} = 1;
+               $brokendep = quotehtml($brokendep) . '  [' . $bug . ']';
+           } else {
+               $brokendep = quotehtml($brokendep);
+           }
+           print(HTML "  <LI>$brokendep\n");
+       } elsif (m/^$/) {
+           next;
+       } else {
+           if ($inlist) {
+               print(HTML "</UL>\n\n");
+           }
+           $_ = &quotehtml($_);
+           print(HTML "<H3>$_</H3>\n");
+           print(HTML "<UL>\n");
+           $inlist = 1;
+       }
+    }
+
+    if ($inlist) {
+       print(HTML "</UL>\n");
+    }
+}
+
+sub make_bugref {
+    my $bugnum = shift;
+    my $bugdir = substr($bugnum, 0, 2);
+
+    return "<A HREF=\"http://www.debian.org/Bugs/db/$bugdir/$bugnum.html\">"
+       . "\#$bugnum</A>";
+}
+
+sub quotehtml {
+    $_ = $_[0] . '';
+    s/&/\&amp;/g;
+    s/</\&lt;/g;
+    s/>/\&gt;/g;
+    return $_;
+}
+
+sub filetime {
+    my $time = (stat(shift))[9]; # mtime
+    return scalar(gmtime($time));
+}
diff --git a/nokia-lintian/depcheck/package.py b/nokia-lintian/depcheck/package.py
new file mode 100644 (file)
index 0000000..8679225
--- /dev/null
@@ -0,0 +1,155 @@
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+import string
+import regex
+
+import version
+import relation
+
+bad_field = 'Bad field value'
+
+defaults = {'depends': [], 'recommends': [], 'suggests': [], 'pre-depends': [],
+            'conflicts': [], 'replaces': [], 'provides': [],
+            'essential': 0, 'distribution': 'main', 'architecture': 'all',
+            'description': '', 'synopsis': ''}
+
+relationships = ['depends', 'recommends', 'suggests', 'pre-depends',
+                'conflicts', 'replaces']
+
+# The Package class models a read-only dictionary that is initialized
+# by feeding it a paragraph of control information.
+# Some translation is done on the field names:
+# 'package'     ->  'name'
+# 'source'      ->  'sourcepackage' and 'sourceversion'
+# 'description' ->  'synopsis' and 'description'
+# 'section'     ->  'distribution' and 'section'
+class Package:
+    def __init__(self):
+       self.fields = {}
+
+    def __len__(self):
+       return len(self.fields)
+
+    # Look up a field in this package.
+    def __getitem__(self, key):
+        if self.fields.has_key(key):
+           return self.fields[key]
+       # If it is not defined, return the default value for that field.
+        if defaults.has_key(key):
+           return defaults[key]
+       # Special defaults
+       if key == 'sourcepackage':
+           return self['name']
+       if key == 'sourceversion':
+           return self['version']
+       # If there is no default, try again with a lowercase version
+       # of the field name.
+        lcase = string.lower(key)
+       if lcase != key:
+           return self[lcase]
+       raise KeyError, key
+
+    # Define some standard dictionary methods
+    def keys(self):   return self.fields.keys()
+    def items(self):  return self.fields.items()
+    def values(self): return self.fields.values()
+    def has_key(self, key):  return self.fields.has_key(key)
+
+    def parsefield(self, field, fieldval):
+       # Perform translations on field and fieldval
+       if field == 'package':
+           field = 'name'
+       elif field == 'version':
+           fieldval = version.make(fieldval)
+       elif field == 'architecture':
+           fieldval = string.split(fieldval)
+           if len(fieldval) == 1:
+               fieldval = fieldval[0]
+       elif field == 'source':
+           field = 'sourcepackage'
+           splitsource = string.split(fieldval)
+           if (len(splitsource) > 1):
+               if splitsource[1][0] != '(' \
+                  or splitsource[1][-1] != ')':
+                   raise ValueError, fieldval
+               fieldval = splitsource[0]
+               self.fields['sourceversion'] = version.make(splitsource[1][1:-1])
+       elif field in relationships:
+           fieldval = map(relation.parse, string.split(fieldval, ','))
+       elif field == 'provides':
+           # I will assume that the alternates construct is
+           # not allowed in the Provides: header.
+           fieldval = string.split(fieldval, ', ')
+       elif field == 'description':
+           i = string.find(fieldval, '\n')
+           if i >= 0:
+               self.fields['description'] = fieldval[i+1:]
+               fieldval = string.strip(fieldval[:i])
+       elif field == 'essential':
+           if fieldval == 'yes':
+               fieldval = 1
+           elif fieldval != 'no':
+               raise ValueError, fieldval
+           else:
+               fieldval = 0 
+       elif field == 'section':
+           i = string.find(fieldval, '/')
+           if i >= 0:
+               self.fields['distribution'] = fieldval[:i]
+               fieldval = fieldval[i+1:]
+       elif field == 'installed-size':
+           fieldval = string.atoi(fieldval)
+       elif field == 'size':
+           fieldval = string.atoi(fieldval)
+
+       self.fields[field] = fieldval
+
+    # This function accepts a list of "field: value" strings, 
+    # with continuation lines already folded into the values.
+    # "filter" is an array of header fields (lowercase) to parse.
+    # If it is None, parse all fields.
+    def parseparagraph(self, lines, filter=None):
+       for line in lines:
+           idx = string.find(line, ':')
+           if idx < 0:
+               raise bad_field, line
+           field = string.lower(line[:idx])
+           if not filter or field in filter:
+               try:
+                   self.parsefield(field, string.strip(line[idx+1:]))
+               except:
+                    raise bad_field, line
+
+def parsepackages(infile, filter=None):
+    packages = {}
+    paragraph = []
+    while 1:
+        line = infile.readline()
+       if len(line) == 0:
+           break 
+       elif line[0] == ' ' or line[0] == '\t':
+           paragraph[-1] = paragraph[-1] + line
+       elif line[0] == '\n':
+           pk = Package()
+           pk.parseparagraph(paragraph, filter)
+           packages[pk['name']] = pk
+           paragraph = []
+       else:
+           paragraph.append(line)
+    return packages
diff --git a/nokia-lintian/depcheck/relation.py b/nokia-lintian/depcheck/relation.py
new file mode 100644 (file)
index 0000000..b406309
--- /dev/null
@@ -0,0 +1,171 @@
+# This module defines package relationships.
+# It exports two special "version" values: Virtual and Any.
+# A Virtual version never matches a versioned conflict or dependency.
+# An Any version always matches a versioned conflict or dependency.
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+
+import string
+
+import version
+
+# The two special "version" values.  All empty lists are unique,
+# so these statements initialize them to unique values.
+Virtual = []
+Any = []
+
+# The basic relationship: a single package name.
+# Its name is stored in the name attribute.
+class SimpleRelation:
+    def __init__(self, package):
+       self.name = package
+
+    def __str__(self):
+       return self.name
+
+    def __repr__(self):
+       return 'SimpleRelation(' + `self.name` + ')'
+
+    def satisfied(self, packagename, version):
+       return packagename == self.name
+
+    def satisfied_by(self, packages):
+       if packages.has_key(self.name):
+           return self.name
+       return None
+
+    def packagenames(self):
+       return [self.name]
+
+# A package name with a version check.
+# The package name is stored in the name attribute.
+# The relation is stored as a string in the relationstring attribute,
+# and as a comparison function in the relation attribute.
+# The version to compare to is stored in the version attribute.
+class VersionedRelation:
+    def __init__(self, package, relation, version):
+       self.name = package
+       self.version = version
+       self.relationstring = relation
+       if relation == '<' or relation == '<=':
+           self.relation = lessthan
+       elif relation == '>' or relation == '>=':
+           self.relation = greaterthan
+       elif relation == '=':
+           self.relation = equalversion
+       elif relation == '>>':
+           self.relation = strictgreater
+       elif relation == '<<':
+           self.relation = strictless
+       else:
+           raise ValueError, 'relation: ' + relation
+
+    def __str__(self):
+       return '%s (%s %s)' % (self.name, self.relationstring, self.version)
+
+    def __repr__(self):
+       return 'VersionedRelation(' + `self.name` + ', ' + \
+               `self.relationstring` + ', ' + `self.version` + ')'
+
+    # version can be the special values Virtual or Any, in addition
+    # to a normal Version instance.
+    def satisfied(self, packagename, version):
+       if packagename != self.name or version is Virtual:
+           return 0
+        if version is Any:
+           return 1
+       return self.relation(version, self.version)
+
+    def satisfied_by(self, packages):
+       version = packages.get(self.name)
+       if version is not None and self.satisfied(self.name, version):
+           return self.name
+       return None
+
+    def packagenames(self):
+       return [self.name]
+
+# Relations joined with the "alternatives" operator, i.e. foo | bar.
+# This class just stores the joined relations as a sequence.
+class AltRelation:
+    def __init__(self, relationlist):
+       self.relations = relationlist
+
+    def __str__(self):
+       return string.join(map(str, self.relations), ' | ')
+
+    def __repr__(self):
+       return 'AltRelation(' + `self.relations` + ')'
+
+    def satisfied(self, packagename, version):
+       for rel in self.relations:
+           if rel.satisfied(packagename, version):
+               return 1
+       return 0
+
+    def satisfied_by(self, packages):
+       rv = []
+       for rel in self.relations:
+           sb = rel.satisfied_by(packages)
+           if sb is not None and rv.count(sb) == 0:
+               rv.append(sb)
+       if len(rv) > 0:
+           return rv
+       return None
+
+    def packagenames(self):
+       return reduce(lambda x, y: x + y.packagenames(), self.relations, [])
+
+def parsealt(str):
+    i = string.find(str, '(')
+    if i == -1:
+       return SimpleRelation(string.strip(str))
+    packagename = string.strip(str[:i])
+    j = string.find(str, ')')
+    relver = string.strip(str[i+1:j])
+    if relver[1] == '<' or relver[1] == '=' or relver[1] == '>':
+       return VersionedRelation(packagename, relver[:2],
+                                version.make(string.strip(relver[2:])))
+    else:
+       return VersionedRelation(packagename, relver[:1],
+                                version.make(string.strip(relver[1:])))
+
+def parse(str):
+    alts = map(parsealt, string.split(str, '|'))
+    if len(alts) > 1:
+       return AltRelation(alts)
+    return alts[0]
+
+# Possible values for the relation attribute
+def strictless(x, y):
+    return x < y
+
+def lessthan(x, y):
+    return x <= y
+
+def equalversion(x, y):
+    return x.equals(y)
+
+def greaterthan(x, y):
+    return x >= y
+
+def strictgreater(x, y):
+    return x > y 
+
diff --git a/nokia-lintian/depcheck/report2html.pl b/nokia-lintian/depcheck/report2html.pl
new file mode 100644 (file)
index 0000000..9daa35b
--- /dev/null
@@ -0,0 +1,83 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+my %bugs;
+if (my $buglist = shift) {
+    open(BUGS, '<', $buglist) or die($buglist);
+    while (<BUGS>) {
+       chop;
+       my $bugline = $_;
+       my @b;
+       while ($bugline =~ s/^(\d+)\s//) {
+           push(@b, &make_bugref($1))
+       }
+       $bugs{$bugline} = join(", ", @b);
+    }
+    close(BUGS);
+}
+
+my $inmenu = 0;
+
+while (<STDIN>) {
+    chop;
+    if (s/^\s+//) {
+       my $brokendep = &quotehtml($_);
+       my $bug = $bugs{$_};
+       if (defined $bug) {
+           delete $bugs{$_};
+           $brokendep .= '  [' . $bug . ']';
+       }
+       print("  <LI>$brokendep\n");
+    } elsif (m/^$/) {
+       next;
+    } else {
+       if ($inmenu) {
+           print("</MENU>\n\n");
+       }
+       $_ = &quotehtml($_);
+       print("<H2>$_</H2>\n");
+       print("<MENU>\n");
+       $inmenu = 1;
+    }
+}
+
+if ($inmenu) {
+    print("</MENU>\n");
+}
+
+exit 0;
+
+# -----
+
+sub make_bugref {
+    my $bugnum = shift;
+    my $bugdir = substr($bugnum, 0, 2);
+
+    return "<A HREF=\"http://www.debian.org/Bugs/db/$bugdir/$bugnum.html\">"
+       . "\#$bugnum</A>";
+}
+
+sub quotehtml {
+    $_ = shift;
+    s/&/\&amp;/g;
+    s/</\&lt;/g;
+    s/>/\&gt;/g;
+    return $_;
+}
diff --git a/nokia-lintian/depcheck/version.py b/nokia-lintian/depcheck/version.py
new file mode 100644 (file)
index 0000000..e7dc309
--- /dev/null
@@ -0,0 +1,217 @@
+# This module defines the immutable Version type. 
+# Initialize it with Version(string).  It defines attributes
+# epoch, upstream, and debian.
+# Comparison operations are defined on Versions and follow the same rules
+# as dpkg.
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+import string
+import re
+
+# TODO:  Is the regexp very slow?  Find out.  It could be simplified
+#        at the cost of some extra string slicing by the caller.
+
+# python can be just as incomprehensible as perl!
+version_format = re.compile(r"^(\d+:)?([\w][\w+.:\-]*?)(-[\w+.]+)?$")
+
+# The regexp above breaks down into three parts:
+#   (\d+:)?            Optional epoch  
+#   ([\w][\w+.:\-]*?)  Upstream version number
+#   (-[\w+.]+)?        Optional Debian revision
+# The *? notation at the end of the upstream version number means the
+# regexp engine should attempt a minimum-length match, rather than
+# maximum-length.  This prevents the upstream-version pattern from
+# gobbling up the Debian revision.
+
+# A non-numeric sequence followed by a numeric sequence.
+# The comparison code uses it to consume the version string according
+# to the algorithm in the Policy manual, two steps at a time.
+compare_format = re.compile(r"([^\d]*)(\d*)")
+
+# An alphabetic sequence followed by a non-alphabetic sequence.
+# This way, the non-numeric parts are divided into parts just
+# like the entire version string is.
+alph_compare_format = re.compile(r"([a-zA-Z]*)([^a-zA-Z]*)")
+
+# Compare non-numeric parts of version strings x and y.
+# It differs from the normal cmp, because non-alphabetic characters
+# must sort newer than alphabetic ones.
+def alphcmp(x, y):
+    while len(x) > 0 and len(y) > 0:
+        # The match is guaranteed not to fail, because the regexp can match
+        # a zero-length string.
+        (xalph, xnonalph) = alph_compare_format.match(x).groups()
+        (yalph, ynonalph) = alph_compare_format.match(y).groups()
+        if xalph == yalph:
+           if xnonalph == ynonalph:
+               x = x[len(xalph) + len(xnonalph):]
+               y = y[len(yalph) + len(ynonalph):]
+           else:
+               return cmp(xnonalph, ynonalph)
+        else:
+           common = min(len(xalph), len(yalph))
+           if xalph[:common] == yalph[:common]:
+               if len(xalph) == common:
+                   if xnonalph == '':
+                       return -1  # y is the longer string
+                   else:
+                       return 1   # xnonalph will sort newer than yalph's tail
+               else:
+                   if ynonalph == '':
+                       return 1   # x is the longer string
+                   else:
+                       return -1  # ynonalph will sort newer than xalph's tail
+           else:
+               return cmp(xalph[:common], yalph[:common])
+
+    # One of the strings is exhausted.  The longer string counts as newer.
+    return cmp(len(x), len(y))
+           
+
+# Compare the version strings x and y.  Return positive if x is
+# newer than y, and negative if x is older than y.  The caller
+# guarantees that they are not equal.
+def versioncmp(x, y):
+    while len(x) > 0 and len(y) > 0:
+        # The match is guaranteed not to fail, because the regexp can match
+        # a zero-length string.
+        (xnondigit, xdigit) = compare_format.match(x).groups()
+        (ynondigit, ydigit) = compare_format.match(y).groups()
+        if xnondigit == ynondigit:
+           if xdigit == ydigit:
+               x = x[len(xnondigit) + len(xdigit):]
+               y = y[len(ynondigit) + len(ydigit):]
+            # Count an empty digit string as zero.  (i.e. 1.1 versus 1.)
+           elif xdigit == '':
+               return cmp(0, string.atoi(ydigit))
+            elif ydigit == '':
+               return cmp(string.atoi(xdigit), 0)
+           else:
+               return cmp(string.atoi(xdigit), string.atoi(ydigit))
+        else:
+           return alphcmp(xnondigit, ynondigit)
+
+    # One of the strings is exhausted.  The longer string counts as newer.
+    return cmp(len(x), len(y))
+
+compare_cache = {}
+
+def cache_versioncmp(x, y):
+    if compare_cache.has_key((x, y)):
+       return compare_cache[(x, y)]
+    c = versioncmp(x, y)
+    compare_cache[(x, y)] = c
+    compare_cache[(y, x)] = -c
+    return c
+       
+# A version is an immutable object.  It is created with Version(string)
+# and is not changed thereafter.  This is not enforced.
+class Version:
+    # A Version object is defined by an epoch (stored in self.epoch
+    # as an integer), an upstream version (stored in self.upstream as
+    # a string), and a debian revision (stroed in self.debian as
+    # a string).
+    # self.debian may be None to indicate that the version number does
+    # not have a Debian revision.
+    def __init__(self, version):
+        # See Policy manual, chapter 4.
+       match = version_format.match(version)
+       if not match:
+           raise ValueError, version
+        (epoch, upstream, debian) = match.group(1, 2, 3)
+       if epoch:
+           # slice off the colon
+           self.epoch = string.atoi(epoch[:-1])
+       else:
+           self.epoch = 0
+       self.upstream = upstream
+       if debian:
+           # slice off the leading hyphen
+           self.debian = debian[1:]
+       else:
+           self.debian = None
+
+    # This function compares two versions.  We use the earlier/later
+    # relationship defined in the policy manual as our ordering
+    # relationship.  Thus, the function should return a negative
+    # number if self is earlier than other, zero if they are equal,
+    # and a positive number if self is later than other.
+    def __cmp__(self, other):
+       if self.epoch == other.epoch:
+           if self.upstream == other.upstream:
+               if self.debian == other.debian:
+                   return 0
+               # "The absence of a <debian_revision> compares earlier than
+               # the presence of one". (Policy manual chapter 4)
+               elif self.debian and not other.debian:
+                   return 1
+               elif not self.debian and other.debian:
+                   return -1
+               else:
+                   return cache_versioncmp(self.debian, other.debian)
+           else:
+               return cache_versioncmp(self.upstream, other.upstream)
+       else:
+           return cmp(self.epoch, other.epoch)
+
+    # Return a good hash value when this object is used as a key
+    # in a dictionary.  Only immutable objects should define a
+    # hash function.
+    def __hash__(self):
+       return hash(self.epoch) ^ hash(self.upstream) ^ hash(self.debian)
+
+    # This should return a string representation of this object.
+    # We represent a version string by recombining the epoch,
+    # upstream version, and debian revision.  
+    def __str__(self):
+        # We normally leave out an epoch of 0, but we do add it if
+        # the upstream version contains a colon (:), in order to
+        # keep it a valid version string.
+       if self.epoch != 0 or string.find(self.upstream, ':') >= 0:
+           if self.debian:
+               return '%d:%s-%s' % (self.epoch, self.upstream, self.debian)
+           else:
+               return '%d:%s' % (self.epoch, self.upstream)
+       elif self.debian:
+           return self.upstream + '-' + self.debian
+       else:
+           return self.upstream
+
+    # This should return a string that is a valid Python expression
+    # for recreating this value.  It is the "official" representation.
+    # Useful for debugging.
+    def __repr__(self):
+       return 'Version(' + `str(self)` + ')'
+       
+    # Cheap comparison, when only equality is asked for.
+    def equals(self, other):
+       return self.upstream == other.upstream and \
+              self.debian == other.debian and \
+              self.epoch == other.epoch
+
+version_cache = {}
+
+def make(version):
+    if version_cache.has_key(version):
+       return version_cache[version]
+    else:
+        v = Version(version)
+       version_cache[version] = v
+       return v
diff --git a/nokia-lintian/doc/CREDITS b/nokia-lintian/doc/CREDITS
new file mode 100644 (file)
index 0000000..c3e03b9
--- /dev/null
@@ -0,0 +1,45 @@
+In addition to those who have contributed substantial pieces of code
+(they are already listed in the copyright file), Lintian has benefited
+greatly from advice and comments by many people:
+
+  Joey Hess <joeyh@master.debian.org>
+  James A. Treacy <treacy@debian.org>
+  Ray Dassen <jdassen@wi.leidenuniv.nl>
+  Yann Dirson <dirson@debian.org>
+  Darren Stalder <torin@daft.com>
+  Topi Miettinen <Topi.Miettinen@ml.tele.fi>
+  Gregor Hoffleit <flight@debian.org>
+  Santiago Vila <sanvila@ctv.es>
+  Holger Rusch
+  Joost Witteveen <joostje@debian.org>
+  James R. Van Zandt <jrv@vanzandt.mv.com>
+  Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
+  Giuliano P Procida <gpp10@cam.ac.uk>
+  Michael Meskes <meskes@debian.org>
+  Christian Leutloff <leutloff@debian.org>
+  James Troup <james@nocrew.org>
+  Gregory S. Stark <gsstark@mit.edu>
+  Gordon Russell <gor@dcs.napier.ac.uk>
+  Adam P. Harris <aph@debian.org>
+  Fabrizio Polacco <fpolacco@debian.org>
+  Dirk Eddelbuettel <edd@debian.org>
+  Robert S. Edmonds <edmonds@freewwweb.com>
+  Roderick Schertler <roderick@argon.org>
+  Juan Cespedes <cespedes@debian.org>
+  Manoj Srivasta <srivasta@debian.org>
+  Oliver Elphick <Oliver.Elphick@lfix.co.uk>
+  Joel Klecker "Espy" <jk@espy.org>
+  Rob Browning <rlb@cs.utexas.edu>
+  Martin Schulze "Joey" <joey@debian.org>
+  Adrian Bridgett <adrian.bridgett@poboxes.com>
+  Marcus Brinkmann <brinkmds@rz.ruhr-uni-bochum.de>
+  Ruud de Rooij <ruud@debian.org>
+  Johnie Ingram <johnie@debian.org>
+  Brian Bassett <brianb@debian.org>
+  Charles Briscoe-Smith <cpbs@debian.org>
+  Julian Gilbey <jdg@maths.qmw.ac.uk>
+  Raphael Geissert <atomo64@gmail.com>
+  Adam D. Barratt <adam@adam-barratt.org.uk>
+
+And of course the entire Debian Project, without which Lintian would
+have no raison to etre!
diff --git a/nokia-lintian/doc/README b/nokia-lintian/doc/README
new file mode 100644 (file)
index 0000000..73affc2
--- /dev/null
@@ -0,0 +1,123 @@
+README file for Lintian
+=======================
+
+Disclaimer
+----------
+
+IMPORTANT NOTES ABOUT THE USE OF LINTIAN:
+
+  1. Lintian is not finished yet and will probably never be. Please don't
+    use Lintian as a reference for Debian policy. Lintian might miss a lot
+    of policy violations while it might also report some violations by
+    mistake. If in doubt, please check out the policy manuals.
+
+  2. The Debian policy gives the maintainers a lot of freedom. In most
+    cases, the guidelines included in the manuals allow exceptions. Thus,
+    if Lintian reports a policy violation on a package and you think this
+    is such an exception (or if you think Lintian has a bug itself) please
+    contact the authors of Lintian about this. There is an `override'
+    file which tells Lintian about policy exceptions.
+
+  3. Please DO NOT use Lintian to file bug reports (neither single ones nor
+    mass bug reports). This is done by authors of Lintian already and
+    duplication of efforts and bug reports should be avoided! If you think
+    a certain bug is `critical', and should be reported/fixed immediately,
+    please contact the maintainer of the corresponding package and/or the
+    Lintian maintainers.
+
+  4. Any feedback about Lintian is welcomed! Please send your comments to
+    <lintian-maint@debian.org>.
+
+
+Running Lintian for the first time
+----------------------------------
+
+Here is what you have to do at minimum to get lintian up and running:
+
+  1. Install the `lintian' package
+
+  2. Run lintian over your packages:
+
+       $ lintian <something>.deb
+       $ lintian <something>.udeb
+       $ lintian <something>.dsc
+       $ lintian <something>.changes
+
+(Yes, Lintian is really easy to use! ;-)
+
+
+Command line options of the lintian command
+-------------------------------------------
+
+  Syntax: lintian [action] [options] [--] [packages] ...
+
+  (Please refer to the manual page lintian(1) for details.)
+
+  Actions:
+    -S, --setup-lab           set up static lab
+    -R, --remove-lab          remove static lab
+    -c, --check               check packages (default action)
+    -C X, --check-part X      check only certain aspects
+    -X X, --dont-check-part X don't check certain aspects
+    -u, --unpack              only unpack packages in the lab
+    -r, --remove              remove package from the lab
+  General options:
+    -h, --help                display short help text
+    -v, --verbose             verbose messages
+    -V, --version             display Lintian version and exit
+    -d, --debug               turn Lintian's debug messages ON
+    --print-version           print unadorned version number and exit
+  Behaviour options:
+    -i, --info                give detailed info about tags
+    -I, --display-info        display "I:" tags (normally suppressed)
+    -l X, --unpack-level X    set default unpack level to X
+    -o, --no-override         ignore overrides
+    --show-overrides          output tags that have been overriden
+    --color never/always/auto disable, enable, or enable color for TTY
+    -U X, --unpack-info X     specify which info should be collected
+    -m, --md5sums             check md5sums when processing a .changes file
+    --allow-root              suppress lintian's warning when run as root
+  Configuration options:
+    --cfg CONFIGFILE          read CONFIGFILE for configuration
+    --lab LABDIR              use LABDIR as permanent laboratory
+    --archivedir ARCHIVEDIR   location of Debian archive to scan for packages
+    --dist DIST               scan packages in this distribution (e.g. sid)
+    --section RELEASE         scan packages in this section (e.g. main)
+    --arch ARCH               scan packages with architecture ARCH
+    --root ROOTDIR            use ROOTDIR instead of /usr/share/lintian
+  Package selection options:
+    -a, --all                 process all packages in distribution
+    -b, --binary              process only binary packages
+    -s, --source              process only source packages
+    --udeb                    process only udeb packages
+    -p X, --packages-file X   process all files in file (special syntax!)
+
+
+Where to find more information
+------------------------------
+
+Details about the `lintian' and the `lintian-info' commands can be
+found in the manual pages lintian(1) and lintian-info(1),
+respectively.
+
+General information about Lintian and how to use it can be found in
+the `Lintian User's Manual' at
+file:/usr/share/doc/lintian/lintian.html/index.html
+
+Weekly updated Lintian reports from all packages in the Debian
+distribution can be found at the Lintian home page at
+
+      http://www.debian.org/lintian/
+
+
+Feedback
+--------
+
+Any comments, critics, or suggestions about Lintian or related topics
+are highly appreciated by the authors! Please contact
+<lintian-maint@debian.org>.  Thanks!
+
+
+
+Christian Schwarz <schwarz@debian.org>, Mar 14, 1998.
+Updated by Frank Lichtenheld, Apr 14, 2004 (Lintian 1.23.0).
diff --git a/nokia-lintian/doc/desc-files b/nokia-lintian/doc/desc-files
new file mode 100644 (file)
index 0000000..bc51f98
--- /dev/null
@@ -0,0 +1,28 @@
+
+Description record for `collector' scripts:
+
+  Collector-Script: <file name of collector script>
+  Info: <description of what this script does>
+  Type: comma-separated list of <binary | source | udeb>
+  Unpack-Level: <1 | 2>
+  Output: <a file that's generated by this script>
+  Order: <order--necessary if this script needs info from other scripts, see Needs-Info>
+  Needs-Info: <info this scripts needs from other collector scripts>
+
+Description record for `checker' scripts:
+
+  Check-Script: <file name of checker script>
+  Abbrev: <abbrev>
+  Info: <description of what this check does>
+  Type: comma-separated list of <binary | source | udeb>
+  Standards-Version: <standards-version for which this check has been designed>
+  Unpack-Level: <1 | 2>
+  Needs-Info: <info this script needs>
+
+Description record of a `Lintian tag':
+
+  Tag: <tag>
+  Type: <warning | error>
+  Info: <description of this tag>
+  Ref: <reference>
+  Status: <untested | <empty> >
diff --git a/nokia-lintian/doc/lintian.sgml b/nokia-lintian/doc/lintian.sgml
new file mode 100644 (file)
index 0000000..6b8953b
--- /dev/null
@@ -0,0 +1,694 @@
+<!doctype debiandoc system>
+
+<book>
+
+<title>Lintian User's Manual
+<author>Christian Schwarz <email>schwarz@debian.org</email>
+<author>Richard Braakman <email>dark@xs4all.nl</email>
+<author>Sean 'Shaleh' Perry <email>shaleh@debian.org</email>
+<author>Frank Lichtenheld <email>djpig@debian.org</email>
+<author>Contact address: <email>lintian-maint@debian.org</email>
+<version>version 1.23.8, 31 January 2005
+
+<abstract>
+This manual describes Lintian, the Debian package checker.
+</abstract>
+
+<copyright>Copyright &copy; 1998 Christian Schwarz and Richard Braakman
+           Copyright &copy; 2000 Sean 'Shaleh' Perry
+           Copyright &copy; 2004 Frank Lichtenheld
+<p>
+
+This manual is free software; you may redistribute it and/or
+modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2, or (at
+your option) any later version.
+
+<p>
+
+This is distributed in the hope that it will be useful, but without
+any warranty; without even the implied warranty of merchantability or
+fitness for a particular purpose. See the GNU General Public License
+for more details.
+
+<p>
+
+A copy of the GNU General Public License is available as
+<tt>/usr/share/common-licenses/GPL</tt> in the Debian GNU/Linux distribution or on the
+World Wide Web at <url id="http://www.gnu.org/copyleft/gpl.html">.
+You can also obtain it by writing to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+<p>
+
+<toc sect>
+
+<chapt>Introduction
+
+<p>
+
+<sect>About Lintian
+
+<p>
+
+Lintian is a Debian package checker. It can be used to check binary
+and source packages for compliance with the Debian policy and for
+other common packaging errors.
+
+<p>
+
+Lintian uses an archive directory, called laboratory, in which it
+stores information about the packages it examines.  It can keep this
+information between multiple invocations in order to avoid repeating
+expensive data-collection operations. It's also possible to check the
+complete Debian archive for bugs -- in a timely manner.
+
+<p>
+
+<sect>The intention of Lintian
+
+<p>
+
+Packaging has become complicated--not because dpkg is complicated
+(indeed, dpkg-deb is very simple to use) but because of the high
+requirements of our policy. If a developer releases a new package, she
+has to consider hundreds of guidelines to make the package `policy
+compliant.'
+
+<p>
+
+All parts of our policy have been introduced by the same procedure:
+Some developer has a good idea how to make packages more `unique' with
+respect to a certain aspect--then the idea is discussed and a policy
+proposal is prepared. If we have a consensus about the policy change,
+it's introduced in our manuals.
+
+<p>
+
+Therefore, our policy is <em>not</em> designed to make life harder for the
+maintainers! The intention is to make Debian the best Linux
+distribution out there. With this in mind, lots of policy changes are
+discussed on the mailing lists each week.
+
+<p>
+
+But changing the policy is only a small part of the story: Just having
+some statement included in the manual does not make Debian any
+better. What's needed is for that policy to become `real life,' i.e., it's
+<em>implemented</em> in our packages. And this is where Lintian comes in:
+Lintian checks packages and reports possible policy violations. (Of
+course, not everything can be checked mechanically -- but a lot of
+things can and this is what Lintian is for.)
+
+<p>
+
+Thus, Lintian has the following goals:
+
+<p>
+
+<list compact>
+
+<item> <em>To give us some impression of the `gap' between theory (written
+policy) and praxis (current state of implementation).</em>
+
+<p>
+
+From the results of the first two Lintian checks I implemented, I see
+that there is a big need to make this gap smaller. Introducing more
+policy aspects is worthless unless they are implemented. We first
+should fix packages to comply with current policy before searching for
+new ways to make policy more detailed. (Of course, there are also
+important policy changes that need to be introduced -- but this is not
+what's meant here.)
+
+<p>
+
+<item> <em>To make us re-think about certain aspects of our policy.</em>
+
+<p>
+
+For example, it could turn out that some ideas that once sounded great
+in theory are hard to implement in all our packages -- in which case
+we should rework this aspect of policy.
+
+<p>
+
+<item> <em>To show us where to concentrate our efforts in order to make
+Debian a higher quality distribution.</em>
+
+<p>
+
+Most release requirements will be implemented through policy.
+Lintian reports provide an easy way to compare <em>all</em> our packages
+against policy and keep track of the fixing process by watching bug reports.
+Note, that all this can be done <em>automatically</em>.
+
+<p>
+
+<item> <em>To make us avoid making the same mistakes all over again.</em>
+
+<p>
+
+Being humans, it's natural for us to make errors. Since we all have
+the ability to learn from our mistakes, this is actually no big
+problem.  Once an important bug is discovered, a Lintian check could
+be written to check for exactly this bug. This will prevent the bug from
+appearing in any future revisions of any of our packages.
+
+<p>
+
+</list>
+
+<sect>Design issues
+
+<p>
+
+There are three fields of application for Lintian:
+
+<p>
+
+<list compact>
+
+<item> one person could use Lintian to check the whole Debian archive
+and reports bugs,
+
+<p>
+
+<item> each maintainer runs Lintian over her packages before uploading
+them,
+
+<p>
+
+<item> dinstall checks packages which are uploaded to master before
+they are installed in the archive.
+
+<p>
+
+</list>
+
+The authors of Lintian decided to use a very modular design to
+achieve the following goals:
+
+<p>
+
+<list compact>
+
+<item> flexibility: Lintian can be used to check single packages or
+the whole archive and to report and keep track of bug reports, etc.
+
+<p>
+
+<item> completeness: Lintian will eventually include checks for
+(nearly) everything that can be checked mechanically.
+
+<p>
+
+<item> uptodateness: Lintian will be updated whenever policy is
+changed.
+
+<p>
+
+<item> performance: Lintian should make it possible to check single packages
+within seconds or check the full archive within a few hours.
+
+<p>
+
+</list>
+
+<sect>Disclaimer
+
+<p>
+
+Here is a list of important notes on how to use Lintian:
+
+<enumlist>
+
+<item> Lintian is not finished yet and will probably never be. Please
+don't use Lintian as a reference for Debian policy. Lintian might miss
+a lot of policy violations while it might also report some violations
+by mistake. If in doubt, please check out the policy manuals.
+
+<p>
+
+<item> The Debian policy gives the maintainers a lot of freedom. In
+most cases, the guidelines included in the manuals allow
+exceptions. Thus, if Lintian reports a policy violation on a package
+and you think this is such an exception (or if you think Lintian has a
+bug) you can do two things: If your package is a bit non-standard and weird in
+this regard, you can install an override. If you think however that the check
+is too easily or outright wrongly triggered, please file a bug on the lintian
+package.
+
+<p>
+
+<item> Please DO NOT use Lintian to file bug reports (neither single
+ones nor mass bug reports). This is done by the authors of Lintian already
+and duplication of efforts and bug reports should be avoided! If you
+think a certain bug is `critical' and should be reported/fixed immediately,
+please contact the maintainer of the corresponding package and/or the Lintian
+maintainers.
+
+<p>
+
+<item> Any feedback about Lintian is welcomed! Please send your
+comments to the lintian maintainers <email/lintian-maint@debian.org/.
+
+<p>
+
+</enumlist>
+
+<chapt>Getting started
+
+<p>
+
+<sect>Installing Lintian
+
+<p>
+
+Before you can start to check your packages with Lintian, you'll have
+to install the <prgn>lintian</prgn> Debian package.
+
+<p>
+
+<sect>Running lintian
+
+<p>
+
+After that, you can run Lintian over any Debian binary, udeb or source packages
+like this:
+
+<p>
+
+<example>
+$ lintian libc5_5.4.38-1.deb
+E: libc5: old-fsf-address-in-copyright-file
+W: libc5: shlib-without-dependency-information usr/lib/libgnumalloc.so.5.4.38
+W: libc5: shlib-without-dependency-information lib/libc.so.5.4.38
+W: libc5: shlib-without-dependency-information lib/libm.so.5.0.9
+E: libc5: shlib-with-executable-bit lib/libc.so.5.4.38 0755
+E: libc5: shlib-with-executable-bit lib/libm.so.5.0.9 0755
+E: libc5: shlib-missing-in-control-file libgnumalloc usr/lib/libgnumalloc.so.5.4.38
+$
+</example>
+
+As you can see, Lintian uses a special format for all its error and
+warning messages. With that, its very easy to write other programs
+which run Lintian and interpret the displayed messages.
+
+<p>
+
+<sect>Lintian Tags
+
+<p>
+
+The first character of each line indicates the type of
+message. Currently, the following types are supported:
+
+<p>
+
+<taglist>
+
+<tag><em>Errors (E)</em>
+<item>The displayed message indicates a policy violation or a
+packaging error. For policy violations, Lintian will cite the
+appropriate policy section when it is invoked with the <tt>-i</tt> option.
+
+<p>
+
+<tag><em>Warnings (W)</em>
+<item>The displayed message might be a policy violation or packaging
+error. A warning is usually an indication that the test is
+known to sometimes produce false positive alarms, because either
+the corresponding rule in policy has many exceptions or the test
+uses some sort of heuristic to find errors.
+
+<p>
+
+<tag><em>Info (I)</em>
+<item>The displayed message is meant to inform the maintainer
+about a certain packaging aspect. Such messages do not usually
+indicate errors, but might still be of interest to the curious.
+They are not displayed unless the <tt>-I</tt> option is set.
+
+<p>
+
+<tag><em>Notes (N)</em>
+<item>The displayed message is a debugging message which
+informs you about the current state of Lintian.
+
+<p>
+
+<tag><em>Experimental (X)</em>
+<item>The displayed message is one of the types listed above, but has been
+flagged as `experimental' by the Lintian maintainers.  This means that
+the code that generates this message is not as well tested as the rest
+of Lintian, and might still give surprising results.  Feel free to
+ignore Experimental messages that do not seem to make sense, though of
+course bug reports are always welcomed.
+
+They are not displayed unless the <tt>-E</tt> option is set.
+<p>
+
+<tag><em>Overridden (O)</em>
+<item>The displayed message indicates a previous
+<em>Warning</em> or <em>Error</em> message which has been
+<em>overridden</em> (see below). They are not displayed unless
+the <tt>--show-overrides</tt> option is set.
+
+<p>
+
+</taglist>
+
+The following parameters after the type indicator tell you about the
+<em>package</em> that has been processed (this can either be a binary or a
+source package) and about the <em>problem</em> that has been
+discovered. The problem is identified by a so-called <em>tag</em> (for
+example, <tt>old-fsf-address-in-copyright-file</tt>).
+
+<p>
+
+Depending on which tag has been reported, the line may contain
+additional arguments which tell you, for example, which files are
+involved.
+
+<p>
+
+If you do not understand what a certain tag is about, you can specify
+the <tt>-i</tt> option when calling Lintian to get a detailed description
+of the reported tags:
+
+<p>
+
+<example>
+$ lintian -i libc5_5.4.38-1.deb
+E: libc5: old-fsf-address-in-copyright-file
+N:
+N:   The /usr/doc/&lt;pkg&gt;/copyright file refers to the old postal address of
+N:   the Free Software Foundation (FSF). The new address is:
+N:   
+N:   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+N:   MA 02110-1301, USA.
+N:
+[...]
+$
+</example>
+
+In some cases, the messages contain some additional text with a
+leading hash character (#). This text should be ignored by any other
+programs which interpret Lintian's output because it doesn't follow a
+unique format between different messages and it's only meant as
+additional information for the maintainer.
+
+<p>
+
+<sect>Overrides
+
+<p>
+
+In some cases, the checked package does not have a bug or does not
+violate policy, but Lintian still reports an error or warning. This
+can have the following reasons: Lintian has a bug itself, a specific Lintian
+check is not smart enough to know about a special case allowed by policy,
+or the policy does allow exceptions to some rule in general.
+
+<p>
+
+In the first case (where Lintian has a bug) you should send a bug
+report to the Debian bug tracking system and describe which package
+you checked, which messages have been displayed, and why you think
+Lintian has a bug. Best would be, if you would run Lintian again over
+your packages using the <tt>-d</tt> (or <tt>--debug</tt>) option,
+which will cause Lintian to
+output much more information (debugging info), and include these
+messages in your bug report. This will simplify the debugging process
+for the authors of Lintian.
+
+<p>
+
+In the other two cases (where the error is actually an exception to
+policy), you should probably add an override. If you're unsure though whether
+it's indeed a good case for an override, you should contact the Lintian
+maintainers too, including the Lintian error message and a short note, stating
+why you think this is an exception. This way, the Lintian maintainers can be
+sure the problem is not actually a bug in Lintian or an error in the author's
+reading of policy. Please do not override bugs in lintian, they should rather
+be fixed than overridden.
+
+Once it has been decided that an override is needed, you can easily add one by
+supply a overrides file. If the override is for a binary or udeb
+package, you have to place it at
+<file>/usr/share/lintian/overrides/&lt;package&gt;</file> inside the
+package. If the override is for a source package, you have to place
+it at <file>debian/source.lintian-overrides</file>. With that, Lintian
+will know about this exception and not report the problem again when
+checking your package. (Actually, Lintian will report the problem 
+again, but with type <em>overridden</em>, see above.) Note that
+support for source overrides was added in Lintian version 1.23.0.
+
+<p>
+
+Note that Lintian extracts the override file from the (u)deb and stores
+it in the laboratory. The files currently installed on the system are
+not used in current Lintian versions.
+
+<p>
+
+The format of the overrides file is simple, it consists of one override per
+line (and may contain empty lines and comments, starting with a #, on others):
+<tt>[&lt;package&gt;[ &lt;type&gt;]: ]&lt;lintian-tag&gt;[
+&lt;lintian-info&gt;]</tt>.  <tt>&lt;package&gt;</tt> is the package name;
+<tt>&lt;type&gt;</tt> is one of <tt>binary</tt>, <tt>udeb</tt> and
+<tt>source</tt>, and <tt>&lt;lintian-info&gt;</tt> is all additional
+information provided by Lintian except for the tag. What's inside brackets is
+optional and may be omitted if you want to match it all.  An example file for
+a binary package would look like:
+
+<example>
+/usr/share/lintian/overrides/foo, where foo is the name of your package
+
+# We use a non-standard dir permission to only allow the webserver to look
+# into this directory:
+foo binary: non-standard-dir-perm
+foo binary: FSSTND-dir-in-usr /usr/man/man1/foo.1.gz
+</example>
+
+<p>
+
+An example file for a source package would look like:
+<example>
+debian/source.lintian-overrides in your base source directory
+foo source: debian-files-list-in-source
+# Upstream distributes it like this, repacking would be overkill though, so
+# tell lintian to not complain:
+foo source: configure-generated-file-in-source config.cache
+</example>
+
+<p>
+
+Many tags can occour more than once (e.g. if the same error is found
+in more than one file). You can override a tag either completly by
+specifying its name (first line in the examples) or only one
+occurrence of it by specifying the additional info, too (second line
+in the examples).
+
+<chapt>Advanced usage
+
+<p>
+
+<sect>How Lintian works
+
+<p>
+
+Lintian is divided into the following layers:
+
+<p>
+
+<taglist>
+
+<tag><em>frontend</em>
+
+<item> the command line interface (currently, this layer consists of
+two scripts, namely <prgn>lintian</prgn> and <prgn>lintian-info</prgn>)
+
+<p>
+
+<tag><em>checkers</em>
+
+<item> a set of scripts that check different aspects of binary or
+source packages
+
+<p>
+
+<tag><em>data collectors</em>
+
+<item> a set of scripts that prepares specific information about a
+package needed by the checker scripts
+
+<p>
+
+<tag><em>unpacking scripts</em>
+
+<item> a set of scripts that unpack binary and source packages and
+extract some basic information about the package contents
+
+<p>
+
+<tag><em>bug reporting scripts</em>
+
+<item> a collection of scripts to report bugs and keep track of them
+afterwards
+
+<p>
+
+</taglist>
+
+When you check a package with Lintian, the following steps are
+performed (not exactly in this order--but the details aren't important
+now):
+
+<p>
+
+<enumlist>
+
+<item> The package contents are unpacked in the <em>laboratory</em> (or
+just <em>lab</em>).
+
+<p>
+
+<item> Some data is collected about the package. (That's done by the
+so-called <em>collector scripts</em>.) For example, the <prgn>file</prgn>
+program is run on each file in the package and the output is saved in the
+<prgn>file-info</prgn> file in the lab.
+
+<p>
+
+<item> The package contents are removed again (to save disk space),
+but the <em>statistics files</em> produced in the last step remain in the
+lab.
+
+<p>
+
+<item> The <em>checker scripts</em> are run over the package and report
+any discovered policy violations or other errors. These scripts don't
+access the package contents directly, but use the collected data as
+input.
+
+<p>
+
+<item> Depending on the <em>lab mode</em> Lintian uses (see below), the
+whole lab directory is removed again.
+
+<p>
+
+</enumlist>
+
+This separation of the <em>checker scripts</em> from the <em>unpacking
+tools</em> and the <em>data collector scripts</em> makes it possible to run
+Lintian several times over a package without having to unpack the
+package each time. In addition, the checker scripts don't have to
+worry about packaging details since they just access the statistics
+files (not the package files directly).
+
+<p>
+
+Furthermore, since it is sufficient to save the statistics files of
+each package in order to run the checks, one can store these files for
+all packages of the Debian archive if one wants to check the whole
+distribution several times.  The space savings is substantial and continues
+to grow as the archive does.
+
+<p>
+
+<sect>The laboratory
+
+<p>
+
+Lintian's laboratory directory can be defined via the <em>LINTIAN_LAB</em>
+variable (either in the configuration file or as environment
+variable). If this variable is not defined, Lintian creates a
+temporary lab in <tt>/tmp</tt> which is removed again after Lintian
+has completed its checks. This mode is called <em>temporary lab mode</em>.
+
+<p>
+
+In the <em>static lab mode</em> (if the laboratory directory is defined by
+the user), the laboratory has to be set up first before it can be used
+by Lintian. This can be done with the <tt>-S</tt> (or <tt>--setup-lab</tt>)
+command line option (see also the next section about the distribution
+directory).
+
+<p>
+
+Here is a sketch of the Lintian laboratory:
+
+<example>
+
+   $LINTIAN_LAB/
+
+      source/
+       &lt;src-pkg-name&gt;/
+        .lintian-status
+        dsc                 dsc file
+        foo.diff.gz
+        foo.orig.tar.gz     (symlinks to actual files)
+        binary/
+            &lt;binary 1&gt; -&gt; ../../../binary/&lt;binary 1&gt;
+            ...
+       unpacked/           (opt., contains unpacked source package)
+
+      binary/
+       &lt;bin-pkg-name&gt;/
+        .lintian-status
+        index               (output of `dpkg -c')
+        control-index       (same for the control.tar.gz of the pkg)
+        control/            (contains all control files)
+        fields/             (contains all control field settings)
+       source -&gt; ../../source/&lt;source pkg&gt;
+        deb                 (symlink to actual file)
+       unpacked/           (opt., contains unpacked binary package)
+
+      udeb/
+       &lt;udeb-pkg-name&gt;/
+       ...                 (same structure as for binary packages)
+
+      info/
+        binary-packages     list of binary packages in archive
+        udeb-packages       list of udeb packages in archive
+       source-packages     list of source packages in archive
+
+</example>
+
+<sect>Distribution directory
+
+<p>
+
+If you want to check the full Debian distribution with Lintian, you
+have to set up the <tt>LINTIAN_DIST</tt> variable in the configuration
+file (or as environment variable). Then, you have to run <tt>lintian
+-S</tt> to set up the laboratory and to create lists of all binary and
+source packages in the distribution. (Note, that this might take some
+time...)
+
+<p>
+
+After that, you can either check single packages simply be running
+<example>
+  $ lintian foo
+</example>
+(without path or extension for the package <tt>foo</tt>) or check the
+whole distribution with
+<example>
+  $ lintian --all
+</example>
+
+<p>
+
+Since Lintian needs an up-to-date list of packages in the
+distribution, you'll have to rerun the <tt>lintian -S</tt> command
+whenever the distribution directory has been changed. (But there is no
+need to remove the laboratory in this situation: Lintian is smart
+enough to only re-unpack packages that have been changed.)
+
+<p>
+
+</book>
diff --git a/nokia-lintian/doc/lintianrc.example b/nokia-lintian/doc/lintianrc.example
new file mode 100644 (file)
index 0000000..5d1031a
--- /dev/null
@@ -0,0 +1,34 @@
+# /etc/lintianrc -- Lintian configuration file
+#
+# Note, that Lintian has reasonable default values for all variables
+# specified below. Thus, you don't have to change this file unless you
+# want something special.
+# 
+# Also note, that this file uses a special syntax:
+# Empty lines are allowed, comments are introduced by a hash sign (#).
+# All other lines must have the format
+#    VAR=text
+# or
+#    VAR="text"
+# It is allowed to use `~' and `$HOME' in the variables, but not other
+# shell/environment variables.
+
+# Specify a laboratory--a directory where Lintian should store some info
+# about packages being checked.
+#LINTIAN_LAB="/var/spool/lintian"
+
+# Override default unpack level. By setting this to 0, Lintian will
+# automatically remove any unpacked packages after they have been
+# processed.
+#LINTIAN_UNPACK_LEVEL="0"
+
+# If you want lintian to check the whole Debian archive instead of just
+# single packages you have to set the LINTIAN_DIST variable to the root
+# directory of the distribution archive (i.e., a local Debian mirror).
+#
+#LINTIAN_DIST="/ftp/debian/dists/unstable"
+
+# Specify a default architecture--when checking the full archive (as
+# specified by LINTIAN_DIST), Lintian will only check packages of this
+# architecture or of architecture `all'.
+#LINTIAN_ARCH="i386"
diff --git a/nokia-lintian/frontend/depcheck b/nokia-lintian/frontend/depcheck
new file mode 100755 (executable)
index 0000000..3285d57
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -w
+
+use strict;
+$ENV{'LINTIAN_ROOT'} = '..';
+require "$ENV{'LINTIAN_ROOT'}/lib/deplib.pl";
+
+my $foo = Dep::parse('aalib1 (>= 1.2), libc6 (>= 2.2.2-2), libgpmg1 (>= 1.14-16), libncurses5 (>= 5.2.20010310-1), libpng2, slang1 (>> 1.3.0-0), svgalibg1 | svgalib-dummyg1, slang1, xlibs (>= 4.0.1-11), libpng2, zlib1g (>= 1:1.1.3)');
+
+use Data::Dumper;
+
+if ($foo->[0] eq 'AND') {
+    my %seen;
+    shift @$foo;
+    foreach my $i (@$foo) {
+       next if ($i->[0] eq 'OR');
+       $seen{$i->[1]}++;
+    }
+    my @dups = grep {$seen{$_} > 1} keys(%seen);
+    if (scalar(@dups) > 0) {
+       print "Dups: " . scalar(@dups) . "\n";
+       print "@dups\n";
+    }
+}
+
+print Dumper($foo) . "\n";
+
+#my @preds = $foo->[1];
+#print Dumper(@preds);
diff --git a/nokia-lintian/frontend/lintian b/nokia-lintian/frontend/lintian
new file mode 100755 (executable)
index 0000000..1be2e9b
--- /dev/null
@@ -0,0 +1,1718 @@
+#!/usr/bin/perl -w
+# {{{ Legal stuff
+# Lintian -- Debian package checker
+#
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+# }}}
+
+# {{{ libraries and such
+use strict;
+
+use Getopt::Long;
+use FileHandle;
+# }}}
+
+# {{{ Global Variables
+my $lintian_info_cmd = 'lintian-info'; #Command to run for ?
+my $LINTIAN_VERSION = "<VERSION>";     #External Version number
+my $BANNER = "Lintian v$LINTIAN_VERSION"; #Version Banner - text form
+my $LAB_FORMAT = 8;            #Lab format Version Number
+                               #increased whenever incompatible
+                               #changes are done to the lab
+                               #so that all packages are re-unpacked
+
+# Variables used to record commandline options
+# Commented out variables have "defined" checks somewhere to determine if
+# they were set via commandline or environment variables
+my $pkg_mode = 'a';            # auto -- automatically search for
+                               # binary and source pkgs
+use vars qw($verbose);
+$verbose = 0;                  #flag for -v|--verbose switch
+our $debug = 0;                #flag for -d|--debug switch
+our $quiet = 0;                        #flag for -q|--quiet switch
+my @debug;
+my $check_everything = 0;      #flag for -a|--all switch
+my $lintian_info = 0;          #flag for -i|--info switch
+our $display_infotags = 0;     #flag for -I|--display-info switch
+our $display_experimentaltags = 0; #flag for -E|--display-experimental switch
+my $unpack_level = undef;      #flag for -l|--unpack-level switch
+our $no_override = 0;          #flag for -o|--no-override switch
+our $show_overrides = 0;       #flag for --show-overrides switch
+our $color = 'never';          #flag for --color switch
+my $check_checksums = 0;       #flag for -m|--md5sums|--checksums switch
+my $allow_root = 0;            #flag for --allow-root switch
+my $fail_on_warnings = 0;       #flag for --fail-on-warnings switch
+my $keep_lab = 0;              #flag for --keep-lab switch
+my $packages_file = 0;         #string for the -p option
+my $OPT_LINTIAN_LAB = "";      #string for the --lab option
+my $OPT_LINTIAN_ARCHIVEDIR = "";#string for the --archivedir option
+my $OPT_LINTIAN_DIST = "";     #string for the --dist option
+my $OPT_LINTIAN_ARCH = "";     #string for the --arch option
+my $OPT_LINTIAN_SECTION = "";  #string for the --release option
+# These options can also be used via default or environment variables
+my $LINTIAN_CFG = "";          #config file to use
+our $LINTIAN_ROOT;             #location of the lintian modules
+
+my $experimental_output_opts = undef;
+
+my @packages;
+
+my $action;
+my $checks;
+my $dont_check;
+my $unpack_info;
+my $cwd;
+my $cleanup_filename;
+my $exit_code = 0;
+my $LAB;
+
+my %collection_info;
+my %already_scheduled;
+my %checks;
+my %check_abbrev;
+my %unpack_infos;
+my %check_info;
+
+# reset configuration variables
+my $LINTIAN_LAB = undef;
+my $LINTIAN_ARCHIVEDIR = undef;
+my $LINTIAN_DIST = undef;
+my $LINTIAN_UNPACK_LEVEL = undef;
+my $LINTIAN_ARCH = undef;
+my $LINTIAN_SECTION = undef;
+# }}}
+
+# {{{ Setup Code
+
+#turn off file buffering
+$| = 1;
+
+# reset locale definition (necessary for tar)
+$ENV{'LC_ALL'} = 'C';
+
+# }}}
+
+# {{{ Process Command Line
+
+#######################################
+# Subroutines called by various options
+# in the options hash below.  These are
+# invoked to process the commandline
+# options
+#######################################
+# Display Command Syntax
+# Options: -h|--help
+sub syntax {
+    print "$BANNER\n";
+    print <<"EOT-EOT-EOT";
+Syntax: lintian [action] [options] [--] [packages] ...
+Actions:
+    -S, --setup-lab           set up static lab
+    -R, --remove-lab          remove static lab
+    -c, --check               check packages (default action)
+    -C X, --check-part X      check only certain aspects
+    -X X, --dont-check-part X don\'t check certain aspects
+    -u, --unpack              only unpack packages in the lab
+    -r, --remove              remove package from the lab
+General options:
+    -h, --help                display short help text
+    -v, --verbose             verbose messages
+    -V, --version             display Lintian version and exit
+    --print-version           print unadorned version number and exit
+    -d, --debug               turn Lintian\'s debug messages ON
+    -q, --quiet               suppress all informational messages
+Behaviour options:
+    -i, --info                give detailed info about tags
+    -I, --display-info        display "I:" tags (normally suppressed)
+    -E, --display-experimental display "X:" tags (normally suppressed)
+    -l X, --unpack-level X    set default unpack level to X
+    -o, --no-override         ignore overrides
+    --show-overrides          output tags that have been overriden
+    --color never/always/auto disable, enable, or enable color for TTY
+    -U X, --unpack-info X     specify which info should be collected
+    -m, --md5sums, --checksums check checksums when processing a .changes file
+    --allow-root              suppress lintian\'s warning when run as root
+    --fail-on-warnings        return a non-zero exit status if warnings found
+    --keep-lab                keep lab after run, even if temporary
+Configuration options:
+    --cfg CONFIGFILE          read CONFIGFILE for configuration
+    --lab LABDIR              use LABDIR as permanent laboratory
+    --archivedir ARCHIVEDIR   location of Debian archive to scan for packages
+    --dist DIST               scan packages in this distribution (e.g. sid)
+    --section RELEASE         scan packages in this section (e.g. main)
+    --arch ARCH               scan packages with architecture ARCH
+    --root ROOTDIR            use ROOTDIR instead of /usr/share/lintian
+Package selection options:
+    -a, --all                 process all packages in distribution
+    -b, --binary              process only binary packages
+    -s, --source              process only source packages
+    --udeb                    process only udeb packages
+    -p X, --packages-file X   process all files in file (special syntax!)
+EOT-EOT-EOT
+
+    exit 0;
+}
+
+# Display Version Banner
+# Options: -V|--version, --print-version
+sub banner {
+    if ($_[0] eq 'print-version') {
+       print "$LINTIAN_VERSION\n";
+    } else {
+       print "$BANNER\n";
+    }
+    exit 0;
+}
+
+# Record action requested
+# Options: -S, -R, -c, -u, -r
+sub record_action {
+    if ($action) {
+       die("too many actions specified: $_[0]");
+    }
+    $action = "$_[0]";
+}
+
+# Record Parts requested for checking
+# Options: -C|--check-part
+sub record_check_part {
+    if (defined $action and $action eq 'check' and $checks) {
+       die("multiple -C or --check-part options not allowed");
+    }
+    if ($dont_check) {
+       die("both -C or --check-part and -X or --dont-check-part options not allowed");
+    }
+    if ($action) {
+       die("too many actions specified: $_[0]");
+    }
+    $action = 'check';
+    $checks = "$_[1]";
+}
+
+# Record Parts requested not to check
+# Options: -X|--dont-check-part X
+sub record_dont_check_part {
+    if (defined $action and $action eq 'check' and $dont_check) {
+       die("multiple -x or --dont-check-part options not allowed");
+    }
+    if ($checks) {
+       die("both -C or --check-part and -X or --dont-check-part options not allowed");
+    }
+    if ($action) {
+       die("too many actions specified: $_[0]");
+    }
+    $action = 'check';
+    $dont_check = "$_[1]";
+}
+
+
+# Process for -U|--unpack-info flag
+sub record_unpack_info {
+    if ($unpack_info) {
+       die("multiple -U or --unpack-info options not allowed");
+    }
+    $unpack_info = "$_[1]";
+}
+
+# Record what type of data is specified
+# Options: -b|--binary, -s|--source, --udeb
+sub record_pkgmode {
+    $pkg_mode = 'b' if $_[0] eq 'binary';
+    $pkg_mode = 's' if $_[0] eq 'source';
+    $pkg_mode = 'u' if $_[0] eq 'udeb';
+}
+
+# Hash used to process commandline options
+my %opthash = (                        # ------------------ actions
+              "setup-lab|S" => \&record_action,
+              "remove-lab|R" => \&record_action,
+              "check|c" => \&record_action,
+              "check-part|C=s" => \&record_check_part,
+              "dont-check-part|X=s" => \&record_dont_check_part,
+              "unpack|u" => \&record_action,
+              "remove|r" => \&record_action,
+
+              # ------------------ general options
+              "help|h" => \&syntax,
+              "version|V" => \&banner,
+              "print-version" => \&banner,
+
+              "verbose|v" => \$verbose,
+              "debug|d" => \@debug, # Count the -d flags
+              "quiet|q" => \$quiet,
+
+              # ------------------ behaviour options
+              "info|i" => \$lintian_info,
+              "display-info|I" => \$display_infotags,
+              "display-experimental|E" => \$display_experimentaltags,
+              "unpack-level|l=i" => \$unpack_level,
+              "no-override|o" => \$no_override,
+              "show-overrides" => \$show_overrides,
+              "color=s" => \$color,
+              "unpack-info|U=s" => \&record_unpack_info,
+              "checksums|md5sums|m" => \$check_checksums,
+              "allow-root" => \$allow_root,
+              "fail-on-warnings" => \$fail_on_warnings,
+              "keep-lab" => \$keep_lab,
+              # Note: Ubuntu has (and other derivatives might gain) a
+              # -D/--debian option to make lintian behave like in Debian, that
+              # is, to revert distribution-specific changes
+
+              # ------------------ configuration options
+              "cfg=s" => \$LINTIAN_CFG,
+              "lab=s" => \$OPT_LINTIAN_LAB,
+              "archivedir=s" => \$OPT_LINTIAN_ARCHIVEDIR,
+              "dist=s" => \$OPT_LINTIAN_DIST,
+              "section=s" => \$OPT_LINTIAN_SECTION,
+              "arch=s" => \$OPT_LINTIAN_ARCH,
+              "root=s" => \$LINTIAN_ROOT,
+
+              # ------------------ package selection options
+              "all|a" => \$check_everything,
+              "binary|b" => \&record_pkgmode,
+              "source|s" => \&record_pkgmode,
+              "udeb" => \&record_pkgmode,
+              "packages-file|p=s" => \$packages_file,
+
+              # ------------------ experimental
+              "exp-output:s" => \$experimental_output_opts,
+             );
+
+# init commandline parser
+Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
+
+# process commandline options
+GetOptions(%opthash)
+    or die("error parsing options\n");
+
+# determine current working directory--we'll need this later
+chop($cwd = `pwd`);
+
+# determine LINTIAN_ROOT if it was not set with --root.
+$LINTIAN_ROOT = $LINTIAN_ROOT || $ENV{'LINTIAN_ROOT'};
+if (defined $LINTIAN_ROOT) {
+    unless ($LINTIAN_ROOT =~ m,^/,) {
+       $LINTIAN_ROOT = "$cwd/$LINTIAN_ROOT";
+    }
+    # see if it has a frontend directory
+    if (-d "$LINTIAN_ROOT/frontend") {
+        $lintian_info_cmd = "$LINTIAN_ROOT/frontend/lintian-info";
+    }
+} else {
+    $LINTIAN_ROOT = '/usr/share/lintian';
+}
+
+$debug = $#debug + 1;
+$verbose = 1 if $debug;
+$::verbose = $verbose; # that's $main::verbose
+
+# keep-lab implies unpack-level=2 unless explicetly
+# given otherwise
+if ($keep_lab and not defined $unpack_level) {
+    $unpack_level = 2;
+}
+
+# option --all and packages specified at the same time?
+if (($check_everything or $packages_file) and $#ARGV+1 > 0) {
+    print STDERR "warning: options -a or -p can't be mixed with package parameters!\n";
+    print STDERR "(will ignore -a or -p option)\n";
+    undef $check_everything;
+    undef $packages_file;
+}
+
+# check permitted values for --color
+if ($color and $color !~ /^(never|always|auto|html)$/) {
+    die "invalid argument to --color: $color\n";
+}
+
+# check specified action
+$action = 'check' unless $action;
+
+# check for arguments
+if ($action =~ /^(check|unpack|remove)$/ and $#ARGV == -1 and not $check_everything and not $packages_file) {
+    syntax();
+}
+
+# }}}
+
+# {{{ Setup Configuration
+#
+# root permissions?
+# check if effective UID is 0
+if ($> == 0 and not $allow_root) {
+    print STDERR "warning: lintian's authors do not recommend running it with root privileges!\n";
+}
+
+# search for configuration file if it was not set with --cfg
+# do not search the default locations if it was set.
+if ($LINTIAN_CFG) {
+} elsif (exists $ENV{'LINTIAN_CFG'} &&
+        -f ($LINTIAN_CFG = $ENV{'LINTIAN_CFG'})) {
+} elsif (-f ($LINTIAN_CFG = $LINTIAN_ROOT . '/lintianrc')) {
+} elsif (exists $ENV{'HOME'} &&
+        -f ($LINTIAN_CFG = $ENV{'HOME'} . '/.lintianrc')) {
+} elsif (-f ($LINTIAN_CFG = '/etc/lintianrc')) {
+} else {
+    undef $LINTIAN_CFG;
+}
+
+# read configuration file
+if ($LINTIAN_CFG) {
+    open(CFG, '<', $LINTIAN_CFG)
+       or fail("cannot open configuration file $LINTIAN_CFG for reading: $!");
+    while (<CFG>) {
+       chop;
+       s/\#.*$//go;
+       s/\"//go;               # " for emacs :)
+       next if m/^\s*$/o;
+
+       # substitute some special variables
+       s,\$HOME/,$ENV{'HOME'}/,go;
+       s,\~/,$ENV{'HOME'}/,go;
+
+       if (m/^\s*LINTIAN_LAB\s*=\s*(.*\S)\s*$/i) {
+           $LINTIAN_LAB = $1;
+       } elsif (m/^\s*LINTIAN_ARCHIVEDIR\s*=\s*(.*\S)\s*$/i) {
+           $LINTIAN_ARCHIVEDIR = $1;
+       } elsif (m/^\s*LINTIAN_DIST\s*=\s*(.*\S)\s*$/i) {
+           $LINTIAN_DIST = $1;
+       } elsif (m/^\s*LINTIAN_UNPACK_LEVEL\s*=\s*(.*\S)\s*$/i) {
+           $LINTIAN_UNPACK_LEVEL = $1;
+       } elsif (/^\s*LINTIAN_SECTION\s*=\s*(.*\S)\s*$/i) {
+           $LINTIAN_SECTION = $1;
+       } elsif (m/^\s*LINTIAN_ARCH\s*=\s*(.*\S)\s*$/i) {
+           $LINTIAN_ARCH = $1;
+       } else {
+           fail("syntax error in configuration file: $_","(Note, that the syntax of the configuration file has been changed\nwith Lintian v0.3.0. In most cases, you don't need a configuration\nfile anymore -- just remove it.)");
+       }
+    }
+    close(CFG);
+}
+
+# environment variables overwrite settings in conf file:
+$LINTIAN_LAB = $ENV{'LINTIAN_LAB'} if $ENV{'LINTIAN_LAB'};
+$LINTIAN_ARCHIVEDIR = $ENV{'LINTIAN_ARCHIVEDIR'} if $ENV{'LINTIAN_ARCHIVEDIR'};
+$LINTIAN_DIST = $ENV{'LINTIAN_DIST'} if $ENV{'LINTIAN_DIST'};
+$LINTIAN_UNPACK_LEVEL = $ENV{'LINTIAN_UNPACK_LEVEL'} if $ENV{'LINTIAN_UNPACK_LEVEL'};
+$LINTIAN_SECTION = $ENV{'LINTIAN_SECTION'} if $ENV{'LINTIAN_SECTION'};
+$LINTIAN_ARCH = $ENV{'LINTIAN_ARCH'} if $ENV{'LINTIAN_ARCH'};
+
+# command-line options override everything
+$LINTIAN_LAB = $OPT_LINTIAN_LAB if $OPT_LINTIAN_LAB;
+$LINTIAN_ARCHIVEDIR = $OPT_LINTIAN_ARCHIVEDIR if $OPT_LINTIAN_ARCHIVEDIR;
+$LINTIAN_DIST = $OPT_LINTIAN_DIST if $OPT_LINTIAN_DIST;
+$LINTIAN_SECTION = $OPT_LINTIAN_SECTION if $OPT_LINTIAN_SECTION;
+$LINTIAN_ARCH = $OPT_LINTIAN_ARCH if $OPT_LINTIAN_ARCH;
+
+# LINTIAN_ARCH must have a value.
+unless (defined $LINTIAN_ARCH) {
+    if ($LINTIAN_DIST) {
+       chop($LINTIAN_ARCH=`dpkg --print-architecture`);
+    } else {
+       $LINTIAN_ARCH = 'any';
+    }
+}
+
+# export current settings for our helper scripts
+if ($LINTIAN_ROOT) {
+    $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT;
+} else {
+    $ENV{'LINTIAN_ROOT'} = "";
+}
+
+if ($LINTIAN_CFG) {
+    $ENV{'LINTIAN_CFG'} = $LINTIAN_CFG;
+} else {
+    $ENV{'LINTIAN_CFG'} = "";
+}
+
+if ($LINTIAN_LAB) {
+    $ENV{'LINTIAN_LAB'} = $LINTIAN_LAB;
+} else {
+    $ENV{'LINTIAN_LAB'} = "";
+    $LINTIAN_LAB = "";
+}
+
+if ($LINTIAN_ARCHIVEDIR) {
+    $ENV{'LINTIAN_ARCHIVEDIR'} = $LINTIAN_ARCHIVEDIR;
+} else {
+    $ENV{'LINTIAN_ARCHIVEDIR'} = "";
+    $LINTIAN_ARCHIVEDIR = "";
+}
+
+if ($LINTIAN_DIST) {
+    $ENV{'LINTIAN_DIST'} = $LINTIAN_DIST;
+} else {
+    $ENV{'LINTIAN_DIST'} = "";
+    $LINTIAN_DIST = "";
+}
+
+if ($LINTIAN_SECTION) {
+    $ENV{'LINTIAN_SECTION'} = $LINTIAN_SECTION;
+} else {
+    $ENV{'LINTIAN_SECTION'} = "";
+    $LINTIAN_SECTION = "";
+}
+
+if ($LINTIAN_ARCH) {
+    $ENV{'LINTIAN_ARCH'} = $LINTIAN_ARCH;
+} else {
+    $ENV{'LINTIAN_ARCH'} = "";
+}
+
+$ENV{'LINTIAN_DEBUG'} = $debug;
+
+# determine requested unpack level
+if (defined($unpack_level)) {
+    # specified through command line
+} elsif (defined($LINTIAN_UNPACK_LEVEL)) {
+    # specified via configuration file or env variable
+    $unpack_level = $LINTIAN_UNPACK_LEVEL;
+} else {
+    # determine by action
+    if (($action eq 'unpack') or ($action eq 'check')) {
+       $unpack_level = 1;
+    } else {
+       $unpack_level = 0;
+    }
+}
+unless (($unpack_level == 0) or ($unpack_level == 1) or ($unpack_level == 2)) {
+    fail("bad unpack level $unpack_level specified");
+}
+
+$LINTIAN_UNPACK_LEVEL = $unpack_level;
+$ENV{'LINTIAN_UNPACK_LEVEL'} = $LINTIAN_UNPACK_LEVEL;
+
+# }}}
+
+# {{{ Loading lintian's own libraries (now LINTIAN_ROOT is known)
+unshift @INC, "$LINTIAN_ROOT/lib";
+
+require Lab;
+
+require Util;
+require Pipeline;
+require Read_pkglists;
+
+import Util;
+import Pipeline;
+
+require Tags;
+import Tags;
+
+my @l_secs = read_dpkg_control("$LINTIAN_ROOT/checks/lintian.desc");
+shift(@l_secs);
+map Tags::add_tag($_), @l_secs;
+
+# }}}
+
+# {{{ No clue why this code is here...
+
+use vars qw(%source_info %binary_info %udeb_info); # from the above
+
+# Print Debug banner
+if ($debug) {
+    print "N: $BANNER\n";
+    print "N: Lintian root directory: $LINTIAN_ROOT\n";
+    print "N: Configuration file: $LINTIAN_CFG\n";
+    print "N: Laboratory: $LINTIAN_LAB\n";
+    print "N: Archive directory: $LINTIAN_ARCHIVEDIR\n";
+    print "N: Distribution: $LINTIAN_DIST\n";
+    print "N: Default unpack level: $LINTIAN_UNPACK_LEVEL\n";
+    print "N: Architecture: $LINTIAN_ARCH\n";
+    print "N: ----\n";
+}
+
+# Set up clean-up handlers.
+undef $cleanup_filename;
+$SIG{'INT'} = \&interrupted;
+$SIG{'QUIT'} = \&interrupted;
+
+# }}}
+
+# {{{ Create/Maintain Lab and add any specified Debian Archives (*.debs)
+
+$LAB = new Lab( $LINTIAN_LAB, $LINTIAN_DIST );
+
+#######################################
+# Process -S option
+if ($action eq 'setup-lab') {
+    if ($#ARGV+1 > 0) {
+       print STDERR "warning: ignoring additional command line arguments\n";
+    }
+
+    $LAB->setup_static()
+       or fail("There was an error while setting up the static lab.");
+
+    exit 0;
+
+#######################################
+# Process -R option
+} elsif ($action eq 'remove-lab') {
+    if ($#ARGV+1 > 0) {
+       print STDERR "warning: ignoring additional command line arguments\n";
+    }
+
+    $LAB->delete_static()
+       or fail("There was an error while removing the static lab.");
+
+    exit 0;
+
+#######################################
+#  Check for non deb specific actions
+} elsif (not (($action eq 'unpack') or ($action eq 'check')
+             or ($action eq 'remove'))) {
+    fail("bad action $action specified");
+}
+
+# sanity check:
+fail("lintian lab has not been set up correctly (perhaps you forgot to run lintian --setup-lab?)")
+    unless $LAB->is_lab();
+
+#XXX: There has to be a cleaner way to do this
+$LINTIAN_LAB = $LAB->{dir};
+
+# }}}
+
+# {{{ Setup the lintian-info pipe
+
+# pipe output through lintian-info?
+# note: if any E:/W: lines are added above this point, this block needs to
+#       be moved up
+if ($lintian_info) {
+    open(OUTPUT_PIPE, '|-', $lintian_info_cmd) or fail("cannot open output pipe to $lintian_info_cmd: $!");
+    select OUTPUT_PIPE;
+}
+# }}}
+
+# {{{ Compile list of files to process
+
+# process package/file arguments
+while (my $arg = shift) {
+    # file?
+    if (-f $arg) {
+       # $arg contains absolute dir spec?
+       unless ($arg =~ m,^/,) {
+           $arg = "$cwd/$arg";
+       }
+
+       # .deb file?
+       if ($arg =~ /\.deb$/) {
+           my $info = get_deb_info($arg);
+           if (not defined $info) {
+               print STDERR "$arg is a zero-byte file, skipping\n";
+               next;
+           }
+           schedule_package('b', $info->{'package'}, $info->{'version'}, $arg);
+       }
+       # .udeb file?
+       elsif ($arg =~ /\.udeb$/) {
+           my $info = get_deb_info($arg);
+           if (not defined $info) {
+               print STDERR "$arg is a zero-byte file, skipping\n";
+               next;
+           }
+           schedule_package('u', $info->{'package'}, $info->{'version'}, $arg);
+       }
+       # .dsc file?
+       elsif ($arg =~ /\.dsc$/) {
+           my $info = get_dsc_info($arg);
+           if (not defined $info) {
+               print STDERR "$arg is a zero-byte file, skipping\n";
+               next;
+           }
+           schedule_package('s', $info->{'source'}, $info->{'version'}, $arg);
+       }
+       # .changes file?
+       elsif ($arg =~ /\.changes$/) {
+           # get directory and filename part of $arg
+           my ($arg_dir, $arg_name) = $arg =~ m,(.*)/([^/]+)$,;
+
+           print "N: Processing changes file $arg_name ...\n" if $verbose;
+
+           my ($data) = read_dpkg_control($arg);
+           if (not defined $data) {
+               warn "$arg is a zero-byte file, skipping\n";
+               next;
+           }
+
+           Tags::set_pkg( $arg, $arg_name, "", "", 'binary' );
+
+           # Description is mandated by dak, but only makes sense if binary
+           # packages are included.  Don't tag pure source uploads.
+           if (!$data->{'description'} && $data->{'architecture'} ne 'source') {
+               tag("no-description-in-changes-file");
+           }
+
+           # check distribution field
+           if (defined $data->{distribution}) {
+               if ($data->{distribution} eq 'UNRELEASED') {
+                   # ignore
+               } elsif ($data->{'version'} =~ /ubuntu|intrepid|hardy|gutsy|feisty|edgy|dapper/) {
+                   my @ubuntu_dists = qw(intrepid hardy gutsy feisty edgy dapper);
+                   my $regex = '^(' . join ('|', @ubuntu_dists) . ')';
+                   if ($data->{distribution} !~ /^$regex(-(proposed|updates|backports|security))?$/ ) {
+                       tag("bad-ubuntu-distribution-in-changes-file",
+                           $data->{distribution});
+                   }
+               } elsif (! (($data->{distribution} eq 'stable')
+                        or ($data->{distribution} eq 'testing')
+                        or ($data->{distribution} eq 'unstable')
+                        or ($data->{distribution} eq 'experimental')
+                        or ($data->{distribution} =~ /\w+-backports/)
+                        or ($data->{distribution} =~ /\w+-proposed-updates/)
+                        or ($data->{distribution} =~ /\w+-security/))
+                       ) {
+                   # bad distribution entry
+                   tag("bad-distribution-in-changes-file",
+                       $data->{distribution});
+               }
+           }
+
+           # Urgency is only recommended by Policy.
+           if (!$data->{'urgency'}) {
+               tag("no-urgency-in-changes-file");
+           } else {
+               my $urgency = lc $data->{'urgency'};
+               $urgency =~ s/ .*//;
+               unless ($urgency =~ /^(low|medium|high|critical|emergency)$/i) {
+                   tag("bad-urgency-in-changes-file", $data->{'urgency'});
+               }
+           }
+
+           # process all listed `files:'
+           my %files;
+
+           my $file_list = $data->{files} || '';
+           for ( split /\n/, $file_list ) {
+               chomp;
+               s/^\s+//o;
+               next if $_ eq '';
+
+               my ($md5sum,$size,$section,$priority,$file) = split(/\s+/o, $_);
+               $files{$file}{md5} = $md5sum;
+               $files{$file}{size} = $size;
+
+               # check section
+               if (($section eq 'non-free') or ($section eq 'contrib')) {
+                   tag( "bad-section-in-changes-file", $file, $section );
+               }
+
+           }
+
+           foreach my $alg (qw(sha1 sha256)) {
+               my $list = $data->{"checksums-$alg"} || '';
+               for ( split /\n/, $list ) {
+                   chomp;
+                   s/^\s+//o;
+                   next if $_ eq '';
+
+                   my ($checksum,$size,$file) = split(/\s+/o, $_);
+                   $files{$file}{$alg} = $checksum;
+                   if ($files{$file}{size} != $size) {
+                       tag( "file-size-mismatch-in-changes-file", $file );
+                   }
+               }
+           }
+
+
+           foreach my $file (keys %files) {
+               my $filename = $arg_dir . '/' . $file;
+
+               # check size
+               if (not -f $filename) {
+                   warn "E: $file does not exist, exiting\n";
+                   exit(-1);
+               }
+               if (-s _ ne $files{$file}{size}) {
+                   print "N: size is $files{$file}{size}, argname is $arg_name, filename is $filename\n";
+
+                   tag( "file-size-mismatch-in-changes-file", $file );
+               }
+
+               # check checksums
+               if ($check_checksums or $file =~ /\.dsc$/) {
+                   foreach my $alg (qw(md5 sha1 sha256)) {
+                       next unless exists $files{$file}{$alg};
+
+                       my $real_checksum = get_file_checksum($alg, $filename);
+
+                       if ($real_checksum ne $files{$file}{$alg}) {
+                           tag( "checksum-mismatch-in-changes-file", $alg, $file );
+                       }
+                   }
+               }
+
+               # process file?
+               if ($file =~ /\.dsc$/) {
+                   my $info = get_dsc_info($filename);
+                   schedule_package('s', $info->{'source'},
+                                    $info->{'version'}, $filename);
+               } elsif ($file =~ /\.deb$/) {
+                   my $info = get_deb_info($filename);
+                   schedule_package('b', $info->{'package'},
+                                    $info->{'version'}, $filename);
+               } elsif ($file =~ /\.udeb$/) {
+                   my $info = get_deb_info($filename);
+                   schedule_package('u', $info->{'package'},
+                                    $info->{'version'}, $filename);
+               }
+           }
+
+           unless ($exit_code) {
+               my $stats = Tags::get_stats( $arg );
+               if ($stats->{severity}{4}) {
+                   $exit_code = 1;
+               } elsif ($fail_on_warnings && $stats->{severity}{2}) {
+                   $exit_code = 1;
+               }
+           }
+
+       } else {
+           fail("bad package file name $arg (neither .deb, .udeb or .dsc file)");
+       }
+    } else {
+       # parameter is a package name--so look it up
+       # search the distribution first, then the lab
+       # special case: search only in lab if action is `remove'
+
+       my $search;
+       if ($action eq 'remove') {
+           # search only in lab--see below
+           $search = 'lab';
+       } else {
+           # search in dist, then in lab
+           $search = 'dist or lab';
+
+           my $found = 0;
+
+           # read package info
+           read_src_list("$LINTIAN_LAB/info/source-packages", 0);
+           read_bin_list("$LINTIAN_LAB/info/binary-packages", 0);
+           read_udeb_list("$LINTIAN_LAB/info/udeb-packages", 0);
+
+           if (($pkg_mode eq 'b') or ($pkg_mode eq 'a')) {
+               if ($binary_info{$arg}) {
+                   schedule_package('b', $binary_info{$arg}->{'package'},
+                                    $binary_info{$arg}->{'version'},
+                                    "$LINTIAN_ARCHIVEDIR/$binary_info{$arg}->{'file'}");
+                   $found = 1;
+               }
+           }
+           if (($pkg_mode eq 'u') or ($pkg_mode eq 'a')) {
+               if ($udeb_info{$arg}) {
+                   schedule_package('u', $udeb_info{$arg}->{'package'},
+                                    $udeb_info{$arg}->{'version'},
+                                    "$LINTIAN_ARCHIVEDIR/$udeb_info{$arg}->{'file'}");
+                   $found = 1;
+               }
+           }
+           if (($pkg_mode eq 's') or ($pkg_mode eq 'a')) {
+               if ($source_info{$arg}) {
+                   schedule_package('s', $source_info{$arg}->{'source'},
+                                    $source_info{$arg}->{'version'},
+                                    "$LINTIAN_ARCHIVEDIR/$source_info{$arg}->{'file'}");
+                   $found = 1;
+               }
+           }
+
+           next if $found;
+       }
+
+       # nothing found so far, so search the lab
+
+       my $b = "$LINTIAN_LAB/binary/$arg";
+       my $s = "$LINTIAN_LAB/source/$arg";
+       my $u = "$LINTIAN_LAB/udeb/$arg";
+
+       if ($pkg_mode eq 'b') {
+           unless (-d $b) {
+               warn "error: cannot find binary package $arg in $search (skipping)\n";
+               $exit_code = 2;
+               next;
+           }
+       } elsif ($pkg_mode eq 's') {
+           unless (-d $s) {
+               warn "error: cannot find source package $arg in $search (skipping)\n";
+               $exit_code = 2;
+               next;
+           }
+       } elsif ($pkg_mode eq 'u') {
+           unless (-d $u) {
+               warn "error: cannot find udeb package $arg in $search (skipping)\n";
+               $exit_code = 2;
+               next;
+           }
+       } else {
+           # $pkg_mode eq 'a'
+           unless (-d $b or -d $s or -d $u) {
+               warn "error: cannot find binary, udeb or source package $arg in $search (skipping)\n";
+               $exit_code = 2;
+               next;
+           }
+       }
+
+       if (($pkg_mode eq 'b') or (($pkg_mode eq 'a') and (-d $b))) {
+           schedule_package('b', get_bin_info_from_lab($b));
+       }
+       if (($pkg_mode eq 's') or (($pkg_mode eq 'a') and (-d $s))) {
+           schedule_package('s', get_src_info_from_lab($s));
+       }
+       if (($pkg_mode eq 'u') or (($pkg_mode eq 'a') and (-d $u))) {
+           schedule_package('u', get_bin_info_from_lab($u));
+       }
+    }
+}
+
+if (not $check_everything and not $packages_file and ($#packages == -1)) {
+    print "N: No packages selected.\n" if $verbose;
+    exit $exit_code;
+}
+# }}}
+
+# {{{ A lone subroutine
+#----------------------------------------------------------------------------
+#  Check to make sure there are packages to check.
+sub set_value {
+    my ($f,$target,$field,$source,$required) = @_;
+    if ($required and not $source->{$field}) {
+       fail("description file $f does not define required tag $field");
+    }
+    $target->{$field} = $source->{$field};
+    delete $source->{$field};
+}
+# }}}
+
+# {{{ Load information about collector scripts
+opendir(COLLDIR, "$LINTIAN_ROOT/collection")
+    or fail("cannot read directory $LINTIAN_ROOT/collection");
+
+for my $f (readdir COLLDIR) {
+    next if $f =~ /^\./;
+    next unless $f =~ /\.desc$/;
+
+    print "N: Reading collector description file $f ...\n" if $debug >= 2;
+    my @secs = read_dpkg_control("$LINTIAN_ROOT/collection/$f");
+    my $script;
+    ($#secs+1 == 1)
+       or fail("syntax error in description file $f: too many sections");
+
+    ($script = $secs[0]->{'collector-script'})
+       or fail("error in description file $f: `Collector-Script:' not defined");
+
+    delete $secs[0]->{'collector-script'};
+    $collection_info{$script}->{'script'} = $script;
+    my $p = $collection_info{$script};
+
+    set_value($f, $p,'type',$secs[0],1);
+    # convert Type:
+    my ($b,$s,$u) = ( "", "", "" );;
+    for (split(/\s*,\s*/o,$p->{'type'})) {
+       if ($_ eq 'binary') {
+           $b = 'b';
+       } elsif ($_ eq 'source') {
+           $s = 's';
+       } elsif ($_ eq 'udeb') {
+           $u = 'u';
+       } else {
+           fail("unknown type $_ specified in description file $f");
+       }
+    }
+    $p->{'type'} = "$s$b$u";
+
+    set_value($f,$p,'unpack-level',$secs[0],1);
+    set_value($f,$p,'output',$secs[0],1);
+    set_value($f,$p,'order',$secs[0],1);
+
+    if (exists $secs[0]->{'needs-info'} && defined $secs[0]->{'needs-info'}) {
+       for (split(/\s*,\s*/o,$secs[0]->{'needs-info'})) {
+           $p->{$_} = 1;
+       }
+       delete $secs[0]->{'needs-info'};
+    }
+
+    # ignore Info: and other fields for now
+    delete $secs[0]->{'info'};
+    delete $secs[0]->{'author'};
+
+    for (keys %{$secs[0]}) {
+       print STDERR "warning: unused tag $_ in description file $f\n";
+    }
+
+    if ($debug >= 2) {
+       for (sort keys %$p) {
+           print "N:  $_: $p->{$_}\n";
+       }
+    }
+}
+
+closedir(COLLDIR);
+# }}}
+
+# {{{ Now we're ready to load info about checks & tags
+
+no warnings 'once';
+if (defined $experimental_output_opts) {
+    $Tags::output_formatter = \&Tags::print_tag_new;
+    my %opts = map { split(/=/) } split( /,/, $experimental_output_opts );
+    foreach (keys %opts) {
+       if ($_ eq 'format') {
+           if ($opts{$_} eq 'colons') {
+               require Tags::ColonSeparated;
+               $Tags::output_formatter = \&Tags::ColonSeparated::print_tag;
+           }
+       }
+       no strict 'refs';
+       ${"Tags::$_"} = $opts{$_};
+    }
+}
+
+$Tags::show_info = $display_infotags;
+$Tags::show_experimental = $display_experimentaltags;
+$Tags::show_overrides = $show_overrides;
+$Tags::color = $color;
+use warnings;
+
+# load information about checker scripts
+opendir(CHECKDIR, "$LINTIAN_ROOT/checks")
+    or fail("cannot read directory $LINTIAN_ROOT/checks");
+
+for my $f (readdir CHECKDIR) {
+    next if $f =~ /^\./;
+    next unless $f =~ /\.desc$/;
+    print "N: Reading checker description file $f ...\n" if $debug >= 2;
+
+    my @secs = read_dpkg_control("$LINTIAN_ROOT/checks/$f");
+    my $script;
+    ($script = $secs[0]->{'check-script'})
+       or fail("error in description file $f: `Check-Script:' not defined");
+
+    # ignore check `lintian' (this check is a special case and contains the
+    # tag info for the lintian frontend--this script here)
+    if ($secs[0]->{'check-script'} ne 'lintian') {
+
+       delete $secs[0]->{'check-script'};
+       $check_info{$script}->{'script'} = $script;
+       my $p = $check_info{$script};
+
+       set_value($f,$p,'type',$secs[0],1);
+       # convert Type:
+       my ($b,$s,$u) = ( "", "", "" );
+       for (split(/\s*,\s*/o,$p->{'type'})) {
+           if ($_ eq 'binary') {
+               $b = 'b';
+           } elsif ($_ eq 'source') {
+               $s = 's';
+           } elsif ($_ eq 'udeb') {
+               $u = 'u';
+           } else {
+               fail("unknown type $_ specified in description file $f");
+           }
+       }
+       $p->{'type'} = "$s$b$u";
+
+       set_value($f,$p,'unpack-level',$secs[0],1);
+       set_value($f,$p,'abbrev',$secs[0],1);
+
+       if (exists $secs[0]->{'needs-info'} && defined $secs[0]->{'needs-info'}) {
+           for (split(/\s*,\s*/o,$secs[0]->{'needs-info'})) {
+               $p->{$_} = 1;
+           }
+           delete $secs[0]->{'needs-info'};
+       }
+
+       # ignore Info: and other fields for now...
+       delete $secs[0]->{'info'};
+       delete $secs[0]->{'standards-version'};
+       delete $secs[0]->{'author'};
+
+       for (keys %{$secs[0]}) {
+           print STDERR "warning: unused tag $_ in description file $f\n";
+       }
+
+       if ($debug >= 2) {
+           for (sort keys %$p) {
+               print "N:  $_: $p->{$_}\n";
+           }
+       }
+
+       shift(@secs);
+       map Tags::add_tag($_), @secs;
+    } # end: if ne lintian
+
+}
+
+closedir(CHECKDIR);
+
+# }}}
+
+# {{{ Again some lone code the author just dumped where his cursor just happened to be
+if ($unpack_info) {
+    # determine which info has been requested
+    for my $i (split(/,/,$unpack_info)) {
+       unless ($collection_info{$i}) {
+           fail("unknown info specified: $i");
+       }
+       $unpack_infos{$i} = 1;
+    }
+}
+
+# create check_abbrev hash
+for my $c (keys %check_info) {
+    $check_abbrev{$check_info{$c}->{'abbrev'}} = $c;
+}
+
+# }}}
+
+# {{{ determine which checks have been requested
+if ($action eq 'check') {
+    my %dont_check = map { $_ => 1 } (split m/,/, ($dont_check || ""));
+    $checks or ($checks = join(',',keys %check_info));
+    for my $c (split(/,/,$checks)) {
+       if ($check_info{$c}) {
+           if ($dont_check{$c} || ($check_info{$c}->{'abbrev'} && $dont_check{$check_info{$c}->{'abbrev'}})) {
+               #user requested not to run this check
+           } else {
+               $checks{$c} = 1;
+           }
+       } elsif (exists $check_abbrev{$c}) {
+           #abbrevs only used when -C is given, so we don't need %dont_check
+           $checks{$check_abbrev{$c}} = 1;
+       } else {
+           fail("unknown check specified: $c");
+       }
+    }
+
+    # determine which info is needed by the checks
+    for my $c (keys %checks) {
+       for my $i (keys %collection_info) {
+           # required by $c ?
+           if ($check_info{$c}->{$i}) {
+               $unpack_infos{$i} = 1;
+           }
+       }
+    }
+}
+
+# }}}
+
+# {{{ determine which info is needed by the collection scripts
+for my $c (keys %unpack_infos) {
+    for my $i (keys %collection_info) {
+       # required by $c ?
+       if ($collection_info{$c}->{$i}) {
+           $unpack_infos{$i} = 1;
+       }
+    }
+}
+# }}}
+
+# {{{ process all packages in the archive?
+if ($check_everything) {
+    # make sure package info is available
+    read_src_list("$LINTIAN_LAB/info/source-packages", 0);
+    read_bin_list("$LINTIAN_LAB/info/binary-packages", 0);
+    read_udeb_list("$LINTIAN_LAB/info/udeb-packages", 0);
+
+    if ($debug >= 2) {
+      print STDERR "pkg_mode = $pkg_mode\n";
+      for my $arg (keys %source_info) {
+        print STDERR $arg."\n";
+      }
+    }
+
+    if (($pkg_mode eq 'a') or ($pkg_mode eq 's')) {
+       for my $arg (keys %source_info) {
+           print STDERR "doing stuff with $LINTIAN_ARCHIVEDIR/$source_info{$arg}->{'file'}\n" if $debug;
+           push(@packages,"s $source_info{$arg}->{'source'} $source_info{$arg}->{'version'} $LINTIAN_ARCHIVEDIR/$source_info{$arg}->{'file'}");
+       }
+    }
+    if (($pkg_mode eq 'a') or ($pkg_mode eq 'b')) {
+       for my $arg (keys %binary_info) {
+           print STDERR "doing stuff with $LINTIAN_ARCHIVEDIR/$binary_info{$arg}->{'file'}\n" if $debug;
+           push(@packages,"b $binary_info{$arg}->{'package'} $binary_info{$arg}->{'version'} $LINTIAN_ARCHIVEDIR/$binary_info{$arg}->{'file'}");
+       }
+    }
+    if (($pkg_mode eq 'a') or ($pkg_mode eq 'u')) {
+       for my $arg (keys %udeb_info) {
+           print STDERR "doing stuff with $LINTIAN_ARCHIVEDIR/$udeb_info{$arg}->{'file'}\n" if $debug;
+           push(@packages,"u $udeb_info{$arg}->{'package'} $udeb_info{$arg}->{'version'} $LINTIAN_ARCHIVEDIR/$udeb_info{$arg}->{'file'}");
+       }
+    }
+
+    # package list still empty?
+    if ($#packages == -1) {
+       print STDERR "warning: no packages found in distribution directory\n";
+    }
+} elsif ($packages_file) {     # process all packages listed in packages file?
+    open(IN, '<', $packages_file)
+       or fail("cannot open packages file $packages_file for reading: $!");
+    while (<IN>) {
+       chop;
+       push(@packages,$_);
+    }
+    close(IN);
+}
+# }}}
+
+# {{{ Some silent exit
+if ($#packages == -1) {
+    print "N: No packages selected.\n" if $verbose;
+    exit 0;
+}
+# }}}
+
+# {{{ Okay, now really processing the packages in one huge loop
+$unpack_infos{ "override-file" } = 1 unless $no_override;
+printf "N: Processing %d packages...\n",$#packages+1 if $verbose;
+if ($debug) {
+    print "N: Selected action: $action\n";
+    print "N: Requested unpack level: $unpack_level\n";
+    printf "N: Requested data to collect: %s\n",join(',',keys %unpack_infos);
+    printf "N: Selected checks: %s\n",join(',',keys %checks);
+}
+
+require Checker;
+require Lintian::Collect;
+
+# for each package (the `reverse sort' is to make sure that source packages are
+# before the corresponding binary packages--this has the advantage that binary
+# can use information from the source packages if these are unpacked)
+my %overrides;
+PACKAGE:
+for (reverse sort @packages) {
+    m/^([bsu]) (\S+) (\S+) (.+)$/ or fail("internal error: syntax error in \@packages array: $_");
+    my ($type,$pkg,$ver,$file) = ($1,$2,$3,$4);
+    my $long_type = ($type eq 'b' ? 'binary' : ($type eq 's' ? 'source' : 'udeb' ));
+
+    print "N: ----\n" if $verbose;
+    if ($verbose) {
+       print "N: Processing $long_type package $pkg (version $ver) ...\n";
+    }
+
+    # determine base directory
+    my $base = "$LINTIAN_LAB/$long_type/$pkg";
+    unless ($base =~ m,^/,) {
+       $base = "$cwd/$base";
+    }
+    print "N: Base directory in lab: $base\n" if $debug;
+
+    my $act_unpack_level = 0;
+
+    # unpacked package up-to-date?
+    if (-d $base) {
+       my $remove_basedir = 0;
+
+        # there's a base dir, so we assume that at least
+        # one level of unpacking has been done
+       $act_unpack_level = 1;
+
+       # lintian status file exists?
+       unless (-f "$base/.lintian-status") {
+           print "N: No lintian status file found (removing old directory in lab)\n" if $verbose;
+           $remove_basedir = 1;
+           goto REMOVE_BASEDIR;
+       }
+
+       # read unpack status -- catch any possible errors
+       my $data;
+       eval { ($data) = read_dpkg_control("$base/.lintian-status"); };
+       if ($@) {               # error!
+           print "N: $@\n" if $verbose;
+           $remove_basedir = 1;
+           goto REMOVE_BASEDIR;
+       }
+
+       # compatible lintian version?
+       if (not exists $data->{'lab-format'} or ($data->{'lab-format'} < $LAB_FORMAT)) {
+           print "N: Lab directory was created by incompatible lintian version\n" if $verbose;
+           $remove_basedir = 1;
+           goto REMOVE_BASEDIR;
+       }
+
+       # version up to date?
+       if (not exists $data->{'version'} or ($data->{'version'} ne $ver)) {
+           print "N: Removing package in lab (newer version exists) ...\n" if $debug;
+           $remove_basedir = 1;
+           goto REMOVE_BASEDIR;
+       }
+
+       # unpack level defined?
+       unless (exists $data->{'unpack-level'}) {
+           print "N: warning: cannot determine unpack-level of package\n" if $verbose;
+           $remove_basedir = 1;
+           goto REMOVE_BASEDIR;
+        } else {
+            $act_unpack_level = $data->{'unpack-level'};
+       }
+
+       # file modified?
+       my $timestamp;
+       my @stat;
+       unless (@stat = stat $file) {
+           print "N: Cannot stat file $file: $!\n";
+       } else {
+           $timestamp = $stat[9];
+       }
+       if ((not defined $timestamp) or (not exists $data->{'timestamp'}) or ($data->{'timestamp'} != $timestamp)) {
+           print "N: Removing package in lab (package has been changed) ...\n" if $debug;
+           $remove_basedir = 1;
+           goto REMOVE_BASEDIR;
+       }
+
+    REMOVE_BASEDIR:
+       if ($remove_basedir) {
+            print "N: Removing $pkg\n" if $verbose;
+           unless (remove_pkg($base)) {
+               print "N: Skipping $action of $long_type package $pkg\n";
+               $exit_code = 2;
+               next PACKAGE;
+           }
+           $act_unpack_level = 0;
+       }
+    }
+
+    # unpack to requested unpack level
+    $act_unpack_level = unpack_pkg($type,$base,$file,$act_unpack_level,
+                                  $unpack_level);
+    if ($act_unpack_level == -1) {
+       print STDERR "internal error: could not unpack package to desired level: $!\n";
+       print "N: Skipping $action of $long_type package $pkg\n";
+       $exit_code = 2;
+       next PACKAGE;
+    }
+
+    if (($action eq 'unpack') or ($action eq 'check')) { # collect info
+       for my $coll (sort by_collection_order keys %unpack_infos) {
+           my $ci = $collection_info{$coll};
+
+           # current type?
+           next unless ($ci->{'type'} =~ m/$type/);
+
+           # info already available?
+           next if (-e "$base/$ci->{'output'}");
+
+           # unpack to desired unpack level (if necessary)
+           $act_unpack_level = unpack_pkg($type,$base,$file,$act_unpack_level,$ci->{'unpack-level'});
+           if ($act_unpack_level == -1) {
+               print STDERR "internal error: could not unpack package to desired level: $!\n";
+               print "N: Skipping $action of $long_type package $pkg\n";
+               $exit_code = 2;
+               next PACKAGE;
+           }
+
+           # chdir to base directory
+           unless (chdir($base)) {
+               print STDERR "internal error: could not chdir into directory $base: $!\n";
+               print "N: Skipping $action of $long_type package $pkg\n";
+               $exit_code = 2;
+               next PACKAGE;
+           }
+
+           # collect info
+           remove_status_file($base);
+           print "N: Collecting info: $coll ...\n" if $debug;
+           if (spawn("$LINTIAN_ROOT/collection/$ci->{'script'}", $pkg, $long_type) != 0) {
+               print STDERR "internal error: collect info $coll about package $pkg: $?\n";
+               print "N: Skipping $action of $long_type package $pkg\n";
+               $exit_code = 2;
+               next PACKAGE;
+           }
+       }
+    }
+
+    if ($action eq 'check') {  # read override file
+       Tags::set_pkg( $file, $pkg, "", "", $long_type );
+
+       unless ($no_override) {
+            if (open(O, '<', "$base/override")) {
+                while (<O>) {
+                    chomp;
+                    next if m,^\s*(\#|\z),o;
+                    s/^\s+//o;
+                    s/\s+$//o;
+                    s/\s+/ /go;
+                    my $override = $_;
+                    $override =~ s/^\Q$pkg\E( \Q$long_type\E)?: //;
+                    if ($override eq '' or $override !~ /^[\w0-9.+-]+(\s+.*)?$/) {
+                        tag ('malformed-override', $_);
+                    } else {
+                        Tags::add_override($override);
+                    }
+                }
+                close(O);
+            }
+        }
+
+       # perform checks
+       my $info = Lintian::Collect->new($pkg, $long_type);
+       for my $check (keys %checks) {
+           my $ci = $check_info{$check};
+
+           # current type?
+           next unless ($ci->{'type'} =~ m/$type/);
+
+           # unpack to desired unpack level (if necessary)
+           $act_unpack_level = unpack_pkg($type,$base,$file,$act_unpack_level,$ci->{'unpack-level'});
+           if ($act_unpack_level == -1) {
+               print STDERR "internal error: could not unpack package to desired level: $!\n";
+               print "N: Skipping $action of $long_type package $pkg\n";
+               $exit_code = 2;
+               next PACKAGE;
+           }
+
+           # chdir to base directory
+           unless (chdir($base)) {
+               print STDERR "internal error: could not chdir into directory $base: $!\n";
+               print "N: Skipping $action of $long_type package $pkg\n";
+               $exit_code = 2;
+               next PACKAGE;
+           }
+
+           my $returnvalue = Checker::runcheck($pkg, $long_type, $info, $check);
+           # Set exit_code correctly if there was not yet an exit code
+           $exit_code = $returnvalue unless $exit_code;
+
+           if ($returnvalue == 2) {
+               print "N: Skipping $action of $long_type package $pkg\n";
+               next PACKAGE;
+           }
+
+       }
+       unless ($exit_code) {
+           my $stats = Tags::get_stats( $file );
+           if ($stats->{severity}{4}) {
+               $exit_code = 1;
+           } elsif ($fail_on_warnings && $stats->{severity}{2}) {
+               $exit_code = 1;
+           }
+       }
+
+       # report unused overrides
+       if (not $no_override) {
+           my $overrides = Tags::get_overrides( $file );
+
+           for my $o (sort keys %$overrides) {
+               next if $overrides->{$o};
+
+               tag( "unused-override", $o );
+           }
+       }
+
+       # Report override statistics.
+       if (not $no_override and not $show_overrides) {
+           my $stats = Tags::get_stats($file);
+           my $short = $file;
+           $short =~ s%.*/%%;
+           my $errors = $stats->{overrides}{by_severity}{4} || 0;
+           my $warnings = $stats->{overrides}{by_severity}{2} || 0;
+           my $info = $stats->{overrides}{by_severity}{0} || 0;
+           $overrides{errors} += $errors;
+           $overrides{warnings} += $warnings;
+           $overrides{info} += $info;
+        }
+    }
+
+    # chdir to lintian root directory (to unlock $base so it can be removed below)
+    unless (chdir($LINTIAN_ROOT)) {
+       print STDERR "internal error: could not chdir into directory $LINTIAN_ROOT: $!\n";
+       print "N: Skipping $action of $long_type package $pkg\n";
+       $exit_code = 2;
+       next PACKAGE;
+    }
+
+    # clean up
+    if ($act_unpack_level > $unpack_level) {
+       $act_unpack_level = clean_pkg($type,$base,$file,$act_unpack_level,$unpack_level);
+       if ($act_unpack_level == -1) {
+           print STDERR "error: could not clean up laboratory for package $pkg: $!\n";
+           print "N: Skipping clean up\n";
+           $exit_code = 2;
+           next PACKAGE;
+       }
+    }
+
+    # create Lintian status file
+    if (($act_unpack_level > 0) and (not -f "$base/.lintian-status")) {
+       my @stat;
+       unless (@stat = stat $file) {
+           print STDERR "internal error: cannot stat file $file: $!\n";
+           print "N: Skipping creation of status file\n";
+           $exit_code = 2;
+           next PACKAGE;
+       }
+       my $timestamp = $stat[9];
+
+       unless (open(STATUS, '>', "$base/.lintian-status")) {
+           print STDERR "internal error: could not create status file $base/.lintian-status for package $pkg: $!\n";
+           $exit_code = 2;
+           next PACKAGE;
+       }
+
+       print STATUS "Lintian-Version: $LINTIAN_VERSION\n";
+       print STATUS "Lab-Format: $LAB_FORMAT\n";
+       print STATUS "Package: $pkg\n";
+       print STATUS "Version: $ver\n";
+       print STATUS "Type: $type\n";
+       print STATUS "Unpack-Level: $act_unpack_level\n";
+       print STATUS "Timestamp: $timestamp\n";
+       close(STATUS);
+    }
+}
+if ($action eq 'check' and not $quiet and not $no_override and not $show_overrides) {
+    my $errors = $overrides{errors} || 0;
+    my $warnings = $overrides{warnings} || 0;
+    my $info = $overrides{info} || 0;
+    my $total = $errors + $warnings + $info;
+    if ($total > 0) {
+       my $total = ($total == 1)
+           ? "$total tag overridden"
+           : "$total tags overridden";
+       my @output;
+       if ($errors) {
+           push (@output, ($errors == 1) ? "$errors error" : "$errors errors");
+       }
+       if ($warnings) {
+           push (@output, ($warnings == 1) ? "$warnings warning" : "$warnings warnings");
+       }
+       if ($info) {
+           push (@output, "$info info");
+       }
+       print "N: $total (", join (', ', @output), ")\n";
+    }
+}
+
+# }}}
+
+# {{{ close up lintian-info pipe if needed
+# did I pipe output through lintian-info?
+if ($lintian_info) {
+    close(OUTPUT_PIPE) or fail("cannot close output pipe to $lintian_info_cmd: $!");
+    select STDOUT;
+}
+# }}}
+
+exit $exit_code;
+
+# {{{ Some subroutines
+
+sub unpack_pkg {
+    my ($type,$base,$file,$cur_level,$new_level) = @_;
+
+    printf("N: Current unpack level is %d\n",$cur_level) if $debug;
+
+    return $cur_level if $cur_level == $new_level;
+
+    # remove .lintian-status file
+    remove_status_file($base);
+
+    if ( ($cur_level == 0) and (-d $base) ) {
+       # We were lied to, there's something already there - clean it up first
+       remove_pkg($base) or return -1;
+    }
+
+    if ( ($new_level >= 1) and
+        (not defined ($cur_level) or ($cur_level < 1)) ) {
+       # create new directory
+       print "N: Unpacking package to level 1 ...\n" if $debug;
+       if (($type eq 'b') || ($type eq 'u')) {
+           spawn("$LINTIAN_ROOT/unpack/unpack-binpkg-l1", $base, $file) == 0
+               or return -1;
+       } else {
+           spawn("$LINTIAN_ROOT/unpack/unpack-srcpkg-l1", $base, $file) == 0
+               or return -1;
+       }
+       $cur_level = 1;
+    }
+
+    if ( ($new_level >= 2) and
+        (not defined ($cur_level) or ($cur_level < 2)) ) {
+       # unpack package contents
+       print "N: Unpacking package to level 2 ...\n" if $debug;
+       if (($type eq 'b') || ($type eq 'u')) {
+           spawn("$LINTIAN_ROOT/unpack/unpack-binpkg-l2", $base) == 0
+               or return -1;
+       } else {
+           print "N: $LINTIAN_ROOT/unpack/unpack-srcpkg-l2 $base\n" if $debug;
+           spawn("$LINTIAN_ROOT/unpack/unpack-srcpkg-l2", $base) == 0
+               or return -1;
+       }
+       $cur_level = 2;
+    }
+
+    return $cur_level;
+}
+
+# TODO: is this the best way to clean dirs in perl?
+# no, look at File::Path module
+sub clean_pkg {
+    my ($type,$base,$file,$cur_level,$new_level) = @_;
+
+    return $cur_level if $cur_level == $new_level;
+
+    if ($new_level < 1) {
+       # remove base directory
+       remove_pkg($base) or return -1;
+       return 0;
+    }
+
+    if ( ($new_level < 2) and defined ($cur_level) and ($cur_level >= 2) ) {
+       # remove .lintian-status file
+       remove_status_file($base);
+
+       # remove unpacked/ directory
+       print "N: Decreasing unpack level to 1 (removing files) ...\n" if $debug;
+       if ( -l "$base/unpacked" ) {
+           spawn('rm', '-rf', '--', "$base/".readlink( "$base/unpacked" )) == 0
+               or return -1;
+           spawn('rm', '-rf', '--', "$base/unpacked") == 0 or return -1;
+       } else {
+           spawn('rm', '-rf', '--', "$base/unpacked") == 0 or return -1;
+       }
+
+       $cur_level = 1;
+    }
+
+    return $cur_level;
+}
+
+# this function removes a package's base directory in the lab completely
+sub remove_pkg {
+    my ($base) = @_;
+
+    print "N: Removing package in lab ...\n" if $debug;
+    if (spawn('rm', '-rf', '--', $base) != 0) {
+       print STDERR "error: cannot remove directory $base: $!\n";
+       return 0;
+    }
+
+    return 1;
+}
+
+sub remove_status_file {
+    my ($base) = @_;
+
+    # status file exists?
+    if (not -e "$base/.lintian-status") {
+       return 1;
+    }
+
+    if (not unlink("$base/.lintian-status")) {
+       print STDERR "internal error: cannot remove status file $base/.lintian-status: $!\n";
+       return 0;
+    }
+
+    return 1;
+}
+
+# -------------------------------
+
+# get package name, version, and file name from the lab
+sub get_bin_info_from_lab {
+    my ($base_dir) = @_;
+    my ($pkg,$ver,$file);
+
+    ($pkg = read_file("$base_dir/fields/package"))
+       or fail("cannot read file $base_dir/fields/package: $!");
+
+    ($ver = read_file("$base_dir/fields/version"))
+       or fail("cannot read file $base_dir/fields/version: $!");
+
+    ($file = readlink("$base_dir/deb"))
+       or fail("cannot read link $base_dir/deb: $!");
+
+    return ($pkg,$ver,$file);
+}
+
+# get package name, version, and file name from the lab
+sub get_src_info_from_lab {
+    my ($base_dir) = @_;
+    my ($pkg,$ver,$file);
+
+    ($pkg = read_file("$base_dir/fields/source"))
+       or fail("cannot read file $base_dir/fields/source: $!");
+
+    ($ver = read_file("$base_dir/fields/version"))
+       or fail("cannot read file $base_dir/fields/version: $!");
+
+    ($file = readlink("$base_dir/dsc"))
+       or fail("cannot read link $base_dir/dsc: $!");
+
+    return ($pkg,$ver,$file);
+}
+
+# schedule a package for processing
+sub schedule_package {
+    my ($type,$pkg,$ver,$file) = @_;
+
+    my $s = "$type $pkg $ver $file";
+
+    if ( $already_scheduled{$s}++ ) {
+       if ($verbose) {
+           printf "N: Ignoring duplicate %s package $pkg (version $ver)\n",
+               $type eq 'b' ? 'binary' : ($type eq 's' ? 'source': 'udeb');
+       }
+       return;
+    }
+
+    push(@packages,$s);
+}
+
+# -------------------------------
+
+# read first line of a file
+sub read_file {
+    my $t;
+
+    open(T, '<', $_[0]) or return;
+    chop($t = <T>);
+    close(T) or return;
+
+    return $t;
+}
+
+# sort collection list by `order'
+sub by_collection_order {
+    $collection_info{$a}->{'order'} <=> $collection_info{$b}->{'order'};
+}
+# }}}
+
+# {{{ Exit handler.
+
+sub END {
+    # Prevent Lab::delete from affecting the exit code.
+    local $?;
+
+    $SIG{'INT'} = 'DEFAULT';
+    $SIG{'QUIT'} = 'DEFAULT';
+
+    $LAB->delete() if $LAB and not $keep_lab;
+}
+
+sub interrupted {
+    $SIG{$_[0]} = 'DEFAULT';
+    die "N: Interrupted.\n";
+}
+# }}}
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: sw=4 ts=8 noet fdm=marker
diff --git a/nokia-lintian/frontend/lintian-info b/nokia-lintian/frontend/lintian-info
new file mode 100755 (executable)
index 0000000..7d6cb8d
--- /dev/null
@@ -0,0 +1,107 @@
+#!/usr/bin/perl -w
+#
+# lintian-info -- transform lintian tags into descriptive text
+#
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+use Getopt::Long;
+
+# turn file buffering off:
+$| = 1;
+
+BEGIN {
+  # determine LINTIAN_ROOT
+  my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'} || '/usr/share/lintian';
+  $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT
+    unless exists $ENV{'LINTIAN_ROOT'};
+}
+
+# import perl libraries
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Read_taginfo;
+
+my %already_displayed = ();
+
+my %tag_info = %{read_tag_info()};
+
+my ($annotate, $tags);
+Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
+GetOptions('annotate|a' => \$annotate, 'tags|t' => \$tags)
+    or die("error parsing options\n");
+
+# If tag mode was specified, read the arguments as tags and display the
+# descriptions for each one.  (We don't currently display the severity,
+# although that would be nice.)
+my $unknown;
+if ($tags) {
+    for my $tag (@ARGV) {
+        print "N: $tag\n";
+        print "N:\n";
+        if (exists $tag_info{$tag}) {
+            print wrap_paragraphs('N:   ', $tag_info{$tag});
+        } else {
+            print "N:   Unknown tag.\n";
+            $unknown = 1;
+        }
+        print "N:\n";
+    }
+    exit ($unknown ? 1 : 0);
+}
+
+# Otherwise, read input files or STDIN, watch for tags, and add descriptions
+# whenever we see one, can, and haven't already explained that tag.  Strip off
+# color and HTML sequences.
+while (<>) {
+    print;
+    chomp;
+    next if /^\s*$/;
+    s/\e[\[\d;]*m//g;
+    s/<span style=\"[^\"]+\">//g;
+    s,</span>,,g;
+
+    my ($type, $pkg);
+    my @pieces = split(/:\s+/);
+    if ($annotate) {
+        $type = shift @pieces if ($pieces[0] =~ /^\w$/);
+        $pkg = shift @pieces if ($pieces[0] =~ /^\S+( (binary|udeb))?$/);
+    } else {
+       $type = shift @pieces;
+       $pkg = shift @pieces;
+    }
+    if ($annotate or (defined $type and $type =~ m/^[OEWIX]$/)) {
+       my $tag = shift @pieces;
+       next if not defined $tag;
+       ($tag) = split(/\s+/, $tag, 2);
+
+       next if not exists $tag_info{$tag} or $already_displayed{$tag}++;
+       print "N:\n";
+       print wrap_paragraphs('N:   ',$tag_info{$tag});
+       print "N:\n";
+    }
+}
+
+exit 0;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 ts=8
diff --git a/nokia-lintian/lib/Checker.pm b/nokia-lintian/lib/Checker.pm
new file mode 100644 (file)
index 0000000..f5336c5
--- /dev/null
@@ -0,0 +1,84 @@
+# Checker -- Perl checker functions for lintian
+# $Id$
+
+# Copyright (C) 2004 Jeroen van Wolffelaar
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Checker;
+use strict;
+no strict 'refs';
+
+use Pipeline;
+use Tags;
+use Cwd 'cwd';
+
+# Quiet "Name "main::LINTIAN_ROOT" used only once"
+# The variable comes from 'lintian'
+() = $main::LINTIAN_ROOT;
+my $LINTIAN_ROOT = $main::LINTIAN_ROOT;
+
+# Can also be more precise later on (only verbose with checker actions) but for
+# now this will do --Jeroen
+my $verbose = $::verbose;
+my $debug = $::debug;
+
+my %checks;
+# For source, binary, udeb, the names of applicable checks
+my %checks_per_type;
+
+# Register a check. Argument is a hash with info
+sub register {
+       my $info = $_[0];
+       fail("Duplicate check $info->{'check-script'}")
+               if exists $checks{$info->{'check-script'}};
+
+       $checks{$info->{'check-script'}} = $info;
+}
+
+sub runcheck {
+       my ($pkg, $type, $info, $name) = @_;
+
+       # Will be set to 2 if error is encountered
+       my $return = 0;
+
+       print "N: Running check: $name ...\n" if $debug;
+
+       my $check = $checks{$name};
+
+       # require has a anti-require-twice cache
+       require "$LINTIAN_ROOT/checks/$name";
+
+       #print STDERR "Now running $name...\n";
+       $name =~ s/[-.]/_/g;
+       eval { &{'Lintian::'.$name.'::run'}($pkg, $type, $info) };
+       if ( $@ ) {
+           print STDERR $@;
+           print STDERR "internal error: cannot run $name check on package $pkg\n";
+           $return = 2;
+       }
+
+       return $return;
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 8
+# End:
+# vim: ts=4 sw=4 noet
diff --git a/nokia-lintian/lib/Dep.pm b/nokia-lintian/lib/Dep.pm
new file mode 100644 (file)
index 0000000..ef3bd94
--- /dev/null
@@ -0,0 +1,624 @@
+# -*- perl -*-
+
+# This library handles operations on dependencies.
+# It provides a routine Dep::parse that converts a dependency line in
+# the dpkg control format to its own internal format.
+# All its other routines work on that internal format.
+
+# A dependency line is viewed as a predicate formula.  The comma
+# separator means "and", and the alternatives separator means "or".
+# A bare package name is the predicate "a package of this name is
+# available".  A package name with a version clause is the predicate
+# "a package of this name that satisfies this version clause is
+# available".
+#
+# This way, the presence of a package can be represented simply as
+# "packagename (=version)", or if it has a Provides line, as
+# "packagename (=version) | provide1 | provide2 | provide3".
+
+use strict;
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+package Dep;
+
+# ---------------------------------
+# public routines
+
+# We permit substvars for package names so that we can use the routines in
+# this library against the unparsed debian/control file.
+sub Pred {
+    $_[0] =~ 
+           /^\s*                           # skip leading whitespace
+             (                             # package name or substvar
+               [a-zA-Z0-9][a-zA-Z0-9+.-]+   #   package name
+               |                            #   or
+               (?:\$\{[a-zA-Z0-9:-]+\})     #   substvar
+              )                             # end of package name or substvar
+             (?:                           # start of optional part
+               \s* \(                      # open parenthesis for version part
+                \s* (<<|<=|=|>=|>>|<|>)     # relation part
+                \s* (.*?)                   # do not attempt to parse version
+                \s* \)                      # closing parenthesis
+             )?                            # end of optional part
+              (?:                           # start of optional architecture
+                \s* \[                      # open bracket for architecture
+                \s* (.*?)                   # don't parse architectures now
+                \s* \]                      # closing bracket
+              )?                            # end of optional architecture
+           /x;
+    return ['PRED', $1, undef, undef, $4] if not defined $2;
+    my $two = $2;
+    if ($two eq '<') {
+       $two = '<<';
+    } elsif ($two eq '>') {
+       $two = '>>';
+    }
+    return ['PRED', $1, $two, $3, $4];
+}
+
+sub Or { return ['OR', @_]; }
+sub And { return ['AND', @_]; }
+sub Not { return ['NOT', $_[0]]; }
+
+# Convert a dependency line into the internal format.
+# Non-local callers may store the results of this routine.
+sub parse {
+    my @deps;
+    for (split(/\s*,\s*/, $_[0])) {
+       next if /^$/;
+       my @alts;
+       if (/^perl\s+\|\s+perl5$/ or /^perl5\s+\|\s+perl\s+/) {
+           $_ = 'perl5';
+       }
+       for (split(/\s*\|\s*/, $_)) {
+           push(@alts, Dep::Pred($_));
+       }
+       if (@alts == 1) {
+           push(@deps, $alts[0]);
+       } else {
+           push(@deps, ['OR', @alts]);
+       }
+    }
+    return $deps[0] if @deps == 1;
+    return ['AND', @deps];
+}
+
+# Take the internal format and convert it back to text.  Note that what this
+# generates for NOT isn't valid Debian dependency syntax.
+sub unparse {
+    my ($p) = @_;
+    if ($p->[0] eq 'PRED') {
+       my $text = $p->[1];
+       if (defined $p->[2]) {
+           $text .= " ($p->[2] $p->[3])";
+       }
+       if (defined $p->[4]) {
+           $text .= " [$p->[4]]";
+       }
+       return $text;
+    } elsif ($p->[0] eq 'AND' || $p->[0] eq 'OR') {
+       my $sep = ($p->[0] eq 'AND') ? ', ' : ' | ';
+       my $text = '';
+       my $i = 1;
+       while ($i < @$p) {
+           $text .= $sep if $text;
+           $text .= unparse($p->[$i++]);
+       }
+       return $text;
+    } elsif ($p->[0] eq 'NOT') {
+       return '! ' . unparse($p->[1]);
+    }
+    return undef;
+}
+
+# ---------------------------------
+
+# Takes two predicate formulas and returns true iff the second can be
+# deduced from the first.
+sub implies {
+    my ($p, $q) = @_;
+    my $i;
+
+    #Dep::debugprint($p);
+    #warn " |- ";
+    #Dep::debugprint($q);
+    #warn "\n";
+    #use Data::Dumper;
+
+    if ($q->[0] eq 'PRED') {
+       if ($p->[0] eq 'PRED') {
+               return Dep::pred_implies($p, $q);
+       } elsif ($p->[0] eq 'AND') {
+           $i = 1;
+           while ($i < @$p) {
+               return 1 if Dep::implies($p->[$i++], $q);
+           }
+           return 0;
+       } elsif ($p->[0] eq 'OR') {
+           $i = 1;
+           while ($i < @$p) {
+               return 0 if not Dep::implies($p->[$i++], $q);
+           }
+           return 1;
+       } elsif ($p->[0] eq 'NOT') {
+           return Dep::implies_inverse($p->[1], $q);
+       }
+    } elsif ($q->[0] eq 'AND') {
+       # Each of q's clauses must be deduced from p.
+       $i = 1;
+       while ($i < @$q) {
+           return 0 if not Dep::implies($p, $q->[$i++]);
+       }
+       return 1;
+    } elsif ($q->[0] eq 'OR') {
+       # If p is something other than OR, p needs to satisfy one of the
+       # clauses of q.  If p is an AND clause, q is satisfied if any of the
+       # clauses of p satisfy it.
+       #
+       # The interesting case is OR.  In this case, do an OR to OR comparison
+       # to determine if q's clause is a superset of p's clause as follows:
+       # take each branch of p and see if it satisfies a branch of q.  If
+       # each branch of p satisfies some branch of q, return 1.  Otherwise,
+       # return 0.
+       #
+       # Simple logic that requires that p satisfy at least one of the
+       # clauses of q considered in isolation will miss that a|b satisfies
+       # a|b|c, since a|b doesn't satisfy any of a, b, or c in isolation.
+       if ($p->[0] eq 'PRED') {
+           $i = 1;
+           while ($i < @$q) {
+               return 1 if Dep::implies($p, $q->[$i++]);
+           }
+           return 0;
+       } elsif ($p->[0] eq 'AND') {
+           $i = 1;
+           while ($i < @$p) {
+               return 1 if Dep::implies($p->[$i++], $q);
+           }
+           return 0;
+       } elsif ($p->[0] eq 'OR') {
+           for ($i = 1; $i < @$p; $i++) {
+               my $j = 1;
+               my $satisfies = 0;
+               while ($j < @$q) {
+                   if (Dep::implies($p->[$i], $q->[$j++])) {
+                       $satisfies = 1;
+                       last;
+                   }
+               }
+               return 0 unless $satisfies;
+           }
+           return 1;
+       } elsif ($p->[0] eq 'NOT') {
+           return Dep::implies_inverse($p->[1], $q);
+       }
+    } elsif ($q->[0] eq 'NOT') {
+       if ($p->[0] eq 'NOT') {
+           return Dep::implies($q->[1], $p->[1]);
+       }
+       return Dep::implies_inverse($p, $q->[1]);
+    }
+}
+
+# Takes two predicate formulas and returns true iff the falsehood of the
+# second can be deduced from the truth of the first.
+sub implies_inverse {
+    my ($p, $q) = @_;
+    my $i;
+
+#    Dep::debugprint($p);
+#    warn " |- !";
+#    Dep::debugprint($q);
+#    warn "\n";
+
+    if ($$q[0] eq 'PRED') {
+       if ($$p[0] eq 'PRED') {
+           return Dep::pred_implies_inverse($p, $q);
+       } elsif ($$p[0] eq 'AND') {
+           # q's falsehood can be deduced from any of p's clauses
+           $i = 1;
+           while ($i < @$p) {
+               return 1 if Dep::implies_inverse($$p[$i++], $q);
+           }
+           return 0;
+       } elsif ($$p[0] eq 'OR') {
+           # q's falsehood must be deduced from each of p's clauses
+           $i = 1;
+           while ($i < @$p) {
+               return 0 if not Dep::implies_inverse($$p[$i++], $q);
+           }
+           return 1;
+       } elsif ($$p[0] eq 'NOT') {
+           return Dep::implies($q, $$p[1]);
+       }
+    } elsif ($$q[0] eq 'AND') {
+       # Any of q's clauses must be falsified by p.
+       $i = 1;
+       while ($i < @$q) {
+           return 1 if Dep::implies_inverse($p, $$q[$i++]);
+       }
+       return 0;
+    } elsif ($$q[0] eq 'OR') {
+       # Each of q's clauses must be falsified by p.
+       $i = 1;
+       while ($i < @$q) {
+           return 0 if not Dep::implies_inverse($p, $$q[$i++]);
+       }
+       return 1;
+    } elsif ($$q[0] eq 'NOT') {
+       return Dep::implies($p, $$q[1]);
+    }
+}
+
+# Takes two predicates and returns true iff the second can be deduced from the
+# first.  If the second is falsified by the first (in other words, if p
+# actually implies not q), return 0.  Otherwise, return undef.  The 0 return
+# is used by pred_implies_inverse.
+sub pred_implies {
+    my ($p, $q) = @_;
+    # If the names don't match, there is no relationship between them.
+    $$p[1] ||= ''; $$q[1] ||= '';
+    return undef if $$p[1] ne $$q[1];
+
+    # If the names match, then the only difference is in the architecture or
+    # version clauses.  First, check architecture.  The architectures for p
+    # must be a superset of the architectures for q.
+    my @p_arches = split(' ', $$p[4] || '');
+    my @q_arches = split(' ', $$q[4] || '');
+    if (@p_arches || @q_arches) {
+        my $p_arch_neg = @p_arches && $p_arches[0] =~ /^!/;
+        my $q_arch_neg = @q_arches && $q_arches[0] =~ /^!/;
+
+        # If p has no arches, it is a superset of q and we should fall through
+        # to the version check.
+        if (not @p_arches) {
+            # nothing
+        }
+
+        # If q has no arches, it is a superset of p and there are no useful
+        # implications.
+        elsif (not @q_arches) {
+            return undef;
+        }
+
+        # Both have arches.  If neither are negated, we know nothing useful
+        # unless q is a subset of p.
+        elsif (not $p_arch_neg and not $q_arch_neg) {
+            my %p_arches = map { $_ => 1 } @p_arches;
+            my $subset = 1;
+            for my $arch (@q_arches) {
+                $subset = 0 unless $p_arches{$arch};
+            }
+            return undef unless $subset;
+        }
+
+        # If both are negated, we know nothing useful unless p is a subset of
+        # q (and therefore has fewer things excluded, and therefore is more
+        # general).
+        elsif ($p_arch_neg and $q_arch_neg) {
+            my %q_arches = map { $_ => 1 } @q_arches;
+            my $subset = 1;
+            for my $arch (@p_arches) {
+                $subset = 0 unless $q_arches{$arch};
+            }
+            return undef unless $subset;
+        }
+
+        # If q is negated and p isn't, we'd need to know the full list of
+        # arches to know if there's any relationship, so bail.
+        elsif (not $p_arch_neg and $q_arch_neg) {
+            return undef;
+        }
+
+        # If p is negated and q isn't, q is a subset of p iff none of the
+        # negated arches in p are present in q.
+        elsif ($p_arch_neg and not $q_arch_neg) {
+            my %q_arches = map { $_ => 1 } @q_arches;
+            my $subset = 1;
+            for my $arch (@p_arches) {
+                $subset = 0 if $q_arches{substr($arch, 1)};
+            }
+            return undef unless $subset;
+        }
+    }
+
+    # Now, down to version.  The implication is true if p's clause is stronger
+    # than q's, or is equivalent.
+
+    # If q has no version clause, then p's clause is always stronger.
+    return 1 if not defined $$q[2];
+
+    # If q does have a version clause, then p must also have one.
+    return undef if not defined $$p[2];
+
+    # q wants an exact version, so p must provide that exact version.  p
+    # disproves q if q's version is outside the range enforced by p.
+    if ($$q[2] eq '=') {
+       if ($$p[2] eq '<<') {
+           return Dep::versions_lte($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '<=') {
+           return Dep::versions_lt($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '>>') {
+           return Dep::versions_gte($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '>=') {
+           return Dep::versions_gt($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '=') {
+           return Dep::versions_equal($$p[3], $$q[3]);
+       }
+    }
+
+    # A greater than clause may disprove a less than clause.  Otherwise, if
+    # p's clause is <<, <=, or =, the version must be <= q's to imply q.
+    if ($$q[2] eq '<=') {
+       if ($$p[2] eq '>>') {
+           return Dep::versions_gte($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '>=') {
+           return Dep::versions_gt($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '=') {
+           return Dep::versions_lte($$p[3], $$q[3]);
+       } else {
+           return Dep::versions_lte($$p[3], $$q[3]) ? 1 : undef;
+       }
+    }
+
+    # Similar, but << is stronger than <= so p's version must be << q's
+    # version if the p relation is <= or =.
+    if ($$q[2] eq '<<') {
+       if ($$p[2] eq '>>' or $$p[2] eq '>=') {
+           return Dep::versions_gte($$p[3], $$p[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '<<') {
+           return Dep::versions_lte($$p[3], $$q[3]);
+       } elsif ($$p[2] eq '=') {
+           return Dep::versions_lt($$p[3], $$q[3]);
+       } else {
+           return Dep::versions_lt($$p[3], $$q[3]) ? 1 : undef;
+       }
+    }
+
+    # Same logic as above, only inverted.
+    if ($$q[2] eq '>=') {
+       if ($$p[2] eq '<<') {
+           return Dep::versions_lte($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '<=') {
+           return Dep::versions_lt($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '=') {
+           return Dep::versions_gte($$p[3], $$q[3]);
+       } else {
+           return Dep::versions_gte($$p[3], $$q[3]) ? 1 : undef;
+       }
+    }
+    if ($$q[2] eq '>>') {
+       if ($$p[2] eq '<<' or $$p[2] eq '<=') {
+           return Dep::versions_lte($$p[3], $$q[3]) ? 0 : undef;
+       } elsif ($$p[2] eq '>>') {
+           return Dep::versions_gte($$p[3], $$q[3]);
+       } elsif ($$p[2] eq '=') {
+           return Dep::versions_gt($$p[3], $$q[3]);
+       } else {
+           return Dep::versions_gt($$p[3], $$q[3]) ? 1 : undef;
+       }
+    }
+
+    return undef;
+}
+
+# Takes two predicates and returns true iff the falsehood of the second can be
+# deduced from the truth of the first.  In other words, p implies not q, or
+# resstated, q implies not p.  (Since if a implies b, not b implies not a.)
+sub pred_implies_inverse {
+    my ($p, $q) = @_;
+    my $res = Dep::pred_implies($q, $p);
+
+    return not $res if defined $res;
+    return undef;
+}
+
+# ---------------------------------
+# version routines
+
+my %cached;
+
+sub versions_equal {
+    my ($p, $q) = @_;
+    my $res;
+
+    return 1 if $p eq $q;
+    return 1 if $Dep::cached{"$p == $q"};
+    return 1 if $Dep::cached{"$p <= $q"} and $Dep::cached{"$p >= $q"};
+    return 0 if $Dep::cached{"$p != $q"};
+    return 0 if $Dep::cached{"$p << $q"};
+    return 0 if $Dep::cached{"$p >> $q"};
+
+    $res = Dep::get_version_cmp($p, 'eq', $q);
+
+    if ($res) {
+       $Dep::cached{"$p == $q"} = 1;
+    } else {
+       $Dep::cached{"$p != $q"} = 1;
+    }
+
+    return $res;
+}
+
+sub versions_lte {
+    my ($p, $q) = @_;
+    my $res;
+
+    return 1 if $p eq $q;
+    return 1 if $Dep::cached{"$p <= $q"};
+    return 1 if $Dep::cached{"$p == $q"};
+    return 1 if $Dep::cached{"$p << $q"};
+    return 0 if $Dep::cached{"$p >> $q"};
+    return 0 if $Dep::cached{"$p >= $q"} and $Dep::cached{"$p != $q"};
+
+    $res = Dep::get_version_cmp($p, 'le', $q);
+
+    if ($res) {
+       $Dep::cached{"$p <= $q"} = 1;
+    } else {
+       $Dep::cached{"$p >> $q"} = 1;
+    }
+
+    return $res;
+}
+
+sub versions_gte {
+    my ($p, $q) = @_;
+    my $res;
+
+    return 1 if $p eq $q;
+    return 1 if $Dep::cached{"$p >= $q"};
+    return 1 if $Dep::cached{"$p == $q"};
+    return 1 if $Dep::cached{"$p >> $q"};
+    return 0 if $Dep::cached{"$p << $q"};
+    return 0 if $Dep::cached{"$p <= $q"} and $Dep::cached{"$p != $q"};
+
+    $res = Dep::get_version_cmp($p, 'ge', $q);
+
+    if ($res) {
+       $Dep::cached{"$p >= $q"} = 1;
+    } else {
+       $Dep::cached{"$p << $q"} = 1;
+    }
+
+    return $res;
+}
+
+sub versions_lt {
+    my ($p, $q) = @_;
+    my $res;
+
+    return 0 if $p eq $q;
+    return 1 if $Dep::cached{"$p << $q"};
+    return 0 if $Dep::cached{"$p == $q"};
+    return 0 if $Dep::cached{"$p >= $q"};
+    return 0 if $Dep::cached{"$p >> $q"};
+    return 1 if $Dep::cached{"$p <= $q"} and $Dep::cached{"$p != $q"};
+
+    $res = Dep::get_version_cmp($p, 'lt', $q);
+
+    if ($res) {
+       $Dep::cached{"$p << $q"} = 1;
+    } else {
+       $Dep::cached{"$p >= $q"} = 1;
+    }
+
+    return $res;
+}
+
+sub versions_gt {
+    my ($p, $q) = @_;
+    my $res;
+
+    return 0 if $p eq $q;
+    return 1 if $Dep::cached{"$p >> $q"};
+    return 0 if $Dep::cached{"$p == $q"};
+    return 0 if $Dep::cached{"$p <= $q"};
+    return 0 if $Dep::cached{"$p << $q"};
+    return 1 if $Dep::cached{"$p >= $q"} and $Dep::cached{"$p != $q"};
+
+    $res = Dep::get_version_cmp($p, 'gt', $q);
+
+    if ($res) {
+       $Dep::cached{"$p >> $q"} = 1;
+    } else {
+       $Dep::cached{"$p <= $q"} = 1;
+    }
+
+    return $res;
+}
+
+sub get_version_cmp {
+    return ::spawn('dpkg', '--compare-versions', @_) == 0;
+}
+
+# ---------------------------------
+
+# Return a list of duplicated relations.  Each member of the list will be an
+# anonymous array holding the set of relations that are considered duplicated.
+# Two relations are considered duplicates if one implies the other.
+sub get_dups {
+    my $p = shift;
+
+    if ($p->[0] ne 'AND') {
+       return ();
+    }
+
+    # The logic here is a bit complex in order to merge sets of duplicate
+    # dependencies.  We want foo (<< 2), foo (>> 1), foo (= 1.5) to end up as
+    # one set of dupliactes, even though the first doesn't imply the second.
+    #
+    # $dups holds a hash, where the key is the earliest dependency in a set
+    # and the value is a hash whose keys are the other dependencies in the
+    # set.  $seen holds a map from package names to the duplicate sets that
+    # they're part of, if they're not the earliest package in a set.  If
+    # either of the dependencies in a duplicate pair were already seen, add
+    # the missing one of the pair to the existing set rather than creating a
+    # new one.
+    my (%dups, %seen);
+    for (my $i = 1; $i < @$p; $i++) {
+       for (my $j = $i + 1; $j < @$p; $j++) {
+           if (Dep::implies($p->[$i], $p->[$j]) || Dep::implies($p->[$j], $p->[$i])) {
+               my $first = unparse($p->[$i]);
+               my $second = unparse($p->[$j]);
+               if ($seen{$first}) {
+                   $dups{$seen{$first}}->{$second} = $j;
+                   $seen{$second} = $seen{$first};
+               } elsif ($seen{$second}) {
+                   $dups{$seen{$second}}->{$first} = $i;
+                   $seen{$first} = $seen{$second};
+               } else {
+                   $dups{$first} ||= {};
+                   $dups{$first}->{$second} = $j;
+                   $seen{$second} = $first;
+               }
+           }
+       }
+    }
+
+    # The sort maintains the original order in which we encountered the
+    # dependencies, just in case that helps the user find the problems,
+    # despite the fact we're using a hash.
+    return map {
+        [ $_,
+          sort {
+              $dups{$_}->{$a} <=> $dups{$_}->{$b}
+          } keys %{ $dups{$_} }
+        ]
+    } keys %dups;
+}
+
+# ---------------------------------
+
+sub debugprint {
+    my $x;
+    my $i;
+
+    for $x (@_) {
+       if ($$x[0] eq 'PRED') {
+           if (@$x == 2) {
+               warn "PRED($$x[1])";
+           } else {
+               warn "PRED($$x[1] $$x[2] $$x[3])";
+           }
+       } else {
+           warn "$$x[0](";
+           $i = 1;
+           while ($i < @$x) {
+               Dep::debugprint($$x[$i++]);
+               warn ", " if ($i < @$x);
+           }
+           warn ")";
+       }
+     }
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 ts=8
diff --git a/nokia-lintian/lib/Lab.pm b/nokia-lintian/lib/Lab.pm
new file mode 100644 (file)
index 0000000..63e20dc
--- /dev/null
@@ -0,0 +1,254 @@
+# Lab -- Perl laboratory functions for lintian
+# $Id$
+
+# Copyright (C) 1998-2004 Various authors
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lab;
+use strict;
+
+use Pipeline;
+use Util;
+
+use File::Temp;
+
+# Quiet "Name "main::LINTIAN_ROOT" used only once"
+# The variables comes from 'lintian'
+() = ($main::LINTIAN_ROOT, $main::verbose, $main::debug);
+
+my $LINTIAN_ROOT = $main::LINTIAN_ROOT;
+
+# Can also be more precise later on (only verbose with lab actions) but for
+# now this will do --Jeroen
+my $verbose = $main::verbose;
+my $debug   = $main::debug;
+
+sub new {
+    my ( $class, $dir, $dist ) = @_;
+
+    my $self = {};
+    bless $self, $class;
+
+    $self->setup( $dir, $dist );
+    return $self;
+}
+
+
+sub is_lab {
+    my ( $self ) = @_;
+
+    return unless $self->{dir};
+    return -d "$self->{dir}/binary"
+       && -d "$self->{dir}/udeb"
+       && -d "$self->{dir}/source"
+       && -d "$self->{dir}/info";
+}
+
+sub setup {
+    my ( $self, $dir, $dist ) = @_;
+
+    if ( $dir ) {
+       $self->{mode} = 'static';
+       $self->{dir} = $dir;
+       $self->{dist} = $dist;
+    } else {
+       $self->{mode} = 'temporary';
+
+       my $created = 0;
+       for (1..10) {
+           $dir = tmpnam();
+
+           if ($self->setup_force( $dir, $dist )) {
+               $created = 1;
+               last;
+           }
+       }
+       unless ($created) {
+           fail("cannot create lab directory $dir");
+       }
+    }
+
+    return 1;
+}
+
+sub setup_static {
+    my ( $self ) = @_;
+
+    unless ( $self->{mode} eq 'static' and $self->{dir} ) {
+       print STDERR "no laboratory specified (need to define LINTIAN_LAB)";
+       return 0;
+    }
+
+    return $self->setup_force( $self->{dir}, $self->{dist} );
+}
+
+
+sub setup_force {
+    my ( $self, $dir, $dist ) = @_;
+
+    return unless $dir;
+
+    print "N: Setting up lab in $dir ...\n" if $verbose;
+
+    # create lab directory
+    # (Note, that the mode 0777 is reduced by the current umask.)
+    unless (-d $dir && ( $self->{mode} eq 'static' )) {
+       mkdir($dir,0777) or return 0;
+    }
+
+    # create base directories
+    for my $subdir (qw( binary source udeb info )) {
+       my $fulldir = "$dir/$subdir";
+       if (not -d $fulldir) {
+           mkdir($fulldir, 0777)
+               or fail("cannot create lab directory $fulldir");
+       }
+    }
+
+    # Just create empty files if they don't already exist.  If they do already
+    # exist, we need to keep the old files so that the list-* unpack programs
+    # can analyze what changed.
+    for my $pkgtype (qw( binary source udeb )) {
+       if (not -f "$dir/info/$pkgtype-packages") {
+           _touch("$dir/info/$pkgtype-packages")
+               or fail("cannot create $pkgtype package list");
+       }
+    }
+
+    $self->{dir} = $dir;
+    $ENV{'LINTIAN_LAB'} = $dir;
+    $self->populate_with_dist( $dist );
+
+    return 1;
+}
+
+sub populate_with_dist {
+    my ( $self, $dist ) = @_;
+
+    return 0 unless $dist;
+    return 0 unless $self->{dir};
+
+    print STDERR "spawning list-binpkg, list-udebpkg and list-srcpkg since LINTIAN_DIST=$dist\n" if ($debug >= 2);
+
+    my $v = $verbose ? '-v' : '';
+
+    spawn("$LINTIAN_ROOT/unpack/list-binpkg",
+         "$self->{dir}/info/binary-packages", $v) == 0
+             or fail("cannot create binary package list");
+    spawn("$LINTIAN_ROOT/unpack/list-srcpkg",
+         "$self->{dir}/info/source-packages", $v) == 0
+             or fail("cannot create source package list");
+    spawn("$LINTIAN_ROOT/unpack/list-udebpkg",
+         "$self->{dir}/info/udeb-packages", $v) == 0
+             or fail("cannot create udeb package list");
+
+    return 1;
+}
+
+sub delete_static {
+    my ( $self ) = @_;
+
+    unless ( $self->{mode} eq 'static' and $self->{dir} ) {
+       print STDERR "warning: no laboratory specified (need to define LINTIAN_LAB)";
+       return 0;
+    }
+
+    return $self->delete_force;
+}
+
+sub delete {
+    my ( $self ) = @_;
+
+    return 1 unless $self->{mode} eq 'temporary';
+
+    return $self->delete_force;
+}
+
+# Remove is apparantly some reserved name...
+sub delete_force {
+    my ( $self ) = @_;
+
+    return 0 unless $self->{dir};
+
+    print "N: Removing $self->{dir} ...\n" if $verbose;
+
+    # since we will chdir in a moment, make the path of the lab absolute
+    unless ( $self->{dir} =~ m,^/, ) {
+       require Cwd;
+       $self->{dir} = Cwd::getcwd() . "/$self->{dir}";
+    }
+
+    # chdir to root (otherwise, the shell will complain if we happen
+    # to sit in the directory we want to delete :)
+    chdir('/');
+
+    # does the lab exist?
+    unless (-d $self->{dir}) {
+               # no.
+               print STDERR "warning: cannot remove lab in directory $self->{dir} ! (directory does not exist)\n";
+               return 0;
+    }
+
+    # sanity check if $self->{dir} really points to a lab :)
+    unless (-d "$self->{dir}/binary") {
+               # binary/ subdirectory does not exist--empty directory?
+               my @t = glob("$self->{dir}/*");
+               if ($#t+1 <= 2) {
+                       # yes, empty directory--skip it
+                       return 1;
+               } else {
+                       # non-empty directory that does not look like a lintian lab!
+                       print STDERR "warning: directory $self->{dir} does not look like a lab! (please remove it yourself)\n";
+                       return 0;
+               }
+    }
+
+    # looks ok.
+    if (spawn('rm', '-rf', '--',
+             "$self->{dir}/binary",
+             "$self->{dir}/source",
+             "$self->{dir}/udeb",
+             "$self->{dir}/info") != 0) {
+               print STDERR "warning: cannot remove lab directory $self->{dir} (please remove it yourself)\n";
+    }
+
+    # dynamic lab?
+    if ($self->{mode} eq 'temporary') {
+               if (rmdir($self->{dir}) != 1) {
+                       print STDERR "warning: cannot remove lab directory $self->{dir} (please remove it yourself)\n";
+               }
+    }
+
+    $self->{dir} = "";
+
+    return 1;
+}
+
+# create an empty file
+# --okay, okay, this is not exactly what `touch' does :-)
+sub _touch {
+    open(T, '>', $_[0]) or return 0;
+    close(T) or return 0;
+
+    return 1;
+}
+
+
+1;
+
+# vim: ts=4 sw=4 noet
diff --git a/nokia-lintian/lib/Lintian/Collect.pm b/nokia-lintian/lib/Lintian/Collect.pm
new file mode 100644 (file)
index 0000000..119b048
--- /dev/null
@@ -0,0 +1,158 @@
+# -*- perl -*-
+# Lintian::Collect -- interface to package data collection
+
+# Copyright (C) 2008 Russ Allbery
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, see <http://www.gnu.org/licenses/>.
+
+package Lintian::Collect;
+use strict;
+
+use Lintian::Collect::Binary;
+use Lintian::Collect::Source;
+
+# Take the package name and type, initialize an appropriate collect object
+# based on the package type, and return it.  Returns undef for an unknown
+# package type.
+sub new {
+    my ($class, $pkg, $type) = @_;
+    my $object;
+    if ($type eq 'source') {
+        $object = Lintian::Collect::Source->new ($pkg);
+    } elsif ($type eq 'binary' or $type eq 'udeb') {
+        $object = Lintian::Collect::Binary->new ($pkg);
+    } else {
+        return;
+    }
+    $object->{name} = $pkg;
+    $object->{type} = $type;
+    return $object;
+}
+
+# Return the package name.
+sub name {
+    my ($self) = @_;
+    return $self->{name};
+}
+
+# Return the package type.
+sub type {
+    my ($self) = @_;
+    return $self->{type};
+}
+
+# Return the value of the specified control field of the package, or undef if
+# that field wasn't present in the control file for the package.  For source
+# packages, this is the *.dsc file; for binary packages, this is the control
+# file in the control section of the package.
+sub field {
+    my ($self, $field) = @_;
+    return $self->{field}{$field} if exists $self->{field}{$field};
+    if (open(FIELD, '<', "fields/$field")) {
+        local $/;
+        my $value = <FIELD>;
+        close FIELD;
+        $value =~ s/\n\z//;
+        $self->{field}{$field} = $value;
+    } else {
+        $self->{field}{$field} = undef;
+    }
+    return $self->{field}{$field};
+}
+
+=head1 NAME
+
+Lintian::Collect - Lintian interface to package data collection
+
+=head1 SYNOPSIS
+
+    my $collect = Lintian::Collect->new($name, $type);
+    $name = $collect->name;
+    $type = $collect->type;
+
+=head1 DESCRIPTION
+
+Lintian::Collect provides the shared interface to package data used by
+source, binary, and udeb packages.  It creates an object of the
+appropriate type and provides common functions used by the collection
+interface to all three types of packages.
+
+This module is in its infancy.  Most of Lintian still reads all data from
+files in the laboratory whenever that data is needed and generates that
+data via collect scripts.  The goal is to eventually access all data via
+this module and its subclasses so that the module can cache data where
+appropriate and possibly retire collect scripts in favor of caching that
+data in memory.
+
+=head1 CLASS METHODS
+
+=over 4
+
+=item new(PACKAGE, TYPE)
+
+Creates a new object appropriate to the package type.  Currently, the only
+TYPE supported is C<source>, which creates a new Lintian::Collect::Source
+object and returns it.  TYPE can be retrieved later with the type()
+method.  Returns undef an unknown TYPE.
+
+PACKAGE is the name of the package and is stored in the collect object.
+It can be retrieved with the name() method.
+
+=back
+
+=head1 INSTANCE METHODS
+
+In addition to the instance methods documented here, see the documentation
+of Lintian::Collect::Source for instance methods specific to source
+packages.
+
+=over 4
+
+=item field(FIELD)
+
+Returns the value of the control field FIELD in the control file for the
+package.  For a source package, this is the *.dsc file; for a binary
+package, this is the control file in the control section of the package.
+The value will be read from the F<fields/> subdirectory of the current
+directory if it hasn't previously been requested and cached in memory so
+that subsequent requests for the same field can be answered without file
+accesses.
+
+=item name()
+
+Returns the name of the package.
+
+=item type()
+
+Returns the type of the package.
+
+=back
+
+=head1 AUTHOR
+
+Originally written by Russ Allbery <rra@debian.org> for Lintian.
+
+=head1 SEE ALSO
+
+lintian(1), Lintian::Collect::Source(3)
+
+=cut
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/lib/Lintian/Collect/Binary.pm b/nokia-lintian/lib/Lintian/Collect/Binary.pm
new file mode 100644 (file)
index 0000000..319b45e
--- /dev/null
@@ -0,0 +1,312 @@
+# -*- perl -*-
+# Lintian::Collect::Binary -- interface to binary package data collection
+
+# Copyright (C) 2008 Russ Allbery
+# Copyright (C) 2008 Frank Lichtenheld
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, see <http://www.gnu.org/licenses/>.
+
+package Lintian::Collect::Binary;
+use strict;
+
+use Lintian::Collect;
+use Util;
+
+our @ISA = qw(Lintian::Collect);
+
+# Initialize a new binary package collect object.  Takes the package name,
+# which is currently unused.
+sub new {
+    my ($class, $pkg) = @_;
+    my $self = {};
+    bless($self, $class);
+    return $self;
+}
+
+# Returns whether the package is a native package according to
+# its version number
+sub native {
+    my ($self) = @_;
+    return $self->{native} if exists $self->{native};
+    my $version = $self->field('version');
+    $self->{native} = ($version !~ m/-/);
+}
+
+# Returns the information from the indices
+# FIXME: should maybe return an object
+sub index {
+    my ($self) = @_;
+    return $self->{index} if exists $self->{index};
+
+    my (@idx, %dir_counts);
+    open my $idx, '<', "index"
+        or fail("cannot open index file index: $!");
+    open my $num_idx, '<', "index-owner-id"
+        or fail("cannot open index file index-owner-id: $!");
+    while (<$idx>) {
+        chomp;
+
+        my (%file, $perm, $owner, $name);
+        ($perm,$owner,$file{size},$file{date},$file{time},$name) =
+            split(' ', $_, 6);
+        $file{operm} = perm2oct($perm);
+        $file{type} = substr $perm, 0, 1;
+
+        my $numeric = <$num_idx>;
+        chomp $numeric;
+        fail("cannot read index file index-owner-id") unless defined $numeric;
+        my ($owner_id, $name_chk) = (split(' ', $numeric, 6))[1, 5];
+        fail("mismatching contents of index files: $name $name_chk")
+            if $name ne $name_chk;
+
+        ($file{owner}, $file{group}) = split '/', $owner, 2;
+        ($file{uid}, $file{gid}) = split '/', $owner_id, 2;
+
+        $name =~ s,^\./,,;
+        if ($name =~ s/ link to (.*)//) {
+            $file{type} = 'h';
+            $file{link} = $1;
+            $file{link} =~ s,^\./,,;
+        } elsif ($file{type} eq 'l') {
+            ($name, $file{link}) = split ' -> ', $name, 2;
+        }
+        $file{name} = $name;
+
+        # count directory contents:
+        $dir_counts{$name} ||= 0 if $file{type} eq 'd';
+        $dir_counts{$1} = ($dir_counts{$1} || 0) + 1
+            if $name =~ m,^(.+/)[^/]+/?$,;
+
+        push @idx, \%file;
+    }
+    foreach my $file (@idx) {
+        if ($dir_counts{$file->{name}}) {
+            $file->{count} = $dir_counts{$file->{name}};
+        }
+    }
+    $self->{index} = \@idx;
+
+    return $self->{index};
+}
+
+# Returns the information from collect/file-info
+sub file_info {
+    my ($self) = @_;
+    return $self->{file_info} if exists $self->{file_info};
+
+    my %file_info;
+    open(my $idx, '<', "file-info")
+        or fail("cannot open file-info: $!");
+    while (<$idx>) {
+        chomp;
+
+        m/^(.+?):\s+(.*)$/o
+            or fail("an error in the file pkg is preventing lintian from checking this package: $_");
+        my ($file, $info) = ($1,$2);
+
+        $file =~ s,^./,,o;
+        $file =~ s,/+$,,o;
+
+        $file_info{$file} = $info;
+    }
+    close $idx;
+    $self->{file_info} = \%file_info;
+
+    return $self->{file_info};
+}
+
+# Returns the information from collect/objdump-info
+sub objdump_info {
+    my ($self) = @_;
+    return $self->{objdump_info} if exists $self->{objdump_info};
+
+    my %objdump_info;
+    my ($dynsyms, $file);
+    open(my $idx, '<', "objdump-info")
+        or fail("cannot open objdump-info: $!");
+    while (<$idx>) {
+        chomp;
+
+        next if m/^\s*$/o;
+
+        if (m,^-- \./(\S+)\s*$,o) {
+            if ($file) {
+                $objdump_info{$file->{name}} = $file;
+            }
+            $file = { name => $1 };
+            $dynsyms = 0;
+        } elsif ($dynsyms) {
+            # The .*? near the end is added because a number of optional fields
+            # might be printed.  The symbol name should be the last word.
+            if (m/^[0-9a-fA-F]+.{6}\w\w?\s+(\S+)\s+[0-9a-zA-Z]+\s+(\S+)\s+(\S+)$/){
+                my ($foo, $sec, $sym) = ($1, $2, $3);
+                push @{$file->{SYMBOLS}}, [ $foo, $sec, $sym ];
+            }
+        } else {
+            if (m/^\s*NEEDED\s*(\S+)/o) {
+                push @{$file->{NEEDED}}, $1;
+            } elsif (m/^\s*RPATH\s*(\S+)/o) {
+                foreach (split m/:/, $1) {
+                    $file->{RPATH}{$_}++;
+                }
+            } elsif (m/^\s*SONAME\s*(\S+)/o) {
+                push @{$file->{SONAME}}, $1;
+            } elsif (m/^\s*\d+\s+\.comment\s+/o) {
+                $file->{COMMENT_SECTION} = 1;
+            } elsif (m/^\s*\d+\s+\.note\s+/o) {
+                $file->{NOTE_SECTION} = 1;
+            } elsif (m/^DYNAMIC SYMBOL TABLE:/) {
+                $dynsyms = 1;
+            } elsif (m/^objdump: (.*?): File format not recognized$/) {
+                push @{$file->{NOTES}}, "File format not recognized";
+            } elsif (m/^objdump: \.(.*?): Packed with UPX$/) {
+                push @{$file->{NOTES}}, "Packed with UPX";
+            } elsif (m/objdump: \.(.*?): Invalid operation$/) {
+                # Don't anchor this regex since it can be interspersed with other
+                # output and hence not on the beginning of a line.
+                push @{$file->{NOTES}}, "Invalid operation";
+            } elsif (m/CXXABI/) {
+                $file->{CXXABI} = 1;
+            } elsif (m%Requesting program interpreter:\s+/lib/klibc-\S+\.so%) {
+                $file->{KLIBC} = 1;
+            }
+        }
+    }
+    if ($file) {
+        $objdump_info{$file->{name}} = $file;
+    }
+    $self->{objdump_info} = \%objdump_info;
+
+    return $self->{objdump_info};
+}
+
+=head1 NAME
+
+Lintian::Collect::Binary - Lintian interface to binary package data collection
+
+=head1 SYNOPSIS
+
+    my $collect = Lintian::Collect->new($name, $type);
+    if ($collect->native) {
+        print "Package is native\n";
+    }
+
+=head1 DESCRIPTION
+
+Lintian::Collect::Binary provides an interface to package data for binary
+packages.  It implements data collection methods specific to binary
+packages.
+
+This module is in its infancy.  Most of Lintian still reads all data from
+files in the laboratory whenever that data is needed and generates that
+data via collect scripts.  The goal is to eventually access all data about
+source packages via this module so that the module can cache data where
+appropriate and possibly retire collect scripts in favor of caching that
+data in memory.
+
+=head1 CLASS METHODS
+
+=item new(PACKAGE)
+
+Creates a new Lintian::Collect::Binary object.  Currently, PACKAGE is
+ignored.  Normally, this method should not be called directly, only via
+the Lintian::Collect constructor.
+
+=back
+
+=head1 INSTANCE METHODS
+
+In addition to the instance methods listed below, all instance methods
+documented in the Lintian::Collect module are also available.
+
+=over 4
+
+=item native()
+
+Returns true if the binary package is native and false otherwise.
+Nativeness will be judged by its version number.
+
+=item index()
+
+Returns a reference to an array of hash references with content
+information about the binary package.  Each hash may have the
+following keys:
+
+=over 4
+
+=item name
+
+Name of the index entry without leading slash.
+
+=item owner
+
+=item group
+
+=item uid
+
+=item gid
+
+The former two are in string form and may depend on the local system,
+the latter two are the original numerical values as saved by tar.
+
+=item date
+
+Format "YYYY-MM-DD".
+
+=item time
+
+Format "hh:mm".
+
+=item type
+
+Entry type as one character.
+
+=item operm
+
+Entry permissions as octal number.
+
+=item size
+
+Entry size in bytes.  Note that tar(1) lists the size of directories as
+0 (so this is what you will get) contrary to what ls(1) does.
+
+=item link
+
+If the entry is either a hardlink or symlink, contains the target of the
+link.
+
+=item count
+
+If the entry is a directory, contains the number of other entries this
+directory contains.
+
+=back
+
+=head1 AUTHOR
+
+Originally written by Frank Lichtenheld <djpig@debian.org> for Lintian.
+
+=head1 SEE ALSO
+
+lintian(1), Lintian::Collect(3)
+
+=cut
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/lib/Lintian/Collect/Source.pm b/nokia-lintian/lib/Lintian/Collect/Source.pm
new file mode 100644 (file)
index 0000000..016385f
--- /dev/null
@@ -0,0 +1,139 @@
+# -*- perl -*-
+# Lintian::Collect::Source -- interface to source package data collection
+
+# Copyright (C) 2008 Russ Allbery
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, see <http://www.gnu.org/licenses/>.
+
+package Lintian::Collect::Source;
+use strict;
+
+use Lintian::Collect;
+use Parse::DebianChangelog;
+
+our @ISA = qw(Lintian::Collect);
+
+# Initialize a new source package collect object.  Takes the package name,
+# which is currently unused.
+sub new {
+    my ($class, $pkg) = @_;
+    my $self = {};
+    bless($self, $class);
+    return $self;
+}
+
+# Get the changelog file of a source package as a Parse::DebianChangelog
+# object.  Returns undef if the changelog file couldn't be found.
+sub changelog {
+    my ($self) = @_;
+    return $self->{changelog} if exists $self->{changelog};
+    if (-l 'debfiles/changelog' || ! -f 'debfiles/changelog') {
+        $self->{changelog} = undef;
+    } else {
+        my %opts = (infile => 'debfiles/changelog', quiet => 1);
+        $self->{changelog} = Parse::DebianChangelog->init(\%opts);
+    }
+    return $self->{changelog};
+}
+
+# Returns whether the package is a native package.  For everything except
+# format 3.0 (quilt) packages, we base this on whether we have a Debian
+# *.diff.gz file.  3.0 (quilt) packages are always non-native.  Returns true
+# if the package is native and false otherwise.
+sub native {
+    my ($self) = @_;
+    return $self->{native} if exists $self->{native};
+    my $format = $self->field('format');
+    if ($format =~ /^\s*3\.0\s+\(quilt\)\s*$/) {
+        $self->{native} = 0;
+    } else {
+        my $version = $self->field('version');
+        $version =~ s/^\d+://;
+        my $name = $self->{name};
+        $self->{native} = (-f "${name}_${version}.diff.gz" ? 0 : 1);
+    }
+    return $self->{native};
+}
+
+=head1 NAME
+
+Lintian::Collect::Source - Lintian interface to source package data collection
+
+=head1 SYNOPSIS
+
+    my $collect = Lintian::Collect->new($name, $type);
+    if ($collect->native) {
+        print "Package is native\n";
+    }
+
+=head1 DESCRIPTION
+
+Lintian::Collect::Source provides an interface to package data for source
+packages.  It implements data collection methods specific to source
+packages.
+
+This module is in its infancy.  Most of Lintian still reads all data from
+files in the laboratory whenever that data is needed and generates that
+data via collect scripts.  The goal is to eventually access all data about
+source packages via this module so that the module can cache data where
+appropriate and possibly retire collect scripts in favor of caching that
+data in memory.
+
+=head1 CLASS METHODS
+
+=item new(PACKAGE)
+
+Creates a new Lintian::Collect::Source object.  Currently, PACKAGE is
+ignored.  Normally, this method should not be called directly, only via
+the Lintian::Collect constructor.
+
+=back
+
+=head1 INSTANCE METHODS
+
+In addition to the instance methods listed below, all instance methods
+documented in the Lintian::Collect module are also available.
+
+=over 4
+
+=item changelog()
+
+Returns the changelog of the source package as a Parse::DebianChangelog
+object, or undef if the changelog is a symlink or doesn't exist.  The
+debfiles collection script must have been run to create the changelog
+file, which this method expects to find in F<debfiles/changelog>.
+
+=item native()
+
+Returns true if the source package is native and false otherwise.
+
+=back
+
+=head1 AUTHOR
+
+Originally written by Russ Allbery <rra@debian.org> for Lintian.
+
+=head1 SEE ALSO
+
+lintian(1), Lintian::Collect(3)
+
+=cut
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/lib/Lintian/Data.pm b/nokia-lintian/lib/Lintian/Data.pm
new file mode 100644 (file)
index 0000000..a8c176d
--- /dev/null
@@ -0,0 +1,169 @@
+# -*- perl -*-
+# Lintian::Data -- interface to query lists of keywords
+
+# Copyright (C) 2008 Russ Allbery
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, see <http://www.gnu.org/licenses/>.
+
+package Lintian::Data;
+use strict;
+
+use Carp qw(croak);
+
+# The constructor loads a list into a hash in %data, which is private to this
+# module.  Use %data as a cache to avoid loading the same list more than once
+# (which means lintian doesn't support having the list change over the life of
+# the proces.  The returned object knows what list, stored in %data, it is
+# supposed to act on.
+{
+    my %data;
+    sub new {
+        my ($class, $type) = @_;
+        croak('no data type specified') unless $type;
+        unless (exists $data{$type}) {
+            my $dir = $ENV{LINTIAN_ROOT} . '/data';
+            open(LIST, '<', "$dir/$type")
+                or croak("unknown data type $type");
+            local ($_, $.);
+            while (<LIST>) {
+                chomp;
+                s/^\s+//;
+                next if /^\#/;
+                next if /^$/;
+                $data{$type}{$_} = 1;
+            }
+        }
+        my $self = { data => $data{$type} };
+        bless($self, $class);
+        return $self;
+    }
+}
+
+# Query a data object for whether a particular keyword is valid.
+sub known {
+    my ($self, $keyword) = @_;
+    return (exists $self->{data}{$keyword}) ? 1 : undef;
+}
+
+=head1 NAME
+
+Lintian::Data - Lintian interface to query lists of keywords
+
+=head1 SYNOPSIS
+
+    my $list = Lintian::Data->new('type');
+    if ($list->known($keyword)) {
+        # do something ...
+    }
+
+=head1 DESCRIPTION
+
+Lintian::Data provides a way of loading a list of keywords from a file in
+the Lintian root and then querying that list.  The lists are stored in the
+F<data> directory of the Lintian root and consist of one keyword per line.
+Blank lines and lines beginning with C<#> are ignored.  Leading and
+trailing whitespace is stripped; other than that, keywords are taken
+verbatim as they are listed in the file and may include spaces.
+
+This module allows lists such as menu sections, doc-base sections,
+obsolete packages, package fields, and so forth to be stored in simple,
+easily editable files.
+
+=head1 CLASS METHODS
+
+=over 4
+
+=item new(TYPE)
+
+Creates a new Lintian::Data object for the given TYPE.  TYPE is a partial
+path relative to the F<data> directory and should correspond to a file in
+that directory.  The contents of that file will be loaded into memory and
+returned as part of the newly created object.  On error, new() throws an
+exception.
+
+A given file will only be loaded once.  If new() is called again with the
+same TYPE argument, the data previously loaded will be reused, avoiding
+multiple file reads.
+
+=back
+
+=head1 INSTANCE METHODS
+
+=over 4
+
+=item known(KEYWORD)
+
+Returns true if KEYWORD was listed in the data file represented by this
+Lintian::Data instance and false otherwise.
+
+=back
+
+=head1 DIAGNOSTICS
+
+=over 4
+
+=item no data type specified
+
+new() was called without a TYPE argument.
+
+=item unknown data type %s
+
+The TYPE argument to new() did not correspond to a file in the F<data>
+directory of the Lintian root.
+
+=back
+
+=head1 FILES
+
+=over 4
+
+=item LINTIAN_ROOT/data
+
+The files loaded by this module must be located in this directory.
+Relative paths containing a C</> are permitted, so files may be organized
+in subdirectories in this directory.
+
+=back
+
+=head1 ENVIRONMENT
+
+=over 4
+
+=item LINTIAN_ROOT
+
+This variable must be set to Lintian's root directory (normally
+F</usr/share/lintian> when Lintian is installed as a Debian package).  The
+B<lintian> program normally takes care of doing this.  This module doesn't
+care about the contents of this directory other than expecting the F<data>
+subdirectory of this directory to contain its files.
+
+=back
+
+=head1 AUTHOR
+
+Originally written by Russ Allbery <rra@debian.org> for Lintian.
+
+=head1 SEE ALSO
+
+lintian(1)
+
+=cut
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/lib/Manual_refs.pm b/nokia-lintian/lib/Manual_refs.pm
new file mode 100644 (file)
index 0000000..2e19012
--- /dev/null
@@ -0,0 +1,46 @@
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+# define hash for manuals
+my %manual =
+(
+ 'policy' => 'Policy Manual',
+ 'devref' => 'Developers Reference',
+ 'fhs'    => 'FHS',
+);
+
+my %url;
+
+my $lib = defined $ENV{LINTIAN_ROOT} ?  "$ENV{LINTIAN_ROOT}/" : "";
+
+open (REFS, '<', "${lib}lib/manual_refs")
+    or die "Could not open manual_refs: $!";
+
+while(<REFS>) {
+    chomp;
+    next if m/^\s*\#/;
+
+    my ($key, $data) = split;
+    $url{$key} = $data;
+}
+
+close REFS;
+
+1;
diff --git a/nokia-lintian/lib/Pipeline.pm b/nokia-lintian/lib/Pipeline.pm
new file mode 100644 (file)
index 0000000..422213c
--- /dev/null
@@ -0,0 +1,143 @@
+# -*- perl -*-
+# Pipeline -- library of process spawn functions that do not invoke a shell
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Pipeline;
+use strict;
+
+use Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT = qw(spawn pipeline pipeline_open pipeline_pure);
+
+use Fcntl;
+
+
+# This is used to avoid END blocks and such, when exiting from
+# children that have not execed.
+use POSIX;
+sub immediate_exit { POSIX::_exit($_[0] + 0); }
+
+# The pipeline function takes a list of coderefs, which are forked off
+# as processes.  The stdout of each is connected to the stdin of the
+# next.
+
+# The coderefs will usually be 'exec' calls.  If the code does return,
+# the process will exit with the return value of that code.  That way
+# you don't have to check if the exec succeeded.
+#
+# Use an explicit exit statement if you don't want this.
+
+# The first list element may be a filename instead of a coderef, in which
+# case it will be opened as stdin for the first process.
+# The last list element may also be a filename instead of a coderef, in
+# which case it will be opened as stdout for the last process.
+
+# pipeline() returns the exit value of the last process in the pipe,
+# or 255 if the exec failed.
+
+sub pipeline {
+    my $i;
+    my $pid = fork();
+    defined $pid or return 255;
+
+    if (not $pid) {            # child
+       sysopen(STDIN, shift, O_RDONLY)
+           or fail("$$: cannot redirect input: $!")
+               unless ref($_[0]) eq "CODE";
+       sysopen(STDOUT, pop, O_WRONLY|O_CREAT|O_TRUNC)
+           or fail("$$: cannot redirect output: $!")
+               unless ref($_[$#_]) eq "CODE";
+
+       # Perhaps I should submit this to the obfuscated perl contest.
+       $i = @_ or immediate_exit 0;
+       $pid = open(STDIN, "-|") while $pid == 0 and --$i;
+       defined $pid or fail("cannot fork: $!");
+       immediate_exit int(&{$_[$i]});
+    } else {                   # parent
+       waitpid($pid, 0);
+       return $?;
+    }
+}
+
+# pipeline_open is just like pipeline, except that it takes a filehandle
+# as its first argument, and cannot take both an input filename and
+# an output filename.  It connects the filehandle to stdout of the
+# last process if no output filename is given, and connects it to
+# stdin of the first process otherwise.  (Be sure to handle SIGPIPE
+# if you do the latter).
+# pipeline_open() returns the pid of the child process, or undef if it failed.
+
+sub pipeline_open (*@) {
+    my ($i, $pid);
+    if (ref($_[$#_]) eq "CODE") {
+       $pid = open(shift, "-|");
+    } else {
+       $pid = open(shift, "|-");
+    }
+    defined $pid or return undef;
+
+    if (not $pid) {            # child
+       sysopen(STDIN, shift, O_RDONLY)
+           or fail("$$: cannot redirect input: $!")
+               unless ref($_[0]) eq "CODE";
+       sysopen(STDOUT, pop, O_WRONLY|O_CREAT|O_TRUNC)
+           or fail("$$: cannot redirect output: $!")
+               unless ref($_[$#_]) eq "CODE";
+
+       $i = @_ or immediate_exit 0;
+       $pid = open(STDIN, "-|") while $pid == 0 and --$i;
+       defined $pid or fail("cannot fork: $!");
+       immediate_exit int(&{$_[$i]});
+    }
+    # parent does nothing
+    return $pid;
+}
+
+# Fork off a single process that immediately execs.  It has a simpler
+# calling syntax than pipeline() with only one argument.
+
+# It returns the exit code of the execed process, or 255 if the
+# fork or exec failed.
+
+sub spawn {
+    my $pid = fork();
+    defined $pid or return 255;
+
+    if (not $pid) {            # child
+       exec @_ or immediate_exit 255;
+    } else {
+       waitpid($pid, 0);
+       return $?;
+    }
+}
+
+# This is just an experiment to see if the loop alone is useful.
+# It looks like it isn't.
+#sub pipeline_pure {
+#    my $pid = 0;
+#    my $i = @_ or return;
+#    $pid = open(STDIN, "-|") while $pid == 0 and --$i;
+#    defined $pid or fail("cannot fork: $!");
+#    &{$_[$i]};
+#    close(STDIN) or fail("child process failed: $?") if $pid;
+#    immediate_exit 0 unless $i == $#_;
+#}
+
+1;
diff --git a/nokia-lintian/lib/Read_pkglists.pm b/nokia-lintian/lib/Read_pkglists.pm
new file mode 100644 (file)
index 0000000..f0f982f
--- /dev/null
@@ -0,0 +1,199 @@
+# Hey emacs! This is a -*- Perl -*- script!
+# Read_pkglists -- Perl utility functions to read Lintian's package lists
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Util;
+
+use vars qw($BINLIST_FORMAT $SRCLIST_FORMAT $UDEBLIST_FORMAT %source_info %binary_info %udeb_info %bin_src_ref);
+
+# these banner lines have to be changed with every incompatible change of the
+# binary and source list file formats
+$BINLIST_FORMAT = "Lintian's list of binary packages in the archive--V2";
+$SRCLIST_FORMAT = "Lintian's list of source packages in the archive--V3";
+$UDEBLIST_FORMAT = "Lintian's list of udeb packages in the archive--V1";
+
+%source_info = ();
+%binary_info = ();
+%udeb_info = ();
+%bin_src_ref = ();
+
+sub read_src_list {
+  my ($src_list,$quiet) = @_;
+  my $LINTIAN_LAB = $ENV{'LINTIAN_LAB'};
+
+  if (%source_info) {
+    warn "\%source_info exists, nothing to do in read_src_list\n" unless $quiet;
+    return;
+  }
+
+  $src_list or ($src_list = "$LINTIAN_LAB/info/source-packages");
+  return unless -s $src_list;
+
+  open(IN, '<', $src_list) or fail("cannot open source list file $src_list: $!");
+
+  # compatible file format?
+  my $f;
+  chop($f = <IN>);
+  if ($f ne $SRCLIST_FORMAT) {
+    close(IN);
+    return 0 if $quiet;
+    fail("the source list file $src_list has an incompatible file format (run lintian --setup-lab)");
+  }
+
+  # compatible format, so read file
+  while (<IN>) {
+    chop;
+    next if /^\s*$/o;
+    my ($src,$ver,$maint,$uploaders,$arch,$std,$bin,$files,$file,$timestamp) = split(/\;/,$_);
+
+    my $src_struct;
+    %$src_struct =
+      (
+       'source' => $src,
+       'version' => $ver,
+       'maintainer' => $maint,
+       'uploaders' => $uploaders,
+       'architecture' => $arch,
+       'standards-version' => $std,
+       'binary' => $bin,
+       'files' => $files,
+       'file' => $file,
+       'timestamp' => $timestamp,
+       );
+
+    $source_info{$src} = $src_struct;
+  }
+
+  close(IN);
+}
+
+sub read_bin_list {
+  my ($bin_list,$quiet) = @_;
+  my $LINTIAN_LAB = $ENV{'LINTIAN_LAB'};
+
+  if (%binary_info) {
+    warn "\%binary_info exists, nothing to do in read_bin_list\n" unless $quiet;
+    return;
+  }
+
+  $bin_list or ($bin_list = "$LINTIAN_LAB/info/binary-packages");
+  return unless -s $bin_list;
+
+  open(IN, '<', $bin_list) or fail("cannot open binary list file $bin_list: $!");
+
+  # compatible file format?
+  my $f;
+  chop($f = <IN>);
+  if ($f ne $BINLIST_FORMAT) {
+    close(IN);
+    return 0 if $quiet;
+    fail("the binary list file $bin_list has an incompatible file format (run lintian --setup-lab)");
+  }
+
+  # compatible format, so read file
+  while (<IN>) {
+    chop;
+
+    next if /^\s*$/o;
+    my ($bin,$ver,$source,$file,$timestamp) = split(/\;/o,$_);
+
+    my $bin_struct;
+    %$bin_struct =
+      (
+       'package' => $bin,
+       'version' => $ver,
+       'source' => $source,
+       'file' => $file,
+       'timestamp' => $timestamp,
+       );
+
+    $binary_info{$bin} = $bin_struct;
+  }
+
+  close(IN);
+}
+
+sub read_udeb_list {
+  my ($udeb_list,$quiet) = @_;
+  my $LINTIAN_LAB = $ENV{'LINTIAN_LAB'};
+
+  if (%udeb_info) {
+    warn "\%udeb_info exists, nothing to do in read_bin_list\n" unless $quiet;
+    return;
+  }
+
+  $udeb_list or ($udeb_list = "$LINTIAN_LAB/info/udeb-packages");
+  return unless -s $udeb_list;
+
+  open(IN, '<', $udeb_list) or fail("cannot open udeb list file $udeb_list: $!");
+
+  # compatible file format?
+  my $f;
+  chop($f = <IN>);
+  if ($f ne $UDEBLIST_FORMAT) {
+    close(IN);
+    return 0 if $quiet;
+    fail("the udeb list file $udeb_list has an incompatible file format (run lintian --setup-lab)");
+  }
+
+  # compatible format, so read file
+  while (<IN>) {
+    chop;
+
+    next if /^\s*$/o;
+    my ($udeb,$ver,$source,$file,$timestamp) = split(/\;/o,$_);
+
+    my $udeb_struct;
+    %$udeb_struct =
+      (
+       'package' => $udeb,
+       'version' => $ver,
+       'source' => $source,
+       'file' => $file,
+       'timestamp' => $timestamp,
+       );
+
+    $udeb_info{$udeb} = $udeb_struct;
+  }
+
+  close(IN);
+}
+
+
+
+sub get_bin_src_ref {
+  read_src_list();
+  for my $source (keys %source_info) {
+    for my $binary (split(/,\s+/o,$source_info{$source}->{'binary'})) {
+      $bin_src_ref{$binary} = $source;
+    }
+  }
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 2
+# End:
+# vim: syntax=perl sw=2 sts=2 ts=2 et shiftround
diff --git a/nokia-lintian/lib/Read_taginfo.pm b/nokia-lintian/lib/Read_taginfo.pm
new file mode 100644 (file)
index 0000000..cd00db9
--- /dev/null
@@ -0,0 +1,122 @@
+# Hey emacs! This is a -*- Perl -*- script!
+# Read_taginfo -- Perl utility function to read Lintian's tag information
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'} || '/usr/share/lintian';
+my $debug = $ENV{'LINTIAN_DEBUG'} || 0;
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Util;
+use Text_utils;
+use Manual_refs;
+use vars qw(%url); # from the above
+
+use strict;
+
+# define hash for manuals
+my %manual = (
+             'policy' => 'Policy Manual',
+             'devref' => 'Developers Reference',
+             'fhs' => 'FHS',
+            );
+
+srand;
+
+# load information about checker scripts
+sub read_tag_info {
+    my ($type) = @_;
+
+    my $dtml_convert;
+    my %tag_info;
+    if (defined $type && $type eq 'html') {
+       $dtml_convert = \&dtml_to_html;
+    } else {
+       $dtml_convert = \&dtml_to_text;
+    }
+
+ #   $debug = 2;
+    for my $f (<$LINTIAN_ROOT/checks/*.desc>) {
+       print "N: Reading checker description file $f ...\n" if $debug >= 2;
+
+       my @secs = read_dpkg_control($f);
+       $secs[0]->{'check-script'} or fail("error in description file $f: `Check-Script:' not defined");
+
+       for (my $i=1; $i<=$#secs; $i++) {
+           (my $tag = $secs[$i]->{'tag'}) or fail("error in description file $f: section $i does not have a `Tag:'");
+
+           my @foo = split_paragraphs($secs[$i]->{'info'});
+           if ($secs[$i]->{'ref'}) {
+               push(@foo,"");
+               push(@foo,format_ref($secs[$i]->{'ref'}));
+           }
+
+           if ($secs[$i]->{'experimental'}) {
+               push(@foo,"");
+               push(@foo,"Please note that this tag is marked Experimental, which "
+                    . "means that the code that generates it is not as well tested "
+                    . "as the rest of Lintian, and might still give surprising "
+                    . "results.  Feel free to ignore Experimental tags that do not "
+                    . "seem to make sense, though of course bug reports are always "
+                    . "welcomed.");
+           }
+
+           $tag_info{$tag} = join("\n",&$dtml_convert(@foo));
+       }
+    }
+    return \%tag_info;
+}
+
+sub format_ref {
+    my ($ref) = @_;
+
+    my @foo = split(/\s*,\s*/o,$ref);
+    my $u;
+    for ($u=0; $u<=$#foo; $u++) {
+       if ($foo[$u] =~ m,^\s*(policy|devref|fhs)\s*([\d\.]+)?\s*$,oi) {
+           my ($man,$sec) = ($1,$2);
+
+           $foo[$u] = $manual{lc $man};
+
+           if ($sec =~ m,^\d+$,o) {
+               $foo[$u] .= ", chapter $sec";
+           } elsif ($sec) {
+               $foo[$u] .= ", section $sec";
+           }
+
+           if (exists $url{"$man-$sec"}) {
+               $foo[$u] = "<a href=\"$url{\"$man-$sec\"}\">$foo[$u]</a>";
+           } elsif (exists $url{$man}) {
+               $foo[$u] = "<a href=\"$url{$man}\">$foo[$u]</a>";
+           }
+       } elsif ($foo[$u] =~ m,\s*([\w_-]+\(\d+\w*\))\s*$,i) {
+           $foo[$u] = "the $foo[$u] manual page";
+       }
+    }
+       
+    if ($#foo+1 > 2) {
+       $ref = sprintf "Refer to %s, and %s for details.",join(', ',splice(@foo,0,$#foo)),@foo;
+    } elsif ($#foo+1 > 0) {
+       $ref = sprintf "Refer to %s for details.",join(' and ',@foo);
+    }
+
+    return $ref;
+}
+
+1;
diff --git a/nokia-lintian/lib/Spelling.pm b/nokia-lintian/lib/Spelling.pm
new file mode 100644 (file)
index 0000000..0b10fbe
--- /dev/null
@@ -0,0 +1,458 @@
+# -*- perl -*-
+# Spelling -- check for common spelling errors
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Spelling;
+use strict;
+use Tags;
+
+use Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT = qw(spelling_check spelling_check_picky);
+
+# All spelling errors that have been observed "in the wild" in package
+# descriptions are added here, on the grounds that if they occurred once they
+# are more likely to occur again.
+
+# Misspellings of "compatibility", "separate", and "similar" are particularly
+# common.
+
+# Be careful with corrections that involve punctuation, since the check is a
+# bit rough with punctuation.  For example, I had to delete the correction of
+# "builtin" to "built-in".
+
+our %CORRECTIONS = qw(
+                      accesnt accent
+                      accelleration acceleration
+                      accessable accessible
+                      accomodate accommodate
+                      acess access
+                      acording according
+                      additionaly additionally
+                      adress address
+                      adresses addresses
+                      adviced advised
+                      afecting affecting
+                      albumns albums
+                      alegorical allegorical
+                      algorith algorithm
+                      allpication application
+                      altough although
+                      alows allows
+                      amoung among
+                      amout amount
+                      analysator analyzer
+                      ang and
+                      appropiate appropriate
+                      arraival arrival
+                      artifical artificial
+                      artillary artillery
+                      attemps attempts
+                      authentification authentication
+                      automaticly automatically
+                      automatize automate
+                      automatized automated
+                      automatizes automates
+                      auxilliary auxiliary
+                      availavility availability
+                      availble available
+                      avaliable available
+                      availiable available
+                      backgroud background
+                      baloons balloons
+                      becomming becoming
+                      becuase because
+                      calender calendar
+                      cariage carriage
+                      challanges challenges
+                      changable changeable
+                      charachters characters
+                      charcter character
+                      choosen chosen
+                      colorfull colorful
+                      comand command
+                      commerical commercial
+                      comminucation communication
+                      commoditiy commodity
+                      compability compatibility
+                      compatability compatibility
+                      compatable compatible
+                      compatibiliy compatibility
+                      compatibilty compatibility
+                      compleatly completely
+                      complient compliant
+                      compres compress
+                      containes contains
+                      containts contains
+                      contence contents
+                      continous continuous
+                      contraints constraints
+                      convertor converter
+                      convinient convenient
+                      cryptocraphic cryptographic
+                      deamon daemon
+                      debain Debian
+                      debians Debian\'s
+                      decompres decompress
+                      definate definite
+                      definately definitely
+                      dependancies dependencies
+                      dependancy dependency
+                      dependant dependent
+                      developement development
+                      developped developed
+                      deveolpment development
+                      devided divided
+                      dictionnary dictionary
+                      diplay display
+                      disapeared disappeared
+                      dissapears disappears
+                      documentaion documentation
+                      docuentation documentation
+                      documantation documentation
+                      dont don\'t
+                      easilly easily
+                      ecspecially especially
+                      edditable editable
+                      editting editing
+                      eletronic electronic
+                      enchanced enhanced
+                      enhaced enhanced
+                      encorporating incorporating
+                      enlightnment enlightenment
+                      enterily entirely
+                      enviroiment environment
+                      environement environment
+                      excellant excellent
+                      exlcude exclude
+                      exprimental experimental
+                      extention extension
+                      failuer failure
+                      familar familiar
+                      fatser faster
+                      fetaures features
+                      forse force
+                      fortan fortran
+                      framwork framework
+                      fuction function
+                      fuctions functions
+                      functionnality functionality
+                      functonality functionality
+                      functionaly functionally
+                      futhermore furthermore
+                      generiously generously
+                      grahical graphical
+                      grahpical graphical
+                      grapic graphic
+                      guage gauge
+                      halfs halves
+                      heirarchically hierarchically
+                      helpfull helpful
+                      hierachy hierarchy
+                      hierarchie hierarchy
+                      howver however
+                      implemantation implementation
+                      incomming incoming
+                      incompatabilities incompatibilities
+                      indended intended
+                      indendation indentation
+                      independant independent
+                      informatiom information
+                      initalize initialize
+                      inofficial unofficial
+                      integreated integrated
+                      integrety integrity
+                      integrey integrity
+                      intendet intended
+                      interchangable interchangeable
+                      intermittant intermittent
+                      jave java
+                      langage language
+                      langauage language
+                      langugage language
+                      lauch launch
+                      lesstiff lesstif
+                      libaries libraries
+                      libary library
+                      licenceing licencing
+                      loggin login
+                      logile logfile
+                      loggging logging
+                      maintainance maintenance
+                      maintainence maintenance
+                      makeing making
+                      managable manageable
+                      manoeuvering maneuvering
+                      mathimatic mathematic
+                      mathimatics mathematics
+                      mathimatical mathematical
+                      ment meant
+                      modulues modules
+                      monochromo monochrome
+                      multidimensionnal multidimensional
+                      navagating navigating
+                      nead need
+                      neccesary necessary
+                      neccessary necessary
+                      necesary necessary
+                      nescessary necessary
+                      noticable noticeable
+                      o\'caml OCaml
+                      optionnal optional
+                      orientatied orientated
+                      orientied oriented
+                      pacakge package
+                      pachage package
+                      packacge package
+                      packege package
+                      packge package
+                      pakage package
+                      particularily particularly
+                      persistant persistent
+                      plattform platform
+                      ploting plotting
+                      protable portable
+                      posible possible
+                      postgressql PostgreSQL
+                      powerfull powerful
+                      prefered preferred
+                      prefferably preferably
+                      prepaired prepared
+                      princliple principle
+                      priorty priority
+                      proccesors processors
+                      proces process
+                      processsing processing
+                      processessing processing
+                      progams programs
+                      programers programmers
+                      programm program
+                      programms programs
+                      promps prompts
+                      pronnounced pronounced
+                      prononciation pronunciation
+                      pronouce pronounce
+                      protcol protocol
+                      protocoll protocol
+                      recieve receive
+                      recieved received
+                      redircet redirect
+                      refence reference
+                      regulamentations regulations
+                      remoote remote
+                      repectively respectively
+                      replacments replacements
+                      requiere require
+                      runnning running
+                      safly safely
+                      savable saveable
+                      searchs searches
+                      separatly separately
+                      seperate separate
+                      seperated separated
+                      seperately separately
+                      seperatly separately
+                      serveral several
+                      setts sets
+                      similiar similar
+                      simliar similar
+                      speach speech
+                      speling spelling
+                      splitted split
+                      standart standard
+                      staically statically
+                      staticly statically
+                      succesful successful
+                      succesfully successfully
+                      suplied supplied
+                      suport support
+                      suppport support
+                      supportin supporting
+                      synax syntax
+                      synchonized synchronized
+                      syncronize synchronize
+                      syncronizing synchronizing
+                      syncronus synchronous
+                      syste system
+                      sythesis synthesis
+                      taht that
+                      throught through
+                      useable usable
+                      usefull useful
+                      usera users
+                      usetnet Usenet
+                      utilites utilities
+                      utillities utilities
+                      utilties utilities
+                      utiltity utility
+                      utitlty utility
+                      variantions variations
+                      varient variant
+                      verson version
+                      vicefersa vice-versa
+                      yur your
+                      wheter whether
+                      wierd weird
+                      xwindows X
+                     );
+
+# The format above doesn't allow spaces.
+$CORRECTIONS{'alot'} = 'a lot';
+
+# Picky corrections, applied before lowercasing the word.  These are only
+# applied to things known to be entirely English text, such as package
+# descriptions, and should not be applied to files that may contain
+# configuration fragments or more informal files such as debian/copyright.
+our %CORRECTIONS_CASE = qw(
+                           D-BUS D-Bus
+                           d-bus D-Bus
+                           dbus D-Bus
+                           debian Debian
+                           english English
+                           french French
+                           EMacs Emacs
+                           Gconf GConf
+                           gconf GConf
+                           german German
+                           Gnome GNOME
+                           gnome GNOME
+                           Gnome-VFS GnomeVFS
+                           Gnome-Vfs GnomeVFS
+                           GnomeVfs GnomeVFS
+                           gnome-vfs GnomeVFS
+                           gnomevfs GnomeVFS
+                           Gobject GObject
+                           gobject GObject
+                           Gstreamer GStreamer
+                           gstreamer GStreamer
+                           GTK GTK+
+                           gtk+ GTK+
+                           kde KDE
+                           meta-package metapackage
+                           MYSQL MySQL
+                           Mysql MySQL
+                           mysql MySQL
+                           linux Linux
+                           Latex LaTeX
+                           latex LaTeX
+                           OCAML OCaml
+                           Ocaml OCaml
+                           ocaml OCaml
+                           OpenLdap OpenLDAP
+                           Openldap OpenLDAP
+                           openldap OpenLDAP
+                           Postgresql PostgreSQL
+                           postgresql PostgreSQL
+                           python Python
+                           russian Russian
+                           SkoleLinux Skolelinux
+                           skolelinux Skolelinux
+                           SLang S-Lang
+                           S-lang S-Lang
+                           s-lang S-Lang
+                           TCL Tcl
+                           tcl Tcl
+                           TEX TeX
+                           Tex TeX
+                           TeTeX teTeX
+                           Tetex teTeX
+                           tetex teTeX
+                           TK Tk
+                           tk Tk
+                           Xemacs XEmacs
+                           XEMacs XEmacs
+                           XFCE Xfce
+                           XFce Xfce
+                           xfce Xfce
+                          );
+
+# The format above doesn't allow spaces.
+$CORRECTIONS_CASE{'Debian-Edu'} = 'Debian Edu';
+$CORRECTIONS_CASE{'debian-edu'} = 'Debian Edu';
+$CORRECTIONS_CASE{'TeXLive'} = 'TeX Live';
+$CORRECTIONS_CASE{'TeX-Live'} = 'TeX Live';
+$CORRECTIONS_CASE{'TeXlive'} = 'TeX Live';
+$CORRECTIONS_CASE{'TeX-live'} = 'TeX Live';
+$CORRECTIONS_CASE{'texlive'} = 'TeX Live';
+$CORRECTIONS_CASE{'tex-live'} = 'TeX Live';
+
+# -----------------------------------
+
+sub _tag {
+    my @args = grep { defined($_) } @_;
+    tag(@args);
+}
+
+# Check spelling of $text and report the tag $tag if we find anything.
+# $filename, if included, is given as the first argument to the tag.  If it's
+# not defined, it will be omitted.
+sub spelling_check {
+    my ($tag, $text, $filename) = @_;
+    return unless $text;
+
+    for my $word (split(/\s+/, $text)) {
+        $word = lc $word;
+
+        # Try deleting the non-alphabetic parts from the word.  Treat
+        # apostrophes specially: only delete them if they occur at the
+        # beginning or end of the word.
+        #
+        # FIXME: Should do something that's aware of Unicode character
+        # classes rather than only handling ISO 8859-15 characters.
+        $word =~ s/(^\')|[^\w\xc0-\xd6\xd8-\xf6\xf8-\xff\'-]+|(\'\z)//g;
+        if (exists $CORRECTIONS{$word}) {
+            _tag($tag, $filename, $word, $CORRECTIONS{$word});
+        }
+    }
+
+    # Special case for correcting a multi-word string.
+    if ($text =~ m,Debian/GNU\s+Linux,) {
+        _tag($tag, $filename, "Debian/GNU Linux", "Debian GNU/Linux");
+    }
+}
+
+# Check spelling of $text against pickier corrections, such as common
+# capitalization mistakes.  This check is separate from spelling_check since
+# it isn't appropriate for some files (such as changelog).  Takes $text to
+# check spelling in and $tag to report if we find anything.  $filename, if
+# included, is given as the first argument to the tag.  If it's not defined,
+# it will be omitted.
+sub spelling_check_picky {
+    my ($tag, $text, $filename) = @_;
+
+    for my $word (split(/\s+/, $text)) {
+        $word =~ s/^\(|[).,?!:;]+$//g;
+        if (exists $CORRECTIONS_CASE{$word}) {
+            _tag($tag, $filename, $word, $CORRECTIONS_CASE{$word});
+            next;
+        }
+    }
+    if ($text =~ m,meta\s+package,) {
+        _tag($tag, $filename, "meta package", "metapackage");
+    }
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/lib/Tags.pm b/nokia-lintian/lib/Tags.pm
new file mode 100644 (file)
index 0000000..b34ab8b
--- /dev/null
@@ -0,0 +1,366 @@
+# Tags -- Perl tags functions for lintian
+# $Id$
+
+# Copyright (C) 1998-2004 Various authors
+# Copyright (C) 2005 Frank Lichtenheld <frank@lichtenheld.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Tags;
+use strict;
+use warnings;
+
+use Exporter;
+our @ISA    = qw(Exporter);
+our @EXPORT = qw(tag);
+
+# support for ANSI color output via colored()
+use Term::ANSIColor;
+
+# Quiet "Name "main::LINTIAN_ROOT" used only once"
+# The variables comes from 'lintian'
+() = ($main::verbose, $main::debug);
+
+# configuration variables and defaults
+our $verbose = $::verbose;
+our $debug = $::debug;
+our $show_info = 0;
+our $show_experimental = 0;
+our $show_overrides = 0;
+our $output_formatter = \&print_tag;
+our $min_severity = 1;
+our $max_severity = 99;
+our $min_significance = 1;
+our $max_significance = 99;
+our $color = 'never';
+
+# The master hash with all tag info. Key is the tag name, value another hash
+# with the following keys:
+# - tag: short name
+# - type: error/warning/info/experimental
+# - info: Description in HTML
+# - ref: Any references
+# - experimental: experimental status (possibly undef)
+my %tags;
+
+# Statistics per file. Key is the filename, value another hash with the
+# following keys:
+# - overrides
+# - tags
+# - severity
+# - significance
+my %stats;
+
+# Info about a specific file. Key is the the filename, value another hash
+# with the following keys:
+# - pkg: package name
+# - version: package version
+# - arch: package architecture
+# - type: one of 'binary', 'udeb' or 'source'
+# - overrides: hash with all overrides for this file as keys
+my %info;
+
+# Currently selected file (not package!)
+my $current;
+
+# Compatibility stuff
+my %codes = ( 'error' => 'E' , 'warning' => 'W' , 'info' => 'I' );
+our %type_to_sev = ( error => 4, warning => 2, info => 0 );
+our @sev_to_type = qw( info warning warning error error );
+
+my @sig_to_qualifier = ( '??', '?', '', '!' );
+my @sev_to_code = qw( I W W E E );
+my @sev_to_color = ( 'cyan', 'yellow', 'yellow', 'red', 'red' );
+
+# Add a new tag, supplied as a hash reference
+sub add_tag {
+       my $newtag = shift;
+       if (exists $tags{$newtag->{tag}}) {
+           warn "Duplicate tag: $newtag->{tag}\n";
+           return 0;
+       }
+
+       # smooth transition
+       $newtag->{type} = $sev_to_type[$newtag->{severity}]
+           unless $newtag->{type};
+       $newtag->{significance} = 2 unless exists $newtag->{significance};
+       $newtag->{severity} = $type_to_sev{$newtag->{type}}
+           unless exists $newtag->{severity};
+       $tags{$newtag->{'tag'}} = $newtag;
+       return 1;
+}
+
+# Add another file, will fail if there is already stored info about
+# the file
+sub set_pkg {
+    my ( $file, $pkg, $version, $arch, $type ) = @_;
+
+    if (exists $info{$file}) {
+       warn "File $file was already processed earlier\n";
+       return 0;
+    }
+
+    $current = $file;
+    $info{$file} = {
+       pkg => $pkg,
+       version => $version,
+       arch => $arch,
+       type => $type,
+       overrides => {},
+    };
+    $stats{$file} = {
+       severity => {},
+       significance => {},
+       tags => {},
+       overrides => {},
+    };
+
+    return 1;
+}
+
+# select another file as 'current' without deleting or adding any information
+# the file must have been added with add_pkg
+sub select_pkg {
+    my ( $file ) = @_;
+
+    unless (exists $info{$file}) {
+       warn "Can't select package $file";
+       return 0;
+    }
+
+    $current = $file;
+    return 1;
+}
+
+# only delete the value of 'current' without deleting any stored information
+sub reset_pkg {
+    undef $current;
+    return 1;
+}
+
+# delete all the stored information (including tags)
+sub reset {
+    undef %stats;
+    undef %info;
+    undef %tags;
+    undef $current;
+    return 1;
+}
+
+# Add an override. If you specifiy two arguments, the first will be taken
+# as file to add the override to, otherwise 'current' will be assumed
+sub add_override {
+    my ($tag, $file) = ( "", "" );
+    if (@_ > 1) {
+       ($file, $tag) = @_;
+    } else {
+       ($file, $tag) = ($current, @_);
+    }
+
+    unless ($file) {
+       warn "Don't know which package to add override $tag to";
+       return 0;
+    }
+
+    $info{$file}{overrides}{$tag} = 0;
+
+    return 1;
+}
+
+sub get_overrides {
+    my ($file) = @_;
+
+    unless ($file) {
+       warn "Don't know which package to get overrides from";
+       return undef;
+    }
+
+    return $info{$file}{overrides};
+}
+
+# Get the info hash for a tag back as a reference. The hash will be
+# copied first so that you can edit it safely
+sub get_tag_info {
+    my ( $tag ) = @_;
+    return { %{$tags{$tag}} } if exists $tags{$tag};
+    return undef;
+}
+
+sub check_range {
+    my ( $x, $min, $max ) = @_;
+
+    return -1 if $x < $min;
+    return 1 if $x > $max;
+    return 0;
+}
+
+# check if a certain tag has a override for the 'current' package
+sub check_overrides {
+    my ( $tag_info, $information ) = @_;
+
+    my $extra = '';
+    $extra = " @$information" if @$information;
+    $extra = '' if $extra eq ' ';
+    if( exists $info{$current}{overrides}{$tag_info->{tag}}) {
+       $info{$current}{overrides}{$tag_info->{tag}}++;
+       return $tag_info->{tag};
+    } elsif( exists $info{$current}{overrides}{"$tag_info->{tag}$extra"} ) {
+       $info{$current}{overrides}{"$tag_info->{tag}$extra"}++;
+       return "$tag_info->{tag}$extra";
+    }
+
+    return '';
+}
+
+# sets all the overridden fields of a tag_info hash correctly
+sub check_need_to_show {
+    my ( $tag_info, $information ) = @_;
+    $tag_info->{overridden}{override} = check_overrides( $tag_info,
+                                                        $information );
+    my $min_sev = $show_info ? 0 : $min_severity; # compat hack
+    $tag_info->{overridden}{severity} = check_range( $tag_info->{severity},
+                                                    $min_sev,
+                                                    $max_severity );
+    $tag_info->{overridden}{significance} = check_range( $tag_info->{significance},
+                                                        $min_significance,
+                                                        $max_significance );
+}
+
+# records the stats for a given tag_info hash
+sub record_stats {
+    my ( $tag_info ) = @_;
+
+    for my $k (qw( severity significance tag )) {
+       $stats{$current}{$k}{$tag_info->{$k}}++
+           unless $tag_info->{overridden}{override}
+               || $tag_info->{overridden}{severity}
+               || $tag_info->{overridden}{significance};
+    }
+    for my $k (qw( severity significance override )) {
+       $stats{$current}{overrides}{$k}{$tag_info->{overridden}{$k}}++
+           if $tag_info->{overridden}{$k};
+    }
+    if ($tag_info->{overridden}{override}) {
+        $stats{$current}{overrides}{by_severity}{$tag_info->{severity}}++;
+    }
+}
+
+# get the statistics for a file (one argument) or for all files (no argument)
+sub get_stats {
+    my ( $file ) = @_;
+
+    return $stats{$file} if $file;
+    return \%stats;
+}
+
+# Color tags with HTML.  Takes the tag and the color name.
+sub colored_html {
+    my ($tag, $color) = @_;
+    return qq(<span style="color: $color">$tag</span>);
+}
+
+sub print_tag {
+    my ( $pkg_info, $tag_info, $information ) = @_;
+
+    my $extra = '';
+    $extra = " @$information" if @$information;
+    $extra = '' if $extra eq ' ';
+    my $code = $codes{$tag_info->{type}};
+    my $severity = $type_to_sev{$tag_info->{type}};
+    $code = 'X' if exists $tag_info->{experimental};
+    $code = 'O' if $tag_info->{overridden}{override};
+    my $type = '';
+    $type = " $pkg_info->{type}" if $pkg_info->{type} ne 'binary';
+
+    my $output = "$code: $pkg_info->{pkg}$type: ";
+    if ($color eq 'always' || ($color eq 'auto' && -t STDOUT)) {
+        $output .= colored($tag_info->{tag}, $sev_to_color[$severity]);
+    } elsif ($color eq 'html') {
+        $output .= colored_html($tag_info->{tag}, $sev_to_color[$severity]);
+    } else {
+        $output .= $tag_info->{tag};
+    }
+    $output .= "$extra\n";
+
+    print $output;
+}
+
+sub print_tag_new {
+    my ( $pkg_info, $tag_info, $information ) = @_;
+
+    my $extra = '';
+    $extra = " @$information" if @$information;
+    $extra = '' if $extra eq ' ';
+    my $code = $sev_to_code[$tag_info->{severity}];
+    $code = 'X' if exists $tag_info->{experimental};
+    $code = 'O' if $tag_info->{overridden}{override};
+    my $qualifier = $sig_to_qualifier[$tag_info->{significance}];
+    $qualifier = '' if $code eq 'O';
+    my $type = '';
+    $type = " $pkg_info->{type}" if $pkg_info->{type} ne 'binary';
+
+    my $output = "$code$qualifier: $pkg_info->{pkg}$type: ";
+    if ($color eq 'always' || ($color eq 'auto' && -t STDOUT)) {
+        $output .= colored($tag_info->{tag}, $sev_to_color[$tag_info->{severity}]);
+    } else {
+        $output .= $tag_info->{tag};
+    }
+    $output .= "$extra\n";
+
+    print $output;
+
+}
+
+sub tag {
+    my ( $tag, @information ) = @_;
+    unless ($current) {
+       warn "Tried to issue tag $tag without setting package\n";
+       return 0;
+    }
+
+    # Newlines in @information would cause problems, so replace them with \n.
+    @information = map { s,\n,\\n,; $_ } @information;
+
+    my $tag_info = get_tag_info( $tag );
+    unless ($tag_info) {
+       warn "Tried to issue unknown tag $tag\n";
+       return 0;
+    }
+    check_need_to_show( $tag_info, \@information );
+
+    record_stats( $tag_info );
+
+    return 0 if
+       exists $tag_info->{experimental} and !$show_experimental;
+
+    return 1 if
+       $tag_info->{overridden}{severity} != 0
+       || $tag_info->{overridden}{significance} != 0
+       || ( $tag_info->{overridden}{override} &&
+            !$show_overrides);
+
+    &$output_formatter( $info{$current}, $tag_info, \@information );
+    return 1;
+}
+
+1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: ts=4 sw=4 noet
diff --git a/nokia-lintian/lib/Tags/ColonSeparated.pm b/nokia-lintian/lib/Tags/ColonSeparated.pm
new file mode 100644 (file)
index 0000000..b9088dc
--- /dev/null
@@ -0,0 +1,55 @@
+# Tags::ColonSeparated -- Perl tags functions for lintian
+# $Id: Tags.pm 489 2005-09-17 00:06:30Z djpig $
+
+# Copyright (C) 2005 Frank Lichtenheld <frank@lichtenheld.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Tags::ColonSeparated;
+use strict;
+use warnings;
+
+sub quote_char {
+    my ( $char, @items ) = @_;
+
+    foreach (@items) {
+       s/\\/\\\\/go;
+       s/\Q$char\E/\\$char/go;
+    }
+
+    return @items;
+}
+
+sub print_tag {
+    my ( $pkg_info, $tag_info, $information ) = @_;
+
+    my $extra = "@$information";
+
+    print join(':', quote_char( ':',
+                               $tag_info->{severity},
+                               $tag_info->{significance},
+                               @{$tag_info->{overridden}}{'override',
+                                                          'severity',
+                                                          'significance'},
+                               @{$pkg_info}{'pkg','version','arch','type'},
+                               $tag_info->{tag},
+                               $extra,
+                               ))."\n";
+}
+
+1;
+
diff --git a/nokia-lintian/lib/Text_utils.pm b/nokia-lintian/lib/Text_utils.pm
new file mode 100644 (file)
index 0000000..56ea7b4
--- /dev/null
@@ -0,0 +1,206 @@
+# Hey emacs! This is a -*- Perl -*- script!
+# Text_utils -- Perl utility functions for lintian
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+# requires wrap() function
+use Text::Wrap;
+
+# html_wrap -- word-wrap a paragaph.  The wrap() function from Text::Wrap
+# is not suitable, because it chops words that are longer than the line
+# length.
+sub html_wrap {
+    my ($lead, @text) = @_;
+    my @words = split(' ', join(' ', @text));
+    # subtract 1 to compensate for the lack of a space before the first word.
+    my $ll = length($lead) - 1;
+    my $cnt = 0;
+    my $r = "";
+
+    while ($cnt <= $#words) {
+       if ($ll + 1 + length($words[$cnt]) > 76) {
+           if ($cnt == 0) {
+               # We're at the start of a line, and word still does not
+               # fit.  Don't wrap it.
+               $r .= $lead . shift(@words) . "\n";
+           } else {
+               # start new line
+               $r .= $lead . join(' ', splice(@words, 0, $cnt)) . "\n";
+               $ll = length($lead) - 1;
+               $cnt = 0;
+           }
+       } else {
+           $ll += 1 + length($words[$cnt]);
+           $cnt++;
+       }
+    }
+
+    if ($#words >= 0) {
+       # finish last line
+       $r .= $lead . join(' ', @words) . "\n";
+    }
+
+    return $r;
+}
+
+# split_paragraphs -- splits a bunch of text lines into paragraphs.
+# This function returns a list of paragraphs.
+# Paragraphs are separated by empty lines. Each empty line is a
+# paragraph. Furthermore, indented lines are considered a paragraph.
+sub split_paragraphs {
+    return "" unless (@_);
+
+    my $t = join("\n",@_);
+
+    my ($l,@o);
+    while ($t) {
+       $t =~ s/^\.\n/\n/o;
+       # starts with space or empty line?
+       if (($t =~ s/^([ \t][^\n]*)\n?//o) or ($t =~ s/^()\n//o)) {
+           #FLUSH;
+           if ($l) {
+               $l =~ s/\s+/ /go;
+               $l =~ s/^\s+//o;
+               $l =~ s/\s+$//o;
+               push(@o,$l);
+               undef $l;
+           }
+           #
+           push(@o,$1);
+       }
+       # normal line?
+       elsif ($t =~ s/^([^\n]*)\n?//o) {
+           $l .= "$1 ";
+       }
+       # what else can happen?
+       else {
+           fail("internal error in wrap");
+       }
+    }
+    #FLUSH;
+    if ($l) {
+       $l =~ s/\s+/ /go;
+       $l =~ s/^\s+//o;
+       $l =~ s/\s+$//o;
+       push(@o,$l);
+       undef $l;
+    }
+    #
+
+    return @o;
+}
+
+sub dtml_to_html {
+    my @o;
+
+    my $pre=0;
+    for $_ (@_) {
+       s,\&maint\;,<a href=\"mailto:lintian-maint\@debian.org\">Lintian maintainer</a>,o; # "
+       s,\&debdev\;,<a href=\"mailto:debian-devel\@lists.debian.org\">debian-devel</a>,o; # "
+
+       # empty line?
+       if (/^\s*$/o) {
+           if ($pre) {
+               push(@o,"\n");
+           }
+       }
+       # preformatted line?
+       elsif (/^\s/o) {
+           if (not $pre) {
+               push(@o,"<pre>");
+               $pre=1;
+           }
+           push(@o,"$_");
+       }
+       # normal line
+       else {
+           if ($pre) {
+               push(@o,"</pre>");
+               $pre=0;
+           }
+           push(@o,"<p>$_\n");
+       }
+    }
+    if ($pre) {
+       push(@o,"</pre>");
+       $pre=0;
+    }
+
+    return @o;
+}
+
+sub dtml_to_text {
+    for $_ (@_) {
+       # substitute Lintian &tags;
+       s,&maint;,lintian-maint\@debian.org,go;
+       s,&debdev;,debian-devel\@lists.debian.org,go;
+
+       # substitute HTML <tags>
+       s,<i>,&lt;,go;
+       s,</i>,&gt;,go;
+       s,<[^>]+>,,go;
+
+       # substitute HTML &tags;
+       s,&lt;,<,go;
+       s,&gt;,>,go;
+       s,&amp;,\&,go;
+
+       # preformatted?
+       if (not /^\s/o) {
+           # no.
+
+           s,\s\s+, ,go;
+           s,^ ,,o;
+           s, $,,o;
+       }
+    }
+
+    return @_;
+}
+
+# wrap_paragraphs -- wrap paragraphs in dpkg/dselect style.
+# indented lines are not wrapped but displayed "as is"
+sub wrap_paragraphs {
+    my $lead = shift;
+    my $html = 0;
+
+    if ($lead eq 'HTML') {
+       $html = 1;
+       $lead = shift;
+    }
+
+    my $o;
+    for my $t (split_paragraphs(@_)) {
+       # empty or indented line?
+       if ($t =~ /^$/ or $t =~ /^\s/) {
+           $o .= "$lead$t\n";
+       } else {
+           if ($html) {
+               $o .= html_wrap($lead, "$t\n");
+           } else {
+               $o .= wrap($lead, $lead, "$t\n");
+           }
+       }
+    }
+    return $o;
+}
+
+1;
diff --git a/nokia-lintian/lib/Util.pm b/nokia-lintian/lib/Util.pm
new file mode 100644 (file)
index 0000000..225b59d
--- /dev/null
@@ -0,0 +1,278 @@
+# Hey emacs! This is a -*- Perl -*- script!
+# Util -- Perl utility functions for lintian
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Util;
+use strict;
+
+use Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT = qw(parse_dpkg_control
+       read_dpkg_control
+       get_deb_info
+       get_dsc_info
+       slurp_entire_file
+       get_file_checksum
+       file_is_encoded_in_non_utf8
+       fail
+       system_env
+       perm2oct);
+
+use FileHandle;
+use Pipeline;
+use Digest::MD5;
+
+# general function to read dpkg control files
+# this function can parse output of `dpkg-deb -f', .dsc,
+# and .changes files (and probably all similar formats)
+# arguments:
+#    $filehandle 
+#    $debconf_flag (true if the file is a debconf template file)
+# output:
+#    list of hashes
+#    (a hash contains one sections,
+#    keys in hash are lower case letters of control fields)
+sub parse_dpkg_control {
+    my ($CONTROL, $debconf_flag) = @_;
+
+    my @data;
+    my $cur_section = 0;
+    my $open_section = 0;
+    my $last_tag;
+
+    while (<$CONTROL>) {
+       chomp;
+
+       # tabs at the beginning are illegal, but handle them anyways
+       s/^\t/ \t/o;
+       next if /^#/; #comment line?
+
+       # empty line?
+       if ((!$debconf_flag && m/^\s*$/) or 
+           ($debconf_flag && m/^$/)) {
+           if ($open_section) { # end of current section
+               $cur_section++;
+               $open_section = 0;
+           }
+       }
+       # pgp sig?
+       elsif (m/^-----BEGIN PGP SIGNATURE/) { # skip until end of signature
+           while (<$CONTROL>) {
+               last if m/^-----END PGP SIGNATURE/o;
+           }
+       }
+       # other pgp control?
+       elsif (m/^-----BEGIN PGP/) { # skip until the next blank line
+           while (<$CONTROL>) {
+               last if /^\s*$/o;
+           }
+       }
+       # new empty field?
+       elsif (m/^(\S+):\s*$/o) {
+           $open_section = 1;
+
+           my ($tag) = (lc $1);
+           $data[$cur_section]->{$tag} = '';
+
+           $last_tag = $tag;
+       }
+       # new field?
+       elsif (m/^(\S+):\s*(.*)$/o) {
+           $open_section = 1;
+
+           my ($tag,$value) = (lc $1,$2);
+           $data[$cur_section]->{$tag} = $value;
+
+           $last_tag = $tag;
+       }
+       # continued field?
+       elsif (m/^ (.*)$/o) {
+           $open_section or fail("syntax error in section $cur_section after the tag $last_tag: $_");
+
+           $data[$cur_section]->{$last_tag} .= "\n".$1;
+       }
+    }
+
+    return @data;
+}
+
+sub read_dpkg_control {
+    my ($file, $debconf_flag) = @_;
+
+    if (not _ensure_file_is_sane($file)) {
+       return undef;
+    }
+
+    my $CONTROL = FileHandle->new;
+    open($CONTROL, '<', $file)
+       or fail("cannot open control file $file for reading: $!");
+    my @data = parse_dpkg_control($CONTROL, $debconf_flag);
+    close($CONTROL)
+       or fail("pipe for control file $file exited with status: $?");
+    return @data;
+}
+
+sub get_deb_info {
+    my ($file) = @_;
+
+    if (not _ensure_file_is_sane($file)) {
+       return undef;
+    }
+
+    # `dpkg-deb -f $file' is very slow. Instead, we use ar and tar.
+    my $CONTROL = FileHandle->new;
+    pipeline_open($CONTROL,
+                 (sub { exec 'ar', 'p', $file, 'control.tar.gz' }),
+                 (sub { exec 'tar', '--wildcards', '-xzO', '-f', '-', '*control' }))
+       or fail("cannot fork to unpack $file: $!\n");
+    my @data = parse_dpkg_control($CONTROL);
+    close($CONTROL) or fail("broken input pipe for unpacking $file: $!");
+    return $data[0];
+}
+
+sub get_dsc_info {
+    my ($file) = @_;
+
+    if (not _ensure_file_is_sane($file)) {
+       return undef;
+    }
+
+    my @data = read_dpkg_control($file);
+    return $data[0];
+}
+
+sub _ensure_file_is_sane {
+    my ($file) = @_;
+
+    # if file exists and is not 0 bytes
+    if (-f $file and -s $file) {
+       return 1;
+    }
+    return 0;
+}
+
+sub slurp_entire_file {
+    my $file = shift;
+    open(C, '<', $file)
+       or fail("cannot open file $file for reading: $!");
+    my $save = $/;
+    undef $/;
+    local $_ = <C>;
+    $/ = $save;
+    close(C);
+    return $_;
+}
+
+sub get_file_checksum {
+       my ($alg, $file) = @_;
+       open (FILE, '<', $file) or fail("Couldn't open $file");
+       my $digest;
+       if ($alg eq 'md5') {
+           $digest = Digest::MD5->new;
+       } elsif ($alg =~ /sha(\d+)/) {
+           require Digest::SHA;
+           $digest = Digest::SHA->new($1);
+       }
+       $digest->addfile(*FILE);
+       close FILE or fail("Couldn't close $file");
+       return $digest->hexdigest;
+}
+
+sub file_is_encoded_in_non_utf8 {
+       my ($file, $type, $pkg) = @_;
+       my $non_utf8 = 0;
+
+       open (ICONV, '-|', "env LANG=C iconv -f utf8 -t utf8 $file 2>&1")
+           or fail("failure while checking encoding of $file for $type package $pkg");
+       my $line = 1;
+       while (<ICONV>) {
+               if (m/iconv: illegal input sequence at position \d+$/) {
+                       $non_utf8 = 1;
+                       last;
+               }
+               $line++
+       }
+       close ICONV;
+
+       return $line if $non_utf8;
+       return 0;
+}
+
+# Just like system, except cleanses the environment first to avoid any strange
+# side effects due to the user's environment.
+sub system_env {
+    my @whitelist = qw(PATH INTLTOOL_EXTRACT);
+    my %newenv = map { exists $ENV{$_} ? ($_ => $ENV{$_}) : () } @whitelist;
+    my $pid = fork;
+    if (not defined $pid) {
+       return -1;
+    } elsif ($pid == 0) {
+       %ENV = %newenv;
+       exec @_ or die("exec of $_[0] failed: $!\n");
+    } else {
+       waitpid $pid, 0;
+       return $?;
+    }
+}
+
+# Translate permission strings like `-rwxrwxrwx' into an octal number.
+sub perm2oct {
+    my ($t) = @_;
+
+    my $o = 0;
+
+    $t =~ m/^.(.)(.)(.)(.)(.)(.)(.)(.)(.)/o;
+
+    $o += 00400 if $1 eq 'r';  # owner read
+    $o += 00200 if $2 eq 'w';  # owner write
+    $o += 00100 if $3 eq 'x';  # owner execute
+    $o += 04000 if $3 eq 'S';  # setuid
+    $o += 04100 if $3 eq 's';  # setuid + owner execute
+    $o += 00040 if $4 eq 'r';  # group read
+    $o += 00020 if $5 eq 'w';  # group write
+    $o += 00010 if $6 eq 'x';  # group execute
+    $o += 02000 if $6 eq 'S';  # setgid
+    $o += 02010 if $6 eq 's';  # setgid + group execute
+    $o += 00004 if $7 eq 'r';  # other read
+    $o += 00002 if $8 eq 'w';  # other write
+    $o += 00001 if $9 eq 'x';  # other execute
+    $o += 01000 if $9 eq 'T';  # stickybit
+    $o += 01001 if $9 eq 't';  # stickybit + other execute
+
+    return $o;
+}
+
+# ------------------------
+
+sub fail {
+    my $str = "internal error";
+    if (@_) {
+       $str .= ": ".join( "\n", @_)."\n";
+    } elsif ($!) {
+       $str .= ": $!\n";
+    } else {
+       $str .= ".\n";
+    }
+    $! = 2; # set return code outside eval()
+    die $str;
+
+}
+
+1;
diff --git a/nokia-lintian/lib/manual_refs b/nokia-lintian/lib/manual_refs
new file mode 100644 (file)
index 0000000..4dacf73
--- /dev/null
@@ -0,0 +1,320 @@
+policy http://www.debian.org/doc/debian-policy/index.html
+policy-1 http://www.debian.org/doc/debian-policy/ch-scope.html
+policy-1.1 http://www.debian.org/doc/debian-policy/ch-scope.html#s1.1
+policy-1.2 http://www.debian.org/doc/debian-policy/ch-scope.html#s1.2
+policy-1.3 http://www.debian.org/doc/debian-policy/ch-scope.html#s1.3
+policy-2 http://www.debian.org/doc/debian-policy/ch2.html
+policy-2.1 http://www.debian.org/doc/debian-policy/ch2.html#s-pkgcopyright
+policy-2.1.1 http://www.debian.org/doc/debian-policy/ch2.html#s2.1.1
+policy-2.1.2 http://www.debian.org/doc/debian-policy/ch2.html#s2.1.2
+policy-2.1.3 http://www.debian.org/doc/debian-policy/ch2.html#s2.1.3
+policy-2.1.4 http://www.debian.org/doc/debian-policy/ch2.html#s2.1.4
+policy-2.1.5 http://www.debian.org/doc/debian-policy/ch2.html#s2.1.5
+policy-2.1.6 http://www.debian.org/doc/debian-policy/ch2.html#s2.1.6
+policy-2.1.7 http://www.debian.org/doc/debian-policy/ch2.html#s2.1.7
+policy-2.2 http://www.debian.org/doc/debian-policy/ch2.html#s2.2
+policy-2.3 http://www.debian.org/doc/debian-policy/ch2.html#s2.3
+policy-2.3.1 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.1
+policy-2.3.2 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.2
+policy-2.3.3 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.3
+policy-2.3.4 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.4
+policy-2.3.5 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.5
+policy-2.3.6 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.6
+policy-2.3.7 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.7
+policy-2.3.8 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.8
+policy-2.3.8.1 http://www.debian.org/doc/debian-policy/ch2.html#s2.3.8.1
+policy-2.4 http://www.debian.org/doc/debian-policy/ch2.html#s2.4
+policy-2.4.1 http://www.debian.org/doc/debian-policy/ch2.html#s2.4.1
+policy-2.4.2 http://www.debian.org/doc/debian-policy/ch2.html#s2.4.2
+policy-2.4.3 http://www.debian.org/doc/debian-policy/ch2.html#s2.4.3
+policy-2.4.4 http://www.debian.org/doc/debian-policy/ch2.html#s2.4.4
+policy-2.4.5 http://www.debian.org/doc/debian-policy/ch2.html#s2.4.5
+policy-2.4.6 http://www.debian.org/doc/debian-policy/ch2.html#s2.4.6
+policy-3 http://www.debian.org/doc/debian-policy/ch-controlfields.html
+policy-3.1 http://www.debian.org/doc/debian-policy/ch-controlfields.html#s3.1
+policy-3.2 http://www.debian.org/doc/debian-policy/ch-controlfields.html#s3.2
+policy-3.2.1 http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Package
+policy-3.2.2 http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
+policy-3.2.3 http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Standards-Version
+policy-3.2.4 http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Distribution
+policy-4 http://www.debian.org/doc/debian-policy/ch-versions.html
+policy-4.1 http://www.debian.org/doc/debian-policy/ch-versions.html#s4.1
+policy-5 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html
+policy-5.1 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s-timestamps
+policy-5.2 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s-debianrules
+policy-5.3 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s-dpkgchangelog
+policy-5.3.1 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s5.3.1
+policy-5.4 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s-srcsubstvars
+policy-5.5 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s-debianfiles
+policy-5.6 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s-restrictions
+policy-5.7 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s-descriptions
+policy-5.7.1 http://www.debian.org/doc/debian-policy/ch-miscellaneous.html#s5.7.1
+policy-6 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
+policy-6.1 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s6.1
+policy-6.2 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s6.2
+policy-6.3 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s6.3
+policy-6.4 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s-mscriptsinstact
+policy-6.5 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s-unpackphase
+policy-6.6 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s6.6
+policy-6.7 http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s6.7
+policy-7 http://www.debian.org/doc/debian-policy/ch-relationships.html
+policy-7.1 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-depsyntax
+policy-7.2 http://www.debian.org/doc/debian-policy/ch-relationships.html#s7.2
+policy-7.3 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts
+policy-7.4 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual
+policy-7.5 http://www.debian.org/doc/debian-policy/ch-relationships.html#s-replaces
+policy-7.5.1 http://www.debian.org/doc/debian-policy/ch-relationships.html#s7.5.1
+policy-7.5.2 http://www.debian.org/doc/debian-policy/ch-relationships.html#s7.5.2
+policy-7.6 http://www.debian.org/doc/debian-policy/ch-relationships.html#s7.6
+policy-8 http://www.debian.org/doc/debian-policy/ch-conffiles.html
+policy-9 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html
+policy-9.1 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-shlibs
+policy-9.2 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s9.2
+policy-9.2.1 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s9.2.1
+policy-9.2.2 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s9.2.2
+policy-9.2.3 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s9.2.3
+policy-9.2.4 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s9.2.4
+policy-9.2.4.1 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s9.2.4.1
+policy-9.2.4.2 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s9.2.4.2
+policy-9.2.5 http://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s9.2.5
+policy-10 http://www.debian.org/doc/debian-policy/ch10.html
+policy-10.1 http://www.debian.org/doc/debian-policy/ch10.html#s10.1
+policy-10.1.1 http://www.debian.org/doc/debian-policy/ch10.html#s10.1.1
+policy-10.1.2 http://www.debian.org/doc/debian-policy/ch10.html#s10.1.2
+policy-10.2 http://www.debian.org/doc/debian-policy/ch10.html#s10.2
+policy-10.3 http://www.debian.org/doc/debian-policy/ch10.html#s-sysvinit
+policy-10.3.1 http://www.debian.org/doc/debian-policy/ch10.html#s-/etc/init.d
+policy-10.3.2 http://www.debian.org/doc/debian-policy/ch10.html#s10.3.2
+policy-10.3.3 http://www.debian.org/doc/debian-policy/ch10.html#s10.3.3
+policy-10.3.4 http://www.debian.org/doc/debian-policy/ch10.html#s10.3.4
+policy-10.3.5 http://www.debian.org/doc/debian-policy/ch10.html#s-init.d notes
+policy-10.3.6 http://www.debian.org/doc/debian-policy/ch10.html#s10.3.6
+policy-10.4 http://www.debian.org/doc/debian-policy/ch10.html#s10.4
+policy-10.5 http://www.debian.org/doc/debian-policy/ch10.html#s10.5
+policy-10.6 http://www.debian.org/doc/debian-policy/ch10.html#s10.6
+policy-10.7 http://www.debian.org/doc/debian-policy/ch10.html#s10.7
+policy-10.8 http://www.debian.org/doc/debian-policy/ch10.html#s10.8
+policy-10.9 http://www.debian.org/doc/debian-policy/ch10.html#s10.9
+policy-11 http://www.debian.org/doc/debian-policy/ch11.html
+policy-11.1 http://www.debian.org/doc/debian-policy/ch11.html#s11.1
+policy-11.2 http://www.debian.org/doc/debian-policy/ch11.html#s11.2
+policy-11.3 http://www.debian.org/doc/debian-policy/ch11.html#s11.3
+policy-11.4 http://www.debian.org/doc/debian-policy/ch11.html#s-scripts
+policy-11.5 http://www.debian.org/doc/debian-policy/ch11.html#s11.5
+policy-11.6 http://www.debian.org/doc/debian-policy/ch11.html#s11.6
+policy-11.7 http://www.debian.org/doc/debian-policy/ch11.html#s-config files
+policy-11.7.1 http://www.debian.org/doc/debian-policy/ch11.html#s11.7.1
+policy-11.7.2 http://www.debian.org/doc/debian-policy/ch11.html#s11.7.2
+policy-11.7.3 http://www.debian.org/doc/debian-policy/ch11.html#s11.7.3
+policy-11.7.4 http://www.debian.org/doc/debian-policy/ch11.html#s11.7.4
+policy-11.7.5 http://www.debian.org/doc/debian-policy/ch11.html#s11.7.5
+policy-11.8 http://www.debian.org/doc/debian-policy/ch11.html#s11.8
+policy-11.9 http://www.debian.org/doc/debian-policy/ch11.html#s11.9
+policy-12 http://www.debian.org/doc/debian-policy/ch12.html
+policy-12.1 http://www.debian.org/doc/debian-policy/ch12.html#s-arch-spec
+policy-12.2 http://www.debian.org/doc/debian-policy/ch12.html#s12.2
+policy-12.3 http://www.debian.org/doc/debian-policy/ch12.html#s12.3
+policy-12.4 http://www.debian.org/doc/debian-policy/ch12.html#s12.4
+policy-12.5 http://www.debian.org/doc/debian-policy/ch12.html#s-web-appl
+policy-12.6 http://www.debian.org/doc/debian-policy/ch12.html#s12.6
+policy-12.7 http://www.debian.org/doc/debian-policy/ch12.html#s12.7
+policy-12.8 http://www.debian.org/doc/debian-policy/ch12.html#s12.8
+policy-12.9 http://www.debian.org/doc/debian-policy/ch12.html#s12.9
+policy-12.10 http://www.debian.org/doc/debian-policy/ch12.html#s12.10
+policy-13 http://www.debian.org/doc/debian-policy/ch13.html
+policy-13.1 http://www.debian.org/doc/debian-policy/ch13.html#s13.1
+policy-13.2 http://www.debian.org/doc/debian-policy/ch13.html#s13.2
+policy-13.3 http://www.debian.org/doc/debian-policy/ch13.html#s13.3
+policy-13.4 http://www.debian.org/doc/debian-policy/ch13.html#s-usrdoc
+policy-13.5 http://www.debian.org/doc/debian-policy/ch13.html#s13.5
+policy-13.6 http://www.debian.org/doc/debian-policy/ch13.html#s-copyrightfile
+policy-13.7 http://www.debian.org/doc/debian-policy/ch13.html#s13.7
+policy-13.8 http://www.debian.org/doc/debian-policy/ch13.html#s-instchangelog
+packaging http://www.debian.org/doc/packaging-manuals/packaging.html/index.html
+packaging-10 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-alternatives.html
+packaging-2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-binarypkg.html
+packaging-2.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-binarypkg.html#s-bincreating
+packaging-2.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-binarypkg.html#s-controlarea
+packaging-2.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-binarypkg.html#s-controlfile
+packaging-9 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-conffiles.html
+packaging-9.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-conffiles.html#s9.1
+packaging-9.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-conffiles.html#s9.2
+packaging-4 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html
+packaging-4.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s4.1
+packaging-4.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s4.2
+packaging-4.2.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Package
+packaging-4.2.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Version
+packaging-4.2.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Architecture
+packaging-4.2.4 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Maintainer
+packaging-4.2.5 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Source
+packaging-4.2.6 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s4.2.6
+packaging-4.2.7 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Description
+packaging-4.2.8 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Essential
+packaging-4.2.9 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-classification
+packaging-4.2.10 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Binary
+packaging-4.2.11 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Installed-Size
+packaging-4.2.12 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Files
+packaging-4.2.13 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Standards-Version
+packaging-4.2.14 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Distribution
+packaging-4.2.15 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Urgency
+packaging-4.2.16 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Date
+packaging-4.2.17 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Format
+packaging-4.2.18 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Changes
+packaging-4.2.19 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Filename
+packaging-4.2.20 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Size
+packaging-4.2.21 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Status
+packaging-4.2.22 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Config-Version
+packaging-4.2.23 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s-f-Conffiles
+packaging-4.2.24 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-controlfields.html#s4.2.24
+packaging-14 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-conversion.html
+packaging-7 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-descriptions.html
+packaging-7.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-descriptions.html#s7.1
+packaging-7.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-descriptions.html#s7.2
+packaging-7.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-descriptions.html#s7.3
+packaging-11 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-diversions.html
+packaging-6 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-maintainerscripts.html
+packaging-6.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-maintainerscripts.html#s6.1
+packaging-6.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-maintainerscripts.html#s-mscriptsinstact
+packaging-6.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-maintainerscripts.html#s-unpackphase
+packaging-6.4 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-maintainerscripts.html#s6.4
+packaging-6.5 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-maintainerscripts.html#s6.5
+packaging-13 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-methif.html
+packaging-13.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-methif.html#s13.1
+packaging-13.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-methif.html#s13.2
+packaging-8 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html
+packaging-8.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s-depsyntax
+packaging-8.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s8.2
+packaging-8.2.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s8.2.1
+packaging-8.2.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s8.2.2
+packaging-8.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s-conflicts
+packaging-8.4 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s-virtual
+packaging-8.5 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s-replaces
+packaging-8.5.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s8.5.1
+packaging-8.5.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s8.5.2
+packaging-8.6 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-relationships.html#s8.6
+packaging-1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-scope.html
+packaging-12 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html
+packaging-12.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s-shlibs
+packaging-12.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s12.2
+packaging-12.2.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s12.2.1
+packaging-12.2.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s12.2.2
+packaging-12.2.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s12.2.3
+packaging-12.2.4 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s12.2.4
+packaging-12.2.4.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s12.2.4.1
+packaging-12.2.4.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s12.2.4.2
+packaging-12.2.5 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sharedlibs.html#s12.2.5
+packaging-3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html
+packaging-3.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s-sourcetools
+packaging-3.1.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.1.1
+packaging-3.1.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.1.2
+packaging-3.1.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.1.3
+packaging-3.1.4 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.1.4
+packaging-3.1.5 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.1.5
+packaging-3.1.6 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.1.6
+packaging-3.1.7 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.1.7
+packaging-3.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s-sourcetree
+packaging-3.2.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.2.1
+packaging-3.2.2 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.2.2
+packaging-3.2.2.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.2.2.1
+packaging-3.2.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s-dpkgchangelog
+packaging-3.2.3.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.2.3.1
+packaging-3.2.4 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s-srcsubstvars
+packaging-3.2.5 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.2.5
+packaging-3.2.6 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.2.6
+packaging-3.3 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s-sourcearchives
+packaging-3.4 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.4
+packaging-3.4.1 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-sourcepkg.html#s3.4.1
+packaging-5 http://www.debian.org/doc/packaging-manuals/packaging.html/ch-versions.html
+devref http://www.debian.org/doc/packaging-manuals/developers-reference/index.html
+devref-1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-scope.en.html
+devref-2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-new-maintainer.en.html
+devref-2.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-new-maintainer.en.html#s2.1
+devref-2.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-new-maintainer.en.html#s-registering
+devref-2.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-new-maintainer.en.html#s-mentors
+devref-3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-developer-duties.en.html
+devref-3.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-developer-duties.en.html#s-user-maint
+devref-3.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-developer-duties.en.html#s-key-maint
+devref-3.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-developer-duties.en.html#s-inform-vacation
+devref-3.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-developer-duties.en.html#s-upstream-coordination
+devref-3.5 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-developer-duties.en.html#s-rc-bugs
+devref-3.6 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-developer-duties.en.html#s-qa-effort
+devref-3.7 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-developer-duties.en.html#s3.7
+devref-4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html
+devref-4.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html#s-mailing-lists
+devref-4.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html#s-server-machines
+devref-4.2.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html#s-servers-master
+devref-4.2.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html#s-servers-ftp-master
+devref-4.2.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html#s-servers-www
+devref-4.2.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html#s-servers-cvs
+devref-4.2.5 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html#s-servers-mirrors
+devref-4.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-servers.en.html#s-other-machines
+devref-5 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html
+devref-5.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s5.1
+devref-5.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s5.2
+devref-5.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s5.3
+devref-5.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s5.4
+devref-5.5 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s5.5
+devref-5.6 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s5.6
+devref-5.6.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s5.6.1
+devref-5.6.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s5.6.2
+devref-5.7 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive.en.html#s-codenames
+devref-6 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html
+devref-6.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s6.1
+devref-6.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-uploading
+devref-6.2.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s6.2.1
+devref-6.2.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-upload-dist
+devref-6.2.2.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-upload-frozen
+devref-6.2.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-upload-checking
+devref-6.2.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-upload-ftp-master
+devref-6.2.5 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-upload-non-us
+devref-6.2.6 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s6.2.6
+devref-6.2.7 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s6.2.7
+devref-6.2.8 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s6.2.8
+devref-6.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-upload-announce
+devref-6.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-upload-notification
+devref-6.4.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-upload.en.html#s-override-file
+devref-7 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html
+devref-7.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html#s-nmu-terms
+devref-7.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html#s-nmu-who
+devref-7.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html#s-nmu-when
+devref-7.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html#s-nmu-guidelines
+devref-7.4.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html#s-nmu-version
+devref-7.4.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html#s-nmu-changelog
+devref-7.4.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html#s-nmu-patch
+devref-7.4.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-nmu.en.html#s-nmu-build
+devref-8 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-porting.en.html
+devref-8.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-porting.en.html#s-kind-to-porters
+devref-8.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-porting.en.html#s-porter-guidelines
+devref-8.2.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-porting.en.html#s-source-nmu-when-porter
+devref-8.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-porting.en.html#s8.3
+devref-8.3.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-porting.en.html#s-quinn-diff
+devref-8.3.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-porting.en.html#s-buildd
+devref-8.3.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-porting.en.html#s-dpkg-cross
+devref-9 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive-manip.en.html
+devref-9.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive-manip.en.html#s9.1
+devref-9.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive-manip.en.html#s-removing-pkgs
+devref-9.2.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive-manip.en.html#s9.2.1
+devref-9.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive-manip.en.html#s9.3
+devref-9.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive-manip.en.html#s-orphaning
+devref-9.5 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-archive-manip.en.html#s-adopting
+devref-10 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-bug-handling.en.html
+devref-10.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-bug-handling.en.html#s10.1
+devref-10.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-bug-handling.en.html#s-submit-bug
+devref-10.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-bug-handling.en.html#s10.3
+devref-10.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-bug-handling.en.html#s-upload-bugfix
+devref-10.5 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-bug-handling.en.html#s-lintian-reports
+devref-10.6 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-bug-handling.en.html#s10.6
+devref-11 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html
+devref-11.1 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-dpkg-dev
+devref-11.2 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-lintian
+devref-11.3 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-debconf
+devref-11.4 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-debhelper
+devref-11.5 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-debmake
+devref-11.6 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-yada
+devref-11.7 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-equivs
+devref-11.8 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-cvs-buildpackage
+devref-11.9 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-dupload
+devref-11.10 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-fakeroot
+devref-11.11 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-devscripts
+devref-11.12 http://www.debian.org/doc/packaging-manuals/developers-reference/ch-tools.en.html#s-debget
+fhs http://www.pathname.com/fhs/
diff --git a/nokia-lintian/lib/scan_script.pl b/nokia-lintian/lib/scan_script.pl
new file mode 100644 (file)
index 0000000..9d9fd46
--- /dev/null
@@ -0,0 +1,118 @@
+# -*- perl -*-
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# Functions are defined here to read a shell script and return it as
+# a list of tokens.
+
+# We do NOT do history expansion, because it's normally turned off in
+# shell scripts.  
+
+# Possible tokens:
+# literal:
+#  <<- << >> && || <> >| >& ;; (( <& >& ( ) < > ; & | -
+#
+# end of line: EOL
+
+use strict;
+
+sub scan_script {
+    my $tokenval = '';
+    my @tokens = ();
+    my $state = 0; #base
+    my $reserved_ok = 1;
+    my $line = 1;
+
+    foreach (split(/\n/, $_[0])) {
+       if ($state == 0) {  # base
+           s/^\s+//;               # skip leading whitespace
+           if (m/^\#|^$/) {
+               # skip blank lines, skip comments till end of line
+               push(@tokens, 'EOL');
+               $reserved_ok = 1;
+               $line++;
+               next;
+           }
+
+           elsif (s/^( <<- | << | >> | <> | >\| | >& )//x) {
+               push(@tokens, $1);
+               $reserved_ok = 0;
+               redo;
+           }
+
+           elsif (s/^( && | \|\| )//x) {
+               push(@tokens, $1);
+               $reserved_ok = 1;
+               redo;
+           }
+
+           elsif (s/^ ;; //x) {
+               push(@tokens, ';;');
+               $state = 1; # case pattern
+               $reserved_ok = 1;
+               redo;
+           }
+
+           elsif ($reserved_ok and s/^ \(\( //x) {
+               push(@tokens, '((');
+               $state = 2; # dparen arithmetic
+               redo;
+               # XXX parse_arith_cmd
+           }
+
+           elsif (s/^( <& | >& )//x) {
+               push(@tokens, $1);
+               # hack <& - and >& - cases.
+               # No comments or newlines can appear between the <& and -.
+               if (s/^ \s* -//x) {
+                   push(@tokens, '-');
+               }
+               $reserved_ok = 0; 
+               redo;
+           }
+
+           elsif (m/^( <\( | >\( )/x) {
+               $state = 3; # word
+               $reserved_ok = 0;
+               redo;
+           }
+
+           elsif (s/^( < | > )//x) {
+               push (@tokens, $1);
+               $reserved_ok = 0;
+               redo;
+           }
+
+           elsif (s/^([();&|])//) {
+               push (@tokens, $1);
+               $reserved_ok = 1;
+               redo;
+           }
+           
+           else {
+               $state = 3; # word
+               redo;
+           }
+       }
+
+    }
+
+    return @tokens;
+}
+
diff --git a/nokia-lintian/man/lintian-info.1 b/nokia-lintian/man/lintian-info.1
new file mode 100644 (file)
index 0000000..a504d3c
--- /dev/null
@@ -0,0 +1,86 @@
+.\" Copyright (C) 1998 Richard Braakman and Christian Schwarz
+.\"
+.\" This manual page is free software.  It is distributed under the
+.\" terms of the GNU General Public License as published by the Free
+.\" Software Foundation; either version 2 of the License, or (at your
+.\" option) any later version.
+.\"
+.\" This manual page is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this manual page; if not, write to the Free Software
+.\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
+.\" USA
+.\"
+.TH LINTIAN-INFO 1 "August 16, 2006" "Debian GNU/Linux"
+.if n .ad l
+.nh
+
+.SH NAME
+lintian-info \- give detailed information about Lintian's error tags
+
+.SH SYNOPSIS
+.B lintian-info
+.RI [ log-file ... ]
+\&...
+
+.B lintian-info \-\-tags
+.I tag
+\&...
+
+.SH DESCRIPTION
+.PP
+The
+.B lintian-info
+command parses the output of the
+.B lintian
+command and gives verbose information about the listed Lintian error
+tags, parses a Lintian override file and gives verbose information about
+the tags included, or (if given the
+.BR \-t " or " \-\-tags
+option) explains a given tag or tags.
+.sp
+If no log-file is specified on the command line, this command expects
+its input on stdin. Thus, the output of
+.B lintian
+can either be piped through
+.B lintian-info
+or a log file produced by
+.B lintian
+can be processed with this command. (Note, that the
+.B lintian
+command has a command line option
+.B \-i
+to automatically pipe its output through
+.BR lintian-info .
+Thus, you will rarely use this command directly.)
+
+.SH OPTIONS
+.TP
+.BR \-a ", " \-\-annotate
+Read from standard input or any files specified on the command line and
+search the input for lines formatted like Lintian override entries.  For
+each one that was found, display verbose information about that tag.
+
+.TP
+.BR \-t ", " \-\-tags
+Rather than treating them as log file names, treat any command-line
+options as tag names and display the descriptions of each tag.
+
+.SH EXIT STATUS
+.PP
+If
+.BR \-t " or " \-\-tags
+was given and one or more of the tags specified were unknown, this command
+returns the exit code 1.  Otherwise, it always returns with exit code 0.
+
+.SH SEE ALSO
+.BR lintian (1)
+
+.SH AUTHORS
+Richard Braakman <dark@xs4all.nl>
+.br
+Christian Schwarz <schwarz@monet.m.isar.de>
diff --git a/nokia-lintian/man/lintian.1 b/nokia-lintian/man/lintian.1
new file mode 100644 (file)
index 0000000..1744e0e
--- /dev/null
@@ -0,0 +1,751 @@
+.\" Copyright (C) 1998 Richard Braakman and Christian Schwarz
+.\"
+.\" This manual page is free software.  It is distributed under the
+.\" terms of the GNU General Public License as published by the Free
+.\" Software Foundation; either version 2 of the License, or (at your
+.\" option) any later version.
+.\"
+.\" This manual page is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this manual page; if not, write to the Free Software
+.\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
+.\" USA
+.\"
+.TH LINTIAN 1 "June 21, 2008" "Debian GNU/Linux"
+.if n .ad l
+.nh
+
+.SH NAME
+lintian \- Debian package checker
+
+.SH SYNOPSIS
+.B lintian
+.RI [ action ]
+.RI [ options ] 
+.RI [ packages ]
+\&...
+
+.SH DESCRIPTION
+.PP
+Lintian dissects Debian packages and reports bugs and policy
+violations.  It contains automated checks for many aspects of Debian
+policy as well as some checks for common errors.
+.sp
+It uses an archive directory, called \fIlaboratory\fR, in which it
+stores information about the packages it examines.  It can keep this
+information between multiple invocations in order to avoid repeating
+expensive data-collection operations.
+.sp
+There are three ways to specify binary, udeb or source packages for Lintian
+to process: by file name (the .deb file for a binary package or the .dsc
+file for a source package), by package name, or by naming a
+.I .changes
+file.  
+If you list packages by package name, you'll have to
+define the 
+.B LINTIAN_DIST
+variable in the configuration file (see below).  Lintian will then
+search for any binary or source packages in this directory for
+packages with the given name. (You can use the
+.BR \-b " (" \-\-binary "), " \-\-udeb
+and
+.BR \-s " (" \-\-source )
+options if you only want to process binary, udeb or source packages.)
+
+If you specify a
+.I .changes
+file, Lintian will process all packages listed in that file.
+This is convenient when checking a new package before uploading it.
+
+.SH OPTIONS
+
+.PP
+Actions of the
+.B lintian
+command: (Only one action can be specified per invocation)
+
+.TP
+.BR \-S ", " \-\-setup\-lab
+Set up or update the laboratory.
+
+.TP
+.BR \-R ", " \-\-remove\-lab
+Remove the laboratory directory.
+
+.TP
+.BR \-c ", " \-\-check
+Run all checks over the specified packages.
+This is the default action.
+
+.TP
+.BR \-C " chk1,chk2,..., " \-\-check\-part " chk1,chk2,..."
+Run only the specified checks.  You can either specify the
+name of the check script or the abbreviation.
+For details, see the CHECKS section below.
+
+.TP
+.BR \-X " chk1,chk2,..., " \-\-dont\-check\-part " chk1,chk2,..."
+Run all but the the specified checks.  You can either specify
+the name of the check script or the abbreviation.
+For details, see the CHECKS section below.
+
+.TP
+.BR \-u ", " \-\-unpack
+Unpack the specified packages up to the current unpack level.
+The default unpack level is 1 for this option.  See the UNPACK
+LEVELS section below.
+
+.TP
+.BR \-r ", " \-\-remove
+Clean up the lintian directory of the specified packages up to
+the current unpack level.  The default unpack level is 0 for
+this option.
+
+.PP
+General options:
+
+.TP
+.BR \-h ", " \-\-help
+Display usage information and exit.
+
+.TP
+.BR \-V ", " \-\-version
+Display lintian version number and exit.
+
+.TP
+.BR \-\-print\-version
+Print unadorned version number and exit.
+
+.TP
+.BR \-v ", " \-\-verbose
+Display verbose messages.
+
+.TP
+.BR \-d ", " \-\-debug
+Display debugging messages. (Implies
+.BR \-v ).
+
+.TP
+.BR \-q ", " \-\-quiet
+Suppress all informational messages.  Currently, the only message this
+suppresses is the message at the end of the run giving the total count of
+overrides.
+
+.PP
+
+Behaviour options for
+.BR lintian .
+
+.TP
+.BR \-i ", " \-\-info
+Print explanatory information about discovered policy violations in
+addition to the lintian error tags. To print a long tag description
+without running lintian, see
+.BR lintian\-info (1).
+
+.TP
+.BR \-I ", " \-\-display\-info
+Display informational ("I:") tags as well.  They are normally suppressed.
+
+.TP
+.BR \-E ", " \-\-display\-experimental
+Display experimental ("X:") tags as well.  They are normally suppressed.
+
+.TP
+.BR \-l " n, " \-\-unpack\-level " n"
+Set unpack level to
+.IR n .
+See the UNPACK LEVELS section, below.
+
+.TP
+.BR \-o ", " \-\-no\-override
+Don't use the overrides file.
+
+.TP
+.BR \-\-show\-overrides
+Output tags that have been overriden.
+
+.TP
+.BR \-\-color " (never|always|auto|html)"
+Whether to colorize tags in lintian output based on their severity.  The
+default is "never", which never uses color.  "always" will always use
+color, "auto" will use color only if the output is going to a terminal,
+and "html" will use HTML <span> tags with a color style attribute (instead
+of ANSI color escape sequences).
+
+.TP
+.BR \-U " info1,info2,..., " \-\-unpack\-info " info1,info2,..."
+Collect information info1, info2, etc. even if these are not
+required by the checks.
+
+.TP
+.BR \-m ", " \-\-md5sums ", " \-\-checksums
+Check checksums when processing a .changes file.  Normally, Lintian only
+checks the checksums for .dsc files when processing a .changes file.
+
+.TP
+.BR \-\-allow\-root
+Override
+.BR lintian 's
+warning when it is run with superuser privileges.
+
+.TP
+.BR \-\-fail\-on\-warnings
+By default,
+.B lintian
+exits with 0 status if only warnings were found.  If this flag is given,
+exit with a status of 1 if either warnings or errors are found.
+
+.TP
+.BR \-\-keep\-lab
+By default, temporary labs will be removed after lintian is finished.
+Specifying this options will leave the lab behind, which might be
+useful for debugging purposes.  You can find out where the temporary
+lab is located by running lintian with the
+.B \-\-verbose
+option.  Implies
+.B \-\-unpack\-level=2
+unless another unpack level is specified directly.
+
+.PP
+
+Configuration options:
+
+.TP
+.BR \-\-cfg " configfile"
+Read the configuration from
+.IR configfile
+rather than the default locations.  This option overrides the
+.B LINTIAN_CFG
+environment variable.
+
+.TP
+.BR \-\-lab " labdir"
+Use
+.IR labdir
+as the permanent laboratory.  This is where Lintian keeps information about
+the packages it checks.  This option overrides the
+.B LINTIAN_LAB
+environment variable and the configuration file entry of the same
+name.
+
+.TP
+.BR \-\-archivedir " archivedir"
+Location of Debian archive to scan for packages.  (See the FILES section
+for complete information on how the path is constructed.)  Use this if you
+want Lintian to check the whole Debian archive instead of just single
+packages. This option overrides the
+.B LINTIAN_ARCHIVEDIR
+environment variable and the configuration file entry of the same
+name.
+
+.TP
+.BR \-\-dist " distdir"
+Scan for packages in the
+.IR distdir
+directory.  (See the FILES section for complete information on how the
+path is constructed.)  Use this if you want Lintian to check the whole
+Debian archive instead of just single packages.  This option overrides the
+.B LINTIAN_DIST
+environment variable and the configuration file entry of the same
+name.
+
+.TP
+.BR \-\-section " release"
+When scanning for packages in the distdir, select only packages from
+section
+.IR section
+(e.g. main). This option overrides the
+.B LINTIAN_SECTION
+environment variable and the configuration file entry of the same name.
+
+.TP
+.BR \-\-arch " arch"
+When scanning for packages in the distdir, select only packages for
+architecture
+.IR arch .
+This option overrides the
+.B LINTIAN_ARCH
+environment variable and the configuration file entry of the same name.
+
+.TP
+.BR \-\-root " rootdir"
+Look for
+.BR lintian 's
+support files (such as check scripts and collection scripts) in
+.IR rootdir .
+This overrides the
+.B LINTIAN_ROOT
+environment variable.  The default location is
+.IR /usr/share/lintian .
+
+.PP
+
+Package selection options:
+
+.TP
+.BR \-a ", " \-\-all
+Check all packages in the distribution. (This requires that the
+LINTIAN_DIST variable is defined in the configuration file.)
+
+.TP
+.BR \-b ", " \-\-binary
+The following packages listed on the command line are binary packages.
+
+.TP
+.BR \-s ", " \-\-source
+The following packages listed on the command line are source packages.
+
+.TP
+.BR \-\-udeb
+The following packages listed on the command line are udeb packages.
+
+.TP
+.BR \-p ", " \-\-packages\-file " X"
+Process all packages which are listed in file
+.BR X .
+Each package has to be listed in a single line using the following format:
+.sp
+.B type package version file
+.sp
+where 
+.B type
+is either `b' or `s' (binary or source package),
+.B package
+is the package name,
+.B version
+is the package's version, and
+.B file
+is the package file name (absolute path specification).
+
+.SH "UNPACK LEVELS"
+.TP
+.B "0 (none)"
+The package does not exist in the \fIlaboratory\fR at all.
+
+.TP
+.B "1 (basic)"
+A directory for this package exists in the \fIlaboratory\fR
+and basic information is extracted.  This does not take
+much space.
+
+For binary and udeb packages,
+the
+.I control
+and
+.I fields
+directories and the
+.I index
+file are unpacked, and symbolic links are made to the
+.B .deb
+file and to the lintian directory for the source package.
+
+For source packages, the
+.I binary
+and
+.I fields
+directories are unpacked, and symbolic links are made to the
+source package files.
+
+.TP
+.B "2 (contents)"
+The actual package contents are unpacked as well.
+
+.PP
+Lintian will unpack packages as far as is necessary to do its checks,
+but it will leave the package in whatever unpack level was specified
+when it is done.
+
+The default unpack level can be overwritten by setting the
+.B LINTIAN_UNPACK_LEVEL
+variable in the configuration file.
+
+.SH CHECKS
+.TP
+.B binaries (bin)
+Search for bugs in binaries and object files.
+
+.TP
+.B changelog\-file (chg)
+Check changelog files in a binary package.
+
+.TP
+.B conffiles (cnf)
+Check if the
+.I conffiles
+control file of a binary package is correct.
+
+.TP
+.B control\-file (dctl)
+This script checks debian/control files in source packages.
+
+.TP
+.B control\-files (ctl)
+Check for unknown control files in the binary package.
+
+.TP
+.B copyright\-file (cpy)
+Check if a binary package conforms to policy with respect to
+the copyright file.  Each binary package must either have a 
+.RI /usr/share/doc/ package /copyright
+file or must have a symlink
+.RI /usr/share/doc/ package \-> foo ,
+where
+.I foo
+comes from the same source package, and this package declares a 
+"Depends" relation on
+.IR foo .
+
+.TP
+.B cruft (deb)
+Looks for cruft in source packages, like files of version control
+systems and temporary files from the build process.
+
+.TP
+.B deb\-format (dfmt)
+Checks if a binary package was build with a broken version of tar so
+that dpkg can't handle it correctly.
+
+.TP
+.B debconf (dc)
+Looks for common mistakes in packages using debconf, like missing
+dependencies or errors in the template file.
+
+.TP
+.B debian\-readme (drm)
+Check if the README.Debian file is merely the debmake template.
+
+.TP
+.B debhelper (dh)
+Looks for common mistakes in source packages using debhelper.
+
+.TP
+.B description (des)
+Check if the
+.B Description
+control field of a binary package conforms to the rules in the
+Policy Manual (section 3.4).
+
+.TP
+.B etcfiles (etc)
+Checks if all files in
+.B /etc
+that are shipped with the package are marked as conffiles as
+required by policy.
+
+.TP
+.B fields (fld)
+Check control fields of a binary or source package.
+
+.TP
+.B files (fil)
+Check if a binary package conforms to policy with respect to
+types, permissions and ownerships of files and directories.
+
+.TP
+.B huge\-usr\-share (hus)
+Checks whether an architecture-dependent package does
+have a significantly big \fB/usr/share\fR. Big amounts of
+architecture independent data in architecture dependent
+packages waste space on the mirrors.
+
+.TP
+.B infofiles (info)
+Check if a binary package conforms to policy with respect
+to info documents.
+
+.TP
+.B init.d (ini)
+Check if a binary package conforms to policy with respect
+to scripts in \fB/etc/init.d\fR.
+
+.TP
+.B manpages (man)
+Check if a binary package conforms to policy with respect
+to manual pages.
+
+.TP
+.B md5sums (md5)
+If the
+.B md5sum
+control file of a binary package exists, check if it is valid.
+
+.TP
+.B menus (men)
+Check if a binary package conforms to policy with respect
+to 
+.B menu
+and 
+.B doc\-base
+files.
+
+.TP
+.B menu\-format (mnf)
+Check the syntax of menu files installed by the package.
+
+.TP
+.B patch\-systems (pat)
+Check source package use of patch systems.
+
+.TP
+.B perl (prl)
+Check perl scripts installed by the package for the usage of perl
+modules, and check that the package declares the appropriate
+dependencies.
+
+.TP
+.B po\-debconf (pd)
+Looks for common mistakes in packages using po\-debconf.
+
+.TP
+.B rules (rul)
+Looks for common problems in the debian/rules file in source packages.
+
+.TP
+.B scripts (scr)
+Check the the \fB#!\fR lines of scripts in a binary package.
+
+.TP
+.B shared\-libs (shl)
+Check if a binary package conforms to policy with respect to
+shared libraries and the
+.B shlibs
+control file.
+
+.TP
+.B spelling (spl)
+Check a binary package's "Description:" field and copyright file
+for common spelling errors.
+
+.TP
+.B standards\-version (std)
+Check if a source package contains a valid
+.B Standards\-Version
+field in its
+.I debian/control
+file.
+
+.TP
+.B version\-substvars (v\-s)
+Check use of version substvars in a source package, particularly whether
+the relationships between packages allow safe binary NMUs.
+
+.TP
+.B watch\-file (watch)
+Check \fIdebian/watch\fP files in source packages.
+
+.SH COLLECTION
+
+.TP
+.B changelog\-file
+Copy the changelog file of a package into the lintian directory.
+
+.TP
+.B copyright\-file
+Copy the copyright file of a package into the lintian directory.
+
+.TP
+.B debfiles
+Collects files shipped in the source of the package.
+
+.TP
+.B debian\-readme
+Copy the README.Debian file of a package into the lintian directory.
+
+.TP
+.B diffstat
+Collect the output of the
+.BR diffstat (1)
+utility for the Debian diff in a source package.
+
+.TP
+.B doc\-base\-files
+Copy the contents of 
+.B /usr/share/doc\-base
+into the lintian directory (below \fBdoc\-base\fR).
+
+.TP
+.B file\-info
+Collect the output of the
+.BR file (1)
+utility for each file in a binary package.
+
+.TP
+.B init.d
+Copy 
+.B /etc/init.d
+scripts into the lintian directory (below \fBinit.d\fR).
+
+.TP
+.B md5sums
+Collect the md5sums of all files in a binary package.
+
+.TP
+.B menu\-files
+Copy the contents of a binary package's
+.I usr/share/doc/menu
+directory into the
+.I menu
+directory in the lab.
+
+.TP
+.B objdump\-info
+Collect the output of the
+.BR objdump (1)
+utility for each file in a binary package.
+
+.TP
+.B override\-file
+Copy the override file of a package into the lintian directory
+
+.TP
+.B scripts
+Collect information about scripts in binary package.
+
+.TP
+.B source-control-file
+Collects information about binary packages from debian/control
+in source packages
+
+.SH FILES
+Lintian looks for its configuration file in the following locations:
+.TP
+The directory given with the \-\-cfg option
+.TP
+.I $LINTIAN_CFG
+.TP 
+.I $LINTIAN_ROOT/lintianrc
+.TP
+.I $HOME/.lintianrc
+.TP
+.I /etc/lintianrc
+.PP
+Lintian uses the following directories:
+.TP
+.I /tmp
+If no lab location is specified via the LINTIAN_LAB environment variable,
+configuration, or the
+.B \-\-lab
+command-line option, lintian defaults to creating a temporary lab
+directory in
+.IR /tmp .
+To change the directory used, set the TMPDIR environment variable to a
+suitable directory.
+.TP
+.I /usr/share/lintian/checks
+Scripts that check aspects of a package.
+.TP
+.I /usr/share/lintian/collection
+Scripts that collect information about a package and store it for
+use by the check scripts.
+.TP
+.I /usr/share/lintian/lib
+Utility scripts used by the other lintian scripts.
+.TP
+.I /usr/share/lintian/unpack
+Scripts that manage the \fIlaboratory\fR.
+
+.PP
+The
+.I /usr/share/lintian
+directory can be overridden with the
+.B LINTIAN_ROOT
+environment variable or the
+.B \-\-root
+option.
+
+.PP
+When looking for packages in a Debian archive, lintian constructs the path
+to the archive from the
+.IR archivedir ,
+.IR distdir ,
+.IR release ,
+.RI and arch
+as follows:
+.sp
+.IR archivedir /dists/ distdir / release / arch
+.sp
+Lintian always expects the "/dists/" path component in paths to Debian
+archives.
+
+.SH EXIT STATUS
+.TP
+.B 0
+No policy violations (errors) detected. (There might have been warnings, though.)
+.TP
+.B 1
+Policy violations detected.
+.TP
+.B 2
+Lintian run-time error. An error message is sent to stderr.
+
+.SH USAGE
+Examples:
+.TP
+.B "$ lintian foo.deb"
+Check binary package foo given by foo.deb.
+.TP
+.B "$ lintian foo.dsc"
+Check source package foo given by foo.dsc.
+.TP
+.B "$ lintian foo"
+Search for package foo in the Debian archive and check it. (Depending
+on what is found, this command will check either the source or binary
+package foo, or both.)
+.TP
+.B "$ lintian --archivedir /var/packages --dist custom --section main"
+Check all packages found in the Debian archive at
+.IR /var/packages/dists/custom/main .
+.TP
+.B "$ lintian \-i foo.changes"
+Check the changes file and, if listed, the source and binary package
+of the upload. The output will contain detailed information about the
+reported tags.
+.TP
+.B "$ lintian \-c \-\-binary foo"
+Search for binary package foo in the Debian archive and check it. 
+.TP
+.B "$ lintian \-C cpy \-\-source foo"
+Run the copyright checks on source package foo.
+.TP
+.B "$ lintian \-u foo"
+Unpack package foo in the Lintian laboratory up to level 1. (If it's
+already unpacked at level 1 or 2, nothing is done.)
+.TP
+.B "$ lintian \-l1 \-r foo"
+Search for package foo in the Debian archive and, if found, reduce the
+package disk usage in the laboratory to level 1.
+.TP
+.B "$ lintian \-r foo"
+Remove package foo from the Lintian laboratory.
+
+.SH BUGS
+Lintian does not handle packages with different binary and source
+version numbers correctly.
+.sp
+Lintian does not have any locking mechanisms yet. (Running several
+checks simultaneously is likely to fail.)
+.sp
+If you discover any other bugs in Lintian, please contact the authors.
+
+.SH SEE ALSO
+.BR lintian\-info (1),
+.B Lintian User's Manual
+(file:/usr/share/doc/lintian/lintian.html/index.html)
+
+Packaging tools:
+.BR debhelper (7),
+.BR dh_make (8),
+.BR dpkg-buildpackage (1)
+
+.SH AUTHORS
+Richard Braakman <dark@xs4all.nl>
+.br
+Christian Schwarz <schwarz@monet.m.isar.de>
+.br
+Please use the email address <lintian\-maint@debian.org> for Lintian related
+comments.
diff --git a/nokia-lintian/private/TODO b/nokia-lintian/private/TODO
new file mode 100644 (file)
index 0000000..980bddd
--- /dev/null
@@ -0,0 +1,66 @@
+Not intended for single bug fixes, use the confirmed and owner tags
+in the BTS, but for somewhat bigger tasks
+
+goals for 1.24.0 [???]
+======================
+
+- go through all checks and try to move common code to modules
+  -- partly done
+- overhaul the Errors/Warnings concept
+  (#197955, #189656)
+  -- will make a proposal after 1.23.1 is released, djpig
+  -- rra: I think we need to classify tags on three axes:
+     --- source of check (policy, devref, library, utility man page)
+     --- reliability (how sure is lintian the problem is present)
+     --- severity (how big of a problem is this)
+     where the last corresponds to the current errors/warnings concept and
+     the others aren't currently present.  We then need to allow users to
+     select what they want to see based on any of the three criteria; for
+     instance, ftp-master may want to run lintian in a mode that only does
+     Policy and "package would be broken" checks with severity error and
+     the top reliability rating.
+
+goals not targetted
+===================
+
+- #118170: [frontend] lintian needs lots of space in /tmp
+  should be tackled, don't know when, though
+- go through the test suite and organise it more cleanly
+- update doc/CREDITS file
+- Go through testset/libbaz/debian/rules, and make sure all TODO's are
+  lintian-detected
+- go through all tags and make sure that any that should have Policy
+  references have them, and more generally that appropriate references are
+  present
+- remove old unbalance `' quotes from all tag descriptions
+
+goals outside of the lintian source
+===================================
+
+- get lintian.debian.org working again with the current lintian
+- set up system for automatically filing bugs based on specific lintian
+  tags (the most reliable ones), with usertags to ensure the bugs aren't
+  repeatedly filed
+- set up lintian for use on ftp-master so that it can be used to
+  automatically REJECT packages with particular errors.  will require a
+  mode that only runs important checks that are highly reliable
+
+old todo list
+=============
+
+reorganize regression suite:
+  valid
+  invalid
+  <in between, odd, etc>
+
+  whenever a check is touched or added, add a valid and invalid example
+
+rewrite into a more sane layout.  What I would really like is a set of modules
+that the controller script can open and use.  Probably some OO design.
+I am leaning towards python, but will give OO perl a look first.
+
+various items require the policy team to make a new policy or update existing
+need to keep on them about this
+  * libs v. plugins
+  * X policy
+
diff --git a/nokia-lintian/private/manual_refs_update.pl b/nokia-lintian/private/manual_refs_update.pl
new file mode 100755 (executable)
index 0000000..a329da0
--- /dev/null
@@ -0,0 +1,104 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2001 Colin Watson
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# Invoke as ./manual_refs_update.pl manual_refs > manual_refs.new
+# You need copies of all the relevant manuals installed in the standard
+# places locally.
+
+# Currently, this is only likely to work with the HTML output by
+# DebianDoc-SGML. This seems to be OK for all the necessary manuals for now.
+
+use strict;
+
+# Location of the manual directory on the local filesystem, and base URL for
+# the eventual target of the reference.
+
+my %manuals = (
+    'policy'    => [ '/usr/share/doc/debian-policy/policy.html',
+                     'http://www.debian.org/doc/debian-policy' ],
+    'devref'    => [ '/usr/share/doc/developers-reference/' .
+                        'developers-reference.html',
+                     'http://www.debian.org/doc/packaging-manuals/' .
+                        'developers-reference' ],
+    'menu'      => [ '/usr/share/doc/menu/html',
+                     'http://www.debian.org/doc/packaging-manuals/menu.html' ],
+);
+
+my %refs;
+
+for my $manual (keys %manuals) {
+    my ($dir, $url) = @{$manuals{$manual}};
+    my @chapter_refs;
+
+    unless (-d $dir) {
+        print STDERR "Manual '$manual' not installed; not updating.\n";
+        next;
+    }
+    $refs{$manual} = [ "$manual $url/index.html" ];
+
+    local *DIR;
+    opendir DIR, $dir or die "Couldn't open $dir: $!";
+    while (defined(my $file = readdir DIR)) {
+        next unless -f "$dir/$file";
+        my $chapter;
+        local *FILE;
+        open FILE, "< $dir/$file" or
+            die "Couldn't open $dir/$file: $!";
+        while (<FILE>) {
+            if (m/^Chapter (\d+)/ and not defined $chapter) {
+                $chapter = $1;
+                push @{$chapter_refs[$chapter]}, "$manual-$1 $url/$file";
+            }
+            elsif (m/<a name="(.+?)">(\d.*?) /) {
+                if (defined $chapter) {
+                    push @{$chapter_refs[$chapter]},
+                         "$manual-$2 $url/$file#$1";
+                } else {
+                    print STDERR "No 'Chapter' line in $dir/$file; ",
+                                 "ignoring this file.\n";
+                    next;
+                }
+            }
+        }
+        close FILE;
+    }
+    closedir DIR;
+
+    for my $chapter_ref (@chapter_refs) {
+        next unless defined $chapter_ref;
+        push @{$refs{$manual}}, @$chapter_ref;
+    }
+}
+
+# Replace all lines for manuals for which we have up-to-date information.
+
+my %seen;
+
+while (<>) {
+    next unless m/^(\w+)/;
+    my $manual = $1;
+    next if $seen{$manual};
+    if (exists $manuals{$manual} and exists $refs{$manual}) {
+        $seen{$manual} = 1;
+        print join("\n", @{$refs{$manual}}), "\n";
+    } else {
+        print;
+    }
+}
diff --git a/nokia-lintian/private/tags-never-seen b/nokia-lintian/private/tags-never-seen
new file mode 100644 (file)
index 0000000..2419b01
--- /dev/null
@@ -0,0 +1,254 @@
+Last generated 2008-07-14
+
+binaries.desc apparently-corrupted-elf-binary
+binaries.desc arch-dependent-file-in-usr-share
+binaries.desc binary-compiled-with-profiling-enabled
+binaries.desc binary-file-compressed-with-upx
+binaries.desc binary-in-etc
+binaries.desc binary-or-shlib-defines-rpath
+binaries.desc library-in-debug-or-profile-should-not-be-stripped
+binaries.desc library-not-linked-against-libc
+binaries.desc program-not-linked-against-libc
+changelog-file.desc html-changelog-without-text-version
+changelog-file.desc no-upstream-changelog
+changelog-file.desc spelling-error-in-changelog
+changelog-file.desc wrong-name-for-changelog-of-native-package
+changelog-file.desc wrong-name-for-debian-changelog-file
+changelog-file.desc wrong-name-for-upstream-changelog
+conffiles.desc duplicate-conffile
+conffiles.desc file-in-usr-marked-as-conffile
+conffiles.desc relative-conffile
+control-file.desc debian-control-file-is-a-symlink
+control-file.desc debian-control-with-duplicate-fields
+control-files.desc control-file-has-bad-owner
+control-files.desc not-allowed-control-file
+control-files.desc unknown-control-file
+copyright-file.desc cannot-check-whether-usr-share-doc-symlink-points-to-foreign-package
+copyright-file.desc copyright-does-not-refer-to-common-license-file
+copyright-file.desc copyright-should-refer-to-common-license-file-for-lgpl
+copyright-file.desc spelling-error-in-copyright
+copyright-file.desc usr-share-doc-symlink-points-outside-of-usr-share-doc
+copyright-file.desc usr-share-doc-symlink-to-foreign-package
+cruft.desc diff-contains-git-control-dir
+cruft.desc diff-contains-hg-control-dir
+cruft.desc diff-contains-patch-failure-file
+cruft.desc documentation-package-not-architecture-independent
+cruft.desc outdated-autotools-helper-file
+cruft.desc source-contains-arch-control-dir
+cruft.desc source-contains-arch-inventory-file
+cruft.desc source-contains-bzr-control-dir
+cruft.desc source-contains-cvs-conflict-copy
+cruft.desc source-contains-cvs-control-dir
+cruft.desc source-contains-hg-control-dir
+cruft.desc source-contains-svk-commit-file
+cruft.desc source-contains-svn-conflict-file
+cruft.desc source-contains-svn-control-dir
+debconf.desc boolean-template-has-bogus-default
+debconf.desc debconf-is-not-a-registry
+debconf.desc duplicate-fields-in-templates
+debconf.desc duplicate-long-description-in-template
+debconf.desc empty-translated-choices
+debconf.desc isdefault-flag-is-deprecated
+debconf.desc malformed-template-name
+debconf.desc no-template-name
+debconf.desc select-without-choices
+debconf.desc unknown-field-in-templates
+debconf.desc unknown-template-type
+debhelper.desc debhelper-compat-file-is-empty
+debhelper.desc dh-make-template-in-source
+debhelper.desc dh_dhelp-is-deprecated
+debian-readme.desc spelling-error-in-readme-debian
+description.desc description-synopsis-has-leading-spaces
+fields.desc alternates-not-allowed
+fields.desc arch-any-in-binary-pkg
+fields.desc aspell-package-not-arch-all
+fields.desc bad-menu-item
+fields.desc bad-package-name
+fields.desc bad-relation
+fields.desc bad-version-number
+fields.desc build-depends-on-x-metapackage
+fields.desc debian-revision-not-well-formed
+fields.desc debian-revision-should-not-be-zero
+fields.desc depends-on-libdb1-compat
+fields.desc depends-on-python-minimal
+fields.desc doc-package-depends-on-main-package
+fields.desc essential-in-source-package
+fields.desc essential-no-not-needed
+fields.desc magic-arch-in-arch-list
+fields.desc maintainer-address-is-on-localhost
+fields.desc maintainer-address-looks-weird
+fields.desc maintainer-address-malformed
+fields.desc maintainer-name-missing
+fields.desc malformed-python-version
+fields.desc multiline-field
+fields.desc new-essential-package
+fields.desc no-architecture-field
+fields.desc no-maintainer-field
+fields.desc no-package-name
+fields.desc no-source-field
+fields.desc no-version-field
+fields.desc obsolete-field
+fields.desc obsolete-relation-form
+fields.desc old-versioned-python-dependency
+fields.desc package-depends-on-an-x-font-package
+fields.desc package-depends-on-multiple-tclx-versions
+fields.desc package-not-lowercase
+fields.desc source-field-does-not-match-pkg-name
+fields.desc source-field-malformed
+fields.desc too-many-architectures
+fields.desc unknown-architecture
+fields.desc unknown-essential-value
+fields.desc unknown-field-in-control
+fields.desc unknown-field-in-dsc
+fields.desc unknown-priority
+fields.desc upstream-version-not-numeric
+fields.desc versioned-provides
+fields.desc wrong-section-for-udeb
+files.desc FSSTND-dir-in-var
+files.desc backup-file-in-package
+files.desc bad-owner-for-doc-file
+files.desc bad-permissions-for-etc-cron.d-script
+files.desc bad-permissions-for-etc-emacs-script
+files.desc compressed-symlink-with-wrong-ext
+files.desc config-file-reserved
+files.desc debug-package-should-be-named-dbg
+files.desc dir-in-usr-local
+files.desc dir-or-file-in-mnt
+files.desc dir-or-file-in-opt
+files.desc dir-or-file-in-tmp
+files.desc executable-in-usr-share-doc
+files.desc file-in-opt
+files.desc file-in-usr-lib-cgi-bin
+files.desc file-in-usr-lib-site-python
+files.desc file-in-usr-local
+files.desc image-file-in-usr-lib
+files.desc nested-examples-directory
+files.desc nfs-temporary-file-in-package
+files.desc non-standard-dir-in-usr
+files.desc non-standard-dir-in-var
+files.desc non-standard-file-perm
+files.desc non-standard-file-permissions-for-etc-init.d-script
+files.desc non-standard-game-executable-perm
+files.desc old-app-defaults-directory
+files.desc old-style-example-dir
+files.desc override-file-in-wrong-location
+files.desc package-contains-xvpics-dir
+files.desc package-installs-font-to-usr-x11r6
+files.desc package-installs-into-etc-rc.boot
+files.desc package-installs-into-etc-rc.d
+files.desc package-installs-perllocal-pod
+files.desc package-uses-obsolete-file
+files.desc perl-module-in-core-directory
+files.desc possible-name-space-pollution
+files.desc script-in-usr-share-doc
+files.desc setgid-binary
+files.desc setuid-gid-binary
+files.desc special-file
+files.desc subdir-in-bin
+files.desc third-party-package-in-python-dir
+files.desc udeb-contains-documentation-file
+infofiles.desc postrm-calls-install-info
+infofiles.desc preinst-calls-install-info
+init.d.desc duplicate-updaterc.d-calls-in-postinst
+init.d.desc file-in-etc-rc.d-marked-as-conffile
+init.d.desc init.d-script-has-bad-start-runlevel
+init.d.desc init.d-script-has-duplicate-lsb-keyword
+init.d.desc script-in-etc-init.d-not-registered-via-update-rc.d
+lintian.desc bad-distribution-in-changes-file
+lintian.desc bad-section-in-changes-file
+lintian.desc bad-urgency-in-changes-file
+lintian.desc checksum-mismatch-in-changes-file
+lintian.desc file-size-mismatch-in-changes-file
+lintian.desc no-description-in-changes-file
+lintian.desc no-urgency-in-changes-file
+manpages.desc FSSTND-dir-in-manual-page
+manpages.desc bad-so-link-within-manual-page
+manpages.desc manpage-for-non-x11-binary-in-wrong-directory
+manpages.desc manpage-for-x11-binary-in-wrong-directory
+manpages.desc manpage-in-wrong-directory
+manpages.desc manpage-section-mismatch
+manpages.desc no-manpage-in-correct-directory
+menu-format.desc bad-test-in-menu-item
+menu-format.desc desktop-entry-contains-deprecated-key
+menu-format.desc desktop-entry-lacks-main-category
+menu-format.desc duplicated-key-in-desktop-entry
+menu-format.desc duplicated-tag-in-menu-item
+menu-format.desc menu-icon-cannot-be-parsed
+menu-format.desc menu-icon-missing
+menu-format.desc menu-icon-not-in-xpm-format
+menu-format.desc menu-icon-too-big
+menu-format.desc menu-item-adds-to-root-menu
+menu-format.desc menu-item-contains-unknown-tag
+menu-format.desc menu-item-creates-new-root-section
+menu-format.desc menu-item-needs-dwww
+menu-format.desc menu-item-uses-apps-games-section
+menu-format.desc menu-item-uses-icon-none
+menu-format.desc old-format-menu-file
+menu-format.desc pkg-not-in-package-test
+menu-format.desc unparsable-menu-item
+menu-format.desc whitespace-after-continuation-character
+menus.desc doc-base-abstract-field-is-template
+menus.desc doc-base-abstract-might-contain-extra-leading-whitespaces
+menus.desc doc-base-document-field-not-in-first-line
+menus.desc doc-base-file-duplicated-field
+menus.desc doc-base-file-references-usr-doc
+menus.desc doc-base-file-separator-extra-whitespaces
+menus.desc doc-base-file-syntax-error
+menus.desc executable-in-usr-share-docbase
+menus.desc executable-menu-file
+menus.desc maintainer-script-does-not-check-for-existence-of-installdocs
+menus.desc maintainer-script-does-not-check-for-existence-of-updatemenus
+menus.desc postinst-has-useless-call-to-install-docs
+menus.desc postinst-has-useless-call-to-update-menus
+menus.desc postrm-calls-installdocs
+menus.desc postrm-has-useless-call-to-update-menus
+menus.desc preinst-calls-installdocs
+menus.desc preinst-calls-updatemenus
+menus.desc prerm-calls-updatemenus
+menus.desc prerm-has-useless-call-to-install-docs
+nmu.desc changelog-is-symlink
+patch-systems.desc more-than-one-patch-system
+patch-systems.desc patch-modifying-debian-files
+patch-systems.desc quilt-patch-with-non-standard-options
+patch-systems.desc quilt-series-but-no-build-dep
+patch-systems.desc quilt-series-references-non-existent-patch
+po-debconf.desc missing-file-from-potfiles-in
+po-debconf.desc missing-potfiles-in
+po-debconf.desc missing-templates-pot
+po-debconf.desc not-using-po-debconf
+rules.desc debian-rules-is-symlink
+rules.desc debian-rules-not-a-makefile
+rules.desc debian-rules-uses-DEB_BUILD_OPTS
+rules.desc desktop-file-but-no-dh_desktop-call
+scripts.desc csh-considered-harmful
+scripts.desc gawk-script-but-no-gawk-dep
+scripts.desc interpreter-in-usr-local
+scripts.desc interpreter-not-absolute
+scripts.desc killall-is-dangerous
+scripts.desc maintainer-script-needs-depends-on-adduser
+scripts.desc maintainer-script-needs-depends-on-update-inetd
+scripts.desc mawk-script-but-no-mawk-dep
+scripts.desc mknod-in-maintainer-script
+scripts.desc ruby-script-but-no-ruby-dep
+scripts.desc script-not-executable
+scripts.desc script-without-interpreter
+scripts.desc tclsh-script-but-no-tclsh-dep
+scripts.desc unusual-control-interpreter
+scripts.desc wish-script-but-no-wish-dep
+shared-libs.desc dev-pkg-without-shlib-symlink
+shared-libs.desc ldconfig-symlink-before-shlib-in-deb
+shared-libs.desc ldconfig-symlink-is-not-a-symlink
+shared-libs.desc ldconfig-symlink-referencing-wrong-file
+shared-libs.desc no-shlibs-control-file
+shared-libs.desc non-dev-pkg-with-shlib-symlink
+shared-libs.desc pkg-has-shlibs-control-file-but-no-actual-shared-libs
+shared-libs.desc postinst-has-useless-call-to-ldconfig
+shared-libs.desc postrm-should-call-ldconfig
+shared-libs.desc postrm-unsafe-ldconfig
+shared-libs.desc preinst-calls-ldconfig
+shared-libs.desc prerm-calls-ldconfig
+shared-libs.desc shlib-with-bad-permissions
+shared-libs.desc shlib-with-executable-stack
+shared-libs.desc shlib-without-PT_GNU_STACK-section
+standards-version.desc invalid-standards-version
+watch-file.desc debian-watch-file-missing-version
diff --git a/nokia-lintian/private/update-never-seen b/nokia-lintian/private/update-never-seen
new file mode 100755 (executable)
index 0000000..65ffc54
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w
+#
+# This simple filter takes the output from runtests -v and mangles it into the
+# format for the tags-never-seen file.
+
+use POSIX qw(strftime);
+
+my @untested;
+while (<>) {
+    next unless /^I: tag-is-not-tested (\S+) in (\S+)/;
+    push (@untested, [ $2, $1 ]);
+}
+@untested = sort { $a->[0] cmp $b->[0] || $a->[1] cmp $b->[1] } @untested;
+print "Last generated ", strftime ('%Y-%m-%d', gmtime), "\n\n";
+for my $tag (@untested) {
+    print "$tag->[0] $tag->[1]\n";
+}
diff --git a/nokia-lintian/reporting/checkout-release b/nokia-lintian/reporting/checkout-release
new file mode 100755 (executable)
index 0000000..ea49d54
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+# Copyright 2008 Frank Lichtenheld <djpig@debian.org>, if at all copyrightable
+
+# Helper script for updating lintian.debian.org to the latest lintian release
+# Call with the release number as only argument, e.g.
+# $ cd /org/lintian.debian.org && ./root/reporting/checkout-release 1.25.0
+
+set -e
+
+if [ $# -ne 1 ]; then
+       echo "Usage: checkout-release <version-number>"
+       exit 2
+fi
+
+release=$1
+
+set -x
+
+svn co http://svn.wolffelaar.nl/lintian/releases/$release lintian-$release
+
+sed -i "s/<VERSION>/$release/" lintian-$release/frontend/lintian
+
+(cd lintian-$release/doc && LANG=C debiandoc2html lintian.sgml)
+
+rm root && ln -s lintian-$release root
+
diff --git a/nokia-lintian/reporting/config b/nokia-lintian/reporting/config
new file mode 100644 (file)
index 0000000..026cc79
--- /dev/null
@@ -0,0 +1,28 @@
+# Hey emacs! This is a -*- Perl -*- script!
+# config -- configuration file for Lintian reporting harness
+
+$HOME = "/org/lintian.debian.org";
+$LINTIAN_ARCHIVEDIR = "/org/ftp.debian.org/ftp";
+$LINTIAN_DIST = "sid";
+$LINTIAN_SECTION = "main";
+$LINTIAN_ARCH = "i386";
+
+$LINTIAN_ROOT = "$HOME/root";
+$LINTIAN_LAB = "$HOME/laboratory";
+$LOG_DIR = "$HOME/logs";
+$HTML_DIR = "$HOME/www";
+$HTML_TMP_DIR = "$HTML_DIR.new";
+$LINTIAN_CFG = "$LINTIAN_ROOT/reporting/lintian-dummy.cfg";  # this config file has to be empty!
+$LINTIAN_UNPACK_LEVEL = "";
+
+$log_file = "$LOG_DIR/harness.log";
+$changes_file = "$LOG_DIR/setup-lab.log";
+$list_file = "$LOG_DIR/changed-packages.list";
+$lintian_log = "$LOG_DIR/lintian.log";
+$old_lintian_log = "$LOG_DIR/lintian.log.old";
+$lintian_cmd = "$LINTIAN_ROOT/frontend/lintian";
+$html_reports_cmd = "$LINTIAN_ROOT/reporting/html_reports";
+$html_reports_log = "$LOG_DIR/html_reports.log";
+$statistics_file = "$LOG_DIR/statistics";
+
+1;
diff --git a/nokia-lintian/reporting/harness b/nokia-lintian/reporting/harness
new file mode 100755 (executable)
index 0000000..9142552
--- /dev/null
@@ -0,0 +1,287 @@
+#!/usr/bin/perl
+#
+# Lintian reporting harness -- Create and maintain Lintian reports automatically
+#
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use Getopt::Std;
+
+use vars qw($opt_c $opt_f $opt_i $opt_r);
+unless (getopts('cfir')) {
+  print <<END;
+Lintian reporting harness
+Create and maintain Lintian reports automatically
+
+Usage: harness [ -i | -c [-f] ] [ -r ]
+
+Options:
+  -c   clean mode, erase everything and start from scratch
+  -f   full mode, blithely overwrite lintian.log
+  -i   incremental mode, use old lintian.log data, process changes only
+  -r   generate HTML reports only
+
+Incremental mode is the default if you have a lintian.log;
+otherwise, it's full.
+
+Report bugs to <lintian-maint\@debian.org>.
+END
+  exit;
+}
+
+die "Can't use both incremental and full/clean." if ($opt_i && ($opt_f || $opt_c));
+$opt_f = 1 if $opt_c;
+die "Can't use other modes with reports only." if ($opt_r && ($opt_i || $opt_f || $opt_c));
+
+# read configuration
+require './config';
+use vars qw($LINTIAN_ROOT $LINTIAN_LAB $LINTIAN_ARCHIVEDIR $LINTIAN_DIST 
+            $LINTIAN_SECTION $LINTIAN_ARCH $LINTIAN_UNPACK_LEVEL $LINTIAN_CFG
+            $lintian_cmd $html_reports_cmd
+            $log_file $lintian_log $old_lintian_log
+            $changes_file $list_file $html_reports_log
+            $LOG_DIR $statistics_file
+            $HTML_DIR $HTML_TMP_DIR);
+
+# import perl libraries
+unshift @INC, "$LINTIAN_ROOT/lib";
+require Read_pkglists;
+use vars qw(%binary_info %source_info %udeb_info); # from the above
+require Util;
+
+# turn file buffering off
+$| = 1;
+
+# rotate log files
+system("savelog $log_file $changes_file $list_file $html_reports_log >/dev/null") == 0
+    or Die("cannot rotate log files");
+
+# create new log file
+open(LOG, '>', $log_file)
+    or Die("cannot open log file $log_file for writing: $!");
+
+# export Lintian's configuration
+$ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT;
+$ENV{'LINTIAN_CFG'} = $LINTIAN_CFG;
+$ENV{'LINTIAN_LAB'} = $LINTIAN_LAB;
+$ENV{'LINTIAN_ARCHIVEDIR'} = $LINTIAN_ARCHIVEDIR;
+$ENV{'LINTIAN_DIST'} = $LINTIAN_DIST;
+$ENV{'LINTIAN_UNPACK_LEVEL'} = $LINTIAN_UNPACK_LEVEL;
+$ENV{'LINTIAN_SECTION'} = $LINTIAN_SECTION;
+$ENV{'LINTIAN_ARCH'} = $LINTIAN_ARCH;
+
+if ($opt_c) { # purge the old packages
+  system("rm -rf $LINTIAN_LAB/binary") == 0 || die "$!";
+  system("mkdir -m 2775 $LINTIAN_LAB/binary") == 0 || die "$!";
+  system("rm -rf $LINTIAN_LAB/udeb") == 0 || die "$!";
+  system("mkdir -m 2775 $LINTIAN_LAB/udeb") == 0 || die "$!";
+  system("rm -rf $LINTIAN_LAB/source") == 0 || die "$!";
+  system("mkdir -m 2775 $LINTIAN_LAB/source") == 0 || die "$!";
+  system("rm -f $LINTIAN_LAB/info/*") == 0 || die "$!";
+}
+
+unless ($opt_r) {
+  # make lintian update its packages files and save output
+  run("$lintian_cmd -v --setup-lab >$changes_file")
+      or Die("cannot run lintian --setup-lab");
+  Log("");
+}
+
+unless ($opt_f || $opt_c) {
+  unless ($opt_r) {
+    if (-f $lintian_log) {
+      $opt_i = 1;
+    } else {
+      $opt_f = 1;
+    }
+  }
+}
+
+if ($opt_f) { # check all packages
+  Log("Running Lintian over all packages...");
+  my $cmd = "$lintian_cmd -I -E -v -a --show-overrides -U changelog-file >$lintian_log";
+  Log("Executing $cmd");
+  my $res = (system($cmd) >> 8);
+  (($res == 0) or ($res == 1))
+    or Log("warning: executing lintian returned $res");
+  Log("");
+}
+
+if ($opt_i) { # process changes only
+
+    die "Old Lintian log file $lintian_log not found!\n" unless -f $lintian_log;
+
+    my $pkgfile;
+    my %skip_binary;
+    my %skip_udeb;
+    my %skip_source;
+
+    # read binary packages files
+    $pkgfile = "$LINTIAN_LAB/info/binary-packages";
+    (-f $pkgfile) or Die("cannot find list of binary packages $pkgfile");
+    read_bin_list($pkgfile);
+
+    # read udeb packages files
+    $pkgfile = "$LINTIAN_LAB/info/udeb-packages";
+    (-f $pkgfile) or Die("cannot find list of udeb packages $pkgfile");
+    read_udeb_list($pkgfile);
+
+    # read source packages files
+    $pkgfile = "$LINTIAN_LAB/info/source-packages";
+    (-f $pkgfile) or Die("cannot find list of source packages $pkgfile");
+    read_src_list($pkgfile);
+
+    # process changes file and create list of packages to process
+    Log("Reading changes file...");
+    open(IN, '<', $changes_file)
+       or Die("cannot open changes file $changes_file for reading: $!");
+    open(OUT, '>', $list_file)
+       or Die("cannot open list file $list_file for writing: $!");
+    while (<IN>) {
+       chop;
+
+       if (/^N: Listed (changed|new) (binary|udeb|source) package (\S+) (\S+)/o) {
+           my ($type,$binsrc,$pkg,$ver) = ($1,$2,$3,$4);
+
+           Log("$type $binsrc package $pkg $ver");
+
+           if ($binsrc eq 'binary') {
+               my $data = $binary_info{$pkg};
+               $data or Die("cannot find binary package $pkg in binary-packages file");
+               print OUT "b $binary_info{$pkg}->{'package'} $binary_info{$pkg}->{'version'} $LINTIAN_ARCHIVEDIR/$binary_info{$pkg}->{'file'}\n";
+               $skip_binary{$pkg} = 1;
+           } elsif ($binsrc eq 'udeb') {
+               my $data = $udeb_info{$pkg};
+               $data or Die("cannot find udeb package $pkg in udeb-packages file");
+               print OUT "u $udeb_info{$pkg}->{'package'} $udeb_info{$pkg}->{'version'} $LINTIAN_ARCHIVEDIR/$udeb_info{$pkg}->{'file'}\n";
+               $skip_udeb{$pkg} = 1;
+           } else {
+               my $data = $source_info{$pkg};
+               $data or Die("cannot find source package $pkg in source-packages file");
+               print OUT "s $source_info{$pkg}->{'source'} $source_info{$pkg}->{'version'} $LINTIAN_ARCHIVEDIR/$source_info{$pkg}->{'file'}\n";
+               $skip_source{$pkg} = 1;
+           }
+       } elsif (/^N: Removed (binary|udeb|source) package (\S+)/o) {
+           my ($binsrc,$pkg) = ($1,$2);
+
+           Log("removed $binsrc package $pkg");
+           run("rm -r -- \"$LINTIAN_LAB/$binsrc/$pkg\"")
+               or Log("could not remove $binsrc package $pkg");
+           if ($binsrc eq 'binary') {
+               $skip_binary{$pkg} = 1;
+           } elsif ($binsrc eq 'udeb') {
+               $skip_udeb{$pkg} = 1;
+           } else {
+               $skip_source{$pkg} = 1;
+           }
+       } elsif (/^N/o) {
+           # ignore other notes
+       } else {
+           Log("skipping changes line: $_");
+       }
+    }
+    close(OUT);
+    close(IN);
+    Log("");
+
+    # update lintian.log
+    Log("Updating lintian.log...");
+    rename $lintian_log, $old_lintian_log;
+    open(IN, '<', $old_lintian_log)
+       or Die("cannot open old lintian.log $old_lintian_log for reading: $!");
+    open(OUT, '>', $lintian_log)
+       or Die("cannot open lintian.log $lintian_log for writing: $!");
+    my $copy_mode = 1;
+    while (<IN>) {
+       if (/^N: Processing (binary|udeb|source) package (\S+)/o) {
+           my ($type,$pkg) = ($1,$2);
+
+           if ($type eq 'binary') {
+               $copy_mode = not exists $skip_binary{$pkg};
+           } elsif ($type eq 'udeb') {
+               $copy_mode = not exists $skip_udeb{$pkg};
+           } else {
+               $copy_mode = not exists $skip_source{$pkg};
+           }
+       }
+
+       if ($copy_mode) {
+           print OUT $_;
+       }
+    }
+    print OUT "N: ---end-of-old-lintian-log-file---\n";
+    close(OUT);
+    close(IN);
+    Log("");
+
+    # run Lintian over the newly introduced or changed packages
+    Log("Running Lintian over newly introduced and changed packages...");
+    my $cmd = "$lintian_cmd -I -E -v --show-overrides -p $list_file -U changelog-file >>$lintian_log";
+    Log("Executing $cmd");
+    my $res = (system($cmd) >> 8);
+    (($res == 0) or ($res == 1))
+        or Log("warning: executing lintian returned $res");
+    Log("");
+}
+
+# create html reports
+Log("Creating HTML reports...");
+run("$html_reports_cmd $lintian_log >$html_reports_log 2>&1")
+    or Log("warning: executing $html_reports_cmd returned $?");
+Log("");
+
+# rotate the statistics file updated by $html_reports_cmd
+if (-f $statistics_file) {
+  system("cp $statistics_file $LOG_DIR/stats/statistics-`date +%Y%m%d`") == 0
+    or Log("warning: couldn't rotate the statistics file");
+}
+
+#Log("Creating depcheck pages...");
+#run("$LINTIAN_ROOT/depcheck/deppages.pl >>$html_reports_log")
+#    or Log("warning: executing deppages.pl returned $?");
+#Log("");
+
+# install new html directory
+Log("Installing HTML reports...");
+system("rm -rf $HTML_DIR") == 0
+    or Die("error removing $HTML_DIR");
+# a tiny bit of race right here
+rename($HTML_TMP_DIR,$HTML_DIR)
+    or Die("error renaming $HTML_TMP_DIR into $HTML_DIR");
+Log("");
+
+# ready!!! :-)
+Log("All done.");
+exit 0;
+
+# -------------------------------
+
+sub Log {
+    print LOG $_[0],"\n";
+}
+
+sub run {
+    Log("Executing $_[0]");
+    return (system($_[0]) == 0);
+}
+
+sub Die {
+    Log("fatal error: $_[0]");
+    exit 1;
+}
diff --git a/nokia-lintian/reporting/html_reports b/nokia-lintian/reporting/html_reports
new file mode 100755 (executable)
index 0000000..fcf94a6
--- /dev/null
@@ -0,0 +1,567 @@
+#!/usr/bin/perl -w
+#
+# Lintian HTML reporting tool -- Create Lintian web reports
+#
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+# Copyright (C) 2007 Russ Allbery
+#
+# This program is free software.  It is distributed under the terms of
+# the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use File::Copy qw(copy);
+use URI::Escape;
+use Text::Template ();
+
+# ------------------------------
+# Global variables and configuration
+
+# Maximum number of identical tags per package to display.  Any remaining tags
+# will be compressed into a "... reported %d more times" line.
+our $MAX_TAGS = 8;
+
+# These have no default and must be set in the configuration file.
+# FIXME: $statistics_file should be in all caps as well.
+our ($LINTIAN_ROOT, $LINTIAN_LAB, $LINTIAN_ARCHIVEDIR, $LINTIAN_DIST,
+     $LINTIAN_SECTION, $LINTIAN_ARCH, $HTML_TMP_DIR, $statistics_file);
+
+# Read the configuration.
+require './config';
+
+# The path to the mirror timestamp.
+our $LINTIAN_TIMESTAMP
+    = "$LINTIAN_ARCHIVEDIR/project/trace/ftp-master.debian.org";
+
+# FIXME: At least the lab should be a parameter to Read_pkglists rather
+# than an environment variable.
+$ENV{'LINTIAN_LAB'} = $LINTIAN_LAB;
+$ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT;
+
+# Import Lintian Perl libraries.
+use lib "$ENV{LINTIAN_ROOT}/lib";
+use Read_pkglists;
+use Read_taginfo;
+use Util;
+
+# Global variables from Read_pkglists.  Ugh.
+# FIXME: Read_pkglists should return this information instead.
+our (%binary_info, %source_info, %udeb_info, %bin_src_ref);
+
+# Get the tag information from the Lintian *.desc files.
+our %tag_info = %{ read_tag_info('html') };
+
+# Set the Lintian version, current timestamp, and archive timestamp.
+our $LINTIAN_VERSION = `$LINTIAN_ROOT/frontend/lintian --print-version`;
+our $timestamp = `date -u --rfc-822`;
+our $mirror_timestamp = slurp_entire_file($LINTIAN_TIMESTAMP);
+chomp ($LINTIAN_VERSION, $timestamp, $mirror_timestamp);
+
+
+# ------------------------------
+# Initialize templates
+
+# The path to our templates.
+our $TEMPLATES = "$LINTIAN_ROOT/reporting/templates";
+
+# This only has to be done once, so do it at the start and then reuse the same
+# templates throughout.
+our %templates;
+for my $template (qw/head foot clean index maintainer maintainers packages tag tags/) {
+    my %options = (TYPE => 'FILE', SOURCE => "$TEMPLATES/$template.tmpl");
+    $templates{$template} = Text::Template->new (%options)
+        or die "cannot load template $template: $Text::Template::ERROR\n";
+}
+
+
+# ------------------------------
+# Main routine
+
+# Read the package lists.
+#
+# FIXME: get_bin_src_ref runs read_src_list unconditionally so we can't call
+# it directly, which is confusing.
+read_bin_list;
+read_udeb_list;
+get_bin_src_ref;
+
+# Create output directories.
+mkdir($HTML_TMP_DIR, 0777)
+    or die "cannot create output directory $HTML_TMP_DIR: $!\n";
+mkdir("$HTML_TMP_DIR/full", 0777)
+    or die "cannot create output directory $HTML_TMP_DIR/full: $!\n";
+mkdir("$HTML_TMP_DIR/maintainer", 0777)
+    or die "cannot create output directory $HTML_TMP_DIR/maintainer: $!\n";
+mkdir("$HTML_TMP_DIR/tags", 0777)
+    or die "cannot create output directory $HTML_TMP_DIR/tags: $!\n";
+symlink(".", "$HTML_TMP_DIR/reports")
+    or die "cannot create symlink $HTML_TMP_DIR/reports: $!\n";
+symlink("$LINTIAN_ROOT/doc/lintian.html", "$HTML_TMP_DIR/manual")
+    or die "cannot create symlink $HTML_TMP_DIR/manual: $!\n";
+if ($ARGV[0]) {
+    symlink($ARGV[0], "$HTML_TMP_DIR/lintian.log")
+        or die "cannot create symlink $HTML_TMP_DIR/lintian.log: $!\n";
+}
+copy("$LINTIAN_ROOT/reporting/lintian.css", "$HTML_TMP_DIR/lintian.css")
+    or die "cannot copy lintian.css to $HTML_TMP_DIR: $!\n";
+for my $image (qw/ico.png l.png logo-small.png/) {
+    copy("$LINTIAN_ROOT/reporting/images/$image", "$HTML_TMP_DIR/$image")
+        or die "cannot copy images/$image to $HTML_TMP_DIR: $!\n";
+}
+
+# This variable will accumulate statistics.  For tags: errors, warnings,
+# experimental, overridden, and info are the keys holding the count of tags of
+# that sort.  For packages: binary, udeb, and source are the number of
+# packages of each type with Lintian errors or warnings.  For maintainers:
+# maintainers is the number of maintainers with Lintian errors or warnings.
+my %statistics;
+
+# %by_maint holds a hash of maintainer names to packages and tags.  Each
+# maintainer is a key.  The value is a hash of package names to hashes.  Each
+# package hash is in turn a hash of versions to an anonymous array of hashes,
+# with each hash having keys code, package, type, tag, extra, and xref.  xref
+# gets the partial URL of the maintainer page for that source package.
+#
+# In other words, the lintian output line:
+#
+#     W: gnubg source: substvar-source-version-is-deprecated gnubg-data
+#
+# for gnubg 0.15~20061120-1 maintained by Russ Allbery <rra@debian.org> is
+# turned into the following structure:
+#
+# { 'gnubg' => {
+#       '0.15~20061120-1' => [
+#           { code    => 'W',
+#             package => 'gnubg',
+#             type    => 'source',
+#             tag     => 'substvar-source-version-is-deprecated',
+#             extra   => 'gnubg-data'
+#             xref    => 'rra@debian.org.html#gnubg' } ] } }
+#
+# and then stored under the key 'Russ Allbery <rra@debian.org>'
+#
+# %by_uploader holds the same thing except for packages for which the person
+# is only an uploader.
+#
+# %by_tag is a hash of tag names to an anonymous array of tag information
+# hashes just like the inside-most data structure above.
+my (%by_maint, %by_uploader, %by_tag);
+
+# We take a lintian log file on either standard input or as the first
+# argument.  This log file contains all the tags lintian found, plus N: tags
+# with informational messages.  Ignore all the N: tags and load everything
+# else into the hashes we use for all web page generation.
+#
+# We keep track of a hash from maintainer page URLs to maintainer values so
+# that we don't have two maintainers who map to the same page and overwrite
+# each other's pages.  If we find two maintainers who map to the same URL,
+# just assume that the second maintainer is the same as the first (but warn
+# about it).
+my (%seen, %saw_maintainer);
+while (<>) {
+    chomp;
+    next unless m/^([EWIXO]): (\S+)(?: (\S+))?: (\S+)(?:\s+(.*))?/;
+    my ($code, $package, $type, $tag, $extra) = ($1, $2, $3, $4, $5);
+    $type = 'binary' unless (defined $type);
+    next unless ($type eq 'source' || $type eq 'binary' || $type eq 'udeb');
+
+    # Update statistics.
+    my $key = {
+        E => 'errors',
+        W => 'warnings',
+        I => 'info',
+        X => 'experimental',
+        O => 'overridden'
+    }->{$code};
+    $statistics{$key}++;
+    unless ($seen{"$package $type"}) {
+        $statistics{"$type-packages"}++;
+        $seen{"$package $type"} = 1;
+    }
+
+    # Determine the source package for this package and warn if there appears
+    # to be no source package in the archive.  Determine the maintainer and
+    # version.  Work around a missing source package by pulling information
+    # from a binary package or udeb of the same name if there is any.
+    my ($source, $version, $maintainer, $uploaders);
+    if ($type eq 'source') {
+        $source = $package;
+        if (exists $source_info{$source}) {
+            $version = $source_info{$source}->{version};
+            $maintainer = $source_info{$source}->{maintainer};
+            $uploaders = $source_info{$source}->{uploaders};
+        } else {
+            warn "source package $package not listed!\n";
+        }
+    } else {
+        $source = $bin_src_ref{$package};
+        if ($source and exists $source_info{$source}) {
+            $maintainer = $source_info{$source}->{maintainer};
+            $uploaders = $source_info{$source}->{uploaders};
+        } else {
+            warn "source for package $package not found!\n";
+            $source = $package;
+            if ($type eq 'binary') {
+                $maintainer = $binary_info{$package}->{maintainer};
+            } elsif ($type eq 'udeb') {
+                $maintainer = $udeb_info{$package}->{maintainer};
+            }
+        }
+        if ($type eq 'binary') {
+            $version = $binary_info{$package}->{version};
+        } elsif ($type eq 'udeb') {
+            $version = $udeb_info{$package}->{version};
+        }
+    }
+    $maintainer ||= '(unknown)';
+    $version ||= 'unknown';
+
+    # Check if we've seen the URL for this maintainer before and, if so, map
+    # them to the same person as the previous one.
+    $maintainer = map_maintainer ($maintainer);
+    $saw_maintainer{$maintainer} = 1;
+
+    # Update maintainer statistics.
+    $statistics{maintainers}++ unless defined $by_maint{$maintainer};
+
+    # Sanitize, just out of paranoia.
+    $source =~ s/[^a-zA-Z0-9.+-]/_/g;
+    $version =~ s/[^a-zA-Z0-9.+:~-]/_/g;
+
+    # Add the tag information to our hashes.  Share the data between the
+    # hashes to save space (which means we can't later do destructive tricks
+    # with it).
+    my $info = {
+        code    => html_quote ($code),
+        package => html_quote ($package),
+        type    => html_quote ($type),
+        tag     => html_quote ($tag),
+        extra   => html_quote ($extra),
+        xref    => maintainer_url ($maintainer) . "#$source"
+    };
+    $by_maint{$maintainer}{$source}{$version} ||= [];
+    push(@{ $by_maint{$maintainer}{$source}{$version} }, $info);
+    $by_tag{$tag} ||= [];
+    push(@{ $by_tag{$tag} }, $info);
+
+    # If the package had uploaders listed, also add the information to
+    # %by_uploaders (still sharing the data between hashes).
+    if ($uploaders) {
+        my @uploaders = split (/\s*,\s*/, $uploaders);
+        for (@uploaders) {
+            my $uploader = map_maintainer ($_);
+            next if $uploader eq $maintainer;
+            $saw_maintainer{$uploader} = 1;
+            $by_uploader{$uploader}{$source}{$version} ||= [];
+            push(@{ $by_uploader{$uploader}{$source}{$version} }, $info);
+        }
+    }
+}
+
+# Build a hash of all maintainers, not just those with Lintian tags.  We use
+# this later to generate stub pages for maintainers whose packages are all
+# Lintian-clean.
+my %clean;
+for my $source (keys %source_info) {
+    my $maintainer = $source_info{$source}->{maintainer};
+    my $id = maintainer_url ($maintainer);
+    $clean{$id} = $maintainer;
+}
+
+# Now, walk through the tags by source package (sorted by maintainer).  Output
+# a summary page of errors and warnings for each maintainer, output a full
+# page that includes info, experimental, and overriden tags, and assemble the
+# maintainer index and the QA package list as we go.
+my (%qa, %maintainers, %packages);
+my @maintainers;
+{
+    my %seen;
+    @maintainers =
+        sort grep { !$seen{$_}++ } keys (%by_maint), keys (%by_uploader);
+}
+for my $maintainer (@maintainers) {
+    my $id = maintainer_url ($maintainer);
+    delete $clean{$id};
+
+    # For each of this maintainer's packages, add statistical information
+    # about warnings and errors to the QA list and build the packages hash
+    # used for the package index.  We only do this for the maintainer
+    # packages, not the uploader packages, to avoid double-counting.
+    for my $source (keys %{ $by_maint{$maintainer} }) {
+        my ($errors, $warnings) = (0, 0);
+        for my $version (keys %{ $by_maint{$maintainer}{$source} }) {
+            my $tags = $by_maint{$maintainer}{$source}{$version};
+            for my $tag (@$tags) {
+                $errors++ if $tag->{code} eq 'E';
+                $warnings++ if $tag->{code} eq 'W';
+                $packages{$tag->{package}} = $tag->{xref};
+            }
+        }
+        $qa{$source} = [ $errors, $warnings ];
+    }
+
+    # Determine if the maintainer's page is clean.  Check all packages for
+    # which they're either maintainer or uploader and set $error_clean if
+    # they have no errors or warnings.
+    my $error_clean = 1;
+    for my $source (keys %{ $by_maint{$maintainer} },
+                    keys %{ $by_uploader{$maintainer} }) {
+        my $versions = $by_maint{$maintainer}{$source}
+            || $by_uploader{$maintainer}{$source};
+        for my $version (keys %$versions) {
+            my $tags = $versions->{$version};
+            for my $tag (@$tags) {
+                $error_clean = 0 if ($tag->{code} eq 'E');
+                $error_clean = 0 if ($tag->{code} eq 'W');
+            }
+        }
+    }
+
+    # Determine the parts of the maintainer and the file name for the
+    # maintainer page.
+    my ($name, $email) = ($maintainer =~ /^(.*) <([^>]+)>/);
+    $name = 'Unknown Maintainer' unless $name;
+    $email = 'unknown' unless $email;
+    my $regular = "maintainer/$id";
+    my $full = "full/$id";
+
+    # Create the regular maintainer page (only errors and warnings) and the
+    # full maintainer page (all tags, including overrides and info tags).
+    print "Generating page for $id\n";
+    my %data = (
+        email      => html_quote (uri_escape ($email)),
+        errors     => 1,
+        id         => $id,
+        maintainer => html_quote ($maintainer),
+        name       => html_quote ($name),
+        packages   => $by_maint{$maintainer},
+        uploads    => $by_uploader{$maintainer},
+    );
+    my $template;
+    if ($error_clean) {
+        $template = $templates{clean};
+    } else {
+        $template = $templates{maintainer};
+    }
+    output_template ($regular, $template, \%data);
+    $template = $templates{maintainer};
+    $data{errors} = 0;
+    output_template ($full, $template, \%data);
+
+    # Add this maintainer to the hash of maintainer to URL mappings.
+    $maintainers{$maintainer} = $id;
+}
+
+# Write out the maintainer index.
+my %data = (
+    maintainers => \%maintainers,
+);
+output_template ('maintainers.html', $templates{maintainers}, \%data);
+
+# Write out the QA package list.
+open (QA, '>', "$HTML_TMP_DIR/qa-list.txt")
+    or die "cannot create qa-list.txt: $!\n";
+for my $source (sort keys %qa) {
+    print QA "$source $qa{$source}[0] $qa{$source}[1]\n";
+}
+close QA or die "cannot write to qa-list: $!\n";
+
+# Now, generate stub pages for every maintainer who has only clean packages.
+for my $id (keys %clean) {
+    my $maintainer = $clean{$id};
+    my ($name, $email) = ($maintainer =~ /^(.*) <([^>]+)>/);
+    $email = 'unknown' unless $email;
+    my %data = (
+        email      => html_quote (uri_escape ($email)),
+        maintainer => html_quote ($maintainer),
+        name       => html_quote ($name),
+    );
+    print "Generating clean page for $id\n";
+    output_template ("maintainer/$id", $templates{clean}, \%data);
+    output_template ("full/$id", $templates{clean}, \%data);
+}
+
+# Create the pages for each tag.  Each page shows the extended description for
+# the tag and all the packages for which that tag was issued.
+for my $tag (sort keys %by_tag) {
+    my $description;
+    if ($tag_info{$tag}) {
+        $description = wrap_paragraphs('HTML', '    ', $tag_info{$tag});
+    } else {
+        $description = "    <p>Can't find description of tag $tag.</p>";
+    }
+    my $code = 'O';
+    foreach (@{$by_tag{$tag}}) {
+        if ($_->{code} ne 'O') {
+            $code = $_->{code};
+            last;
+        }
+    }
+    my %data = (
+        description => $description,
+        tag         => html_quote ($tag),
+        code        => $code,
+        tags        => $by_tag{$tag},
+    );
+    output_template ("tags/$tag.html", $templates{tag}, \%data);
+}
+
+# Create the general tag index.
+%data = (
+    tags      => \%by_tag,
+);
+output_template ('tags.html', $templates{tags}, \%data);
+
+# Generate the package lists.  These are huge, so we break them into four
+# separate pages.
+#
+# FIXME: Does anyone actually use these pages?  They're basically unreadable.
+my %list;
+$list{'0-9, A-F'} = [];
+$list{'G-L'}      = [];
+$list{'M-R'}      = [];
+$list{'S-Z'}      = [];
+for my $package (sort keys %packages) {
+    my $first = uc substr($package, 0, 1);
+    if    ($first le 'F') { push(@{ $list{'0-9, A-F'} }, $package) }
+    elsif ($first le 'L') { push(@{ $list{'G-L'} },      $package) }
+    elsif ($first le 'R') { push(@{ $list{'M-R'} },      $package) }
+    else                  { push(@{ $list{'S-Z'} },      $package) }
+}
+%data = (
+    packages  => \%packages,
+);
+my $i = 1;
+for my $section (sort keys %list) {
+    $data{section} = $section;
+    $data{list} = $list{$section};
+    output_template ("packages_$i.html", $templates{packages}, \%data);
+    $i++;
+}
+
+# Finally, we can start creating the index page.  First, read in the old
+# statistics file so that we can calculate deltas for all of our statistics.
+my $old_statistics;
+if (-f $statistics_file) {
+    ($old_statistics) = read_dpkg_control($statistics_file);
+}
+my %delta;
+my @attrs = qw(maintainers source-packages binary-packages udeb-packages
+               errors warnings info experimental overridden);
+for my $attr (@attrs) {
+    my $old = $old_statistics->{$attr} || 0;
+    $statistics{$attr} ||= 0;
+    $delta{$attr} = sprintf("%d (%+d)", $statistics{$attr},
+                            $statistics{$attr} - $old);
+}
+
+# Update the statistics file.
+open (STATS, '>', $statistics_file)
+    or die "cannot open $statistics_file for writing: $!\n";
+print STATS "last-updated: $timestamp\n";
+print STATS "mirror-timestamp: $mirror_timestamp\n";
+for my $attr (@attrs) {
+    print STATS "$attr: $statistics{$attr}\n";
+}
+print STATS "lintian-version: $LINTIAN_VERSION\n";
+close STATS or die "cannot write to $statistics_file: $!\n";
+
+# Create the main page.
+%data = (
+    architecture => $LINTIAN_ARCH,
+    delta        => \%delta,
+    dist         => $LINTIAN_DIST,
+    mirror       => $mirror_timestamp,
+    previous     => $old_statistics->{'last-updated'},
+    section      => $LINTIAN_SECTION,
+);
+output_template ('index.html', $templates{index}, \%data);
+exit 0;
+
+# ------------------------------
+# Utility functions
+
+# Determine the file name for the maintainer page given a maintainer.  It
+# should be <email>.html where <email> is their email address with all
+# characters other than a-z A-Z 0-9 - _ . @ = + replaced with _.  Don't change
+# this without coordinating with QA.
+sub maintainer_url {
+    my ($maintainer) = @_;
+    my ($email) = ($maintainer =~ /<([^>]+)>/);
+    my ($regular, $full);
+    if ($email) {
+        my $id = $email;
+        $id =~ tr/a-zA-Z0-9_.@=+-/_/c;
+        return "$id.html";
+    } else {
+        return 'unsorted.html';
+    }
+}
+
+# Deduplicate maintainers.  Maintains a cache of the maintainers we've seen
+# with a given e-mail address, issues a warning if two maintainers have the
+# same e-mail address, and returns the maintainer string that we should use
+# (which is whatever maintainer we saw first with that e-mail).
+{
+    my (%urlmap, %warned);
+    sub map_maintainer {
+        my ($maintainer) = @_;
+        my $url = maintainer_url ($maintainer);
+        if ($urlmap{$url} && $urlmap{$url} ne $maintainer) {
+            warn "$maintainer has the same page as $urlmap{$url}\n"
+                unless ($warned{$maintainer}
+                        || lc ($maintainer) eq lc ($urlmap{$url})
+                        || $maintainer =~ /\@lists\.(alioth\.)?debian\.org>/);
+            $warned{$maintainer}++;
+            $maintainer = $urlmap{$url};
+        } else {
+            $urlmap{$url} = $maintainer;
+        }
+        return $maintainer;
+    }
+}
+
+# Quote special characters for HTML output.
+sub html_quote {
+    my ($text) = @_;
+    $text ||= '';
+    $text =~ s/&/\&amp;/g;
+    $text =~ s/</\&lt;/g;
+    $text =~ s/>/\&gt;/g;
+    return $text;
+}
+
+# Given a file name, a template, and a data hash, fill out the template with
+# that data hash and output the results to the file.
+sub output_template {
+    my ($file, $template, $data) = @_;
+    $data->{version} ||= $LINTIAN_VERSION;
+    $data->{timestamp} ||= $timestamp;
+    $data->{head} ||= sub { $templates{head}->fill_in (HASH => { page_title => $_[0],
+                                                                 path_prefix => '../' x ($_[1]||0),
+                                                                 %$data }) };
+    $data->{foot} ||= sub { $templates{foot}->fill_in (HASH => $data) };
+    open (OUTPUT, '>', "$HTML_TMP_DIR/$file")
+        or die "creating $HTML_TMP_DIR/$file falied: $!\n";
+    $template->fill_in (OUTPUT => \*OUTPUT, HASH => $data)
+        or die "filling out $file failed: $Text::Template::ERROR\n";
+    close OUTPUT;
+}
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround
diff --git a/nokia-lintian/reporting/images/ico.png b/nokia-lintian/reporting/images/ico.png
new file mode 100644 (file)
index 0000000..cd7355d
Binary files /dev/null and b/nokia-lintian/reporting/images/ico.png differ
diff --git a/nokia-lintian/reporting/images/l.png b/nokia-lintian/reporting/images/l.png
new file mode 100644 (file)
index 0000000..abea734
Binary files /dev/null and b/nokia-lintian/reporting/images/l.png differ
diff --git a/nokia-lintian/reporting/images/logo-small.png b/nokia-lintian/reporting/images/logo-small.png
new file mode 100644 (file)
index 0000000..d6b4650
Binary files /dev/null and b/nokia-lintian/reporting/images/logo-small.png differ
diff --git a/nokia-lintian/reporting/lintian-dummy.cfg b/nokia-lintian/reporting/lintian-dummy.cfg
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/nokia-lintian/reporting/lintian.css b/nokia-lintian/reporting/lintian.css
new file mode 100644 (file)
index 0000000..c5acb79
--- /dev/null
@@ -0,0 +1,372 @@
+/* lintian.css -- Style sheet for lintian.debian.org pages. */
+
+/*
+ # Table of Contents:
+ #
+ # 1. General styles (links, lists, titles, tables...)
+ # 2. Header
+ # 3. Navigation
+ # 4. Main content
+ # 5. Footer
+ # 6. Other
+ */
+
+/*
+ # Order:
+ #
+ # example {
+ #   display
+ #   position
+ #   width
+ #   height
+ #   margin
+ #   padding
+ #   background
+ #   color
+ #   font
+ #   text
+ #   line-height
+ #   border
+ # }
+ */
+
+
+/*
+ * 1. General styles
+ */
+
+body {
+    margin: 0;
+    padding: 0;
+    color: #222;
+    font-family: sans-serif;
+}
+
+h1, h2 {
+    font-family: "Junicode", "FreeSerif", serif;
+}
+
+h2 {
+    margin-bottom: 14px;
+    padding-bottom: 6px;
+    border-bottom: 2px solid #AAA;
+}
+
+h3 {
+    margin: 5px 0 5px 10px;
+    color: #444;
+    font-size: 1.0em;
+}
+
+p {
+    line-height: 1.4em;
+}
+
+a {
+    color: #3252B2;
+}
+
+ul {
+    margin: 0;
+}
+
+li {
+    color: #333;
+}
+
+hr {
+    display: none;
+}
+
+
+/*
+ * 2. Header title
+ */
+
+#header {
+    margin: 0 0 28px 0;
+    padding: 5px 20px;
+    /* TODO: Needs full path or url... */
+    background: #F3F3F3 url('logo-small.png') no-repeat right;
+    border-bottom: 1px solid #AAA;
+}
+
+#header p {
+    float: left;
+    margin: 5px 0;
+    color: #444;
+    font-size: 1.0em;
+    font-family: sans-serif;
+    font-weight: bold;
+}
+
+#header p a {
+    color: #444;
+    text-decoration: none;
+}
+
+
+/*
+ * 3. Navigation bar
+ */
+
+#nav {
+    float: right;
+    margin: 5px 55px 5px 0;
+    padding: 0;
+}
+
+#nav li {
+    display: inline;
+    margin-left: 5px;
+}
+
+#nav a {
+    padding: 3px 5px;
+    color: #333;
+    font-size: 0.9em;
+    text-decoration: none;
+}
+
+#nav a:hover {
+    background-color: #FBFBFB;
+    border-bottom: 2px solid #D70751;
+}
+
+
+/*
+ * 4. Main content
+ */
+
+#main {
+    margin: 0 25px;
+    font-size: 0.9em;
+    line-height: 1.4em;
+}
+
+/* Front page */
+
+#logo {
+    text-align: center;
+}
+
+#index h2, #stats h2 {
+    margin: 1.4em 0 0.4em 0;
+    border: none;
+}
+
+#info {
+    margin: 25px 0;
+    padding: 20px;
+    background: #EFF4F8 url(l.png) no-repeat left;
+    border: 1px solid #DFE4E8;
+}
+
+#info p {
+    margin-left: 130px;
+}
+
+#stats table {
+    border-collapse: collapse;
+}
+
+#stats table tr td {
+    padding: 3px 5px;
+    background-color: #FDFDFD;
+    border: 1px solid #CCC;
+}
+
+#stats td span {
+    margin: 0 3px 0 0;
+    padding: 1px 3px;
+    font-family: monospace;
+}
+
+/* Maintainer reports */
+
+#summary {
+    font-size: 0.9em;
+}
+
+#summary p {
+    margin-top: 5px;
+    font-size: 0.95em;
+}
+
+#summary ul {
+    padding-left: 20px;
+}
+
+ul.report {
+    padding-left: 20px;
+    padding-bottom: 1em;
+}
+
+ul.tag {
+    padding-bottom: 1em;
+}
+
+ul.report li {
+    padding-left: 5px;
+    padding-bottom: 6px;
+    list-style: none;
+}
+
+ul.tag li {
+    list-style: square;
+}
+
+li span {
+    margin: 0 3px 0 0;
+    padding: 1px 3px;
+    font-family: monospace;
+}
+
+h1 span {
+    padding: 1px 5px;
+    font-family: monospace;
+    font-size: 0.85em;
+    font-weight: normal;
+}
+
+ul.extra {
+    margin-bottom: 0;
+    padding-bottom: 0;
+}
+
+ul.report li ul.extra li {
+    padding-left: 0;
+    padding-bottom: 1px;
+    color: #444;
+    list-style: square;
+}
+
+div.source-header {
+    width: 100%;
+    margin: 1.4em 0 14px 0;
+    padding-bottom: 6px;
+    border-bottom: 2px solid #AAA;
+}
+
+div.source-header p, div.source-header h2 {
+    display: inline;
+    border: none;
+}
+
+.info-links {
+    margin-top: 0;
+}
+
+.info-links:before {
+    content: "– ";
+}
+
+/* Tag type */
+
+h2.tag {
+    margin: 5px 0;
+    padding: 0;
+    color: #444;
+    font-family: sans-serif;
+    font-size: 1.0em;
+    font-weight: normal;
+    border: none;
+}
+
+h2.tag a {
+    font-weight: bold;
+}
+
+h2.tag span.type-O {
+    margin: 0 3px 0 0;
+    padding: 2px 4px;
+    color: #555;
+    background: #EEE;
+    font-family: monospace;
+    font-size: 1.1em;
+    font-weight: bold;
+    border: 1px solid #DDD;
+}
+
+/* E/W/I colors */
+
+span.type-I {
+    color: #111;
+    background-color: #C7EA3C;
+}
+
+span.type-W {
+    color: #111;
+    background-color: #FFEB44;
+}
+
+span.type-E {
+    color: #111;
+    background-color: #FF6700;
+}
+
+span.type-X {
+    color: #111;
+    background-color: #EE99EE;
+}
+
+span.type-O {
+    color: #111;
+    background-color: #DDD;
+}
+
+li.type-O {
+    color: #444;
+}
+
+blockquote {
+    padding: 6px 16px;
+    background-color: #EEE;
+    border: 1px solid #DDD;
+}
+
+blockquote.type-I {
+    background-color: #DFA;
+    border: 1px solid #C7EA3C;
+}
+
+blockquote.type-W {
+    background-color: #FFD;
+    border: 1px solid #FFEB44;
+}
+
+blockquote.type-E {
+    background-color: #FE9;
+    border: 1px solid #FF6700;
+}
+
+blockquote.type-X {
+    background-color: #FECCFE;
+    border: 1px solid #DE66DE;
+}
+
+
+/*
+ * 5. Footer
+ */
+
+#footer {
+    margin: 20px 20px;
+    padding: 10px 0 0 0;
+    font-size: 0.85em;
+    border-top: 1px solid #AAA;
+}
+
+#footer p {
+    margin: 0;
+    padding: 0;
+}
+
+
+/*
+ * 6. Other
+ */
+
+div.clear {
+    clear: both;
+}
diff --git a/nokia-lintian/reporting/templates/clean.tmpl b/nokia-lintian/reporting/templates/clean.tmpl
new file mode 100644 (file)
index 0000000..8317428
--- /dev/null
@@ -0,0 +1,15 @@
+{ head("Lintian Report for $name", 1) }
+  <h1>{$name}</h1>
+
+  <p>
+    All of the packages maintained by {$maintainer} are Lintian-clean.
+    But also see the <a href="../full/{$id}">full report</a>, which includes
+    info, experimental and overridden tags.
+  </p>
+
+  <p>
+    Also see their
+    <a href="http://qa.debian.org/developer.php?login={$email}">QA
+    overview</a>.
+  </p>
+{ foot() }
diff --git a/nokia-lintian/reporting/templates/foot.tmpl b/nokia-lintian/reporting/templates/foot.tmpl
new file mode 100644 (file)
index 0000000..8a64389
--- /dev/null
@@ -0,0 +1,14 @@
+</div> <!-- main -->
+
+<hr/>
+
+<div id="footer">
+  <p>
+    Please send all comments about these web pages to the
+    <a href="mailto:lintian-maint@debian.org">Lintian maintainers</a>.
+  </p>
+  <p>Page last updated: {$timestamp} using Lintian {$version}.</p>
+</div>
+
+</body>
+</html>
diff --git a/nokia-lintian/reporting/templates/head.tmpl b/nokia-lintian/reporting/templates/head.tmpl
new file mode 100644 (file)
index 0000000..02738cd
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html
+    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>{$page_title}</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <link rel="stylesheet" href="{$path_prefix}lintian.css" type="text/css" />
+  <link rel="icon" href="{$path_prefix}ico.png" type="image/png" />
+</head>
+
+<body>
+
+<div id="header">
+  <p><a href="{$path_prefix}index.html">Lintian Reports</a></p>
+  <ul id="nav">
+    <li><a href="{$path_prefix}maintainers.html">Maintainers</a></li>
+    <li><a href="{$path_prefix}tags.html">Tags</a></li>
+    <li><a href="{$path_prefix}packages_1.html">Packages</a></li>
+  </ul>
+  <div class="clear"></div>
+</div>
+
+<div id="main">
diff --git a/nokia-lintian/reporting/templates/index.tmpl b/nokia-lintian/reporting/templates/index.tmpl
new file mode 100644 (file)
index 0000000..d331c53
--- /dev/null
@@ -0,0 +1,82 @@
+{ head("Lintian") }
+  <div id="front">
+    <div id="info">
+      <p>
+        Lintian dissects <a href="http://www.debian.org/">Debian</a>
+        <a href="http://packages.debian.org/">packages</a> and tries to find
+        bugs and policy violations. It contains automated checks for many
+        aspects of <a href="http://www.debian.org/doc/debian-policy/">Debian
+        policy</a> as well as some checks for common errors.
+      </p>
+
+      <p>
+        For more information, see the <a href="manual/index.html">User
+        Manual</a>.
+      </p>
+
+      <p>
+        Lintian is available in the Debian
+        <a href="http://packages.debian.org/lintian">lintian package</a>.
+      </p>
+    </div> <!-- info -->
+    <div class="clear"></div>
+  </div> <!-- front -->
+
+  <div id="index">
+    <h2>Indices</h2>
+
+    <ul>
+      <li><a href="maintainers.html">Maintainers</a></li>
+      <li><a href="tags.html">Tag types</a></li>
+      <li>Packages that have names starting with:
+        <ul>
+          <li><a href="packages_1.html">0-9, A-F</a></li>
+          <li><a href="packages_2.html">G-L</a></li>
+          <li><a href="packages_3.html">M-R</a></li>
+          <li><a href="packages_4.html">S-Z</a></li>
+        </ul>
+      </li>
+    </ul>
+  </div> <!-- index -->
+
+  <div id="stats">
+    <h2>Statistics</h2>
+    <table>
+      <tr><td>Last updated:</td>     <td>{$timestamp}</td></tr>
+      <tr><td>Archive timestamp:</td><td>{$mirror}</td></tr>
+      <tr><td>Distribution:</td>     <td>{$dist}</td></tr>
+      <tr><td>Section:</td>          <td>{$section}</td></tr>
+      <tr><td>Architecture:</td>     <td>{$architecture}</td></tr>
+      <tr><td>Maintainers:</td>      <td>{$delta{maintainers}}</td></tr>
+      <tr><td>Source packages:</td>  <td>{$delta{'source-packages'}}</td></tr>
+      <tr><td>Binary packages:</td>  <td>{$delta{'binary-packages'}}</td></tr>
+      <tr><td>&mu;deb packages:</td> <td>{$delta{'udeb-packages'}}</td></tr>
+      <tr>
+        <td><span class="type-E">E</span> Errors:</td>
+        <td>{$delta{errors}}</td>
+      </tr>
+      <tr>
+        <td><span class="type-W">W</span> Warnings:</td>
+        <td>{$delta{warnings}}</td>
+      </tr>
+      <tr>
+        <td><span class="type-I">I</span> Info tags:</td>
+        <td>{$delta{info}}</td>
+      </tr>
+      <tr>
+        <td><span class="type-O">O</span> Overridden tags:</td>
+        <td>{$delta{overridden}}</td>
+      </tr>
+      <tr>
+        <td><span class="type-X">X</span> Experimental tags:</td>
+        <td>{$delta{experimental}}</td>
+      </tr>
+      <tr><td>Lintian version:</td>  <td>{$version}</td></tr>
+    </table>
+
+    <p>
+      (The numbers in parentheses describe the changes since the last Lintian
+      report, published on {$previous}.)
+    </p>
+  </div> <!-- stats -->
+{ foot() }
diff --git a/nokia-lintian/reporting/templates/maintainer.tmpl b/nokia-lintian/reporting/templates/maintainer.tmpl
new file mode 100644 (file)
index 0000000..18ec72a
--- /dev/null
@@ -0,0 +1,104 @@
+{ head("Lintian Report for $name", 1) }
+  <h1>{$name}</h1>
+
+  <p>
+    At the time of the last Lintian run, the following possible problems
+    were found in packages maintained by {$maintainer}, listed by source
+    package.
+{
+    if ($errors) {
+        qq(    See also the <a href="../full/$id">full report</a>, including)
+           . " info, experimental and overridden tags.";
+    } else {
+        qq(    See also the <a href="../maintainer/$id">report showing)
+           . " only errors and warnings</a>.";
+    }
+}
+    Also see their
+    <a href="http://qa.debian.org/developer.php?login={$email}">QA
+    overview</a>.
+  </p>
+
+{
+    # Show the summary only if the number of packages is within a certain
+    # range.
+    my $num_packages = keys(%packages) + keys(%uploads);
+    if ($num_packages > 1 and $num_packages < 20) {
+        $OUT .= qq(  <div id="summary">\n    <ul>\n);
+        foreach $source (sort(keys(%packages), keys(%uploads))) {
+            $OUT .= qq(      <li><a href="#$source">$source</a></li>\n);
+        }
+        $OUT .= "    </ul>\n  </div>\n";
+    }
+}
+  <div class="clear"></div>
+
+{
+    # We get a hash of package names to a hash of versions to a list of tags.
+    # Create a list with the package information as the title and the tags as
+    # the value.
+    for my $source (sort (keys (%packages), keys (%uploads))) {
+        my ($data, $upload);
+        if ($packages{$source}) {
+            $data = $packages{$source};
+        } else {
+            $data = $uploads{$source};
+            $upload = 1;
+        }
+        for my $version (sort keys %$data) {
+            my $tags = $data->{$version};
+            my $first = 1;
+            my $binary = '';
+            my $tag = '';
+            for my $info (@$tags) {
+                if ($errors) {
+                    next unless $info->{code} eq 'E' or $info->{code} eq 'W';
+                }
+
+                my $is_binary = $info->{type} eq "binary";
+                my $new_binary = $info->{package} ne $binary if $is_binary;
+
+                if ($first) {
+                    $OUT .= qq(  <div class="source-header">\n);
+                    $OUT .= qq(   <h2 id="$source">);
+                    $OUT .= "$source ($version)";
+                    $OUT .= " [Uploader]" if $upload;
+                    $OUT .= "</h2>\n";
+                    $OUT .= qq(   <p class="info-links">\n);
+                    $OUT .= qq(    <a href="http://packages.debian.org/src:$source">Info</a>\n);
+                    $OUT .= qq(    <a href="http://packages.qa.debian.org/$source">PTS</a>\n);
+                    $OUT .= qq(    <a href="http://bugs.debian.org/src:$source">Bugs</a>\n);
+                    $OUT .= qq(   </p>\n  </div>\n);
+                    $OUT .= qq(  <ul class="report">\n) unless $is_binary;
+                }
+
+                if ($new_binary) {
+                    $OUT .= "</ul>\n    </li>\n  </ul>\n" unless $first;
+                    $OUT .= qq(  <h3>$info->{package}</h3>\n);
+                    $OUT .= qq(  <ul class="report">\n);
+                }
+
+                # Display tag name only once.
+                if ($tag ne $info->{tag} or $new_binary) {
+                    $OUT .= "</ul>\n    </li>\n" unless $first or $new_binary;
+                    $OUT .= "    <li>\n";
+                    $OUT .= qq(      <span class="type-$info->{code}">);
+                    $OUT .= "$info->{code}</span> ";
+                    $OUT .= qq(<a href="../tags/$info->{tag}.html">);
+                    $OUT .= "$info->{tag}</a>\n";
+                    $OUT .= qq(      <ul class="extra">);
+                }
+
+                if ($info->{extra}) {
+                    $OUT .= "<li>$info->{extra}</li>";
+                }
+
+                $first = 0;
+                $binary = $info->{package};
+                $tag = $info->{tag};
+            }
+            $OUT .= "</ul>\n    </li>\n  </ul>\n";
+        }
+    }
+}
+{ foot() }
diff --git a/nokia-lintian/reporting/templates/maintainers.tmpl b/nokia-lintian/reporting/templates/maintainers.tmpl
new file mode 100644 (file)
index 0000000..e199e48
--- /dev/null
@@ -0,0 +1,44 @@
+{ head("Lintian Reports by Maintainer") }
+  <h1>Maintainers</h1>
+
+  <p>
+    Maintainers are listed sorted case-insensitively by package maintainer
+    string.  This is an unsophisticated sort that doesn't take into
+    account any national collating sequence, only Unicode strings, so
+    maintainers whose names start with non-ASCII characters will sort at
+    the end of this page.
+  </p>
+
+  <p>
+    Jump to: { join (' ', map { qq(<a href="#$_">$_</a>) } 'A'..'Z') }
+  </p>
+
+{
+    # Put headings before each new initial letter and add anchors, except
+    # for non-ASCII initial characters.  For those, since we can't be
+    # assured we'll get combining characters right, just accumulate them
+    # under a heading of Other.
+    my $letter = '';
+    for my $maintainer (sort { lc ($a) cmp lc ($b) } keys %maintainers) {
+        my ($url) = $maintainers{$maintainer};
+        my $first = uc substr($maintainer, 0, 1);
+        if ($first lt 'A' || $first gt 'Z') {
+            $first = 'Other';
+        }
+        if ($first ne $letter) {
+            unless ($letter) {
+                $OUT .= "  </p>\n\n";
+            }
+            $letter = $first;
+            if ($letter eq 'Other') {
+                $OUT .= qq(  </p>\n\n  <h2>Other</h2>\n\n  <p>\n);
+            } else {
+                $OUT .= qq(  </p>\n\n  <h2 id="$letter"><a name="$letter">)
+                    . $letter . "</a></h2>\n\n  <p>\n";
+            }
+        }
+        $OUT .= qq(    <a href="maintainer/$url">$maintainer</a>)
+            . qq{ (<a href="full/$url">full report</a>)<br />\n};
+    }
+}  </p>
+{ foot() }
diff --git a/nokia-lintian/reporting/templates/packages.tmpl b/nokia-lintian/reporting/templates/packages.tmpl
new file mode 100644 (file)
index 0000000..31c6ef2
--- /dev/null
@@ -0,0 +1,32 @@
+{ head("Lintian Package Index: $section") }
+  <h1>Package Index: {$section}</h1>
+
+  <p>
+    This is a list of all source or binary packages that have at least one
+    lintian tag.  This includes all tags, even experimental and info tags
+    and tags that were overridden.  The list is huge, so it's broken into
+    four separate pages.  This page covers package names starting with
+    {$section}.
+  </p>
+
+  <p>
+      <a href="packages_1.html">0-9, A-F</a>
+    | <a href="packages_2.html">G-L</a>
+    | <a href="packages_3.html">M-R</a>
+    | <a href="packages_4.html">S-Z</a>
+  </p>
+
+{
+    # Put headings before each new initial letter.
+    my $letter = '';
+    for my $package (@list) {
+        my $first = uc substr($package, 0, 1);
+        if ($first ne $letter) {
+            $OUT .= "  </p>\n\n" if $letter;
+            $OUT .= qq(  <h2>$first</h2>\n\n  <p>\n);
+            $letter = $first;
+        }
+        $OUT .= qq(    <a href="full/$packages{$package}">$package</a>\n);
+    }
+}  </p>
+{ foot() }
diff --git a/nokia-lintian/reporting/templates/tag.tmpl b/nokia-lintian/reporting/templates/tag.tmpl
new file mode 100644 (file)
index 0000000..e9b4f84
--- /dev/null
@@ -0,0 +1,53 @@
+{ head("Lintian Tag: $tag", 1) }
+  <h1><span class="type-{$code}">{$code}</span> {$tag}</h1>
+
+  <p>
+    All reports of {$tag} for the archive. The extended description of this
+    tag is:
+  </p>
+
+  <blockquote class="type-{$code}">
+{$description}
+  </blockquote>
+
+  <p>
+    The package names link to the relevant maintainer page and the
+    corresponding report for the source package.  The links go to the full
+    maintainer report page, which includes info and experimental tags and
+    overridden tags, rather than the default page that shows only errors
+    and warnings.
+  </p> 
+{
+    # We get a list of tag data.  We create a separate paragraph for each
+    # package name.
+    my ($last, $tag, $has_nonoverridden);
+    for my $info (sort { $a->{package} cmp $b->{package} } @tags) {
+        if (!$last
+           or "$info->{package} $info->{type}" ne "$last->{package} $last->{type}") {
+           if ($last) {
+               my $overridden = $has_nonoverridden ? '' : qq{ <span class="type-O">overridden</span>};
+               $OUT .= qq(  <h2 class="tag"><a href="../full/$last->{xref}">);
+               $OUT .= "$last->{package}</a> ($last->{type})$overridden</h2>\n";
+               $OUT .= qq(  <ul class="tag">\n);
+               $OUT .= $tag;
+               $OUT .= "</ul>\n";
+           }
+           $last = $info;
+           $tag = '';
+           $has_nonoverridden = 0;
+       }
+       $has_nonoverridden = 1 if $info->{code} ne 'O';
+       if ($info->{extra}) {
+           $tag .= qq{    <li class="type-$info->{code}">};
+           $tag .= qq{<span class="type-O">O</span> } if $info->{code} eq 'O';
+           $tag .= "$info->{extra}</li>\n";
+       }
+    }
+    my $overridden = $has_nonoverridden ? '' : qq{ <span class="type-O">overridden</span>};
+    $OUT .= qq(  <h2 class="tag"><a href="../full/$last->{xref}">);
+    $OUT .= "$last->{package}</a> ($last->{type})$overridden</h2>\n";
+    $OUT .= qq(  <ul class="tag">\n);
+    $OUT .= $tag;
+    $OUT .= "</ul>\n";
+}
+{ foot() }
diff --git a/nokia-lintian/reporting/templates/tags.tmpl b/nokia-lintian/reporting/templates/tags.tmpl
new file mode 100644 (file)
index 0000000..af8fe7d
--- /dev/null
@@ -0,0 +1,29 @@
+{ head("Lintian Tags") }
+  <h1>Tags</h1>
+
+  <p>
+    This is a list of all tags that occur at least once in the archive
+    with their frequency counts.  This includes all tags, even
+    experimental and info tags.
+  </p>
+
+  <ul>
+{
+    for my $tag (sort keys %tags) {
+        my ($count, $overrides) = (0, 0);
+        my %seen;
+        for my $info (@{ $tags{$tag} }) {
+            if ($info->{code} eq 'O') {
+                $overrides++;
+            } else {
+                $count++;
+                $seen{$info->{xref}}++;
+            }
+        }
+        my $packages = scalar keys %seen;
+        $OUT .= qq(    <li><a href="tags/$tag.html">$tag</a>)
+            . " ($packages packages, $count tags, plus $overrides overrides)"
+            . "</li>\n";
+    }
+}  </ul>
+{ foot() }
diff --git a/nokia-lintian/testset/binary/INSTALL b/nokia-lintian/testset/binary/INSTALL
new file mode 100644 (file)
index 0000000..3b50ea9
--- /dev/null
@@ -0,0 +1,176 @@
+Basic Installation
+==================
+
+   These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+   The file `configure.in' is used to create `configure' by a program
+called `autoconf'.  You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes a while.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  You can give `configure'
+initial values for variables by setting them in the environment.  Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory.  After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+   By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on.  Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+     CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+   If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+     Use and save the results of the tests in FILE instead of
+     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
+     debugging `configure'.
+
+`--help'
+     Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--version'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/nokia-lintian/testset/binary/Makefile b/nokia-lintian/testset/binary/Makefile
new file mode 100644 (file)
index 0000000..da1dc55
--- /dev/null
@@ -0,0 +1,12 @@
+all: hello hello-static
+
+hello: hello.c
+       gcc hello.c -o hello
+
+hello-static: hello.c
+       gcc -static hello.c -o hello-static
+
+clean:
+       rm -f hello hello-static
+
+distclean: clean
diff --git a/nokia-lintian/testset/binary/debian/NEWS.Debian b/nokia-lintian/testset/binary/debian/NEWS.Debian
new file mode 100644 (file)
index 0000000..29f561c
--- /dev/null
@@ -0,0 +1,12 @@
+binary (4-1.1) UNRELEASED; urgency=high
+
+  This is a Debian NEWS entry that isn't encoded properly in UTF-8: ü.
+  It also has a usefull speling error.
+
+ -- Russ Allbery <rra@debian.org>  Sun, 14 Oct 2007 17:11:36 -0700
+
+binary (1) unstable; urgency=low
+
+  This is another entry but this one isn't syntactically valid.
+
+ -- Russ Allbery  2007-10-14
diff --git a/nokia-lintian/testset/binary/debian/README.Debian b/nokia-lintian/testset/binary/debian/README.Debian
new file mode 100644 (file)
index 0000000..94bcc0a
--- /dev/null
@@ -0,0 +1,5 @@
+this is a binary package to test lintian's handling of bins.
+Check handling of D-Bus and dbus (neither of which should produce
+warnings).
+
+ -- Russ Allbery <rra@debian.org>, Wed,  6 Feb 2008 18:35:11 -0800
diff --git a/nokia-lintian/testset/binary/debian/changelog b/nokia-lintian/testset/binary/debian/changelog
new file mode 100644 (file)
index 0000000..2c5ba8b
--- /dev/null
@@ -0,0 +1,45 @@
+binary (4-1.1) unstable; urgency=low
+
+  * I'm doing an comaintainer-upload, acknowledging a NMU, but with a version
+    number which suggests I'm doing a NMU myself.
+
+    Lintian-maintainers: Please don't update this changelog, otherwise you'll
+    probably break the checks/nmu checks.
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Sun, 18 Apr 2004 01:49:42 +0200
+
+binary (4-1) unstable; urgency=low
+
+  * Weird version number for the new check for accidents with native
+    packaging.
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  The, 15 Apr 2004 23:33:51 +0200
+
+binary (4) unstable; urgency=low
+
+  * Add big file to /usr/share to trigger the big-usr-share check
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Fri, 27 Feb 2004 10:15:59 +0100
+
+binary (3) unstable; urgency=unlimited
+
+  * Add some bogus menu entries using su-to-root in a bogus way
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Thu, 12 Feb 2004 20:11:22 +0100
+
+binary (2) unstable; urgency=low
+
+  * Added an INSTALL document which policy 6.3 suggests not to do
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Tue, 30 Jan 2001 15:23:59 -0800
+
+binary (1) unstable; urgency=low
+
+  * hello.c added
+  * hello-static is same as hello, but compiled statically
+  * added a menu entry which lacks a Section
+  * added a postinst
+  * postinst calls suidregister which is no longer policy compliant
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed, 10 Jan 2001 08:55:34 -0800
+
diff --git a/nokia-lintian/testset/binary/debian/conffiles b/nokia-lintian/testset/binary/debian/conffiles
new file mode 100644 (file)
index 0000000..d1a0843
--- /dev/null
@@ -0,0 +1 @@
+/etc/menu-methods/lintian
diff --git a/nokia-lintian/testset/binary/debian/control b/nokia-lintian/testset/binary/debian/control
new file mode 100644 (file)
index 0000000..88ec151
--- /dev/null
@@ -0,0 +1,37 @@
+Source: binary
+Section: misc
+Priority: extra
+Maintainer: Lintian Maintainers <lintian-maint@debian.org>
+Uploaders: Co-maintainer one <one@debian.org>, Jeroen van Wolffelaar <jeroen@wolffelaar.nl>, Co-maintainer three <three@debian.org>
+Standards-Version: 3.2.1
+Homepage: http://lintian.debian.org/
+Vcs-Svn: http://svn.wolffelaar.nl/lintian/trunk
+XS-Vcs-Browser: http://svn.wolffelaar.nl/lintian/trunk
+XS-Dm-Upload-Allowed: yes
+
+Package: binary
+Architecture: any
+Pre-Depends: ${shlibs:Depends}, xorg, binary-data (= ${Source-Version}), libssl0.9.8
+Homepage: <http://lintian.debian.org/>
+Vcs-Svn: http://svn.wolffelaar.nl/lintian/trunk
+Description: test handling of binary files
+ Regression test for lintian's handling of binary files for debian.  This
+ is checked for picky spelling errors.
+ .
+  Homepage: http://lintian.debian.org/
+
+Package: binary-data
+Architecture: all
+Depends: binary (= ${Source-Version}), libssl-not-openssl,
+ libssl0.9.8 | or-something-else
+Description: test handling of binary relationships
+ Regression test for lintian's checking of package relationships between
+ arch:any and arch:all packages.
+
+#Package: binary-comment
+#Architecture: space-almonds
+#Depends: *
+#Depends: *
+#Description: test comment support
+# Yes, comments are actually allowed in debian/control, so none of the
+# above should produce errors.
diff --git a/nokia-lintian/testset/binary/debian/copyright b/nokia-lintian/testset/binary/debian/copyright
new file mode 100644 (file)
index 0000000..e49e187
--- /dev/null
@@ -0,0 +1,15 @@
+hello.c is released under public domain.  This is distributed in the hope that
+it will be useful, but without any warranty; without even the implied warranty
+of merchantability or fitness for a particular purpose.
+
+A reference to /usr/share/common-licenses/GPL to make it look like this
+package is under the GPL and trigger the OpenSSL warning.
+
+Test for old FSF address:
+
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+Test for deprecated nätionäl äncoding.
+
+Improper capitalization of linux or debian isn't caught here.
diff --git a/nokia-lintian/testset/binary/debian/doc-base b/nokia-lintian/testset/binary/debian/doc-base
new file mode 100644 (file)
index 0000000..7e5b38f
--- /dev/null
@@ -0,0 +1,41 @@
+Document: binary!docs  
+Title: Broken debian binary doc-base control file
+Author: Russ Allbery
+Abstract: This control file exercises various tests of doc-base control
+  files, including several things that aren't tested yet.  The third and
+  fourth one has trailing whitespace.
+  .
+ This section has a speling error and bad ® character.
+ .
+ The above separator was fine.
+Section: Non/Existant
+Unknown: Some field
+
+
+
+Format: debiandoc-sgML
+Files: /usr/share/doc/binary/binary.sgml.gz
+Unknown: Some field
+
+Format: ESP
+Index: /usr/share/doc/binary/binary.txt
+
+Index: /usr/share/doc/binary/html/index.html  
+ /usr/share/doc/binary/html/ch1.html  
+ /usr/share/doc/binary/html/ch4.html
+
+
+Format: HTML  
+Index: /usr/share/doc/binary/html/index.html
+Files: /usr/share/doc/binary/html/ch?.h*l
+       /usr/share/doc/binary/hml/*.html
+
+Format: inFO
+Files: /usr/share/info/binary.info.gz
+
+Format: HTML
+Index: /usr/share/doc/binary/html/index.html
+Files: /usr/share/doc/binary/html/ch5.html
+       /usr/share/doc/binary/html/ch6.html
+
+
diff --git a/nokia-lintian/testset/binary/debian/goodbye.desktop b/nokia-lintian/testset/binary/debian/goodbye.desktop
new file mode 100644 (file)
index 0000000..f6ce8e3
--- /dev/null
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Name:Goodbye
+# Name=Goodbye
+Comment=Say hello!
+SpecialTag=This doesn't exist!
+Exec=goodbye
+icon=hello
+Terminal=true
+Type=Application
+Categories=WeirdStuff;Screensaver;
+Encoding=ISO-10646-1
+[Other Entry]
+Name=Goodbye
diff --git a/nokia-lintian/testset/binary/debian/hello.desktop b/nokia-lintian/testset/binary/debian/hello.desktop
new file mode 100644 (file)
index 0000000..4f4a865
--- /dev/null
@@ -0,0 +1,14 @@
+# some random comment
+
+# [Foo Bar]
+[Desktop Entry]
+Name=Hello
+Name[en_US]=Hello
+Comment=Say hello!\r
+Exec=kdesu hello
+Icon=hello
+Terminal=true
+Type=Application
+Categories=GNOME;GTK;System;Applet;X-Foo;Settings;
+Encoding=UTF-8
+OnlyShowIn=GNOME;
diff --git a/nokia-lintian/testset/binary/debian/menu b/nokia-lintian/testset/binary/debian/menu
new file mode 100644 (file)
index 0000000..652381a
--- /dev/null
@@ -0,0 +1,25 @@
+?package(binary):needs=text title="Hello World" command="/usr/bin/hello"
+?package(binary):needs=text section="Applications/System" title="Run cfdisk (0)" command="/usr/bin/su-to-root cfdisk"
+?package(binary):needs="text" section="Applications/System/Hardware" title="Run cfdisk (1)" command="sux -p cfdisk"
+?package(binary):needs="x11" section="Window Managers" title="Run xfdisk" command="/usr/sbin/su-to-root -c xfdisk"
+?package(binary):needs="wm" section="Applications/System/Administration" title="Run fdisk-wm" command="su-to-root -c hello"
+?package(binary):section="Apps/Games" title="I'm not root!" command="su-to-root -c imnothere"
+?package(binary):needs="text" section="Apps/System" title="I'm not here!" command="/imnothere"
+?package(binary,other-binary):\
+ needs="text"\
+ section="Applications/Shells"\
+ title="more than one required"\
+ command="other-bin -s omething"
+?package(binary):needs="wmmodule" section="WindowManagers/Modules" title="somemodule" command="ModuleCmd"
+?package(binary):needs="wmmodule" section="FVWM Modules" title="somemodule" command="ModuleCmd"
+?package(binary):needs="text" section="Applications/System/Administration" title="I'm not in /usr/bin!" command="iminusrbin"
+?package(binary):needs="text"\
+ section="Applications/System/Administration"\
+ title="I'm not root!" command="su-to-root -c imnothere"
+?package(binary):needs="text" section="Applications/System/Administration"\
+ title="Run cfdisk (0)" command="cfdisk"
+?package(binary):needs="text" section="Applications/System/Administration" title="Hello World" command="/usr/bin/hello"
+?package(binary):needs="wm" section="FVWM Modules" title="Fake Module" command="hello"
+?package(binary):needs="fvwmmodule" section="Window Maker" title="Fake Module"\
+ command="hello"
+?package(binary):needs="x11" section="Applications/System/Hardware" title="Run xfdisk" command="su-to-root -c 'xfdisk -f'"
diff --git a/nokia-lintian/testset/binary/debian/menu-method b/nokia-lintian/testset/binary/debian/menu-method
new file mode 100644 (file)
index 0000000..9f07bd7
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/install-menu
+
+#   -*- mode: shell-script; -*-
+#I need menu-1!
+#
+
+!include notmenu.h
+compat="menu-2"
+
+outputencoding="UTF-8";
+outputlanguage="C";
+
+x11 = AppEntry("false");
+text = AppEntry("true");
+
+startmenu = "";
+endmenu = "";
+submenutitle = "";
+rootprefix = "/var/lib/lintian/menu";
+userprefix = ".local/share/lintian/menu";
+
diff --git a/nokia-lintian/testset/binary/debian/postinst b/nokia-lintian/testset/binary/debian/postinst
new file mode 100644 (file)
index 0000000..29e1861
--- /dev/null
@@ -0,0 +1,6 @@
+#! /bin/bash -e
+
+if [ $1 eq 'configure' ]
+then
+       suidregister hello-static root root 4755
+fi
diff --git a/nokia-lintian/testset/binary/debian/rules b/nokia-lintian/testset/binary/debian/rules
new file mode 100755 (executable)
index 0000000..33d83f6
--- /dev/null
@@ -0,0 +1,89 @@
+#!/usr/bin/make -f
+
+tmp=debian/tmp
+
+# This reference to $(PWD) should not cause an error but the one below
+# should.
+build:
+       make
+       echo $(PWD)
+
+clean:
+       make -i clean
+       rm -f debian/files debian/substvars
+
+binary-arch: build
+       install -d $(tmp)/usr/bin
+       install -d $(tmp)/boot/hello
+       install -m 755 hello $(tmp)/usr/bin
+       touch $(tmp)/usr/bin/iminusrbin
+       chmod 755 $(tmp)/usr/bin/iminusrbin
+       install -m 755 hello-static $(tmp)/usr/bin
+       strip $(tmp)/usr/bin/hello-static
+       install -m 755 hello-static $(tmp)/usr/bin/hello.static
+       strip --remove-section=.comment --remove-section=.note $(tmp)/usr/bin/hello.static
+       ln $(tmp)/usr/bin/hello.static $(tmp)/usr/bin/static-hello
+       install -m 755 hello-static $(tmp)/boot/hello
+       strip --remove-section=.comment --remove-section=.note $(tmp)/boot/hello/hello-static
+       install -d $(tmp)/usr/share/doc/binary
+       install -m 644 INSTALL $(tmp)/usr/share/doc/binary
+       install -d $(tmp)/usr/share/doc/binary/html
+       echo '<html></html>' > $(tmp)/usr/share/doc/binary/html/index.html
+       echo '<html></html>' > $(tmp)/usr/share/doc/binary/html/ch1.html
+       ln -s ../html/./ch1.html $(tmp)/usr/share/doc/binary/html/ch2.html
+       ln -s /usr/share/doc/binary/htm/ch1.html $(tmp)/usr/share/doc/binary/html/ch3.html
+       echo '<html></html>' > $(tmp)/usr/share/doc/binary/html/ch5.html
+       ln $(tmp)/usr/share/doc/binary/html/ch5.html \
+           $(tmp)/usr/share/doc/binary/html/ch6.html
+       install -d $(tmp)/usr/share/menu
+       install -d $(tmp)/usr/lib/menu
+       install -d $(tmp)/usr/share/binary
+       install -m 644 debian/menu $(tmp)/usr/share/menu/binary
+       install -m 644 debian/menu $(tmp)/usr/lib/menu/binary
+       install -d $(tmp)/etc/menu-methods
+       install -m 755 debian/menu-method $(tmp)/etc/menu-methods/lintian
+       install -d $(tmp)/usr/share/doc-base
+       install -m 644 debian/doc-base $(tmp)/usr/share/doc-base/binary
+       touch '$(tmp)/usr/share/doc-base/space '
+       install -m 644 debian/README.Debian $(tmp)/usr/share/doc/binary
+       install -m 644 debian/NEWS.Debian $(tmp)/usr/share/doc/binary
+       gzip -9 $(tmp)/usr/share/doc/binary/NEWS.Debian
+       install -m 644 debian/copyright $(tmp)/usr/share/doc/binary
+       install -m 644 debian/changelog $(tmp)/usr/share/doc/binary
+       #gzip -9 $(tmp)/usr/share/doc/binary/changelog
+       install -d $(tmp)/DEBIAN
+       install -m 755 debian/postinst $(tmp)/DEBIAN
+       install -m 644 debian/conffiles $(tmp)/DEBIAN
+
+       install -d $(tmp)/usr/share/applications
+       install -m 644 debian/hello.desktop \
+           $(tmp)/usr/share/applications/hello.desktop
+       install -m 755 debian/goodbye.desktop \
+           $(tmp)/usr/share/applications/goodbye.desktop
+
+       # should be ok...
+       echo boe > $(tmp)/usr/bar
+       ln $(tmp)/usr/bar $(tmp)/usr/foo 
+       # but this isn't
+       echo boe > $(tmp)/usr/bar2
+       ln $(tmp)/usr/bar2 $(tmp)/usr/share/baz 
+
+       dd if=/dev/zero of=$(tmp)/usr/share/binary/largefile bs=1024 count=2000
+
+       install -d debian/binary-data/DEBIAN
+       install -d debian/binary-data/usr/share/doc
+       ln -s binary debian/binary-data/usr/share/doc/binary-data
+
+       dpkg-shlibdeps $(tmp)/usr/bin/hello
+       dpkg-gencontrol -pbinary -isp
+       dpkg-gencontrol -pbinary-data -Pdebian/binary-data -isp
+
+       # Test an md5sums check while we're here.
+       touch debian/binary-data/DEBIAN/md5sums
+
+       dpkg --build debian/tmp ..
+       dpkg --build debian/binary-data ..
+
+binary: binary-arch
+
+.PHONY: build binary-arch binary clean
diff --git a/nokia-lintian/testset/binary/debian/templates b/nokia-lintian/testset/binary/debian/templates
new file mode 100644 (file)
index 0000000..3d92861
--- /dev/null
@@ -0,0 +1,16 @@
+# The debconf templates defined here are the sort that you'd use if
+# providing a wordlist and an ispell dictionary for the language
+# "perl".  This shouldn't trigger warnings about not using debconf-po.
+
+Template: shared/packages-ispell
+Type: text
+Description:
+
+Template: shared/packages-wordlist
+Type: text
+Description:
+
+Template: miscfiles/languages
+Type: text
+Default: perl (Pathologically Eclectic Rubbish Lister)
+Description:
diff --git a/nokia-lintian/testset/binary/hello.c b/nokia-lintian/testset/binary/hello.c
new file mode 100644 (file)
index 0000000..2fb04e1
--- /dev/null
@@ -0,0 +1,8 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[]) {
+
+       printf("Hello, World!\n");
+       exit(0);
+}
diff --git a/nokia-lintian/testset/cdbs-test/debian/changelog b/nokia-lintian/testset/cdbs-test/debian/changelog
new file mode 100644 (file)
index 0000000..0656ebb
--- /dev/null
@@ -0,0 +1,15 @@
+cdbs-test (1-1~bpo40+1) unstable; urgency=low
+
+  * Backport, but for some reason I go on and on for longer than 80 columns thus making the entry annoying to read.
+  * this-is-a-really-long-dpatch-name-that-contains-the-entire-bug-report-in-the-file-name.dpatch:
+    - New.
+  * Not really too long: “héh锓héh锓héh锓héh锓héh锓héhé”
+  
+ -- Lintian Maintainers <debian-lint-maint@lists.debian.org>  Thu, 05 Jun 2008 00:00:00 -0700
+
+cdbs-test (1-1) unstable; urgency=low
+
+  * Initial release
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu,  4 Aug 2005 23:09:00 +0200
+
diff --git a/nokia-lintian/testset/cdbs-test/debian/compat b/nokia-lintian/testset/cdbs-test/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/nokia-lintian/testset/cdbs-test/debian/control b/nokia-lintian/testset/cdbs-test/debian/control
new file mode 100644 (file)
index 0000000..7bf7b8c
--- /dev/null
@@ -0,0 +1,13 @@
+Source: cdbs-test
+Section: devel
+Priority: optional
+Maintainer: Lintian Maintainers <debian-lint-maint@lists.debian.org>
+Build-Depends: cdbs, yada, patchutils (>= 0.2.25)
+Build-Depends-Indep: debhelper, cdbs
+Standards-Version: 3.7.3
+
+Package: cdbs-test
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Checks related to the cdbs build-system
+ bla bla bla
diff --git a/nokia-lintian/testset/cdbs-test/debian/copyright b/nokia-lintian/testset/cdbs-test/debian/copyright
new file mode 100644 (file)
index 0000000..be8c4ed
--- /dev/null
@@ -0,0 +1,5 @@
+This package was debianized by Frank Lichtenheld <djpig@debian.org> on
+Thu,  4 Aug 2005 23:09:00 +0200.
+
+Test copyright date handling:
+Copyright 2005 Frank Lichtenheld
diff --git a/nokia-lintian/testset/cdbs-test/debian/rules b/nokia-lintian/testset/cdbs-test/debian/rules
new file mode 100755 (executable)
index 0000000..118deef
--- /dev/null
@@ -0,0 +1,6 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
diff --git a/nokia-lintian/testset/cdbs-test/debian/watch b/nokia-lintian/testset/cdbs-test/debian/watch
new file mode 100644 (file)
index 0000000..0a3cf72
--- /dev/null
@@ -0,0 +1,4 @@
+# Test of multiple and unknown version numbers in a watch file.
+version=2
+version=4
+http://example.com/cdbs-test-(.*)\.tar\.gz
diff --git a/nokia-lintian/testset/cdbs-test/setup.py b/nokia-lintian/testset/cdbs-test/setup.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/nokia-lintian/testset/cdbs-test_1.orig.tar.gz b/nokia-lintian/testset/cdbs-test_1.orig.tar.gz
new file mode 100644 (file)
index 0000000..49920bc
Binary files /dev/null and b/nokia-lintian/testset/cdbs-test_1.orig.tar.gz differ
diff --git a/nokia-lintian/testset/copyright/debian/changelog b/nokia-lintian/testset/copyright/debian/changelog
new file mode 100644 (file)
index 0000000..47c178e
--- /dev/null
@@ -0,0 +1,17 @@
+copyright (1) unstable; urgency=emergency
+
+  * Initial release.
+  * Add the following tests of tags never seen:
+    - debian-copyright-file-uses-obsolete-national-encoding
+    - copyright-file-contains-full-gpl-license
+    - copyright-file-contains-full-gfdl-license
+    - copyright-lists-upstream-authors-with-dh_make-boilerplate
+    - copyright-refers-to-incorrect-directory
+    - copyright-refers-to-compressed-license
+    - copyright-refers-to-old-directory
+    - copyright-file-is-symlink
+    - copyright-file-compressed
+    - old-style-copyright-file
+    - FSSTND-dir-in-usr
+
+ -- Tobias Toedter <t.toedter@gmx.net>  Sun, 13 Jul 2008 16:32:25 -0700
diff --git a/nokia-lintian/testset/copyright/debian/compat b/nokia-lintian/testset/copyright/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/nokia-lintian/testset/copyright/debian/control b/nokia-lintian/testset/copyright/debian/control
new file mode 100644 (file)
index 0000000..535d77a
--- /dev/null
@@ -0,0 +1,52 @@
+Source: copyright
+Section: text
+Priority: optional
+Maintainer: Lintian Maintainers <lintian-maint@debian.org>
+Uploaders: Tobias Toedter <t.toedter@GMX.NET>
+Build-Depends-Indep: debhelper (>5)
+Standards-Version: 3.8.0
+
+Package: copyright.iso-8859-1
+Architecture: all
+Description: checks for non-utf-8-encodings
+ This is just a sentence.
+
+Package: copyright.full-gpl
+Architecture: all
+Description: checks inclusion of GPL in full text
+ This is just a sentence.
+
+Package: copyright.full-gfdl
+Architecture: all
+Description: checks inclusion of GFDL in full text
+ This is just a sentence.
+
+Package: copyright.full-apache-2
+Architecture: all
+Description: checks inclusion of Apache 2.0 in full text
+ This is just a sentence.
+
+Package: copyright.misc-errors
+Architecture: all
+Description: checks various errors in copyright files
+ This is just a sentence.
+
+Package: copyright.no-errors
+Architecture: all
+Description: this should not emit any error
+ This is just a sentence.
+
+Package: copyright.symlink
+Architecture: all
+Description: just use a symlink for the copyright file
+ This is just a sentence.
+
+Package: copyright.compressed
+Architecture: all
+Description: include a valid copyright file and compress it
+ This is just a sentence.
+
+Package: copyright.old-style
+Architecture: all
+Description: use an old-style directory structure
+ This is just a sentence.
diff --git a/nokia-lintian/testset/copyright/debian/copyright.full-apache-2 b/nokia-lintian/testset/copyright/debian/copyright.full-apache-2
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/nokia-lintian/testset/copyright/debian/copyright.full-gfdl b/nokia-lintian/testset/copyright/debian/copyright.full-gfdl
new file mode 100644 (file)
index 0000000..4a0fe1c
--- /dev/null
@@ -0,0 +1,397 @@
+               GNU Free Documentation License
+                 Version 1.2, November 2002
+
+
+ Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
+     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The "Document", below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as "you".  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject.  (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+   from that of the Document, and from those of previous versions
+   (which should, if there were any, be listed in the History section
+   of the Document).  You may use the same title as a previous version
+   if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+   responsible for authorship of the modifications in the Modified
+   Version, together with at least five of the principal authors of the
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+   Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+   adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+   giving the public permission to use the Modified Version under the
+   terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+   and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
+   publisher of the Modified Version as given on the Title Page.  If
+   there is no section Entitled "History" in the Document, create one
+   stating the title, year, authors, and publisher of the Document as
+   given on its Title Page, then add an item describing the Modified
+   Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+   public access to a Transparent copy of the Document, and likewise
+   the network locations given in the Document for previous versions
+   it was based on.  These may be placed in the "History" section.
+   You may omit a network location for a work that was published at
+   least four years before the Document itself, or if the original
+   publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
+   and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+   unaltered in their text and in their titles.  Section numbers
+   or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements".  Such a section
+   may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+   or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications".  You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License.  Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License.  However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation License from time to time.  Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.  See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+    Copyright (c)  YEAR  YOUR NAME.
+    Permission is granted to copy, distribute and/or modify this document
+    under the terms of the GNU Free Documentation License, Version 1.2
+    or any later version published by the Free Software Foundation;
+    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+    A copy of the license is included in the section entitled "GNU
+    Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+    with the Invariant Sections being LIST THEIR TITLES, with the
+    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/nokia-lintian/testset/copyright/debian/copyright.full-gpl b/nokia-lintian/testset/copyright/debian/copyright.full-gpl
new file mode 100644 (file)
index 0000000..94a9ed0
--- /dev/null
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/nokia-lintian/testset/copyright/debian/copyright.iso-8859-1 b/nokia-lintian/testset/copyright/debian/copyright.iso-8859-1
new file mode 100644 (file)
index 0000000..819b3d7
--- /dev/null
@@ -0,0 +1,5 @@
+Copyright (C) 2008 Author
+
+Äußerst ärgerlich, falls nicht UTF-8 benutzt würde.
+
+This directory is obsolete: /usr/share/doc/copyright/copyright
diff --git a/nokia-lintian/testset/copyright/debian/copyright.misc-errors b/nokia-lintian/testset/copyright/debian/copyright.misc-errors
new file mode 100644 (file)
index 0000000..50c5213
--- /dev/null
@@ -0,0 +1,24 @@
+This copyright file contains several errors.
+
+Downloaded from <url://example.com>
+
+You should not use the template for
+Upstream Author(s): Tobias
+Copyright 2008 Tobias
+
+The path /usr/share/common-licences/GPL contains a spelling error.
+
+It's wrong to reference a compressed license, like this:
+/usr/share/common-licenses/BSD.gz
+
+This path /usr/share/doc/copyright is obsolete.
+
+This copyright info was automatically extracted from the perl module.
+It may not be accurate, so you better check the module sources
+if you don't want to get into legal troubles.
+
+This line is overly long. It should be less than 80 characters so that it fits nicely in an 80x25 terminal.
+
+This line isn't too long, but ćōňţăĭņş a number of UTF-8 characters which
+could make it appear to be if improperly decoded.
+
diff --git a/nokia-lintian/testset/copyright/debian/copyright.no-errors b/nokia-lintian/testset/copyright/debian/copyright.no-errors
new file mode 100644 (file)
index 0000000..95aba66
--- /dev/null
@@ -0,0 +1,34 @@
+This package was debianized by Tobias Toedter <t.toedter@gmx.net> on
+Thu, 20 Mar 2008 23:48:15 +0100
+
+It was downloaded from <http://www.example.org/>
+
+Upstream Authors: 
+
+    Tobias Toedter <t.toedter@gmx.net>
+
+Copyright: 
+
+    Copyright (C) 2008 Tobias Toedter
+
+License:
+
+    This package is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+    You should have received a copy of the GNU General Public License
+    along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2008, Tobias Toedter <t.toedter@gmx.net> and
+is licensed under the GPL, see above.
diff --git a/nokia-lintian/testset/copyright/debian/rules b/nokia-lintian/testset/copyright/debian/rules
new file mode 100755 (executable)
index 0000000..cd3d7bb
--- /dev/null
@@ -0,0 +1,76 @@
+#!/usr/bin/make -f
+
+tmp=debian/tmp
+
+build:
+
+binary-arch:
+
+binary-indep:
+       # Create several copyright packages
+       for copyright in debian/copyright* ; do \
+               install -d $(tmp) ;\
+               install -d $(tmp)/DEBIAN ;\
+               install -d $(tmp)/usr/share/doc/`basename $$copyright` ;\
+               install -m 644 debian/changelog \
+                 $(tmp)/usr/share/doc/`basename $$copyright`/changelog ;\
+               gzip -9 $(tmp)/usr/share/doc/`basename $$copyright`/changelog ;\
+               install -m 644 $$copyright \
+                 $(tmp)/usr/share/doc/`basename $$copyright`/copyright ; \
+               dh_md5sums -p`basename $$copyright` -P$(tmp) ; \
+               dpkg-gencontrol -p`basename $$copyright` -P$(tmp) ; \
+               dpkg --build $(tmp) .. ; \
+               rm -rf $(tmp) ; \
+       done
+
+       # Create package with symlink
+       install -d $(tmp)
+       install -d $(tmp)/DEBIAN
+       install -d $(tmp)/usr/share/doc/copyright.symlink
+       install -m 644 debian/changelog \
+         $(tmp)/usr/share/doc/copyright.symlink/changelog
+       gzip -9 $(tmp)/usr/share/doc/copyright.symlink/changelog
+       cp debian/copyright.no-errors $(tmp)/usr/share/doc/copyright.symlink
+       ln -s $(tmp)/usr/share/doc/copyright.symlink/copyright.no-errors \
+         $(tmp)/usr/share/doc/copyright.symlink/copyright
+       dh_md5sums -pcopyright.symlink -P$(tmp)
+       dpkg-gencontrol -pcopyright.symlink -P$(tmp)
+       dpkg --build $(tmp) ..
+       rm -rf $(tmp)
+
+       # Create package with compressed file
+       install -d $(tmp)
+       install -d $(tmp)/DEBIAN
+       install -d $(tmp)/usr/share/doc/copyright.compressed
+       install -m 644 debian/changelog \
+         $(tmp)/usr/share/doc/copyright.compressed/changelog
+       gzip -9 $(tmp)/usr/share/doc/copyright.compressed/changelog
+       cp debian/copyright.no-errors \
+         $(tmp)/usr/share/doc/copyright.compressed/copyright
+       gzip -9 $(tmp)/usr/share/doc/copyright.compressed/copyright
+       dh_md5sums -pcopyright.compressed -P$(tmp)
+       dpkg-gencontrol -pcopyright.compressed -P$(tmp)
+       dpkg --build $(tmp) ..
+       rm -rf $(tmp)
+
+       # Create package with old directory
+       install -d $(tmp)
+       install -d $(tmp)/DEBIAN
+       install -d $(tmp)/usr/share/doc/copyright.old-style
+       install -d $(tmp)/usr/doc/copyright
+       install -m 644 debian/changelog \
+         $(tmp)/usr/share/doc/copyright.old-style/changelog
+       gzip -9 $(tmp)/usr/share/doc/copyright.old-style/changelog
+       cp debian/copyright.no-errors \
+         $(tmp)/usr/doc/copyright/copyright.old-style
+       dh_md5sums -pcopyright.old-style -P$(tmp)
+       dpkg-gencontrol -pcopyright.old-style -P$(tmp)
+       dpkg --build $(tmp) ..
+       #rm -rf $(tmp)
+
+binary: binary-arch binary-indep
+
+clean:
+       rm -rf debian/files $(tmp) debian/substvars
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/debconf/debian/changelog b/nokia-lintian/testset/debconf/debian/changelog
new file mode 100644 (file)
index 0000000..2569799
--- /dev/null
@@ -0,0 +1,6 @@
+debconf (1~rc1) unstable; urgency=low
+
+  * Initial Release
+  * Changelog line with exactly 80 characters which tests the line-too-long tag.
+
+ -- Lintian Maintainers <lintian@packages.debian.org>  Wed,  3 May 2006 18:07:19 -0500
diff --git a/nokia-lintian/testset/debconf/debian/compat b/nokia-lintian/testset/debconf/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/nokia-lintian/testset/debconf/debian/control b/nokia-lintian/testset/debconf/debian/control
new file mode 100644 (file)
index 0000000..a45801f
--- /dev/null
@@ -0,0 +1,37 @@
+Source: debconf
+Section: utils
+Priority: optional
+Build-Depends: debhelper (>= 4), dpatch
+Maintainer: Lintian Maintainers <lintian@packages.debian.org>
+Standards-Version: 3.7.2
+
+Package: debconf-test
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Test package for the debconf checks of lintian
+
+Package: debconf-test-noscripts
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Test package for the debconf checks of lintian
+ Package missing postinst/postrm/config
+
+Package: debconf-test-preinst
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Test package for the debconf checks of lintian
+ Package uses debconf only in preinst
+
+Package: debconf-test-postinst
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Test package for the debconf checks of lintian
+ Package uses debconf only in postinst
+
+Package: debconf-udeb
+Section: debian-installer
+XC-Package-Type: udeb
+XB-Installer-Menu-Item: 100
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Test udeb package for the debconf checks of lintian
diff --git a/nokia-lintian/testset/debconf/debian/copyright b/nokia-lintian/testset/debconf/debian/copyright
new file mode 100644 (file)
index 0000000..84843ee
--- /dev/null
@@ -0,0 +1,10 @@
+Copyright (C) 2004 Frank Lichtenheld <djpig@debian.org>
+
+Test for really old FSF address:
+
+Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
+MA 02139, USA.
+
+Test for a dh-make boilerplate:
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test-noscripts.templates b/nokia-lintian/testset/debconf/debian/debconf-test-noscripts.templates
new file mode 100644 (file)
index 0000000..93f8071
--- /dev/null
@@ -0,0 +1,3 @@
+Template: debconf/test
+Type: text
+_description: Foo bar (1)
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test-postinst.postinst b/nokia-lintian/testset/debconf/debian/debconf-test-postinst.postinst
new file mode 100644 (file)
index 0000000..56ab871
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_input medium debconf/test
+
+#DEBHELPER#
+
+true
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test-postinst.postrm b/nokia-lintian/testset/debconf/debian/debconf-test-postinst.postrm
new file mode 100644 (file)
index 0000000..cbf5e3b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
+    . /usr/share/debconf/confmodule
+    db_purge
+fi
+#DEBHELPER#
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test-postinst.templates b/nokia-lintian/testset/debconf/debian/debconf-test-postinst.templates
new file mode 100644 (file)
index 0000000..2a2a8ab
--- /dev/null
@@ -0,0 +1,3 @@
+Template: debconf/test
+Type: text
+_description: Enter something:
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test-preinst.postrm b/nokia-lintian/testset/debconf/debian/debconf-test-preinst.postrm
new file mode 100644 (file)
index 0000000..cbf5e3b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
+    . /usr/share/debconf/confmodule
+    db_purge
+fi
+#DEBHELPER#
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test-preinst.preinst b/nokia-lintian/testset/debconf/debian/debconf-test-preinst.preinst
new file mode 100644 (file)
index 0000000..bf6f074
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+
+# Obsolete name for the confmodule
+. /usr/share/debconf/confmodule.sh
+
+. /usr/share/debconf/confmodule
+
+db_input medium debconf/test
+
+#DEBHELPER#
+
+true
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test-preinst.templates b/nokia-lintian/testset/debconf/debian/debconf-test-preinst.templates
new file mode 100644 (file)
index 0000000..2a2a8ab
--- /dev/null
@@ -0,0 +1,3 @@
+Template: debconf/test
+Type: text
+_description: Enter something:
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test.config b/nokia-lintian/testset/debconf/debian/debconf-test.config
new file mode 100644 (file)
index 0000000..9e32d06
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_settitle "Funky lintian test"
+
+# Bad priorities.
+db_text LOW debconf/test
+db_input normal debconf/test
+
+# Valid priorities.
+db_text \
+high debconf/test
+foo=medium
+db_input $foo debconf/test
+db_input "$foo" debconf/test
+db_input 'medium' debconf/test
+
+# debconf/transtring should not be flagged as unused
+# (it's aliased to debconf/alias, which is used)
+db_register debconf/transtring debconf/alias
+db_input medium debconf/alias
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test.postinst b/nokia-lintian/testset/debconf/debian/debconf-test.postinst
new file mode 100644 (file)
index 0000000..b387037
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+# Not supposed to do this here.
+db_input medium debconf/test
+
+true
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test.templates b/nokia-lintian/testset/debconf/debian/debconf-test.templates
new file mode 100644 (file)
index 0000000..811bb6c
--- /dev/null
@@ -0,0 +1,101 @@
+Template: debconf/test
+Type: text
+_description: Foo bar (1)
+
+Template: debconf/testmulti
+Type: multiselect
+__Choices: foo, bar, boo
+_Description: test comma usages in choices fields
+
+Template: debconf/testmulti-escape
+Type: multiselect
+_Choices: foo\, bar, boo
+_Description: test escaped comma usages in choices fields:
+
+Template: debconf/testboolean
+Type: boolean
+_Description: Enter yes or no:
+ Do you want to answer this question?
+
+Template: debconf/teststring
+Type: string
+_Description: This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+ This template goes on and on.
+
+Template: debconf/testnote
+Type: note
+Description: This should be a title and not a really long sentence that ends in a regular period.
+
+Template: debconf/1st-person
+Type: select
+__Choices: one, two
+_Description: Select one of these:
+ I am a stupid test of first-person syntax that tells you to select yes
+ even though yes isn't an option in this prompt.
+
+Template: debconf/internal
+Type: boolean
+Description: For internal use only
+ We are testing that style checks are not applied to templates that are
+ marked as internal.
+
+Template: debconf/no-description
+Type: string
+
+Template: debconf/translate
+Type: boolean
+_Default: false
+_Description: Should this really be translated?
+
+Template: debconf/transtring
+Type: string
+_Default: 1
+_Description: Count of templates:
+ The number of useless numbers that a translator would have to translate
+ for this template.
+
+Template: debconf/language
+__Choices: English, Spanish, German, French
+# This is the default choice.  Translators should put their own language,
+# if available, here instead, but the value MUST be the English version
+# of the value for the package scripts to work properly.
+_Default: English[ translators, see the comment in the PO files]
+_Description: The default language, an example of a default that should
+ be translated.
+
+Template: debconf/error
+Type: error
+_Description: An error occurred
+ This is a sample Debconf error template.
+
+Template: debconf/should-be-boolean
+Type: select
+__Choices: yes, no
+_Description: Choose:
+ Pick yes or no.
+
+Template: debconf/should-be-no-longer-a-problem
+Type: boolean
+_Description: Decide, lintian
+ Using "no longer" should no longer be detected as 
+ making-assumptions-about-interfaces-in-templates by lintian.
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test.templates.de b/nokia-lintian/testset/debconf/debian/debconf-test.templates.de
new file mode 100644 (file)
index 0000000..f9ea121
--- /dev/null
@@ -0,0 +1,3 @@
+Template: debconf/testmulti
+Type: multiselect
+Choices: foo, bar\, boo, boo
diff --git a/nokia-lintian/testset/debconf/debian/debconf-test.templates.in b/nokia-lintian/testset/debconf/debian/debconf-test.templates.in
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/nokia-lintian/testset/debconf/debian/debconf-udeb.postinst b/nokia-lintian/testset/debconf/debian/debconf-udeb.postinst
new file mode 100644 (file)
index 0000000..4ce41f0
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+ldconfig
+
+true
diff --git a/nokia-lintian/testset/debconf/debian/debconf-udeb.templates b/nokia-lintian/testset/debconf/debian/debconf-udeb.templates
new file mode 100644 (file)
index 0000000..5d7cf5a
--- /dev/null
@@ -0,0 +1,3 @@
+Template: debian-installer/debconf-udeb/title
+Type: text
+_description: This is just a test
diff --git a/nokia-lintian/testset/debconf/debian/po/POTFILES.in b/nokia-lintian/testset/debconf/debian/po/POTFILES.in
new file mode 100644 (file)
index 0000000..d0c82f0
--- /dev/null
@@ -0,0 +1,2 @@
+[type: gettext/rfc822deb] debconf-test.templates
+[type: gettext/rfc822deb] debconf-udeb.templates
diff --git a/nokia-lintian/testset/debconf/debian/po/de.po b/nokia-lintian/testset/debconf/debian/po/de.po
new file mode 100644 (file)
index 0000000..86c5796
--- /dev/null
@@ -0,0 +1,66 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: debconf-test 1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-12-06 00:51+0100\n"
+"PO-Revision-Date: 2004-12-06 01:01+0100\n"
+"Last-Translator: Frank Lichtenheld <djpig@debian.org>\n"
+"Language-Team: debian-l10n-german@l.d.o\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: text
+#. description
+#: ../debconf-test.templates:3
+msgid "Foo bar (2)"
+msgstr ""
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "foo"
+msgstr "foo"
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "bar"
+msgstr "bar, boo"
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "boo"
+msgstr "boo"
+
+#. Type: multiselect
+#. Description
+#: ../debconf-test.templates:8
+msgid "test comma usages in choices fields"
+msgstr ""
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:11
+msgid "foo\\, bar, boo"
+msgstr "foo, bar, boo"
+
+#. Type: text
+#. description
+#: ../debconf-udeb.templates:3
+msgid "This is just a test"
+msgstr "Dies ist nur ein Test"
diff --git a/nokia-lintian/testset/debconf/debian/po/fr.po b/nokia-lintian/testset/debconf/debian/po/fr.po
new file mode 100644 (file)
index 0000000..c74deb2
--- /dev/null
@@ -0,0 +1,60 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: debconf-test 1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-12-06 00:51+0100\n"
+"PO-Revision-Date: 2005-10-13 15:03+0200\n"
+"Last-Translator: Frank Lichtenheld <djpig@debian.org>\n"
+"Language-Team: debian-l10n-german@l.d.o\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: text
+#. description
+#: ../debconf-test.templates:3
+msgid "Foo bar (2)"
+msgstr ""
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "foo"
+msgstr "foo"
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "bar"
+msgstr "bar, boo"
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "boo"
+msgstr "boo"
+
+#. Type: multiselect
+#. Description
+#: ../debconf-test.templates:8
+msgid "test comma usages in choices fields"
+msgstr ""
+
+#. Type: text
+#. description
+#: ../debconf-udeb.templates:3
+msgid "This is just a test"
+msgstr "
diff --git a/nokia-lintian/testset/debconf/debian/po/lang.po b/nokia-lintian/testset/debconf/debian/po/lang.po
new file mode 100644 (file)
index 0000000..7ac498a
--- /dev/null
@@ -0,0 +1,15 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: debconf-test 1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-12-06 00:51+0100\n"
+"PO-Revision-Date: 2005-10-13 15:03+0200\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: text
+#. description
+#: ../debconf-test.templates:3
+msgid "Foo bar (2)"
+msgstr ""
diff --git a/nokia-lintian/testset/debconf/debian/po/nds.po b/nokia-lintian/testset/debconf/debian/po/nds.po
new file mode 100644 (file)
index 0000000..7ac498a
--- /dev/null
@@ -0,0 +1,15 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: debconf-test 1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-12-06 00:51+0100\n"
+"PO-Revision-Date: 2005-10-13 15:03+0200\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: text
+#. description
+#: ../debconf-test.templates:3
+msgid "Foo bar (2)"
+msgstr ""
diff --git a/nokia-lintian/testset/debconf/debian/po/output b/nokia-lintian/testset/debconf/debian/po/output
new file mode 100644 (file)
index 0000000..c3df1a5
--- /dev/null
@@ -0,0 +1 @@
+2 utf8
diff --git a/nokia-lintian/testset/debconf/debian/po/pt_BR.po b/nokia-lintian/testset/debconf/debian/po/pt_BR.po
new file mode 100644 (file)
index 0000000..7ac498a
--- /dev/null
@@ -0,0 +1,15 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: debconf-test 1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-12-06 00:51+0100\n"
+"PO-Revision-Date: 2005-10-13 15:03+0200\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: text
+#. description
+#: ../debconf-test.templates:3
+msgid "Foo bar (2)"
+msgstr ""
diff --git a/nokia-lintian/testset/debconf/debian/po/sample-file.po b/nokia-lintian/testset/debconf/debian/po/sample-file.po
new file mode 100644 (file)
index 0000000..8dcc0ff
--- /dev/null
@@ -0,0 +1 @@
+This is some file that isn't actually a valid .po file.
diff --git a/nokia-lintian/testset/debconf/debian/po/templates.pot b/nokia-lintian/testset/debconf/debian/po/templates.pot
new file mode 100644 (file)
index 0000000..914c77f
--- /dev/null
@@ -0,0 +1,61 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-12-06 00:51+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: text
+#. description
+#: ../debconf-test.templates:3
+msgid "Foo bar (2)"
+msgstr ""
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "foo"
+msgstr ""
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "bar"
+msgstr ""
+
+#. Type: multiselect
+#. Choices
+#: ../debconf-test.templates:7
+msgid "boo"
+msgstr ""
+
+#. Type: multiselect
+#. Description
+#: ../debconf-test.templates:8
+msgid "test comma usages in choices fields"
+msgstr ""
+
+#. Type: text
+#. description
+#: ../debconf-udeb.templates:3
+msgid "This is just a test"
+msgstr ""
diff --git a/nokia-lintian/testset/debconf/debian/pycompat b/nokia-lintian/testset/debconf/debian/pycompat
new file mode 100644 (file)
index 0000000..0cfbf08
--- /dev/null
@@ -0,0 +1 @@
+2
diff --git a/nokia-lintian/testset/debconf/debian/rules b/nokia-lintian/testset/debconf/debian/rules
new file mode 100755 (executable)
index 0000000..4cedfcd
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/bin/make -f
+
+export DH_COMPAT = 4
+
+deb_dir                =       debian/debconf
+udeb_dir       =       debian/debconf-udeb
+build_dirs     =       $(deb_dir) $(udeb_dir)
+
+build:
+       dh_testdir
+       touch build
+
+clean:
+       dh_testdir
+       dh_testroot
+       -rm -f build
+
+       dh_clean
+
+binary-indep:  build
+# There are no architecture-independent files to be uploaded
+# generated by this package.  If there were any they would be
+# made here.
+
+binary-arch:   build
+       dh_testdir
+       dh_testroot
+       dh_clean -k -a
+       dh_installdirs -a
+
+       dh_installchangelogs -a
+       dh_installdocs -a
+       dh_installdebconf -pdebconf-test
+       dh_installdebconf -pdebconf-test-noscripts --noscripts
+       dh_installdebconf -pdebconf-test-preinst --noscripts
+       dh_installdebconf -pdebconf-test-postinst --noscripts
+       dh_installdebconf -pdebconf-udeb
+
+       # Not needed, but it tests dh_python build dependencies.
+       dh_python -a
+
+       dh_compress -a
+       dh_fixperms -a
+
+# The shlibs stuff doesn't matter here so do it in a weird order to
+# test wwarnings.
+       dh_installdeb -a
+       dh_shlibdeps -a
+       dh_makeshlibs -a
+       dh_gencontrol -a
+       dh_md5sums
+       dh_builddeb -a
+       dh_makeshlibs -a
+
+# Below here is fairly generic really
+
+binary:                binary-indep binary-arch
+
+.PHONY: binary binary-arch binary-indep clean checkroot
diff --git a/nokia-lintian/testset/debug/debian/_symbols b/nokia-lintian/testset/debug/debian/_symbols
new file mode 100644 (file)
index 0000000..a91ce05
--- /dev/null
@@ -0,0 +1,22 @@
+  This line should flag a syntax error
+# but this one shouldn't
+| although this one should, but for a different reason
+ and so should this
+
+libhello.so.0 libhello0 #MINVER#
+| libhello0c2 (>= 1.2)
+| hello-dbg
+ hello@Base 1.0
+* Build-Dep-Foo: bar
+ hello2@Base 2.0 3
+ hello3@Base 2.0 1
+ hello3@Base 2.0 A
+ dummy
+
+libhello.so.2 libhello2 #MINVER#
+* Build-Depends-Package: libbar
+| libhello2 (>= 1:2.3)
+ hello@Base 2.0
+
+libhello.so.0 libhello0 #MINVER#
+ duplicate@Base 1.0
diff --git a/nokia-lintian/testset/debug/debian/changelog b/nokia-lintian/testset/debug/debian/changelog
new file mode 100644 (file)
index 0000000..d00c574
--- /dev/null
@@ -0,0 +1,7 @@
+debug (1.0) unstable; urgency=low
+
+  * NMU.
+  * Initial version.
+
+ -- Russ Allbery <rra@debian.org>  Sat,  4 Mar 2006 21:31:06 -0800
+
diff --git a/nokia-lintian/testset/debug/debian/control b/nokia-lintian/testset/debug/debian/control
new file mode 100644 (file)
index 0000000..b80e8db
--- /dev/null
@@ -0,0 +1,35 @@
+Source: debug
+Section: utils
+Priority: optional
+Maintainer: Russ Allbery <rra@debian.org>
+Build-Depends: debhelper (>= 5.0.0)
+Build-Depends-Indep: not-debhelper (>= 0.4.3)
+Standards-Version: 3.7.0
+
+Package: hello
+Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Test for external debugging information
+ lintian regression test for external debugging file handling.
+
+Package: hello-dbg
+Priority: extra
+Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
+Depends: hello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: Test for external debugging information
+ lintian regression test for external debugging file handling.
+
+Package: libhello0
+Section: libs
+Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Test for external debugging information
+ lintian regression test for external debugging file handling.
+
+Package: libhello0-dbg
+Section: libdevel
+Priority: extra
+Architecture: alpha amd64 arm hppa hurd-i386 i386 ia64 kfreebsd-i386 m68k mips mipsel powerpc ppc64 s390 sparc
+Depends: libhello (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: Test for external debugging information
+ lintian regression test for external debugging file handling.
diff --git a/nokia-lintian/testset/debug/debian/copyright b/nokia-lintian/testset/debug/debian/copyright
new file mode 100644 (file)
index 0000000..5d4f6c2
--- /dev/null
@@ -0,0 +1,4 @@
+Written Sat, 04 Mar 2006 21:30:01 -0800 by Russ Allbery <rra@debian.org>.
+
+Test for copyright in capital letters. (#464992)
+COPYRIGHT RUSS ALLBERY 2006
diff --git a/nokia-lintian/testset/debug/debian/rules b/nokia-lintian/testset/debug/debian/rules
new file mode 100755 (executable)
index 0000000..a40c380
--- /dev/null
@@ -0,0 +1,89 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper. 
+# This file is public domain software, originally written by Joey Hess.
+
+export DH_COMPAT := 5
+
+build: build-stamp
+build-stamp:
+       dh_testdir
+       gcc -D_REENTRANT -fPIC -c libhello.c
+       gcc -o libhello.so.0.0 -shared -Wl,-soname,libhello.so.0 libhello.o
+       ln -s libhello.so.0.0 libhello.so
+       gcc -o hello hello.c -L. -lhello
+       touch build-stamp
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp *.o libhello.so.0.0
+       dh_clean
+
+install: build-stamp
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       install -D hello $(CURDIR)/debian/hello/usr/bin/hello
+       install -D libhello.so.0.0 \
+           $(CURDIR)/debian/libhello0/usr/lib/libhello.so.0.0
+       ln -s libhello.so.0.0 \
+           $(CURDIR)/debian/libhello0/usr/lib/libhello.so.0
+
+# Build architecture-dependent files here.
+export DH_OPTIONS
+binary-arch: DH_OPTIONS=-a
+binary-arch: build-stamp install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs
+       dh_installdocs
+       DH_OPTIONS= dh_strip -phello --dbg-package=hello-dbg
+       DH_OPTIONS= dh_strip -plibhello0 --dbg-package=libhello0-dbg
+
+       # Now break a few things.  Copy the debugging data into places it
+       # shouldn't be.
+       cp $(CURDIR)/debian/hello-dbg/usr/lib/debug/usr/bin/hello \
+           $(CURDIR)/debian/hello/usr/bin/hello.dbg
+       cp $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/usr/lib/libhello.so.0.0 \
+           $(CURDIR)/debian/libhello0-dbg/usr/lib/libhello.so.dbg
+
+       # Put a full copy of the library in libhello0-dbg in /usr/lib/debug,
+       # which is okay.
+       install -m 644 libhello.so.0.0 \
+           $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/libhello.so.0.0
+
+       # Also put it in /usr/lib/debug/lib, which isn't.
+       install -D -m 644 libhello.so.0.0 \
+           $(CURDIR)/debian/libhello0-dbg/usr/lib/debug/lib/libhello.so.0.0
+
+       # Requires a versioned dependency.
+       dh_icons
+
+       dh_link
+       dh_compress
+       dh_fixperms
+       dh_makeshlibs -X debug
+       dh_installdeb
+       dh_shlibdeps -X debug
+
+       # We do this by hand as otherwise dpkg-gensymbols
+       # will error due to the broken symbols file
+       # and abort the build; similarly the file in
+       # the source tree is _symbols so that dpkg
+       # doesn't attempt to sanity check it
+       install -d $(CURDIR)/debian/libhello0/DEBIAN
+       install -m 644 $(CURDIR)/debian/_symbols \
+           $(CURDIR)/debian/libhello0/DEBIAN/symbols
+       # hello doesn't contain any shlibs, but we
+       # make it contain a symbols file
+       install -d $(CURDIR)/debian/hello/DEBIAN
+       install -m 644 $(CURDIR)/debian/_symbols \
+           $(CURDIR)/debian/hello/DEBIAN/symbols
+
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary-indep:
+binary: binary-indep binary-arch
+.PHONY: binary binary-indep binary-arch build clean install
diff --git a/nokia-lintian/testset/debug/hello.c b/nokia-lintian/testset/debug/hello.c
new file mode 100644 (file)
index 0000000..76f8337
--- /dev/null
@@ -0,0 +1,9 @@
+#include <stdlib.h>
+#include "libhello.h"
+
+int
+main(void)
+{
+       hello();
+       exit(0);
+}
diff --git a/nokia-lintian/testset/debug/libhello.c b/nokia-lintian/testset/debug/libhello.c
new file mode 100644 (file)
index 0000000..e2f8409
--- /dev/null
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+void
+hello(void)
+{
+       printf("Hello, World!\n");
+}
diff --git a/nokia-lintian/testset/debug/libhello.h b/nokia-lintian/testset/debug/libhello.h
new file mode 100644 (file)
index 0000000..ef77476
--- /dev/null
@@ -0,0 +1 @@
+void hello(void);
diff --git a/nokia-lintian/testset/description/debian/changelog b/nokia-lintian/testset/description/debian/changelog
new file mode 100644 (file)
index 0000000..d191d84
--- /dev/null
@@ -0,0 +1,31 @@
+description (1.1-1) unstable; urgency=low
+
+  * Add the following tests of tags never seen:
+    - description-synopsis-has-leading-spaces
+      This is not yet recognized by Lintian, so the testset currently
+      fails.
+
+ -- Tobias Toedter <toddy@debian.org>  Sun, 13 Jul 2008 16:30:36 -0700
+
+description (1.0-1) unstable; urgency=low
+
+  * Initial release.
+  * Add the following tests of tags never seen:
+    - changelog-not-compressed-with-max-compression
+    - debian-changelog-file-contains-obsolete-user-emacs-settings
+    - description-starts-with-package-name
+    - description-starts-with-leading-spaces
+    - description-contains-tabs
+    - description-is-debmake-template
+    - description-synopsis-is-empty
+    - description-contains-invalid-control-statement
+    - description-too-long
+    - extended-description-line-too-long
+    - possible-unindented-list-in-extended-description
+
+ -- Tobias Toedter <t.toedter@gmx.net>  Wed, 19 Mar 2008 17:01:51 +0100
+
+# Local Variables:
+# cperl-indent-level: 4
+# add-log-mailing-address: Lintian Maintainers <lintian-maint@debian.org>
+# indent-tabs-mode: t
diff --git a/nokia-lintian/testset/description/debian/control b/nokia-lintian/testset/description/debian/control
new file mode 100644 (file)
index 0000000..0a88f05
--- /dev/null
@@ -0,0 +1,44 @@
+Source: description
+Section: text
+Priority: extra
+Maintainer: Lintian Maintainers <lintian-maint@debian.org>
+Uploaders: Tobias Toedter <toddy@debian.org>
+Standards-Version: 3.8.0
+
+Package: description
+Architecture: all
+Description: description is a package which tests lintian's description checks.
+ missing
+ The the synopsis should not start with the package's name. Moreover,
+ the long description
+       should
+       not
+ contain tabs.
+ .control statements are not allowed as well.
+ .
+ All all all of of these these should be matched matched matched
+
+Package: description-foo
+Architecture: all
+Description: Don't use tabs    in the synopsis and restrict yourself to less than 80 characters, otherwise Lintian will complain
+    Oh, and don't start the long description with spaces.
+ Now here comes a list:
+ - which is
+ - unfortunately
+ - not correctly indented.
+
+Package: description-bar
+Architecture: all
+Description:
+ There should really be a synopsis.
+ . and please avoid control statements in the long description.
+ The line in an extended description should be less than 80 characters, otherwise you'll get
+ a Lintian warning.
+ .
+ And the old man said "he he is the one!"
+ "No, I am am not", he replied
+
+Package: description-baz
+Architecture: all
+Description:    the synopsis starts with spaces
+ This is a real Lintian bug which has been discovered with this testset.
diff --git a/nokia-lintian/testset/description/debian/rules b/nokia-lintian/testset/description/debian/rules
new file mode 100755 (executable)
index 0000000..855170c
--- /dev/null
@@ -0,0 +1,57 @@
+#!/usr/bin/make -f
+
+description=debian/description
+description-foo=debian/description-foo
+description-bar=debian/description-bar
+description-baz=debian/description-baz
+
+build:
+
+binary-indep:
+       # Create package description
+       install -d $(description)
+       install -d $(description)/DEBIAN
+       install -d $(description)/usr/share/doc/description
+       install -m 644 debian/changelog \
+         $(description)/usr/share/doc/description/changelog.Debian
+       gzip -1 $(description)/usr/share/doc/description/changelog.Debian
+       dpkg-gencontrol -pdescription -P$(description)
+       dpkg --build $(description) ..
+       
+       # Create package description-foo
+       install -d $(description-foo)
+       install -d $(description-foo)/DEBIAN
+       install -d $(description-foo)/usr/share/doc/description
+       install -m 644 debian/changelog \
+         $(description-foo)/usr/share/doc/description/changelog.Debian
+       gzip -9 $(description-foo)/usr/share/doc/description/changelog.Debian
+       dpkg-gencontrol -pdescription-foo -P$(description-foo)
+       dpkg --build $(description-foo) ..
+       
+       # Create package description-bar
+       install -d $(description-bar)
+       install -d $(description-bar)/DEBIAN
+       install -d $(description-bar)/usr/share/doc/description
+       install -m 644 debian/changelog \
+         $(description-bar)/usr/share/doc/description/changelog.Debian
+       gzip -9 $(description-bar)/usr/share/doc/description/changelog.Debian
+       dpkg-gencontrol -pdescription-bar -P$(description-bar)
+       dpkg --build $(description-bar) ..
+       
+       # Create package description-baz
+       install -d $(description-baz)
+       install -d $(description-baz)/DEBIAN
+       install -d $(description-baz)/usr/share/doc/description
+       install -m 644 debian/changelog \
+         $(description-baz)/usr/share/doc/description/changelog.Debian
+       gzip -9 $(description-baz)/usr/share/doc/description/changelog.Debian
+       dpkg-gencontrol -pdescription-baz -P$(description-baz)
+       dpkg --build $(description-baz) ..
+
+binary: binary-indep
+
+clean:
+       rm -rf debian/files $(description) $(description-foo) \
+         $(description-bar) $(description-baz) debian/substvars
+
+.PHONY: build binary-indep binary clean
diff --git a/nokia-lintian/testset/dh-test/debian/README.Debian b/nokia-lintian/testset/dh-test/debian/README.Debian
new file mode 100644 (file)
index 0000000..5ce4495
--- /dev/null
@@ -0,0 +1,6 @@
+dh-test for Debian
+------------------
+
+<possible notes regarding this package - if none, delete this file>
+
+ -- Frank Lichtenheld <djpig@debian.org>, Thu,  4 Aug 2005 23:09:00 +0200
diff --git a/nokia-lintian/testset/dh-test/debian/changelog b/nokia-lintian/testset/dh-test/debian/changelog
new file mode 100644 (file)
index 0000000..5886b75
--- /dev/null
@@ -0,0 +1,6 @@
+dh-test (1-1) unstable; urgency=low
+
+  * Initial release Closes: #nnnn  (nnnn is the bug number of your ITP)
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu,  4 Aug 2005 23:09:00 +0200
+
diff --git a/nokia-lintian/testset/dh-test/debian/control b/nokia-lintian/testset/dh-test/debian/control
new file mode 100644 (file)
index 0000000..febe799
--- /dev/null
@@ -0,0 +1,12 @@
+Source: dh-test
+Section: unknown
+Priority: optional
+Maintainer: Frank Lichtenheld <djpig@debian.org>
+Build-Depends: debhelper (>= 4.0.0)
+Standards-Version: 3.6.2
+
+Package: dh-test
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: <insert up to 60 chars description>
+ <insert long description, indented with spaces>
diff --git a/nokia-lintian/testset/dh-test/debian/copyright b/nokia-lintian/testset/dh-test/debian/copyright
new file mode 100644 (file)
index 0000000..2bcce49
--- /dev/null
@@ -0,0 +1,10 @@
+This package was debianized by Frank Lichtenheld <djpig@debian.org> on
+Thu,  4 Aug 2005 23:09:00 +0200.
+
+It was downloaded from <fill in ftp site>
+
+Copyright Holder: <put author(s) name and email here>
+
+License:
+
+<Put the license of the package here>
diff --git a/nokia-lintian/testset/dh-test/debian/postinst b/nokia-lintian/testset/dh-test/debian/postinst
new file mode 100644 (file)
index 0000000..4f37c66
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+# postinst script for #PACKAGE#
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/nokia-lintian/testset/dh-test/debian/rules b/nokia-lintian/testset/dh-test/debian/rules
new file mode 100755 (executable)
index 0000000..dbe5113
--- /dev/null
@@ -0,0 +1,101 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DH_COMPAT=3
+export DH_COMPAT
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+
+       touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+       dh_testdir
+
+       # Add here commands to compile the package.
+#      $(MAKE)
+       #docbook-to-man debian/dh-test.sgml > dh-test.1
+
+       touch build-stamp
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       -$(MAKE) clean
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/dh-test.
+#      $(MAKE) install DESTDIR=$(CURDIR)/debian/dh-test
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testversion
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs 
+       dh_installdocs
+       dh_installexamples
+#      dh_install
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+#      dh_dhelp
+       dh_suidregister
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+#      dh_perl
+#      dh_python
+#      dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/nokia-lintian/testset/dh7-minimal/debian/changelog b/nokia-lintian/testset/dh7-minimal/debian/changelog
new file mode 100644 (file)
index 0000000..6b7a730
--- /dev/null
@@ -0,0 +1,6 @@
+dh7-minimal (1) unstable; urgency=low
+
+  * Initial release, also testing case-insensitive matching.
+
+ -- Russ Allbery <rra@Debian.ORG>  Fri, 06 Jun 2008 17:20:53 -0700
+
diff --git a/nokia-lintian/testset/dh7-minimal/debian/compat b/nokia-lintian/testset/dh7-minimal/debian/compat
new file mode 100644 (file)
index 0000000..7f8f011
--- /dev/null
@@ -0,0 +1 @@
+7
diff --git a/nokia-lintian/testset/dh7-minimal/debian/control b/nokia-lintian/testset/dh7-minimal/debian/control
new file mode 100644 (file)
index 0000000..a5b0e92
--- /dev/null
@@ -0,0 +1,12 @@
+Source: dh7-minimal
+Section: devel
+Priority: optional
+Maintainer: Russ Allbery <rra@debian.org>
+Build-Depends: debhelper (>= 7)
+Standards-Version: 3.9.0
+
+Package: dh7-test
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Checks related to debhelper rule minimization
+ New in debhelper 7.
diff --git a/nokia-lintian/testset/dh7-minimal/debian/copyright b/nokia-lintian/testset/dh7-minimal/debian/copyright
new file mode 100644 (file)
index 0000000..9b24687
--- /dev/null
@@ -0,0 +1 @@
+Copyright 2008 Russ Allbery
diff --git a/nokia-lintian/testset/dh7-minimal/debian/rules b/nokia-lintian/testset/dh7-minimal/debian/rules
new file mode 100755 (executable)
index 0000000..cbe925d
--- /dev/null
@@ -0,0 +1,3 @@
+#!/usr/bin/make -f
+%:
+       dh $@
diff --git a/nokia-lintian/testset/dh7-test/debian/changelog b/nokia-lintian/testset/dh7-test/debian/changelog
new file mode 100644 (file)
index 0000000..0281294
--- /dev/null
@@ -0,0 +1,6 @@
+dh7-test (1.dfsg-1) unstable; urgency=low
+
+  * Initial release
+
+ -- Frank Lichtenheld <djpig@debian.org>  Wed, 04 Jun 2008 15:53:27 -0700
+
diff --git a/nokia-lintian/testset/dh7-test/debian/compat b/nokia-lintian/testset/dh7-test/debian/compat
new file mode 100644 (file)
index 0000000..1e8b314
--- /dev/null
@@ -0,0 +1 @@
+6
diff --git a/nokia-lintian/testset/dh7-test/debian/control b/nokia-lintian/testset/dh7-test/debian/control
new file mode 100644 (file)
index 0000000..49827ac
--- /dev/null
@@ -0,0 +1,12 @@
+Source: dh7-test
+Section: devel
+Priority: optional
+Maintainer: Lintian Maintainers <debian-lint-maint@lists.debian.org>
+Build-Depends: debhelper (>= 6)
+Standards-Version: 3.8.0
+
+Package: dh7-test
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Checks related to the dh build utility
+ New in debhelper 7.
diff --git a/nokia-lintian/testset/dh7-test/debian/copyright b/nokia-lintian/testset/dh7-test/debian/copyright
new file mode 100644 (file)
index 0000000..355bfc1
--- /dev/null
@@ -0,0 +1,5 @@
+This package was debianized by Frank Lichtenheld <djpig@debian.org> on
+Thu,  4 Aug 2005 23:09:00 +0200.
+
+Test copyright date handling:
+Copyright 2005, 2008 Frank Lichtenheld
diff --git a/nokia-lintian/testset/dh7-test/debian/rules b/nokia-lintian/testset/dh7-test/debian/rules
new file mode 100755 (executable)
index 0000000..14b3e4b
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+export DH_VERBOSE = 1
+
+clean build binary-indep binary:
+       dh $@
+
+.PHONY: clean build binary-arch binary-indep binary
diff --git a/nokia-lintian/testset/dh7-test/debian/watch b/nokia-lintian/testset/dh7-test/debian/watch
new file mode 100644 (file)
index 0000000..0915699
--- /dev/null
@@ -0,0 +1,5 @@
+# watch file with no version mangling, even though there's a dfsg in the
+# package version number.
+
+version=2
+http://www.example.com/dist/ dh7-test\.([\d.]+)\.tar\.gz
diff --git a/nokia-lintian/testset/dh7-test_1.dfsg.orig.tar.gz b/nokia-lintian/testset/dh7-test_1.dfsg.orig.tar.gz
new file mode 100644 (file)
index 0000000..1f69199
Binary files /dev/null and b/nokia-lintian/testset/dh7-test_1.dfsg.orig.tar.gz differ
diff --git a/nokia-lintian/testset/diffs/.bzr/dummy b/nokia-lintian/testset/diffs/.bzr/dummy
new file mode 100644 (file)
index 0000000..2380f51
--- /dev/null
@@ -0,0 +1 @@
+Some dummy file to trigger the .bzr in diff check.
diff --git a/nokia-lintian/testset/diffs/ChangeLog b/nokia-lintian/testset/diffs/ChangeLog
new file mode 100644 (file)
index 0000000..7fd37e0
--- /dev/null
@@ -0,0 +1 @@
+upstream changelog
diff --git a/nokia-lintian/testset/diffs/Makefile b/nokia-lintian/testset/diffs/Makefile
new file mode 100644 (file)
index 0000000..df9ba4f
--- /dev/null
@@ -0,0 +1,5 @@
+
+all: binary
+
+clean:
+       rm -f binary
diff --git a/nokia-lintian/testset/diffs/binary.c b/nokia-lintian/testset/diffs/binary.c
new file mode 100644 (file)
index 0000000..5e0d16c
--- /dev/null
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+int main () {
+  printf("Helooooooo nurse! :)\n");
+}
diff --git a/nokia-lintian/testset/diffs/config.cache b/nokia-lintian/testset/diffs/config.cache
new file mode 100644 (file)
index 0000000..06cf653
--- /dev/null
@@ -0,0 +1 @@
+cache
diff --git a/nokia-lintian/testset/diffs/config.log b/nokia-lintian/testset/diffs/config.log
new file mode 100644 (file)
index 0000000..6bfe6b1
--- /dev/null
@@ -0,0 +1 @@
+log
diff --git a/nokia-lintian/testset/diffs/config.status b/nokia-lintian/testset/diffs/config.status
new file mode 100644 (file)
index 0000000..8be5547
--- /dev/null
@@ -0,0 +1 @@
+status
diff --git a/nokia-lintian/testset/diffs/configure b/nokia-lintian/testset/diffs/configure
new file mode 100755 (executable)
index 0000000..1f0f380
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo cache > config.cache
+echo log > config.log
+echo status > config.status
diff --git a/nokia-lintian/testset/diffs/debian/changelog b/nokia-lintian/testset/diffs/debian/changelog
new file mode 100644 (file)
index 0000000..e8eee64
--- /dev/null
@@ -0,0 +1,15 @@
+diffs (1-1~lint1) unstable; urgency=low
+
+  * Initial version
+  (Closes: #123456)
+  closes: Bug#123456
+  (Closes: #nnnnnn)
+  (Closes: #123nnn)
+  (Closes: #1, #foo)
+  (Closes: #1, Bug#2, #bar)
+  (Closes 1 bug)
+  (Closes 456712)
+  (Closes Bug# 123893)
+  (Closes #1239124)
+
+ -- Lintian Maintainers <lintian-maint@debian.org>  Thu,  6 Mar 2003 18:00:00 -0600
diff --git a/nokia-lintian/testset/diffs/debian/config.cache b/nokia-lintian/testset/diffs/debian/config.cache
new file mode 100644 (file)
index 0000000..06cf653
--- /dev/null
@@ -0,0 +1 @@
+cache
diff --git a/nokia-lintian/testset/diffs/debian/control b/nokia-lintian/testset/diffs/debian/control
new file mode 100644 (file)
index 0000000..756fb62
--- /dev/null
@@ -0,0 +1,12 @@
+Source: diffs
+Section: interpreters
+Priority: extra
+Maintainer: Lintian Maintainers <lintian-maint@debian.org>
+Build-Depends: dpatch
+Standards-Version: 3.5.9
+
+Package: diffs
+Architecture: all
+Depends: test
+Description: test lintian's diff file checks
+ Regression test lintian's diff file checks.
diff --git a/nokia-lintian/testset/diffs/debian/files b/nokia-lintian/testset/diffs/debian/files
new file mode 100644 (file)
index 0000000..ee2e26d
--- /dev/null
@@ -0,0 +1 @@
+diffs_1-1~lint1_all.deb interpreters extra
diff --git a/nokia-lintian/testset/diffs/debian/patches/00list b/nokia-lintian/testset/diffs/debian/patches/00list
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/nokia-lintian/testset/diffs/debian/rules b/nokia-lintian/testset/diffs/debian/rules
new file mode 100755 (executable)
index 0000000..61a76d1
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/make -f
+
+package := diffs
+tmp := debian/tmp
+
+build:
+       make
+
+binary-arch:
+
+binary-indep:
+       install -d $(tmp)/usr/bin/
+       install -d $(tmp)/usr/share/doc/$(package)/
+       install -d $(tmp)/DEBIAN
+
+       install -m 755 binary $(tmp)/usr/bin/$(package)
+       gzip -c9 ChangeLog > $(tmp)/usr/share/doc/$(package)/changelog.gz
+       gzip -c9 debian/changelog > $(tmp)/usr/share/doc/$(package)/changelog.Debian.gz
+
+       dpkg-gencontrol -isp
+       dpkg --build $(tmp) ..
+
+binary: binary-arch binary-indep
+
+clean:
+       rm -rf $(tmp)
+       make clean
+       rm -f subdir-good/config.cache subdir-good/config.log subdir-good/config.status
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/diffs/debian/substvars b/nokia-lintian/testset/diffs/debian/substvars
new file mode 100644 (file)
index 0000000..79ad1e4
--- /dev/null
@@ -0,0 +1,2 @@
+# This shouldn't be included in the package; it's normally created
+# dynamically and removed on debian/rules clean.
diff --git a/nokia-lintian/testset/diffs/subdir-bad/config.cache b/nokia-lintian/testset/diffs/subdir-bad/config.cache
new file mode 100644 (file)
index 0000000..06cf653
--- /dev/null
@@ -0,0 +1 @@
+cache
diff --git a/nokia-lintian/testset/diffs/subdir-bad/config.log b/nokia-lintian/testset/diffs/subdir-bad/config.log
new file mode 100644 (file)
index 0000000..6bfe6b1
--- /dev/null
@@ -0,0 +1 @@
+log
diff --git a/nokia-lintian/testset/diffs/subdir-bad/config.status b/nokia-lintian/testset/diffs/subdir-bad/config.status
new file mode 100644 (file)
index 0000000..8be5547
--- /dev/null
@@ -0,0 +1 @@
+status
diff --git a/nokia-lintian/testset/diffs/subdir-bad/configure b/nokia-lintian/testset/diffs/subdir-bad/configure
new file mode 100755 (executable)
index 0000000..1f0f380
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo cache > config.cache
+echo log > config.log
+echo status > config.status
diff --git a/nokia-lintian/testset/diffs/subdir-good/config.cache b/nokia-lintian/testset/diffs/subdir-good/config.cache
new file mode 100644 (file)
index 0000000..06cf653
--- /dev/null
@@ -0,0 +1 @@
+cache
diff --git a/nokia-lintian/testset/diffs/subdir-good/config.log b/nokia-lintian/testset/diffs/subdir-good/config.log
new file mode 100644 (file)
index 0000000..6bfe6b1
--- /dev/null
@@ -0,0 +1 @@
+log
diff --git a/nokia-lintian/testset/diffs/subdir-good/config.status b/nokia-lintian/testset/diffs/subdir-good/config.status
new file mode 100644 (file)
index 0000000..8be5547
--- /dev/null
@@ -0,0 +1 @@
+status
diff --git a/nokia-lintian/testset/diffs/subdir-good/configure b/nokia-lintian/testset/diffs/subdir-good/configure
new file mode 100755 (executable)
index 0000000..1f0f380
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo cache > config.cache
+echo log > config.log
+echo status > config.status
diff --git a/nokia-lintian/testset/diffs/svn-commit.tmp b/nokia-lintian/testset/diffs/svn-commit.tmp
new file mode 100644 (file)
index 0000000..42b5ab6
--- /dev/null
@@ -0,0 +1 @@
+Temporary file left over from failed upstream commit.
diff --git a/nokia-lintian/testset/diffs_1.orig.tar.gz b/nokia-lintian/testset/diffs_1.orig.tar.gz
new file mode 100644 (file)
index 0000000..2374b99
Binary files /dev/null and b/nokia-lintian/testset/diffs_1.orig.tar.gz differ
diff --git a/nokia-lintian/testset/empty/debian/changelog b/nokia-lintian/testset/empty/debian/changelog
new file mode 100644 (file)
index 0000000..1e8cca3
--- /dev/null
@@ -0,0 +1,11 @@
+empty (2) unstable; urgency=low
+
+  * Add pyempty, empty-docs and empty-perl (to check for section errors)
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Thu, 29 Nov 2007 12:48:13 +0100
+
+empty (1) unstable; urgency=low
+
+  * Initial version
+
+ -- Richard Braakman <dark@xs4all.nl>  Wed, 10 Jun 1998 19:45:40 +0200
diff --git a/nokia-lintian/testset/empty/debian/control b/nokia-lintian/testset/empty/debian/control
new file mode 100644 (file)
index 0000000..5825d59
--- /dev/null
@@ -0,0 +1,17 @@
+Source: empty
+Maintainer: empty
+
+Package: empty
+Architecture: all
+
+Package: empty-docs
+Architecture: all
+Section: perl
+
+Package: libempty-perl
+Architecture: all
+Section: doc
+
+Package: python-empty
+Architecture: all
+Section: doc
diff --git a/nokia-lintian/testset/empty/debian/rules b/nokia-lintian/testset/empty/debian/rules
new file mode 100755 (executable)
index 0000000..b3d4e70
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/make -f
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+build:
+
+binary-indep:
+       install -d debian/empty debian/empty/DEBIAN
+       dpkg-gencontrol -pempty -Pdebian/empty
+       dpkg --build debian/empty ..
+       install -d debian/empty-docs debian/empty-docs/DEBIAN
+       dpkg-gencontrol -pempty-docs -Pdebian/empty-docs
+       dpkg --build debian/empty-docs ..
+       install -d debian/libempty-perl debian/libempty-perl/DEBIAN
+       dpkg-gencontrol -plibempty-perl -Pdebian/libempty-perl
+       dpkg --build debian/libempty-perl ..
+       install -d debian/python-empty debian/python-empty/DEBIAN
+       dpkg-gencontrol -ppython-empty -Pdebian/python-empty
+       dpkg --build debian/python-empty ..
+
+binary: binary-indep
+
+clean:
+       rm -rf $(CURDIR)/debian/empty $(CURDIR)/debian/empty-docs \
+               $(CURDIR)/debian/libempty-perl $(CURDIR)/debian/python-empty \
+               debian/files
+
+.PHONY: build binary-indep binary clean
diff --git a/nokia-lintian/testset/etcfiles/debian/README.Debian b/nokia-lintian/testset/etcfiles/debian/README.Debian
new file mode 100644 (file)
index 0000000..e289bfb
--- /dev/null
@@ -0,0 +1,5 @@
+this is a package to test lintian's handling of files in /etc.
+Also, there's a random mention of /usr/doc here to prompt a warning.
+But /usr/documentation doesn't.
+
+ -- Russ Allbery <rra@debian.org>, Mon, 18 Feb 2008 16:40:55 -0800
diff --git a/nokia-lintian/testset/etcfiles/debian/changelog b/nokia-lintian/testset/etcfiles/debian/changelog
new file mode 100644 (file)
index 0000000..3622782
--- /dev/null
@@ -0,0 +1,7 @@
+etcfiles (1) unstable; urgency=low
+
+  * Acknowledge NMU (Closes: #1234).
+  * initial setup
+
+ -- Lintian Maintainers <lintian-maint@debian.org>  Fri, 21 Sep 2001 11:56:02 -0700
+
diff --git a/nokia-lintian/testset/etcfiles/debian/conffiles b/nokia-lintian/testset/etcfiles/debian/conffiles
new file mode 100644 (file)
index 0000000..76032b7
--- /dev/null
@@ -0,0 +1,5 @@
+/etc/proper
+/var/lib/foo
+/etc/cron.daily/cronfile-normal
+/etc/cron.daily/.cronfile-begins-with-fullstop
+/etc/cron.daily/cronfile-contains.fullstop
diff --git a/nokia-lintian/testset/etcfiles/debian/conffiles.only b/nokia-lintian/testset/etcfiles/debian/conffiles.only
new file mode 100644 (file)
index 0000000..a4b3895
--- /dev/null
@@ -0,0 +1,2 @@
+/etc/etcfiles/foo
+/etc/etcfiles/bar
diff --git a/nokia-lintian/testset/etcfiles/debian/control b/nokia-lintian/testset/etcfiles/debian/control
new file mode 100644 (file)
index 0000000..878a7cf
--- /dev/null
@@ -0,0 +1,16 @@
+Source: etcfiles
+Section: misc
+Priority: extra
+Maintainer: Lintian Maintainers <lintian-maint@debian.org>
+Standards-Version: 3.5.0
+
+Package: etcfiles
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: test handling of files in /etc
+ Regression test for lintian's handling of files in /etc.
+
+Package: only-etcfiles
+Architecture: all
+Depends: etcfiles (= ${source:Version})
+Description: test handling of conffile-only package
diff --git a/nokia-lintian/testset/etcfiles/debian/rules b/nokia-lintian/testset/etcfiles/debian/rules
new file mode 100755 (executable)
index 0000000..1e58c81
--- /dev/null
@@ -0,0 +1,62 @@
+#!/usr/bin/make -f
+
+tmp=debian/tmp
+tmponly=debian/only-etcfiles
+
+clean:
+       rm -f debian/files debian/substvars
+       rm -rf debian/tmp
+       rm -rf debian/only-etcfiles
+
+build:
+binary-indep:
+       install -d $(tmp)/etc
+       install -m 644 proper $(tmp)/etc
+       install -m 644 improper $(tmp)/etc
+       mkdir $(tmp)/etc/cron.daily
+       touch $(tmp)/etc/cron.daily/cronfile-normal
+       touch $(tmp)/etc/cron.daily/.cronfile-begins-with-fullstop
+       touch $(tmp)/etc/cron.daily/cronfile-contains.fullstop
+       ln $(tmp)/etc/improper $(tmp)/etc/improper-link
+       install -d $(tmp)/usr/share/doc/etcfiles
+       install -d $(tmp)/var/lib
+       install -m 644 proper $(tmp)/var/lib/foo
+       install -m 644 debian/README.Debian $(tmp)/usr/share/doc/etcfiles
+       install -m 644 debian/changelog $(tmp)/usr/share/doc/etcfiles
+       #gzip -9 $(tmp)/usr/share/doc/etcfiles/changelog
+       install -d $(tmp)/DEBIAN
+       install -m 644 debian/conffiles $(tmp)/DEBIAN
+
+       echo '68b329da9893e34099c7d8ad5cb9c940  ./etc/cron.daily/cronfile-normal' \
+           > debian/tmp/DEBIAN/md5sums
+       echo '68b329da9893e34099c7d8ad5cb9c940  ./etc/cron.daily/.cronfile-begins-with-fullstop' \
+           > debian/tmp/DEBIAN/md5sums
+       echo '68b329da9893e34099c7d8ad5cb9c940  ./etc/cron.daily/cronfile-contains.fullstop' \
+           > debian/tmp/DEBIAN/md5sums
+       echo 'ab371382468880299e5ebd05921764ce  ./etc/proper' \
+           > debian/tmp/DEBIAN/md5sums
+       echo 'ab371382468880299e5ebd05921764ce  etc/improper' \
+           >> debian/tmp/DEBIAN/md5sums
+       echo 'ab371382468880299e5ebd05921764ce  usr/bin/foo' \
+           >> debian/tmp/DEBIAN/md5sums
+       echo 'this is a malformed line' \
+           >> debian/tmp/DEBIAN/md5sums
+       echo '56fb27e455dd86d8801f1ecd3a4cee49  usr/share/doc/etcfiles/README.Debian' \
+           >> debian/tmp/DEBIAN/md5sums
+
+       install -d $(tmponly)/etc/etcfiles
+       touch $(tmponly)/etc/etcfiles/foo
+       touch $(tmponly)/etc/etcfiles/bar
+       install -d $(tmponly)/usr/share/doc
+       cd $(tmponly)/usr/share/doc && ln -s etcfiles only-etcfiles
+       install -d $(tmponly)/DEBIAN
+       install -m 644 debian/conffiles.only $(tmponly)/DEBIAN/conffiles
+
+       dpkg-gencontrol -isp -petcfiles
+       dpkg-gencontrol -isp -ponly-etcfiles -P$(tmponly)
+       dpkg --build $(tmp) ..
+       dpkg --build $(tmponly) ..
+
+binary: binary-indep
+
+.PHONY: binary-indep binary clean
diff --git a/nokia-lintian/testset/etcfiles/improper b/nokia-lintian/testset/etcfiles/improper
new file mode 100644 (file)
index 0000000..23656f4
--- /dev/null
@@ -0,0 +1,2 @@
+[config]
+   var = value
\ No newline at end of file
diff --git a/nokia-lintian/testset/etcfiles/proper b/nokia-lintian/testset/etcfiles/proper
new file mode 100644 (file)
index 0000000..f3dc68b
--- /dev/null
@@ -0,0 +1,2 @@
+# i am a config file
+foo = var
\ No newline at end of file
diff --git a/nokia-lintian/testset/filenames/debian/.be/dummy b/nokia-lintian/testset/filenames/debian/.be/dummy
new file mode 100644 (file)
index 0000000..fba37e2
--- /dev/null
@@ -0,0 +1 @@
+Dummy file to trigger diff-contains-bts-control-dir
diff --git a/nokia-lintian/testset/filenames/debian/changelog b/nokia-lintian/testset/filenames/debian/changelog
new file mode 100644 (file)
index 0000000..e936b33
--- /dev/null
@@ -0,0 +1,78 @@
+filenames (12-0.1) unstable; urgency=low
+
+  * /me is doing a correct NMU of this package.
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Sun, 18 Apr 2004 02:04:39 +0200
+
+filenames (11) unstable; urgency=low
+
+  * Add a README.macos.
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Mon, 12 Apr 2004 23:35:24 +0200
+
+filenames (10) unstable; urgency=low
+
+  * Some new files to check the checks for the use of /usr/*/X11 and
+    /usr/X11R6/*.
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Sun, 11 Apr 2004 17:35:20 +0200
+
+filenames (9) unstable; urgency=low
+
+  * Add a two *.ali files, one with the right permission, one with
+    the more common, but false one.
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Sun, 11 Apr 2004 00:18:16 +0200
+
+filenames (8) unstable; urgency=low
+
+  * Add a real ancient file
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu,  8 Apr 2004 22:22:40 +0200
+
+filenames (7) unstable; urgency=low
+
+  * Add a dozen symlinks, some correct, some not
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Fri, 27 Feb 2004 01:28:42 +0100
+
+filenames (6) unstable; urgency=low
+
+  * Add perl files to check if
+    package-installs-nonbinary-perl-in-usr-lib-perl5 is correctly
+    issued even after attempting to suppress it in some cases
+
+ -- Frank Lichtenheld <djpig@debian.org>  Fri, 27 Feb 2004 00:49:44 +0100
+
+filenames (5) unstable; urgency=low
+
+  * Added check for too long symlink
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed,  3 Jan 2001 13:20:31 -0800
+
+filenames (4) unstable; urgency=low
+
+  * Add /usr/lib/menu/menu file to test the bad-menu-file-name tag.
+  * Add /usr/lib/menu/README to test the new execption for it.
+
+ -- Richard Braakman <dark@xs4all.nl>  Thu, 22 Oct 1998 15:42:52 +0200
+
+filenames (3) unstable; urgency=low
+
+  * Don't rely on the installer's umask.
+
+ -- Richard Braakman <dark@xs4all.nl>  Thu, 20 Aug 1998 12:45:47 +0200
+
+filenames (2) unstable; urgency=low
+
+  * Noted more limitations on what filenames lintian handles.
+  * Added Changes.gz in /usr/doc/filenames and made a symlink from changelog.gz
+    to Changes.gz.
+
+ -- Richard Braakman <dark@xs4all.nl>  Sat,  4 Jul 1998 15:46:11 +0200
+
+filenames (1) unstable; urgency=low
+
+  * Initial version
+
+ -- Richard Braakman <dark@xs4all.nl>  Sat,  4 Jul 1998 15:25:01 +0200
diff --git a/nokia-lintian/testset/filenames/debian/control b/nokia-lintian/testset/filenames/debian/control
new file mode 100644 (file)
index 0000000..c8a72e0
--- /dev/null
@@ -0,0 +1,34 @@
+Source: filenames
+Maintainer: Lintian Maintainer <lintian-maint@debian.org>
+Standards-Version: 3.1.1
+
+Package: filenames
+Architecture: all
+Depends: test
+Description: see how lintian reacts to weird filenames
+ This package contains files with the most evil names I could find,
+ except for ones that lintian is explicitly not designed to handle.
+ .
+ Lintian does not handle filenames containing newlines, or filenames
+ that contain the strings " link to ", " -> ", or ": ".  The last one
+ is used as a separator by the file command, the others are used as
+ separators by tar.
+ .
+ Lintian also does not handle filenames that contain backslashes, or
+ other characters that are mangled by tar's -tv output.
+
+Package: filename-games
+Architecture: all
+Depends: filenames
+Section: games
+Description: Test game filename/location checks
+ This package contains files with slightly less evil names than
+ filenames.
+
+Package: more-filename-games
+Architecture: all
+Depends: filenames, filename-games
+Section: games
+Priority: optional
+Description: More test for game filename/location checks
+ This package contains no evil names, only evil locations.
diff --git a/nokia-lintian/testset/filenames/debian/doc-base b/nokia-lintian/testset/filenames/debian/doc-base
new file mode 100644 (file)
index 0000000..e5a611b
--- /dev/null
@@ -0,0 +1,11 @@
+Document: testing
+Title: Working doc-base control file
+Author: Russ Allbery
+Abstract: This control file ensures that we don't get false positives for
+ correct doc-base files.
+ .
+ There isn't anything wrong with this one.
+Section: Education
+
+Format: Text
+Files: /usr/share/doc/filenames/README.macosx
diff --git a/nokia-lintian/testset/filenames/debian/rules b/nokia-lintian/testset/filenames/debian/rules
new file mode 100755 (executable)
index 0000000..921637d
--- /dev/null
@@ -0,0 +1,229 @@
+#!/usr/bin/make -f
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+clean:
+       mkdir -p .svn CVS "{arch}" .arch-ids .bzr
+       touch files/.cvsignore files/svn-commit.tmp files/svk-commitsEr9P.tmp
+       touch files/.arch-inventory
+       touch 'files/.#Maelstrom Sound.1.1.1' 'files/Maelstrom Sounce.r121'
+       touch 'files/Maelstrom Sound.mine'
+
+build:
+
+binary-arch:
+
+binary-indep:
+       install -d debian/tmp/DEBIAN
+       cp -a files debian/tmp
+       chmod -R go=rX debian/tmp/files
+
+       install -d debian/tmp/usr/lib/filenames
+       install -m 555 -d debian/tmp/usr/lib/filenames/readonly
+       touch debian/tmp/usr/lib/filenames/readonly/test
+
+       install -d debian/tmp/usr/lib/menu
+       install -d debian/tmp/usr/share/menu
+       touch debian/tmp/usr/lib/menu/README
+       touch debian/tmp/usr/share/menu/README
+       touch debian/tmp/usr/lib/menu/menu
+       touch debian/tmp/usr/share/menu/menu
+       chmod 644 debian/tmp/usr/lib/menu/*
+
+       install -d debian/tmp/usr/lib/perl5/foo
+       mkdir debian/tmp/usr/lib/perl5/.svn
+       mkdir debian/tmp/usr/lib/perl5/CVS
+       mkdir "debian/tmp/usr/lib/perl5/{arch}"
+       mkdir debian/tmp/usr/lib/perl5/.arch-ids
+       mkdir debian/tmp/usr/lib/perl5/.bzr
+       mkdir debian/tmp/usr/lib/perl5/.be
+       mkdir debian/tmp/usr/lib/perl5/.ditrack
+       install -d debian/tmp/usr/share/perl5
+       echo foo > debian/tmp/usr/lib/perl5/foo/.gitignore
+       echo foo > debian/tmp/usr/lib/perl5/foo/.hgignore
+       echo foo > debian/tmp/usr/lib/perl5/foo/.hgtags
+       echo foo > debian/tmp/usr/lib/perl5/foo/.hg_archival.txt
+
+       touch debian/tmp/usr/lib/perl5/foo/.packlist
+       chmod 644 debian/tmp/usr/lib/perl5/foo/.packlist
+       touch debian/tmp/usr/lib/perl5/foo/bar.pm
+       touch -t 197501010101 debian/tmp/usr/lib/perl5/foo/ancient.pm
+       chmod 644 debian/tmp/usr/lib/perl5/foo/bar.pm
+
+       install -d debian/tmp/usr/share/pixmaps
+       install -d debian/tmp/usr/share/pixmaps/foo
+       touch debian/tmp/usr/share/pixmaps/license.jpeg
+       touch debian/tmp/usr/share/pixmaps/licence.jpg
+       touch debian/tmp/usr/share/pixmaps/copying.xpm
+       touch debian/tmp/usr/share/pixmaps/foo/COPYING.svg
+       touch debian/tmp/usr/share/pixmaps/foo/copying.png
+       touch debian/tmp/usr/share/pixmaps/license.txt
+       touch debian/tmp/usr/share/pixmaps/license.foo
+       touch debian/tmp/usr/share/pixmaps/COPYING
+
+       install -d debian/tmp/usr/share/python-support/filenames
+
+       install -d debian/tmp/usr/share/linda/overrides
+       echo 'foo' > debian/tmp/usr/share/linda/overrides/filenames
+
+       install -d debian/tmp/usr/share/doc/filenames
+       touch debian/tmp/usr/share/doc/filenames/README.macosx
+
+       echo foo > debian/tmp/usr/share/doc/filenames/bokmål
+       echo foo > debian/tmp/usr/share/doc/filenames/bokm\\ål
+       echo foo > debian/tmp/usr/share/doc/filenames/bokm\\\\ål
+       echo foo > debian/tmp/usr/share/doc/filenames/bokmål
+       echo foo > debian/tmp/usr/share/doc/filenames/bokm\\ål
+       echo foo > debian/tmp/usr/share/doc/filenames/bokm\\\\ål
+
+       echo foo > debian/tmp/usr/share/doc/filenames/Thumbs.db
+       echo foo > debian/tmp/usr/share/doc/filenames/.DS_Store
+       echo foo > debian/tmp/usr/share/doc/filenames/._NEWS.Debian
+
+       touch debian/tmp/usr/share/doc/filenames/news.debian
+       gzip debian/tmp/usr/share/doc/filenames/news.debian
+       touch debian/tmp/usr/share/doc/filenames/NEWS.Debian
+
+       echo foo > debian/tmp/usr/share/doc/filenames/link-one
+       ln debian/tmp/usr/share/doc/filenames/link-one \
+           debian/tmp/usr/share/doc/filenames/link-two
+
+       install -d debian/tmp/usr/share/doc/filenames/examples
+       touch debian/tmp/usr/share/doc/filenames/examples/__init__.py
+       touch debian/tmp/usr/share/doc/filenames/examples/very_interesting_example
+       touch debian/tmp/usr/share/doc/filenames/examples/very_interesting_example2
+       gzip debian/tmp/usr/share/doc/filenames/examples/very_interesting_example2
+
+       install -d debian/tmp/usr/lib/ada/adalib/
+       touch debian/tmp/usr/lib/ada/adalib/test.ali debian/tmp/usr/lib/ada/adalib/test2.ali
+       chmod 0644 debian/tmp/usr/lib/ada/adalib/test.ali
+       chmod 0444 debian/tmp/usr/lib/ada/adalib/test2.ali
+
+       install -d debian/tmp/usr/bin/X11/
+       touch debian/tmp/usr/bin/X11/testxbin
+       install -d debian/tmp/usr/X11R6/bin
+       touch debian/tmp/usr/X11R6/bin/testxbin2
+       install -d debian/tmp/usr/include/X11
+       touch debian/tmp/usr/include/X11/foo.h
+
+       install -d debian/tmp/usr/bin/mh
+       touch debian/tmp/usr/bin/mh/read
+       chmod 755 debian/tmp/usr/bin/mh/read
+       install -d debian/tmp/usr/bin/bin
+       touch debian/tmp/usr/bin/bin/bad
+       chmod 755 debian/tmp/usr/bin/bin/bad
+
+       # Create some files with invalid ownership.
+       set -e; for owner in 100:0 0:2001 30001:65535 65535:65001; do \
+             touch debian/tmp/usr/lib/filenames/wrong-owner-$$owner ; \
+             chmod 644 debian/tmp/usr/lib/filenames/wrong-owner-$$owner ; \
+             chown "$$owner" debian/tmp/usr/lib/filenames/wrong-owner-$$owner ; \
+       done
+
+       install -m 644 debian/changelog debian/tmp/usr/share/doc/filenames/Changes
+       gzip -9 debian/tmp/usr/share/doc/filenames/Changes
+       ln -s Changes.gz debian/tmp/usr/share/doc/filenames/changelog.gz
+
+       install -d debian/tmp/var/www
+       echo foo > debian/tmp/var/www/foo
+
+       install -d debian/tmp/srv/foo
+       touch debian/tmp/srv/foo/bar
+
+       install -d debian/tmp/etc/gconf/schemas
+       touch debian/tmp/etc/gconf/schemas/test.schema
+
+       install -d debian/tmp/usr/lib/sgml
+       touch debian/tmp/usr/lib/sgml/package
+
+       install -d debian/tmp/usr/share/gnome/apps/System
+       touch debian/tmp/usr/share/gnome/apps/System/foo.desktop
+
+       install -d debian/tmp/usr/share/filenames
+       touch debian/tmp/usr/share/filenames/jquery.js
+       touch debian/tmp/usr/share/filenames/jquery.lite.js
+       touch debian/tmp/usr/share/filenames/jquery.min.js
+       touch debian/tmp/usr/share/filenames/jquery.pack.js
+       touch debian/tmp/usr/share/filenames/mochikit.js
+       touch debian/tmp/usr/share/filenames/prototype-1.2.3.4.js
+       touch debian/tmp/usr/share/filenames/prototype.js
+       touch debian/tmp/usr/share/filenames/prototype.js.gz
+       touch debian/tmp/usr/share/filenames/scriptaculous.js
+
+       ln -s '../filenames/doc/version6.txt.gz' debian/tmp/usr/share/doc/filenames/version.txt.gz
+       ln -s ../../share/symlink debian/tmp/usr/lib/filenames/symlink1ok
+       ln -s ../../../etc/symlink debian/tmp/usr/lib/filenames/symlink1wrong
+       ln -s ../../../../etc/symlink debian/tmp/usr/lib/filenames/symlink2wrong
+       ln -s /etc/symlink debian/tmp/usr/lib/filenames/symlink2ok
+       ln -s /usr/lib/filenames/symlink2 debian/tmp/usr/lib/filenames/symlink3wrong
+       ln -s test debian/tmp/usr/lib/filenames/symlink3ok
+       ln -s ../filenames/symlink2 debian/tmp/usr/lib/filenames/symlink4wrong
+       ln -s ../menu/../somethingelse debian/tmp/usr/lib/filenames/symlink5wrong
+       ln -s ../menu/somethingelse debian/tmp/usr/lib/filenames/symlink4ok
+       ln -s ./file4 debian/tmp/usr/lib/filenames/symlink6wrong
+       ln -s ../menu/./something debian/tmp/usr/lib/filenames/symlink7wrong
+       ln -s ../menu//something debian/tmp/usr/lib/filenames/symlink8wrong
+       ln -s ../menu/something/ debian/tmp/usr/lib/filenames/symlink9wrong
+       ln -s .. debian/tmp/usr/lib/filenames/symlink5ok+warn
+       ln -s . debian/tmp/usr/lib/filenames/symlink6ok+warn
+       ln -s / debian/tmp/usr/lib/filenames/symlink7ok+warn
+       ln -s ../../.. debian/tmp/usr/lib/filenames/symlink10wrong
+
+# devhelp tests.  Files in /usr/share/gtk-doc/html or /usr/share/devhelp/books
+# are okay.  Files elsewhere are okay iff their parent path is symlinked into
+# one of those paths.
+       install -d debian/tmp/usr/share/devhelp/books/filenames
+       echo 'Not really XML' > debian/tmp/usr/share/devhelp/books/filenames/a.devhelp
+       echo 'Not really XML' > debian/tmp/usr/share/devhelp/books/filenames/.devhelp2
+       gzip -9 debian/tmp/usr/share/devhelp/books/filenames/.devhelp2
+       install -d debian/tmp/usr/share/gtk-doc/html/filenames
+       echo 'Not really XML' > debian/tmp/usr/share/gtk-doc/html/filenames/b.devhelp
+       gzip -9 debian/tmp/usr/share/gtk-doc/html/filenames/b.devhelp
+       install -d debian/tmp/usr/share/doc/filenames/good-devhelp
+       echo 'Not really XML' > debian/tmp/usr/share/doc/filenames/good-devhelp/.devhelp2
+       install -d debian/tmp/usr/share/doc/filenames/bad-devhelp
+       echo 'Not really XML' > debian/tmp/usr/share/doc/filenames/bad-devhelp/c.devhelp
+       gzip -9 debian/tmp/usr/share/doc/filenames/bad-devhelp/c.devhelp
+       ln -s ../../doc/filenames/good-devhelp debian/tmp/usr/share/gtk-doc/html/good
+       ln -s ../doc/filenames/bad-devhelp debian/tmp/usr/share/gtk-doc/html/bad
+
+       install -d debian/tmp/usr/share/doc-base
+       install -m 644 debian/doc-base debian/tmp/usr/share/doc-base/filenames
+
+       dpkg-gencontrol -pfilenames -Pdebian/tmp
+       dpkg --build debian/tmp ..
+
+       install -d debian/filename-games debian/filename-games/DEBIAN
+       install -d debian/filename-games/usr debian/filename-games/usr/games debian/filename-games/usr/bin
+       echo '#! /bin/sh' > debian/filename-games/usr/bin/test-game
+       chmod 755 debian/filename-games/usr/bin/test-game
+       dpkg-gencontrol -pfilename-games -Pdebian/filename-games
+       dpkg --build debian/filename-games ..
+
+       install -d debian/more-filename-games debian/more-filename-games/DEBIAN
+       install -d debian/more-filename-games/usr debian/more-filename-games/usr/games debian/more-filename-games/usr/bin
+       echo '#! /bin/sh' > debian/more-filename-games/usr/bin/another-test-game
+       echo '#! /bin/sh' > debian/more-filename-games/usr/games/yet-another-test-game
+       chmod 755 debian/more-filename-games/usr/bin/another-test-game debian/more-filename-games/usr/games/yet-another-test-game
+       dpkg-gencontrol -pmore-filename-games -Pdebian/more-filename-games
+       dpkg --build debian/more-filename-games ..
+
+binary: binary-arch binary-indep
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/filenames/files/ .tif b/nokia-lintian/testset/filenames/files/ .tif
new file mode 100644 (file)
index 0000000..07fd914
--- /dev/null
@@ -0,0 +1,2 @@
+This filename was inspired by the ".tif used by fnlib.  The real package
+uses space.tif.
diff --git a/nokia-lintian/testset/filenames/files/".tif b/nokia-lintian/testset/filenames/files/".tif
new file mode 100644 (file)
index 0000000..e005775
--- /dev/null
@@ -0,0 +1 @@
+This filename is really used, by fnlib.
diff --git a/nokia-lintian/testset/filenames/files/'\ b/nokia-lintian/testset/filenames/files/'\
new file mode 100644 (file)
index 0000000..51ab806
--- /dev/null
@@ -0,0 +1 @@
+This is evil.
diff --git a/nokia-lintian/testset/filenames/files/Maelstrom Sound b/nokia-lintian/testset/filenames/files/Maelstrom Sound
new file mode 100644 (file)
index 0000000..4110410
--- /dev/null
@@ -0,0 +1 @@
+This filename occurs in the maelstrom package.
diff --git a/nokia-lintian/testset/foo++/debian/README.Debian b/nokia-lintian/testset/foo++/debian/README.Debian
new file mode 100644 (file)
index 0000000..87bfcdf
--- /dev/null
@@ -0,0 +1,7 @@
+foo++ for Debian
+----------------
+
+This should trigger a warning, as i use a fake mail address.
+
+ -- Marc 'HE' Brockschmidt <foo@unknown>, Wed, 14 Apr 2004 01:44:18 +0200
+
diff --git a/nokia-lintian/testset/foo++/debian/changelog b/nokia-lintian/testset/foo++/debian/changelog
new file mode 100644 (file)
index 0000000..e1637f7
--- /dev/null
@@ -0,0 +1,31 @@
+foo++ (5) unstable; urgency=low
+
+  * Add a fake README.Debian to trigger a warning.
+  * This should trigger
+    debian-changelog-file-contains-debmake-default-email-address.
+
+ -- Marc 'HE' Brockschmidt <he@unknown>  Wed, 14 Apr 2003 01:35:47 +0200
+
+foo++ (4) unstable; urgency=low
+
+  * This changelog now includes a ISO-8859-1 character: 'ä'
+
+ -- Frank Lichtenheld <djpig@debian.org>  Fri,  5 Mar 2004 13:41:39 +0100
+
+foo++ (3) unstable; urgency=low
+
+  * Set maintainers + uploaders incorrectly
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Fri,  5 Mar 2004 04:20:24 +0100
+
+foo++ (2) unstable; urgency=low
+
+  * Added a foo++-helper package to try and catch even more ++ bugs.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Sat, 10 Feb 2001 23:16:17 -0800
+
+foo++ (1) unstable; urgency=low
+
+  * Initial version
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu, 16 Nov 2000 09:11:40 -0800
diff --git a/nokia-lintian/testset/foo++/debian/control b/nokia-lintian/testset/foo++/debian/control
new file mode 100644 (file)
index 0000000..2ed1c43
--- /dev/null
@@ -0,0 +1,26 @@
+Source: foo++
+Section: misc
+Priority: optional
+Maintainer: Lintian Maintainer <debian-qa@lists.debian.org>
+Uploaders: Marc 'HE' Brockschmidt <he@unknown>, Jeroen van Wolffelaar<jeroen@localhost.localdomain>,
+ Frank <djpig@debian.org>, Yama@gotchi, Josip,
+ I am afraid of spam and think this helps <no_spam_please AT debian.org>
+Standards-Version: 3.1.1
+XS-Dm-Upload-Allowed: no
+
+Package: foo++
+Architecture: all
+Build-Depends: test
+Depends: test, libssl0.9.7
+Description: see how lintian reacts to plus signs in the package name
+ Regression test to see if lintian tests work on a package with plus signs in
+ its name.
+ .
+ This description also uses non-UTF8 high bytes chars: ÄÖÜß
+
+Package: foo++-helper
+Architecture: all
+Depends: test, foo++
+Description: see how lintian reacts to plus signs in the package name
+ Regression test to see if lintian tests work on a package with plus signs in
+ its name.  This has /usr/share/doc links to foo++ to trigger even more checks.
diff --git a/nokia-lintian/testset/foo++/debian/copyright b/nokia-lintian/testset/foo++/debian/copyright
new file mode 100644 (file)
index 0000000..e2d6d93
--- /dev/null
@@ -0,0 +1,7 @@
+A reference to /usr/share/common-licenses/GPL to make it look like this
+package is under the GPL and trigger the OpenSSL warning.
+
+However, there is also a reference to /usr/share/common-licenses/LGPL, so
+who knows what bits actually depend on libssl.
+
+Copr. 2007 Somebody.
diff --git a/nokia-lintian/testset/foo++/debian/rules b/nokia-lintian/testset/foo++/debian/rules
new file mode 100755 (executable)
index 0000000..d769f80
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/make -f
+
+foo=foo++
+helper=foo++-helper
+
+build:
+
+binary-arch:
+
+binary-indep:
+       install -d debian/$(foo)/DEBIAN
+       install -d debian/$(foo)/usr/share/doc/$(foo)
+       install -m 644 debian/changelog \
+         debian/$(foo)/usr/share/doc/$(foo)/changelog
+       gzip -9 debian/$(foo)/usr/share/doc/$(foo)/changelog
+       install -m 644 debian/README.Debian \
+         debian/$(foo)/usr/share/doc/$(foo)/README.Debian
+       gzip -9 debian/$(foo)/usr/share/doc/$(foo)/README.Debian
+       dpkg-gencontrol -isp -p$(foo) -Pdebian/$(foo)
+       dpkg --build debian/$(foo) ..
+
+       install -d debian/$(helper)/DEBIAN
+       install -d debian/$(helper)/usr/share/doc/
+       ln -sf $(foo) debian/$(helper)/usr/share/doc/$(helper)
+       dpkg-gencontrol -isp -p$(helper) -Pdebian/$(helper)
+       dpkg --build debian/$(helper) ..
+
+binary: binary-arch binary-indep
+
+clean:
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/foo++/debian/watch b/nokia-lintian/testset/foo++/debian/watch
new file mode 100644 (file)
index 0000000..26f9a3c
--- /dev/null
@@ -0,0 +1,6 @@
+# A comment \
+version=0
+
+# uscan does not interpret the backslash above, it is just part of the comment
+
+http://domain.tld/file-(.*)\.tar\.gz
diff --git a/nokia-lintian/testset/libbaz/Makefile b/nokia-lintian/testset/libbaz/Makefile
new file mode 100644 (file)
index 0000000..4a3bf2d
--- /dev/null
@@ -0,0 +1,44 @@
+# This is the correct way to build a lib
+
+CC=gcc
+CFLAGS=-Wall -Winline -O2
+
+OBJS=baz.o extra.o
+
+all: libbaz1.a libbaz2.a libbaz1.so.1.0.3b libbaz2.so libbaz3.so.1.0.3b
+
+libbaz2.so: libbaz2.so.1.0
+       ln -sf $^ $@
+libbaz2.so.1.0: libbaz2.so.1.0.3b
+       ln -sf $^ $@
+
+# Oops, forget the soname altogether
+libbaz1.so.1.0.3b: $(OBJS)
+       $(CC) -o $@ -shared $^ -lc
+
+libbaz2.so.1.0.3b: $(OBJS:%.o=%.sho)
+       $(CC) -o $@ -shared -Wl,-soname,libbaz2.so.1.0 $^ -lc
+
+# Non-PIC.
+libbaz3.so.1.0.3b: $(OBJS)
+       $(CC) -o $@ -shared -Wl,-soname,libbaz3.so.1 $^ -lc
+
+#%.o-noreentrant: %.c
+#      $(CC) $(CFLAGS) -o $@ -c $<
+
+%.sho: %.c
+       $(CC) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $<
+
+%.o: %.c
+       $(CC) $(CFLAGS) -D_REENTRANT -o $@ -c $<
+
+libbaz2.a: $(OBJS)
+       ar cq $@ $(OBJS)
+       ranlib $@
+
+# The pic one in the .a (wrong), no archive table
+libbaz1.a: $(OBJS:%.o=%.sho)
+       ar cqS $@ $^
+
+clean:
+       rm -f *.a *.o *.so* *.sho
diff --git a/nokia-lintian/testset/libbaz/baz.c b/nokia-lintian/testset/libbaz/baz.c
new file mode 100644 (file)
index 0000000..4d5fc45
--- /dev/null
@@ -0,0 +1,6 @@
+#include <math.h>
+
+double pw(double p)
+{
+       return exp(p);
+}
diff --git a/nokia-lintian/testset/libbaz/debian/changelog b/nokia-lintian/testset/libbaz/debian/changelog
new file mode 100644 (file)
index 0000000..44c0a83
--- /dev/null
@@ -0,0 +1,6 @@
+libbaz (1-1) unstable; urgency=low
+
+  * Initial setup
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Tue, 30 Jan 2001 15:23:59 -0800
+
diff --git a/nokia-lintian/testset/libbaz/debian/compat b/nokia-lintian/testset/libbaz/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/nokia-lintian/testset/libbaz/debian/control b/nokia-lintian/testset/libbaz/debian/control
new file mode 100644 (file)
index 0000000..8330ac8
--- /dev/null
@@ -0,0 +1,43 @@
+Source: libbaz
+Section: libs
+Priority: extra
+Maintainer: Lintian Maintainer <lintian-maint@debian.org>
+Build-depends: debhelper (>=4)
+Standards-Version: 3.2.1
+
+Package: libbaz1
+Architecture: any
+Provides: libbaz
+Description: test handling of library packages
+ Regression test for lintian's handling of libraries
+
+Package: libbaz1-dev
+Architecture: any
+Depends: libbaz1 (= ${source:Version}), perlapi-5.8.8
+Description: development package
+ Regression test for lintian's handling of libraries
+
+Package: libbaz2
+Architecture: any
+Depends: ${shlibs:Depends}, libssl0.9.8
+Description: test handling of library packages
+ Regression test for lintian's handling of libraries
+
+Package: libbaz2-dev
+Architecture: any
+Depends: ${shlibs:Depends}, libbaz2 (= ${Source-Version})
+Description: development package
+ Regression test for lintian's handling of libraries
+
+Package: libbaz2-dbg
+Architecture: any
+Depends: libbaz2 (= ${binary:Version})
+Priority: optional
+Description: debugging package
+ Regression test for lintian's handling of libraries
+
+Package: ia32-libbaz2
+Architecture: all
+Depends: ${shlibs:Depends}
+Description: multiarch package
+ Regression test for lintian's handling of libraries
diff --git a/nokia-lintian/testset/libbaz/debian/copyright b/nokia-lintian/testset/libbaz/debian/copyright
new file mode 100644 (file)
index 0000000..a7a70dc
--- /dev/null
@@ -0,0 +1,8 @@
+This package is released under public domain.  This is distributed in the hope
+that it will be useful, but without any warranty; without even the implied
+warranty of merchantability or fitness for a particular purpose.
+
+A reference to /usr/share/common-licenses/GPL to make it look like this
+package is under the GPL and trigger the OpenSSL warning.
+
+However, this has an OpenSSL exception.
diff --git a/nokia-lintian/testset/libbaz/debian/dev.postinst b/nokia-lintian/testset/libbaz/debian/dev.postinst
new file mode 100644 (file)
index 0000000..683e3cc
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+$PKG=libbaz1-dev
+
diff --git a/nokia-lintian/testset/libbaz/debian/dev.prerm b/nokia-lintian/testset/libbaz/debian/dev.prerm
new file mode 100644 (file)
index 0000000..683e3cc
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+$PKG=libbaz1-dev
+
diff --git a/nokia-lintian/testset/libbaz/debian/lib.postinst b/nokia-lintian/testset/libbaz/debian/lib.postinst
new file mode 100644 (file)
index 0000000..ec0b98a
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+$PKG=libbaz1
+
+if [ "$1" = "configure" ]; then
+        if [ -d /usr/doc -a ! -e /usr/doc/$PKG -a -d /usr/share/doc/$PKG ]
+; then
+                ln -sf ../share/doc/$PKG /usr/doc/$PKG
+        fi
+fi
diff --git a/nokia-lintian/testset/libbaz/debian/lib.prerm b/nokia-lintian/testset/libbaz/debian/lib.prerm
new file mode 100644 (file)
index 0000000..50e37c3
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+$PKG=libbaz1
+
+if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/$PKG ]; then
+        rm -f /usr/doc/$PKG
+fi
diff --git a/nokia-lintian/testset/libbaz/debian/lib.shlibs b/nokia-lintian/testset/libbaz/debian/lib.shlibs
new file mode 100644 (file)
index 0000000..b88e288
--- /dev/null
@@ -0,0 +1,8 @@
+libdoesntexist2 1.0 libbaz1
+libdoesntexist2 1.0 libbaz1
+libbaz2 1.1 libbaz
+libbaz3 1 libbaz1 (>> 1-1)
+libbaz4 1 libbaz1 (= 1-1)
+libbaz5 1 libbaz2
+udeb: libdoesntexist2 1.0 libbaz2
+udeb: libdoesntexist2 1.0 libbaz2
diff --git a/nokia-lintian/testset/libbaz/debian/lib.symbols b/nokia-lintian/testset/libbaz/debian/lib.symbols
new file mode 100644 (file)
index 0000000..72f9d8a
--- /dev/null
@@ -0,0 +1,3 @@
+libbaz.so.2 libbaz1 #MINVER#
+ pw 1-1
+ foo 1.1-1
diff --git a/nokia-lintian/testset/libbaz/debian/rules b/nokia-lintian/testset/libbaz/debian/rules
new file mode 100755 (executable)
index 0000000..ad4be16
--- /dev/null
@@ -0,0 +1,120 @@
+#!/usr/bin/make -f
+
+lib_tmp=debian/tmp-lib
+dev_tmp=debian/tmp-dev
+
+LIB=libbaz1
+DEV=libbaz1-dev
+
+build:
+       $(MAKE)
+
+clean:
+       $(MAKE) clean
+       dh_clean -plibbaz2 -plibbaz2-dev
+       rm -f debian/files debian/substvars
+       rm -rf $(lib_tmp) $(dev_tmp)
+
+# Now the correct libbaz2-dev package
+binary-correct:
+       install -d debian/libbaz2-dev/usr/lib
+       cp -a libbaz2.a libbaz2.so debian/libbaz2-dev/usr/lib
+       # usually, I'd also include some .h files to /usr/include
+
+       # Now the correct libbaz2 package
+       install -d debian/libbaz2/usr/lib
+       cp -a libbaz2.so.* debian/libbaz2/usr/lib
+       chmod a-x debian/libbaz2/usr/lib/*
+
+       # Also install in the multiarch path.
+       install -d debian/ia32-libbaz2/usr/lib/i486-linux-gnu
+       cp -a libbaz2.so.* debian/ia32-libbaz2/usr/lib/i486-linux-gnu
+       chmod a-x debian/ia32-libbaz2/usr/lib/i486-linux-gnu/*
+
+       # General stuff that is tested in other testsets:
+       dh_installdocs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg -pia32-libbaz2
+       dh_installchangelogs -pia32-libbaz2
+       dh_compress -plibbaz2 -plibbaz2-dev -plibbaz2-dbg -pia32-libbaz2
+
+       # Mess up the libbaz2 changelog files to test the symlink handling.
+       ln -s /usr/share/doc/lintian/changelog.gz \
+           debian/libbaz2/usr/share/doc/libbaz2/changelog.gz
+       install -m 644 debian/changelog \
+           debian/libbaz2-dev/usr/share/doc/libbaz2-dev/foo
+       ln -s foo debian/libbaz2-dev/usr/share/doc/libbaz2-dev/changelog
+
+       # Okay, if either line is omitted, it should be noted
+       dh_strip --dbg-package=libbaz2-dbg -plibbaz2 -plibbaz2-dev
+       dh_strip -pia32-libbaz2
+       dh_makeshlibs -plibbaz2 -plibbaz2-dev -plibbaz2-dbg -pia32-libbaz2
+       dh_shlibdeps -plibbaz2 -plibbaz2-dev -plibbaz2-dbg -pia32-libbaz2
+
+       # and again, regular packaging stuff
+       dh_installdeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg -pia32-libbaz2
+       echo udeb: libbaz2 1.0 libbaz2 >> debian/libbaz2/DEBIAN/shlibs
+       dh_gencontrol -plibbaz2 -plibbaz2-dev -plibbaz2-dbg -pia32-libbaz2
+       dh_md5sums -pia32-libbaz2
+       dh_builddeb -plibbaz2 -plibbaz2-dev -plibbaz2-dbg -pia32-libbaz2
+
+# and the incorrect one
+binary-arch: build binary-correct
+       # first, the lib package
+       install -d $(lib_tmp)/usr/lib
+       # resp. no soname (check), wrong soname (check), and no-pic (check)
+       cp -a libbaz1.so.1.0* $(lib_tmp)/usr/lib
+       cp -a libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/libfoo2.so.1.0.3b
+       install -m644 libbaz3.so.1.0.3b $(lib_tmp)/usr/lib/libbaz3.so.1.0.3b
+       # let's include the .a in the non-dev too (TODO)
+       # Also, libbaz1.a hasn't a symbol table (TODO)
+       cp -a *.a $(lib_tmp)/usr/lib
+       # And a wrong .so symlink (wrong, only in -dev, TODO)
+       ln -s libfoo3.so.0.9 $(lib_tmp)/usr/lib/libfoo3.so
+       # And a wrong .so.X symlink (wrong, should point to a real existing
+       # shlib, TODO)
+       ln -s libfoo.so.0.9.1 $(lib_tmp)/usr/lib/libfoo.so.0.9
+       # And a plain .so (wrong, TODO)
+       touch $(lib_tmp)/usr/lib/libbar2.so
+       # Pretend to be a Perl module to test a lack of Perl dependencies.
+       install -d $(lib_tmp)/usr/lib/perl5/auto/Foo
+       install -m 644 libbaz2.so.1.0.3b $(lib_tmp)/usr/lib/perl5/auto/Foo/Foo.so
+       strip $(lib_tmp)/usr/lib/perl5/auto/Foo/Foo.so
+
+       install -d $(lib_tmp)/usr/share/doc/$(LIB)
+       install -m 644 debian/copyright $(lib_tmp)/usr/share/doc/$(LIB)
+       install -m 644 debian/changelog $(lib_tmp)/usr/share/doc/$(LIB)
+       gzip -9 $(lib_tmp)/usr/share/doc/$(LIB)/changelog
+       install -d $(lib_tmp)/DEBIAN
+       install -m 755 debian/lib.postinst $(lib_tmp)/DEBIAN/postinst
+       install -m 755 debian/lib.prerm $(lib_tmp)/DEBIAN/prerm
+       touch $(lib_tmp)/usr/share/doc/README.Debian
+       #dpkg-shlibdeps $(lib_tmp)/usr/lib/libbaz.so.1.0
+       install -m 755 debian/lib.shlibs $(lib_tmp)/DEBIAN/shlibs
+       install -m 755 debian/lib.symbols $(lib_tmp)/DEBIAN/symbols
+       dpkg-gencontrol -isp -p$(LIB) -P$(lib_tmp)
+       dpkg --build $(lib_tmp) ..
+
+       # now the -dev package
+       install -d $(dev_tmp)/usr/include
+       install -d $(lib_tmp)/usr/lib
+       # let's also install the .so at the same time... (wrong, TODO)
+       cp -a *.a *.so.* $(lib_tmp)/usr/lib
+       # and fuck up permission (TODO)
+       chmod a+x $(lib_tmp)/usr/lib/*.a
+       # Pretend to be a Perl module to test a lack of Perl dependencies.
+       install -d $(dev_tmp)/usr/lib/perl5/auto/Foo
+       install -m 644 libbaz2.so.1.0.3b $(dev_tmp)/usr/lib/perl5/auto/Foo/Foo.so
+       strip $(dev_tmp)/usr/lib/perl5/auto/Foo/Foo.so
+       install -d $(dev_tmp)/usr/share/doc
+       ln -s $(LIB) $(dev_tmp)/usr/share/doc/$(DEV) 
+       install -d $(dev_tmp)/DEBIAN
+       install -m 755 debian/dev.postinst $(dev_tmp)/DEBIAN/postinst
+       install -m 755 debian/dev.prerm $(dev_tmp)/DEBIAN/prerm
+       dpkg-gencontrol -isp -p$(DEV) -P$(dev_tmp)
+       dpkg --build $(dev_tmp) ..
+
+
+binary: binary-arch
+
+# The mention of binary-indep here should be sufficient to suppress the
+# warning that it's not present.
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/libbaz/debian/source.lintian-overrides b/nokia-lintian/testset/libbaz/debian/source.lintian-overrides
new file mode 100644 (file)
index 0000000..6008d27
--- /dev/null
@@ -0,0 +1 @@
+libbaz source: maintainer-script-lacks-debhelper-token
diff --git a/nokia-lintian/testset/libbaz/extra.c b/nokia-lintian/testset/libbaz/extra.c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/changelog b/nokia-lintian/testset/maintainer-scripts/debian/changelog
new file mode 100644 (file)
index 0000000..a0c6dc5
--- /dev/null
@@ -0,0 +1,57 @@
+maintainer-scripts (7+dfsg-0.1) unstable; urgency=low
+
+  * Doing an upload for QA  but I fail to give it a correct version number,
+    have some uploaders, and also fail to mention it... Bad me ;)
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Sun, 18 Apr 2004 02:05:29 +0200
+
+maintainer-scripts (6.1) unstable; urgency=low
+
+  * I made this entry on my local PC, oops ;)
+
+ -- Jeroen van Wolffelaar <jeroen@mordor>  Sat, 21 Feb 2004 18:29:37 +0100
+
+maintainer-scripts (6) unstable; urgency=low
+
+  * added ldconfig calls to postrm to check test the postrm tests
+    from shared-libs
+
+ -- Frank Lichtenheld <djpig@debian.org>  Sat, 21 Feb 2004 18:29:36 +0100
+
+maintainer-scripts (5) unstable; urgency=low
+
+  * added bash style arrays to postinst, this one is for you Torsten (-:
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri, 30 Mar 2001 23:27:06 -0800
+
+maintainer-scripts (4) unstable; urgency=low
+
+  * added a here document to the prerm, along with two more bashisms
+  * made postrm a bash script to check that bash scripts are not searched
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Mon, 26 Feb 2001 13:02:57 -0800
+
+maintainer-scripts (3) unstable; urgency=low
+
+  * Added check for '.' called as '. foo || bar', lintian 1.11.15 failed this
+   thinking the '||' was a argument.
+  * also added an invalid call to '. foo bar'
+  * postinst now has a space between the #! and /bin/sh to test the interpreter
+    checking code.
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Tue,  9 Jan 2001 23:06:25 -0800
+
+maintainer-scripts (2) unstable; urgency=low
+
+  * Fix location of changelog.
+  * prerm and postrm do 'update-alternatives --remove'; should only complain
+    about postrm.
+
+ -- Colin Watson <cjw44@flatline.org.uk>  Fri, 29 Dec 2000 06:01:24 +0000
+
+maintainer-scripts (1) unstable; urgency=low
+
+  * Initial version
+  * postinst and prerm set the usr/doc symlink
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu, 16 Nov 2000 09:11:40 -0800
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/config b/nokia-lintian/testset/maintainer-scripts/debian/config
new file mode 100644 (file)
index 0000000..29abeba
--- /dev/null
@@ -0,0 +1,3 @@
+#!/usr/bin/python
+
+# I use python, but that's not what I'm supposed to be allowed to use
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/control b/nokia-lintian/testset/maintainer-scripts/debian/control
new file mode 100644 (file)
index 0000000..f5aabc5
--- /dev/null
@@ -0,0 +1,14 @@
+Source: maintainer-scripts
+Section: misc
+Priority: optional
+Maintainer: QA group <packages@qa.debian.org>
+Uploaders: Anyone but Jeroen <jeroen@wolffelaar.nl>
+Build-Depends: debhelper
+Standards-Version: 3.1.1
+XS-Dm-Upload-Allowed: Yes
+
+Package: maintainer-scripts
+Architecture: all
+Depends: test
+Description: test lintian's maintainer script checks
+ Regression test lintian's maintainer script checks.
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/postinst b/nokia-lintian/testset/maintainer-scripts/debian/postinst
new file mode 100644 (file)
index 0000000..a721458
--- /dev/null
@@ -0,0 +1,167 @@
+#! /bin/sh
+
+if [ "$1" = "configure" ]; then
+        if [ -d /usr/doc -a ! -e /usr/doc/maintainer-scripts -a -d /usr/share/doc/maintainer-scripts ]; then
+                ln -sf ../share/doc/maintainer-scripts /usr/doc/maintainer-scripts
+        fi
+fi
+
+# valid
+. /usr/share/lintian/shell || exit 0
+. /usr/share/lintian/shell >/dev/null
+. /usr/share/lintian/shell 2>/dev/null
+. /usr/share/lintian/shell </dev/null
+. "$(dirname $0)/shell" ; bar
+# invalid
+. /usr/share/lintian/shell foo
+. "$(dirname $0)/shell" bar
+
+print "Hit enter to continue"
+read
+
+H[0]='this is a string'
+echo ${H[0]}
+echo "Index 0's length is ${#H[0]}"
+echo "All of the array is: ${H[@]}"
+
+install-info /usr/share/info/foo \
+       --quiet \ # make it so
+       --section foo
+
+echo Please use update-rc.d or invoke-rc.d to set up blah blah.
+
+wm-menu-config
+
+chown root.root /usr/share/doc/maintainer-scripts/changelog
+chown root:root /usr/share/doc/maintainer-scripts/changelog
+
+$FOO=bar
+update-rc.d foo defaults >/dev/null
+update-rc.d $FOO defaults
+update-rc.d foo remove
+
+# valid
+FOO=/tmp
+FOO=/var/tmp
+: ${FOO:=/tmp}
+FOO=`mktemp /tmp/scripts.XXXXXX`
+rm "$FOO"
+FOO=`tempfile -n/tmp/scripts.tmp`
+mkdir /var/tmp/scripts
+# invalid
+echo foo >>/tmp/scripts.tmp
+rm /tmp/scripts.tmp
+rmdir /var/tmp/scripts
+
+# invalid, maintainer-script-hides-init-failure
+invoke-rc.d foo start || exit 0
+
+# The right way to invoke an rc script
+if which invoke-rc.d >/dev/null 2>&1; then
+    invoke-rc.d package start
+else
+    /etc/init.d/package start
+fi
+
+# Example ucf invocation.
+ucf /usr/share/foo/configuration /etc/foo.conf
+
+# Calling gconftool directly.
+gconftool-2 --makefile-install-rule foo.schema
+
+# Calling gconf-schemas with no dependency.
+gconf-schemas --register foo.schema
+
+# Calling update-xmlcatalog with no dependency.
+update-xmlcatalog --add --type system --id "/usr/share/sgml/dtd/foo" \
+    --package maintainer-scripts --root
+
+# Maintainer scripts shouldn't touch /var/lib/dpkg/status.  This is the old
+# recipe from the dpkg wiki that should be replaced with dpkg-query.
+sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' /etc/conffile'{s/.* //;p}}\" \
+    /var/lib/dpkg/status
+
+# Don't modify these files.
+echo 'broken    6714/tcp' >> /etc/services
+cp /nonexistent /etc/protocols
+mv /usr/share/doc/rpc /etc/rpc
+
+# But this is okay.
+cp /etc/protocols /etc/protocols.new
+
+# This is also wrong.
+echo 'broken' > /etc/inetd.conf
+cp /etc/inetd.conf.new /etc/inetd.conf
+
+# But this is fine.
+cp /etc/inetd.conf /srv/chroot/etc/inetd.conf
+
+# Deprecated and not allowed except the second one.
+install-sgmlcatalog --install package
+install-sgmlcatalog --remove package
+
+# This too is a heredoc.
+some-program > /etc/config-file <<'EOF'
+echo "All of the array is: ${H[@]}"
+EOF
+
+# But this isn't.
+cat '<<EOF'
+echo "All of the array is: ${H[@]}"
+EOF
+
+# This is a heredoc
+cat <<-EOF
+echo "All of the arry is ${H[@]}"
+EOF
+
+# As is this
+cat <<';'
+echo "All of the array is ${H[@]}"
+;
+
+# and this
+cat <<foo
+echo "All of the array is ${H[@]}"
+foobar
+echo $HOSTNAME
+foo
+
+# and again
+cat <<\bar
+echo "All of the array is ${H[@]}"
+bar
+
+# yet another
+cat <<"x++"
+echo "All of the array is ${H[@]}"
+x++
+
+# Recognize single quotes even if they start at the beginning of a line.
+echo not a bashism \
+'/{ptex,tex}/{amstex,plain,generic,}'
+
+# More bashisms.
+echo -e 'foo\n'
+echo "${!foo}"
+cat $(\< file)
+select foo in a b ; do echo $foo ; done
+cnt=$((cnt + 1))
+if false ; then
+    exec -l /bin/sh
+    exec -c /bin/sh
+    exec -a foo /bin/sh
+fi
+let cnt++
+if test -a /etc/default ; then
+    echo "$RANDOM|stuff"
+fi
+
+# Calling start-stop-daemon directly in an init script.
+start-stop-daemon --start --quiet --name foo --startas /usr/bin/foo
+
+# But stopping it is fine -- we may be working around something else.
+start-stop-daemon --stop --quiet --name foo --startas /usr/bin/foo
+
+# Deprecated chown use with flags.
+chown -R root.root /usr/share/doc/maintainer-scripts
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/postrm b/nokia-lintian/testset/maintainer-scripts/debian/postrm
new file mode 100644 (file)
index 0000000..a337bac
--- /dev/null
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+update-alternatives --remove dummy /usr/bin/dummy-alternative
+
+# Normally read in a maintainer script is not kosher, but here we're going
+# to do it only if debconf doesn't exist.
+if ! test -f /usr/share/debconf/confmodule ; then
+    echo "Hit enter"
+    read
+fi
+
+# neither of the following should be detected as postrm-unsafe-ldconfig
+# intended, without quotes
+   if [ "$1" = remove ]; then
+       ldconfig
+    fi
+# reversed, many whitespace
+if [ 'remove' = "$1" ]
+then
+ ldconfig
+fi
+
+[ "remove" ="$1" ] && ldconfig
+
+update-rc.d bar remove
+
+# Shouldn't provoke an error despite no invoke-rc.d.
+echo "/etc/init.d/package stop to stop something"
+
+# Shouldn't require a ucf dependency.  Unfortunately, right now that's
+# just because postrm isn't checked, not because we ensure that the
+# invocation is conditional.
+if which ucf >/dev/null; then
+    ucf --purge /etc/foo.conf
+fi    
+
+# This isn't allowed.
+rm /tmp/foo /dev/device
+rm     /dev/device1
+
+# But this is okay.
+rm /tmp/foo > /dev/null
+
+# Not allowed here even with remove.
+install-sgmlcatalog --remove package
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/preinst b/nokia-lintian/testset/maintainer-scripts/debian/preinst
new file mode 100644 (file)
index 0000000..01f0fee
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+update-rc.d foo remove
+update-rc.d bar defaults
+
+# Obsolete dpkg assertions.
+dpkg --assert-support-predepends || exit 1
+dpkg --assert-working-epoch || exit 1
+dpkg --assert-long-filenames || exit 1
+dpkg --assert-multi-conrep || exit 1
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/prerm b/nokia-lintian/testset/maintainer-scripts/debian/prerm
new file mode 100644 (file)
index 0000000..55f21b5
--- /dev/null
@@ -0,0 +1,174 @@
+#!/bin/sh
+
+if [ "$1" != "upgrade" ]; then
+       update-alternatives --remove dummy /usr/bin/dummy-alternative
+fi
+
+if ([ "$1" = "upgrade" ] || [ "$1" = "remove" ]) && [ -L /usr/doc/maintainer-scripts ]; the
+n
+        rm -f /usr/doc/maintainer-scripts
+fi
+
+cat <<EOF
+This is all really bad bash specific code!!!
+read
+source /bar/baz/bat foo
+EOF
+
+# ok, back to checking
+if [ "$2" == "purge" ]; then
+       rm -r /bar/baz
+fi
+
+function foo( ) {
+   # but not here: local
+   local bar
+   echo "foo" &>/dev/null
+}
+
+source $FOO
+
+trap "echo hi" EXIT HUP 3
+
+if [[ "$2" = "purge" ]]; then
+    kill -HUP $$
+fi
+
+#this is ok though
+if test -n $(echo foo | perl -pe 's/[[:space:]]//go'); then
+    echo 1
+fi
+
+update-rc.d foo remove
+
+# More false positives for bashism checks.  None of these are errors.
+echo "$line" | grep -q '{fonts/map,}/{\$progname,pdftex,dvips,}//'
+echo "$line" | grep -q "${fonts},${foo}"
+echo '$[1+2]'
+printf "foo |& bar"
+perl -e "print q( kill -HUP $? )"
+
+# Still catch disallowed expansions in double-quotes, though.
+echo "${line:3:1}"
+
+# The wrong way to run an init script (no invoke-rc.d).
+/etc/init.d/package stop
+
+# This is the only install-sgmlcatalog call that's allowed.
+install-sgmlcatalog --quiet --remove package
+
+# More bashisms checks
+
+read -x foo
+read -x
+read -r foo
+read foo
+read
+
+echo "a\\b"
+echo 'a\nb'
+
+echo "${UID}"
+echo "$EUID"
+echo "$SHLVL"
+echo "$DIRSTACK"
+echo "$SECONDS"
+echo "$BASH"
+echo "$BASH_FOO"
+echo "$SHELLOPTS"
+echo "$PIPESTATUS"
+
+bar="$(cut '-d|' -f2 <<< "$foo")"
+
+VAR=1
+VAR+=a
+
+echos() {
+  echo -n -e "bar"
+  echo -e -n "bar"
+  echo -en "bar"
+  echo -ne "bar"
+  echo "bar"
+  echo "echo -e foo"
+}
+
+ech.os() {
+  echo foo >& 2
+  echo foo >&bar
+  echo foo >& bar
+}
+
+echoes() {
+  echo "abc\nxyz"
+  echo 'xyz\rabc'
+  echo foo\cbar
+
+  echo -e "abc\nxyz"
+  echo -net 'xyz\rabc'
+  echo -e foo\cbar
+}
+
+foobar.() {
+  suspend x
+  suspended x
+  caller x
+  complete x
+  compgen x
+  declare -a foo
+}
+
+.foobar() {
+  typeset -x bar
+  disown 1
+  builtin foo
+  set -B
+  alias -p
+  unalias -a
+}
+
+IFS="()"
+
+ulimit
+shopt
+type -v bar
+time ls
+dirs
+diff <(tac a) <(tac b)
+
+pushd
+
+local foo=bar
+local -x foo
+
+popd
+
+readonly -f
+
+echo bar > /dev/tcp
+export x
+export -x x
+export -p x
+
+sh -x
+sh -D
+sh --foo
+sh +O
+
+# Brace expansion checks
+echo {a,b}
+echo {abc},{bcd}
+
+foobar()
+{
+  # This is a function
+}
+
+ foo.bar()
+(
+  # This is a function with a bad name
+)
+
+foobar@()    
+{
+  # As is this
+}
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/rules b/nokia-lintian/testset/maintainer-scripts/debian/rules
new file mode 100755 (executable)
index 0000000..98240ed
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/make -f
+
+build:
+
+binary-arch:
+
+binary-indep:
+       install -d debian/tmp/DEBIAN
+       install -m 0644 debian/config debian/tmp/DEBIAN
+       install -m 0755 debian/preinst debian/tmp/DEBIAN
+       install -m 0755 debian/postinst debian/tmp/DEBIAN
+       install -m 0755 debian/prerm debian/tmp/DEBIAN
+       install -m 0755 debian/postrm debian/tmp/DEBIAN
+       install -m 0644 debian/triggers debian/tmp/DEBIAN
+       install -d debian/tmp/usr/share/doc/maintainer-scripts
+       install -m 0644 debian/changelog \
+         debian/tmp/usr/share/doc/maintainer-scripts/changelog
+       gzip -9 debian/tmp/usr/share/doc/maintainer-scripts/changelog
+       dpkg-gencontrol -isp
+       dpkg --build debian/tmp ..
+
+binary: binary-arch binary-indep
+
+# Make sure we see dh_clean even in a rule clean depends on.  Not the point of
+# this test suite, but a convenient place to put it.
+clean: clean1 clean2 clean3
+clean1:
+clean2:
+       dh_clean
+clean3:
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/triggers b/nokia-lintian/testset/maintainer-scripts/debian/triggers
new file mode 100644 (file)
index 0000000..f627094
--- /dev/null
@@ -0,0 +1,4 @@
+# Example triggers file
+activate foo
+
+interest bar
diff --git a/nokia-lintian/testset/maintainer-scripts/debian/watch b/nokia-lintian/testset/maintainer-scripts/debian/watch
new file mode 100644 (file)
index 0000000..982696c
--- /dev/null
@@ -0,0 +1,11 @@
+# A whitespace is fine for uscan:
+ version=4
+
+# Following line should not be matched:
+#opts=uversionmangle=s/$/+debian/,dversionmangle=s/foo/bar/ \
+# Following one is incorrect, there's a missing backslash at the end
+opts=uversionmangle=s/$/+dfsg/,dversionmangle=s/foo/bar/
+
+# 'active' is useless here, but it works anyway
+options=active \
+http://domain.tld/foo-(.+)\.tar\.gz
\ No newline at end of file
diff --git a/nokia-lintian/testset/manpages/debian/changelog b/nokia-lintian/testset/manpages/debian/changelog
new file mode 100644 (file)
index 0000000..2ea4e3b
--- /dev/null
@@ -0,0 +1,29 @@
+manpages (4-0.0.1) unstable; urgency=low
+
+  * Add a test manpage.
+  * debian/rules: 
+    + Fix a little bug creating a file named 755 in the source dir.
+    + Add a new binary with no english manpage.
+  * Sample changelog fixing spelling: publically -> publicly
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Sat, 18 Dec 2004 13:32:29 +0100
+
+manpages (3) unstable; urgency=low
+
+  * Add X11 binary to check the manpage-for-non-x11-binary-in-wrong-directory
+    and friends.
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Sun, 11 Apr 2004 16:39:04 +0200
+
+manpages (2) unstable; urgency=low
+
+  * Add a hardlink check after the recent hardlink breackage
+  * Add some fake binaries
+
+ -- Frank Lichtenheld <djpig@debian.org>  Thu, 26 Feb 2004 21:20:07 +0100
+
+manpages (1) unstable; urgency=low
+
+  * Initial version
+
+ -- Colin Watson <cjw44@flatline.org.uk>  Mon, 22 Jan 2001 23:39:18 +0000
diff --git a/nokia-lintian/testset/manpages/debian/control b/nokia-lintian/testset/manpages/debian/control
new file mode 100644 (file)
index 0000000..a5f871b
--- /dev/null
@@ -0,0 +1,11 @@
+Source: manpages
+Section: misc
+Priority: optional
+Maintainer: Lintian Maintianer <lintian-maint@debian.org>
+Standards-Version: 3.2.1
+
+Package: manpages
+Architecture: all
+Depends: test
+Description: test lintian's manual page checks
+ Regression test lintian's manual page checks.
diff --git a/nokia-lintian/testset/manpages/debian/overrides b/nokia-lintian/testset/manpages/debian/overrides
new file mode 100644 (file)
index 0000000..78a7e2f
--- /dev/null
@@ -0,0 +1,12 @@
+   manpages:   no-copyright-file    
+foo-tag-that-does-not-exist
+# this is a valid comment
+
+
+   
+#and some empty lines
+but-this-is-just-broken!
+manpages:
+
+# An 'info' tag:
+no-md5sums-control-file
diff --git a/nokia-lintian/testset/manpages/debian/postinst b/nokia-lintian/testset/manpages/debian/postinst
new file mode 100644 (file)
index 0000000..521c791
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+install-info /usr/share/info/foo.info.gz
+install-info /usr/share/info/bar.gz
diff --git a/nokia-lintian/testset/manpages/debian/rules b/nokia-lintian/testset/manpages/debian/rules
new file mode 100755 (executable)
index 0000000..4266526
--- /dev/null
@@ -0,0 +1,87 @@
+#!/usr/bin/make -f
+
+tmp=debian/tmp
+
+build:
+
+binary-arch:
+
+binary-indep:
+       install -d $(tmp)/usr/share/man/man1 $(tmp)/usr/share/man/man3 \
+                  $(tmp)/usr/share/man/man6 $(tmp)/usr/X11R6/man/man6 \
+                  $(tmp)/usr/bin $(tmp)/usr/sbin $(tmp)/usr/X11R6/bin \
+                 $(tmp)/usr/share/man/de/man1 $(tmp)/usr/X11R6/man/man1/ \
+                 $(tmp)/usr/bin/bin
+       touch $(tmp)/usr/bin/usr-bin-binary-alt
+       chmod 755 $(tmp)/usr/bin/usr-bin-binary-alt
+       touch $(tmp)/usr/sbin/usr-sbin-binary
+       chmod 755 $(tmp)/usr/sbin/usr-sbin-binary
+       touch $(tmp)/usr/X11R6/bin/rstartd
+       touch $(tmp)/usr/bin/binary-without-english-manpage
+       chmod 755 $(tmp)/usr/bin/binary-without-english-manpage
+       touch $(tmp)/usr/bin/bin/bad
+       chmod 755 $(tmp)/usr/bin/bin/bad
+
+       gzip -c9 <test.1p >$(tmp)/usr/share/man/man1/test.1p.gz
+       gzip -c9 <test.1p.de >$(tmp)/usr/share/man/man1/test-latin1-chars.1p.gz
+
+       gzip -c9 <true.1 >$(tmp)/usr/share/man/man1/true.1.gz
+
+       gzip -c9 <program.1 >$(tmp)/usr/share/man/man1/program.1.gz
+
+       ln -s ../X11R6/bin/rstartd $(tmp)/usr/bin/rstartd
+       touch $(tmp)/usr/X11R6/man/man1/rstartd.1x.gz
+
+       ln -s ../man7/undocumented.7.gz \
+             $(tmp)/usr/share/man/man1/bin-binary.1.gz
+       ln -s undocumented.7.gz $(tmp)/usr/share/man/man1/sbin-binary.1.gz
+       ln -s undocumented.3.gz $(tmp)/usr/share/man/man3/function.3.gz
+       touch $(tmp)/usr/share/man/man1/usr-bin-binary.1
+       chmod 644 $(tmp)/usr/share/man/man1/usr-bin-binary.1
+       touch $(tmp)/usr/share/man/man1/usr-sbin-binary.1.gz
+       chmod 644 $(tmp)/usr/share/man/man1/usr-sbin-binary.1.gz
+       cd $(tmp)/usr/share/man/man1 && ln usr-sbin-binary.1.gz usr-bin-binary-alt.1.gz
+       touch $(tmp)/usr/share/man/man6/usr-games-binary.6
+       chmod 644 $(tmp)/usr/share/man/man6/usr-games-binary.6
+       gzip -1 $(tmp)/usr/share/man/man6/usr-games-binary.6
+       touch $(tmp)/usr/X11R6/man/man6/X11R6-binary.man
+       chmod 644 $(tmp)/usr/X11R6/man/man6/X11R6-binary.man
+       touch $(tmp)/usr/share/man/de/man1/binary-without-english-manpage.1
+       chmod 755 $(tmp)/usr/share/man/de/man1/binary-without-english-manpage.1
+       gzip -c9 <test.1p.de >$(tmp)/usr/share/man/de/man1/test-latin1-chars.1p.gz
+
+       install -d $(tmp)/usr/share/man/de_DE/man1
+       gzip -c9 <test.1p.utf-8 >$(tmp)/usr/share/man/de_DE/man1/test-utf8-chars.1p.gz
+
+       gzip -c9 <include.3 >$(tmp)/usr/share/man/man3/include.3.gz
+       gzip -c9 <included.3 >$(tmp)/usr/share/man/man3/included.3.gz
+
+       install -d $(tmp)/usr/share/man/man1/not-a-man-page.1.gz
+
+       install -d $(tmp)/usr/share/lintian/overrides
+       install -m644 debian/overrides $(tmp)/usr/share/lintian/overrides/manpages
+
+       install -d $(tmp)/usr/share/info
+       touch $(tmp)/usr/share/info/broken
+       gzip -c9 <foo.info >$(tmp)/usr/share/info/foo.info.gz
+       gzip -c1 </dev/null >$(tmp)/usr/share/info/bar.gz
+       install -m644 foo.info $(tmp)/usr/share/info/baz.broken.gz
+       touch $(tmp)/usr/share/info/image.png
+
+# Emit an info tag to test override handling.
+       mkdir -p $(tmp)/usr/lib/perl5
+
+       install -d $(tmp)/usr/share/doc/manpages
+       install -m644 debian/changelog $(tmp)/usr/share/doc/manpages/changelog
+       gzip -9 $(tmp)/usr/share/doc/manpages/changelog
+       install -d $(tmp)/DEBIAN
+       install -m755 debian/postinst $(tmp)/DEBIAN/postinst
+       dpkg-gencontrol -isp
+       dpkg --build $(tmp) ..
+
+binary: binary-arch binary-indep
+
+clean:
+       rm -rf debian/files $(tmp)
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/manpages/foo.info b/nokia-lintian/testset/manpages/foo.info
new file mode 100644 (file)
index 0000000..165c919
--- /dev/null
@@ -0,0 +1,6 @@
+This is foo.info, produced by hand from thin air.
+
+INFO-DIR-SECTION Lintian
+START-INFO-DIR-ENTRY
+* foo: (foo).                   A miracle occurs.
+END-INFO-DIR-ENTRY
diff --git a/nokia-lintian/testset/manpages/include.3 b/nokia-lintian/testset/manpages/include.3
new file mode 100644 (file)
index 0000000..e8c6eb5
--- /dev/null
@@ -0,0 +1,16 @@
+.TH INCLUDE 3
+.SH NAME
+include \- include another chunk of a man page
+.SH INCLUDED BIT
+.nr zY 1
+.so man3/included.3
+.SH HYPHENS
+This isn't a hyphen\*(--just a long dash\*(--and \h'-1' also isn't, nor
+should we warn about `\-' or \-a, but -a
+and `-' (nope, that's fine) are bad news.  So is
+--foo and
+(--bar)
+"--baz"
+and '--foo'.
+.SH SEE ALSO
+included(3)
diff --git a/nokia-lintian/testset/manpages/included.3 b/nokia-lintian/testset/manpages/included.3
new file mode 100644 (file)
index 0000000..c0379db
--- /dev/null
@@ -0,0 +1,10 @@
+.if \n(zY=1 .ig zY
+.TH INCLUDED 3
+.SH NAME
+included \- both a man page and a dessert topping
+.SH INCLUDED BIT
+.zY
+This stuff ends up in both man pages.  Isn't it neat?
+.if \n(zY=1 .ig zY
+.SH SEE ALSO
+include(3)
diff --git a/nokia-lintian/testset/manpages/program.1 b/nokia-lintian/testset/manpages/program.1
new file mode 100644 (file)
index 0000000..7464631
--- /dev/null
@@ -0,0 +1,59 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH PROGRAM 1 "2007-06-18"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+program \- program to do something
+.SH SYNOPSIS
+.B program
+.RI [ options ] " files" ...
+.br
+.B bar
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B program
+and
+.B bar
+commands.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+\fBprogram\fP is a program that...
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+For a complete description, see the Info files.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.SH SEE ALSO
+.BR bar (1),
+.BR baz (1).
+.br
+The programs are documented fully by
+.IR "The Rise and Fall of a Fooish Bar" ,
+available via the Info system.
+.SH AUTHOR
+program was written by <upstream author>.
+.PP
+This manual page was written by #USERNAME# <#EMAIL#>,
+for the Debian project (but may be used by others).
diff --git a/nokia-lintian/testset/manpages/test.1p b/nokia-lintian/testset/manpages/test.1p
new file mode 100644 (file)
index 0000000..b87cdd7
--- /dev/null
@@ -0,0 +1,12 @@
+.IX Title "TEST 1"
+.TH TEST 1P "2004-12-18" "Debian Project" "Debian GNU/Linux manual"
+.SH "NAME"
+\&\fBTEST\fR \- A test manpage with a .1P extension.
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBTEST\fR tests lintian.
+.PP
+Use more up-level tools like human brains to understand lintian.
+Here's a bad undefined macro.
+Here's a serious syntax error.
+.dep
diff --git a/nokia-lintian/testset/manpages/test.1p.de b/nokia-lintian/testset/manpages/test.1p.de
new file mode 100644 (file)
index 0000000..8891e8c
--- /dev/null
@@ -0,0 +1,10 @@
+.IX Title "TEST 1"
+.TH TEST 1P "2004-12-18" "Debian Project" "Debian GNU/Linux Handbuch"
+.SH "NAME"
+\&\fBTEST\fR \- Eine Test-Manpage mit .1P Erweiterung.
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBTEST\fR tests lintian.
+.PP
+Diese Seite dient hauptsächlich dem Testen von latin1-Buchstaben, wie äöüß
+in Manpages.
diff --git a/nokia-lintian/testset/manpages/test.1p.utf-8 b/nokia-lintian/testset/manpages/test.1p.utf-8
new file mode 100644 (file)
index 0000000..1b409c7
--- /dev/null
@@ -0,0 +1,10 @@
+.IX Title "TEST 1"
+.TH TEST 1P "2004-12-18" "Debian Project" "Debian GNU/Linux Handbuch"
+.SH "NAME"
+\&\fBTEST\fR \- Eine Test-Manpage mit .1P Erweiterung.
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fBTEST\fR tests lintian.
+.PP
+Diese Seite dient hauptsächlich dem Testen von latin1-Buchstaben, wie äöüß
+in Manpages.
diff --git a/nokia-lintian/testset/manpages/true.1 b/nokia-lintian/testset/manpages/true.1
new file mode 100644 (file)
index 0000000..bcb13cd
--- /dev/null
@@ -0,0 +1,44 @@
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.36.
+.TH TRUE "1" "July 2006" "true 5.96" "User Commands"
+.SH NAME
+true \- manual page for true 5.96
+.SH SYNOPSIS
+.B true
+[\fIignored command line arguments\fR]
+.br
+.B true
+\fIOPTION\fR
+.SH DESCRIPTION
+Exit with a status code indicating success.
+.TP
+\fB\-\-help\fR
+display this help and exit
+.TP
+\fB\-\-version\fR
+output version information and exit
+.PP
+NOTE: your shell may have its own version of true, which usually supersedes
+the version described here.  Please refer to your shell's documentation
+for details about the options it supports.
+.SH AUTHOR
+Written by Jim Meyering.
+.SH "REPORTING BUGS"
+Report bugs to <bug\-coreutils@gnu.org>.
+.SH COPYRIGHT
+Copyright \(co 2006 Free Software Foundation, Inc.
+.br
+This is free software.  You may redistribute copies of it under the terms of
+the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+The full documentation for
+.B true
+is maintained as a Texinfo manual.  If the
+.B info
+and
+.B true
+programs are properly installed at your site, the command
+.IP
+.B info true
+.PP
+should give you access to the complete manual.
diff --git a/nokia-lintian/testset/non-us/debian/changelog b/nokia-lintian/testset/non-us/debian/changelog
new file mode 100644 (file)
index 0000000..41a9f5b
--- /dev/null
@@ -0,0 +1,11 @@
+non-us (1) unstable; urgency=low
+
+  * Another initial version.
+
+ -- Russ Allbery <rra@debian.org>  Mon, 03 Dec 2007 23:42:09 -0800
+
+non-us (1) unstable; urgency=low
+
+  * Initial version
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Wed, 31 Jan 2001 14:27:20 -0800
diff --git a/nokia-lintian/testset/non-us/debian/control b/nokia-lintian/testset/non-us/debian/control
new file mode 100644 (file)
index 0000000..4dbeeb3
--- /dev/null
@@ -0,0 +1,31 @@
+Source: non-us
+Priority: optional
+Maintainer: Lintian Maintainer <lintian-maint@debian.org>
+Uploaders: Sean 'Shaleh' Perry <shaleh@debian.org>,
+ Russ Allbery <rra@debian.org>
+Standards-Version: 3.1.1
+
+Package: patented-app
+Architecture: all
+Section: non-us
+Description: test for non-us checks
+ regession test to stress non-us checks
+
+Package: crypto-app
+Architecture: all
+Section: non-US
+Description: proper non-US app
+ This is a proper non-us package
+
+Package: broken-crypto
+Architecture: all
+Section: non-US/admin
+Description: broken non-US app
+ This package declares an invalid section
+
+Package: nonfree-crypto-app
+Architecture: all
+Section: non-US/non-free
+Description: proper non-US/non-free app
+ This is a proper non-us package
+
diff --git a/nokia-lintian/testset/non-us/debian/rules b/nokia-lintian/testset/non-us/debian/rules
new file mode 100755 (executable)
index 0000000..e4b34c1
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/make -f
+
+PATENT=patented-app
+CRYPTO=crypto-app
+BROKEN=broken-crypto
+NONFREE=nonfree-crypto-app
+
+build:
+
+binary-arch:
+
+binary-indep:
+       # patented-app
+       install -d debian/$(PATENT)-tmp/DEBIAN
+       install -d debian/$(PATENT)-tmp/usr/share/doc/$(PATENT)
+       gzip -9c debian/changelog > debian/$(PATENT)-tmp/usr/share/doc/$(PATENT)/changelog.gz
+       dpkg-gencontrol -isp -p$(PATENT) -Pdebian/$(PATENT)-tmp
+       dpkg --build debian/$(PATENT)-tmp ..
+
+       # crypto-app
+       install -d debian/$(CRYPTO)-tmp/DEBIAN
+       install -d debian/$(CRYPTO)-tmp/usr/share/doc/$(CRYPTO)
+       echo '© 2000' > debian/$(CRYPTO)-tmp/usr/share/doc/$(CRYPTO)/copyright
+       dpkg-gencontrol -isp -p$(CRYPTO) -Pdebian/$(CRYPTO)-tmp
+       dpkg --build debian/$(CRYPTO)-tmp ..
+
+       # broken-crypto
+       install -d debian/$(BROKEN)-tmp/DEBIAN
+       dpkg-gencontrol -isp -p$(BROKEN) -Pdebian/$(BROKEN)-tmp
+       dpkg --build debian/$(BROKEN)-tmp ..
+
+       # nonfree-crypto-app
+       install -d debian/$(NONFREE)-tmp/DEBIAN
+       dpkg-gencontrol -isp -p$(NONFREE) -Pdebian/$(NONFREE)-tmp
+       dpkg --build debian/$(NONFREE)-tmp ..
+
+binary: binary-arch binary-indep
+
+clean:
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/relations/debian/changelog b/nokia-lintian/testset/relations/debian/changelog
new file mode 100644 (file)
index 0000000..ef46606
--- /dev/null
@@ -0,0 +1,33 @@
+relations (5) unstable; urgency=low
+
+  * I'm orphaning this package -- I'm sick of it: it's completely broken,
+    lintian complains all over the place.
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Sun, 02 Dec 2007 15:59:59 -0800
+
+relations (4) unstable; urgency=low
+
+  * Added a package that tests dependencies for multiple versions of
+    libraries, and test some description stuff in there as well.
+
+ -- Josip Rodin <jrodin@jagor.srce.hr>  Fri, 29 Nov 2002 20:13:33 +0100
+
+relations (3) unstable; urgency=low
+
+  * Added a virtual provides to test against my virtual depends without
+    a real package first test
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Thu,  8 Feb 2001 11:29:53 -0800
+
+relations (2) unstable; urgency=low
+
+  * Added a ddepends on dpkg (violates policy) and a versioned depends
+    on bash (follows policy)
+
+ -- Sean 'Shaleh' Perry <shaleh@debian.org>  Fri,  2 Feb 2001 12:37:17 -0800
+
+relations (1) unstable; urgency=low
+
+  * Initial version
+
+ -- Richard Braakman <dark@xs4all.nl>  Tue,  7 Jul 1998 16:27:56 +0200
diff --git a/nokia-lintian/testset/relations/debian/control b/nokia-lintian/testset/relations/debian/control
new file mode 100644 (file)
index 0000000..81c05e2
--- /dev/null
@@ -0,0 +1,50 @@
+Source: relations
+Section: misc
+Priority: optional
+Build-Depends: mail-transport-agent, libc6-dev, findutils, foo (= 3) [!amd64 !i386], bar, arch-test1 [i386], arch-test2 [!i386], quilt (>= 0.40), perl, python-all-dev
+Build-Depends-Indep: make, bash, debmake, build-essential, baz (= 2.0), ghostscript | gs,
+  car (>= 1.0), car (<= 2.0), caz (= 1.0) [amd64], caz (>= 2.0) [i386],
+  caz (= 2.0) [powerpc], perl (>= 5.0), foo (<< 4) [!amd64 !i386], libfoo (>= 1.2-1), bozzle [kfreebsd-i386]
+Build-Conflicts: foo [amd64 i386], bar [alpha test], xlibs-dev, arch-test1 [powerpc], arch-test2 [!sparc]
+Build-Conflicts-Indep: debmake [!powerpc]
+Maintainer: Debian QA Group <packages@qa.debian.org>
+Standards-Version: 3.7.3
+Homepage: lintian.debian.org
+Origin: Debian
+Bugs: debbugs://bugs.debian.org/
+
+Package: relations
+Architecture: all
+Section: contrib/misc
+Pre-Depends: awk|gawk
+Depends: relations(<< 3), dpkg, bash (>> 2.0 ), mail-transport-agent, gawk | awk, foo (>> 2.0), foo (<< 2.2), coreutils, ,null (>= 0), ${misc:Depends}
+Provides: mail-reader
+Replaces: relations
+Conflicts: foobar (<< 5&5), foo, relations,
+           gnuwdf,
+Suggests: alpha, gnu (>= 44-3-4-8-11.4) | ung (<< 89beta) | nug | ngu, beta, some-other-package
+Recommends: emacs21 | emacsen, dpkg, null, some-other-package, ${f-oo:b-ar}, gs | ghostscript | gs-aladdin
+Description: Strange dependency relationships
+ This package declares relationships designed to tickle lintian's "fields"
+ check.  It should generate a number of tags for these.
+ .
+ The package is built with "dpkg --build --no-check", because some of the
+ relationships used here are normally rejected by dpkg.
+
+Package: relations-multiple-libs
+Architecture: all
+Section: non-free/misc
+Depends: libstdc++2.10, libstdc++2.10-glibc2.2, libstdc++3.0, tk8.2, tk8.3, tcl8.0, tcl8.2, tkx8.2, tkx8.3, tclx8.2, libpng2, libpng3, xorg, ${shlibs:Depends}
+Provides: awk
+Recommends: ${shlibs:Depends}, relations-multiple-libs, gs | gs-gpl
+Breaks: libpng3 (<< 1.0), libpng2
+Suggests: x-dev, ghostscript | gs
+Description: Duplicate library dependency relationships.
+ Duplicate library dependency relationships.
+ This tests the depending on different versions of the same library
+ at the same time.
+ .
+ At the same time, it conveniently tests some description file checks. :)
+ .
+ It is a metapackage from the lintian perspective, so the xorg dependency
+ should be allowed.
diff --git a/nokia-lintian/testset/relations/debian/rules b/nokia-lintian/testset/relations/debian/rules
new file mode 100755 (executable)
index 0000000..722be9b
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/make -f
+
+# Copyright (C) 1998 Richard Braakman
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+build:
+
+binary-arch:
+
+binary-indep:
+       install -d debian/tmp/DEBIAN
+       dpkg-gencontrol -prelations -isp
+       dpkg --build debian/tmp ../relations_5_all.deb
+       install -d debian/tmp/usr/share/doc/
+       ln -s relations debian/tmp/usr/share/doc/relations-multiple-libs
+       dpkg-gencontrol -prelations-multiple-libs -isp
+       dpkg --build debian/tmp ../relations-multiple-libs_5_all.deb
+
+binary: binary-arch binary-indep
+
+clean::
+       rm -rf debian/tmp debian/files
+
+# Test that python-all-dev satisfies a Python requirement.
+       python -V || true
+
+# Test allowing quilt Build-Depends for manual quilt invocations.
+       TESTING=foo ANOTHER=bar quilt || true
+
+# Test requiring perl Build-Depends for manual perl invocations.
+       [ ! -f Build ] || $(PERL) Build distclean
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/relations/debian/tmp/DEBIAN/control b/nokia-lintian/testset/relations/debian/tmp/DEBIAN/control
new file mode 100644 (file)
index 0000000..87e7fe6
--- /dev/null
@@ -0,0 +1,14 @@
+Package: relations-multiple-libs
+Version: 4
+Section: misc
+Priority: optional
+Architecture: all
+Depends: libstdc++2.10, libstdc++2.10-glibc2.2, libstdc++3.0, tk8.2, tk8.3, tcl8.0, tcl8.2, tkx8.2, tkx8.3, tclx8.2, libpng2, libpng3
+Installed-Size: 12
+Maintainer: Lintian Maintainer <lintian-maint@debian.org>
+Source: relations
+Description: Duplicate library dependency relationships.
+ Duplicate library dependency relationships. This tests the depending on
+ different versions of the same library at the same time.
+ .
+ At the same time, it conveniently tests some description file checks. :)
diff --git a/nokia-lintian/testset/runtests b/nokia-lintian/testset/runtests
new file mode 100755 (executable)
index 0000000..0cd13de
--- /dev/null
@@ -0,0 +1,345 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 1998 Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+sub usage {
+    print <<END;
+Usage: $0 [-k] [-v] [-d] testset-directory testing-directory [test]
+
+The -k option means do not stop after one failed test, but try
+them all and report all errors.
+
+The -v option will also display those tests that have a description, but are
+not tested in any testset-package.
+
+The -d option will display debugging information.
+
+The optional 3rd parameter causes runtests to only run that particular test.
+END
+    exit 2;
+}
+
+# for debugging:
+my $debug = 0;
+
+# Tests layout:
+# Every test package is in a directory pkgname-version in the testset
+# directory.  The lintian output that is expected for each package is
+# in a file tags.pkgname in the testset directory.
+
+# Running the tests:
+# Each test package is copied to a subdirectory of the testing-directory,
+# and built there.  Then lintian is run over the resulting .changes file,
+# with its output redirected to tags.pkgname in the testing-directory.
+
+# If the tags output is not identical to the tags.pkgname file in the
+# testset-directory, then runtests will output the diff and exit with
+# a failure code.
+
+# The build output is directed to build.pkgname in the testing-directory.
+
+# Exit codes:
+# 0 - success
+# 1 - one or more tests failed
+# 2 - an error prevented proper running of the tests
+
+# Turns out I might as well have written this in bash.  Oh well.
+
+my $run_all_tests = 0;
+my $verbose = 0;
+
+# --- Parse options, such as they are.
+while ($#ARGV >= 0 && $ARGV[0] =~ m/^-/) {
+    if ($ARGV[0] eq '-k') {
+       $run_all_tests = 1;
+    } elsif ($ARGV[0] eq '-v') {
+       $verbose = 1;
+    } elsif ($ARGV[0] eq '-d') {
+       $debug = 1;
+    } else {
+       usage;
+    }
+    shift;
+}
+
+# --- Parse directory arguments
+if ($#ARGV < 1 || $#ARGV > 2) {
+    usage;
+}
+
+my $testset = shift;
+my $rundir = shift;
+my $singletest;
+if ($#ARGV == 0) {
+    $singletest = shift;
+}
+
+# --- Set and unset environment variables that lintian is sensitive to
+BEGIN {
+    my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'};
+    if (not $LINTIAN_ROOT) {
+       use Cwd ();
+       $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT = Cwd::cwd();
+    }
+    delete $ENV{'LINTIAN_CFG'};
+    delete $ENV{'LINTIAN_LAB'};
+    delete $ENV{'LINTIAN_DIST'};
+    delete $ENV{'LINTIAN_UNPACK_LEVEL'};
+    $ENV{'LC_COLLATE'} = 'C';
+
+    # Set standard umask because many of the test packages rely on this
+    # when creating files from the debian/rules script.
+    umask(022);
+}
+
+my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'};
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Util;
+use Tags;
+
+# --- Set the ways to call lintian and dpkg-buildpackage
+my $lintian_options = '-I -E';
+my $lintian_info_options = '-I -E -i';
+my $dpkg_buildpackage_options = '-rfakeroot -us -uc -d -iNEVER_MATCH_ANYTHING'
+    . ' -INEVER_MATCH_ANYTHING';
+my $lintian_path = $LINTIAN_ROOT . "/frontend/lintian";
+
+my $testok = 0;
+my %tags;
+my %types = ( 'E' => 'error', 'W' => 'warning', 'I' => 'info', 'X' => 'experimental' );
+
+# --- Display output immediately
+$| = 1;
+
+# --- Let's play.
+
+-d $rundir
+    or fail("test directory $rundir does not exist\n");
+
+# does every tag have an info section?
+print "Checking for missing info tags ... ";
+
+$testok = 1;
+for my $desc_file (<$LINTIAN_ROOT/checks/*.desc>) {
+    for my $i (read_dpkg_control($desc_file)) {
+       $desc_file =~ s#.*/##;
+       if (exists $i->{'tag'}) {
+           if ($i->{'tag'} !~ /^[\w0-9.+-]+$/) {
+               print "E: test-tag-has-invalid-characters $i->{'tag'}"
+                   . " in $desc_file\n";
+           }
+           if (not exists $i->{'info'}) {
+               print "E: test-has-no-info $i->{'tag'} in $desc_file\n";
+               $testok = 0;
+           }
+
+           # Check the tag info for unescaped <> or for unknown tags (which
+           # probably indicate the same thing).
+           my $info = $i->{'info'};
+           my @tags;
+           while ($info =~ s,<([^\s>]+)(?:\s+href=\"[^\"]+\")?>.*?</\1>,,s) {
+               push (@tags, $1);
+           }
+           my %known = map { $_ => 1 } qw(a em i tt);
+            my %seen;
+           @tags = grep { !$known{$_} && !$seen{$_}++ } @tags;
+           if (@tags) {
+               print "E: test-info-has-unknown-html-tags $i->{'tag'} @tags"
+                   . " in $desc_file\n";
+           }
+           if ($info =~ /[<>]/) {
+               print "E: test-info-has-stray-angle-brackets $i->{'tag'}"
+                   . " in $desc_file\n";
+           }
+
+           if (!exists($i->{'type'}) && !exists($i->{'severity'})) {
+               use Data::Dumper;
+               print Dumper $i;
+               print "E: test-has-no-type $i->{'tag'} in $desc_file\n";
+               $testok = 0;
+               next;
+           }
+
+           $tags{$i->{'tag'}}{'desc_file'} = $desc_file;
+           if (exists $i->{'experimental'}) {
+               $tags{$i->{'tag'}}{'desc_type'} = "experimental";
+           } else {
+               $tags{$i->{'tag'}}{'desc_type'} = $i->{'type'} ||
+                   $Tags::sev_to_type[$i->{'severity'}];
+           }
+       }
+    }
+}
+
+if ($testok) {
+    print "done.\n";
+} else {
+    print "FAILED!\n";
+    exit 1 unless $run_all_tests;
+}
+
+# can I make a lab?
+print "Running static lab test ... create ... ";
+$testok = runsystem_ok("$lintian_path --lab $rundir/test_lab --setup-lab");
+# can I renew a lab?
+print " renew ... ";
+$testok = runsystem_ok("$lintian_path --lab $rundir/test_lab --setup-lab")
+    if $testok;
+# can I remove a lab?
+print " remove ...";
+$testok = runsystem_ok("$lintian_path --lab $rundir/test_lab --remove-lab")
+    if $testok;
+# should be empty now
+print " rmdir ...";
+$testok = runsystem_ok("rmdir $rundir/test_lab")
+    if $testok;
+# cleanup
+runsystem("rm -r $rundir/test_lab") if -d "$rundir/test_lab";
+if ($testok) {
+    print "done.\n";
+} else {
+    print "FAILED!\n";
+    exit 1 unless $run_all_tests;
+}
+
+# ok, I can make a static lab, now let's test the package checks
+# in temporary labs
+my @tests;
+if ($singletest) {
+    @tests = ( $singletest );
+} else {
+       opendir(TESTDIR, $testset)
+               or fail("cannot open $testset: $!\n");
+
+       @tests = sort(readdir(TESTDIR));
+
+       closedir(TESTDIR);
+}
+
+for (@tests) {
+    next if $_ eq '.' or $_ eq '..' or $_ eq 'CVS' or $_ eq '.svn';
+    next unless -d "$testset/$_";
+
+    my $pkgdir = $_;
+
+    open(CHANGELOG, "$testset/$pkgdir/debian/changelog") or
+        die("Could not open $testset/$pkgdir/debian/changelog");
+    my $line = <CHANGELOG>;
+    chomp($line);
+    close(CHANGELOG);
+    $line =~ s/^.*\(//;
+    $line =~ s/\).*$//;
+    
+    my ($pkg, $ver) = ($pkgdir, $line);
+    print "Running test on $pkg $ver: copying... ";
+
+    print "Cleaning up and repopulating $rundir/$pkgdir...\n" if $debug;
+    runsystem_ok("rm -rf $rundir/$pkgdir");
+    runsystem("cp -rp $testset/$pkgdir $rundir");
+    opendir D, "$testset" or die;
+    foreach (readdir D) {
+      next unless /^\Q${pkg}\E_.*\.orig\.tar\.gz$/;
+      print "Symlinking $_ in $rundir...\n" if $debug;
+      symlink $ENV{'PWD'}."/$testset/$_", "$rundir/$_";
+    }
+    closedir D;
+    runsystem("find $rundir -name CVS -o -name .svn -print0 | xargs -0r rm -R");
+
+    print "building... ";
+    print "Running dpkg-buildpackage $dpkg_buildpackage_options in $rundir/$pkgdir...\n" if $debug;
+    runsystem("cd $rundir/$pkgdir && dpkg-buildpackage $dpkg_buildpackage_options >../build.$pkg 2>&1");
+
+    print "testing... ";
+    print "Running lintian $lintian_options on $rundir/$pkg\_$ver*.changes...\n" if $debug;
+    runsystem_ok("$lintian_path $lintian_options $rundir/$pkg\_$ver*.changes".
+       " 2>&1 | sort > $rundir/tags.$pkg");
+
+    # Run a sed-script if it exists, for tests that have slightly variable
+    # output
+    runsystem_ok("sed -i -f $testset/tags.$pkg.sed $rundir/tags.$pkg")
+       if -e "$testset/tags.$pkg.sed";
+
+    $testok = runsystem_ok("cmp -s $rundir/tags.$pkg $testset/tags.$pkg");
+    if ($testok) {
+       print "done.\n";
+    } else {
+       print "FAILED:\n";
+       runsystem_ok("diff -u $testset/tags.$pkg $rundir/tags.$pkg");
+       exit 1 unless $run_all_tests;
+       next;
+    }
+
+    open TAGS, "$rundir/tags.$pkg" or fail("Cannot open $rundir/tags.$pkg");
+    while (<TAGS>) {
+       next if /^N: /;
+       if (not /^(.): (\S+)(?: (?:source|udeb))?: (\S+)/) {
+           print "E: Invalid line:\n$_";
+           next;
+       }
+       $tags{$3}{'tested_type'} = $types{$1};
+       $tags{$3}{'tested_package'} = $2;
+    }
+    close TAGS;
+}
+
+print "Checking whether all tags are tested and tags have description ... \n";
+$testok = 1;
+for (keys %tags) {
+    my $values = $tags{$_};
+    if (not defined $values->{'desc_type'}) {
+       print "E: tag-has-no-description $_ in $values->{'tested_package'}\n";
+       $testok = 0;
+    } elsif (not defined $values->{'tested_type'}) {
+       print "I: tag-is-not-tested $_ in $values->{'desc_file'}\n"
+           if $verbose;
+    } elsif ($values->{'desc_type'} ne $values->{'tested_type'}) {
+       print "E: tag-has-inconsistent-type $_ $values->{'tested_type'} vs ".
+           "$values->{'desc_type'}\n";
+       $testok = 0;
+    }
+}
+
+if ($testok) {
+    print "done.\n";
+} else {
+    print "FAILED\n";
+    exit 1 unless $run_all_tests;
+}
+
+# --------------
+sub runsystem {
+    system(@_) == 0
+       or fail("failed: @_\n");
+}
+
+sub runsystem_ok {
+    my $errcode = system(@_);
+    $errcode == 0 or $errcode == (1 << 8)
+       or fail("failed: @_\n");
+    return $errcode == 0;
+}
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: ts=8 sw=4
diff --git a/nokia-lintian/testset/scripts/csh-foo b/nokia-lintian/testset/scripts/csh-foo
new file mode 100644 (file)
index 0000000..eaf47a1
--- /dev/null
@@ -0,0 +1,2 @@
+#! /bin/csh
+
diff --git a/nokia-lintian/testset/scripts/debian/changelog b/nokia-lintian/testset/scripts/debian/changelog
new file mode 100644 (file)
index 0000000..cbdb6d1
--- /dev/null
@@ -0,0 +1,41 @@
+scripts (6ds-1ubuntu0.5.10.1) unstable; urgency=low
+
+  * I'm also not able to write my name.
+  * Added a script in /etc/Xsession.d
+  * Bizarre version number courtesy of
+    https://wiki.ubuntu.com/SecurityUpdateProcedures#Prepare
+
+ -- Mark 'HE' Brokschmitt <he@debian.org>  Thu, 23 Jun 2005 14:32:39 +0200
+
+scripts (5) unstable; urgency=low
+
+  * I'm making a typo in my own name... And I want lintian to warn me about
+    it.
+
+ -- Jeroen van Wolffelaar <jeroen@wolffelaar.nl>  Sun, 18 Apr 2004 02:26:34 +0200
+
+scripts (4) unstable; urgency=low
+
+  * Add new example to check that not executable files with a shebang line
+    called *in don't trigger the script-not-executable warning.
+
+ -- Marc 'HE' Brockschmidt <he@debian.org>  Wed, 14 Apr 2004 19:44:04 +0200
+
+scripts (3) unstable; urgency=low
+
+  * Add suidperlfoo and some code in debian/rules to
+    check the new suidperl checks
+
+ -- Frank Lichtenheld <djpig@debian.org>  Wed, 31 Mar 2004 21:06:20 +0000
+
+scripts (2) unstable; urgency=low
+
+  * Add tkfoo script for tk checkings
+
+ -- Lintian Maintainers <lintian-maint@debian.org>  Sat, 21 Feb 2004 17:13:36 +0100
+
+scripts (1) unstable; urgency=low
+
+  * Initial version
+
+ -- Lintian Maintainers <lintian-maint@debian.org>  Sat, 10 Feb 2001 15:37:31 -0800
diff --git a/nokia-lintian/testset/scripts/debian/control b/nokia-lintian/testset/scripts/debian/control
new file mode 100644 (file)
index 0000000..3a290fa
--- /dev/null
@@ -0,0 +1,14 @@
+Source: scripts
+Section: interpreters
+Priority: extra
+Maintainer: Lintian Maintainers <lintian-maint@debian.org>
+Uploaders: Jeroen van Wolfelaar <jeroen@wolffelaar.nl>, Marc 'HE' Brockschmidt <he@debian.org>
+Build-Depends-Indep: python (>= 2.3), python (<< 2.4), dpatch
+Standards-Version: 3.2.1
+
+Package: scripts
+Architecture: all
+Depends: test, ruby1.8, build-essential, libssl0.9.7
+Recommends: tk8.4 | wish
+Description: test lintian's script file checks
+ Regression test lintian's script file checks.
diff --git a/nokia-lintian/testset/scripts/debian/copyright b/nokia-lintian/testset/scripts/debian/copyright
new file mode 100644 (file)
index 0000000..ad8a119
--- /dev/null
@@ -0,0 +1,5 @@
+This file contains the phrase "under the same terms as Perl itself" to
+trigger warnings about not having common-licenses references.
+
+This file contains the phrase "public domain" which should suppress
+warnings about no copyright date.
diff --git a/nokia-lintian/testset/scripts/debian/patches/00list b/nokia-lintian/testset/scripts/debian/patches/00list
new file mode 100644 (file)
index 0000000..fd3c7ee
--- /dev/null
@@ -0,0 +1,9 @@
+01_not_here_right_now.dpatch
+
+# some comment
+/* some more
+   elaborate comment
+   which needs DPATCH_OPTION_CPP=1
+  */02_i_dont_have_a_description.patch 03_specified_without_dpatch
+
+// and again a comment
diff --git a/nokia-lintian/testset/scripts/debian/patches/00list.sparc b/nokia-lintian/testset/scripts/debian/patches/00list.sparc
new file mode 100644 (file)
index 0000000..8b47ab3
--- /dev/null
@@ -0,0 +1 @@
+01_some_other_patch_thats_not_in_the_package.dpatch
diff --git a/nokia-lintian/testset/scripts/debian/patches/00options b/nokia-lintian/testset/scripts/debian/patches/00options
new file mode 100644 (file)
index 0000000..57ffeb6
--- /dev/null
@@ -0,0 +1 @@
+DPATCH_OPTION_CPP=1
diff --git a/nokia-lintian/testset/scripts/debian/patches/02_i_dont_have_a_description.patch b/nokia-lintian/testset/scripts/debian/patches/02_i_dont_have_a_description.patch
new file mode 100644 (file)
index 0000000..9279c1b
--- /dev/null
@@ -0,0 +1,7 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_i_dont_have_a_description.patch.dpatch by Marc 'HE' Brockschmidt <Marc 'HE' Brockschmidt <he@debian.org>>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
diff --git a/nokia-lintian/testset/scripts/debian/patches/03_specified_without_dpatch.dpatch b/nokia-lintian/testset/scripts/debian/patches/03_specified_without_dpatch.dpatch
new file mode 100644 (file)
index 0000000..8303ac6
--- /dev/null
@@ -0,0 +1,5 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Listed in 00list without .dpatch suffix.
+
+@DPATCH@
diff --git a/nokia-lintian/testset/scripts/debian/postinst b/nokia-lintian/testset/scripts/debian/postinst
new file mode 100644 (file)
index 0000000..4172b09
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+if [ -x "/etc/init.d/lsb-broken" ] ; then
+    update-rc.d lsb-broken defaults >/dev/null
+fi
+if [ -x "/etc/init.d/no-lsb" ] ; then
+    update-rc.d no-lsb defaults >/dev/null
+fi
+if [ -x "/etc/init.d/skeleton" ] ; then
+    update-rc.d skeleton defaults >/dev/null
+fi
+if [ -x "/etc/init.d/lsb-other" ] ; then
+    update-rc.d lsb-other defaults >/dev/null
+fi
diff --git a/nokia-lintian/testset/scripts/debian/postrm b/nokia-lintian/testset/scripts/debian/postrm
new file mode 100644 (file)
index 0000000..31e699b
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+if [ "$1" = purge ] ; then
+    update-rc.d lsb-broken remove >/dev/null
+    update-rc.d no-lsb remove >/dev/null
+    update-rc.d skeleton remove >/dev/null
+    update-rc.d lsb-other remove >/dev/null
+    update-rc.d lsb-other remove >/dev/null
+fi
diff --git a/nokia-lintian/testset/scripts/debian/preinst b/nokia-lintian/testset/scripts/debian/preinst
new file mode 100644 (file)
index 0000000..0799557
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+set -x
+
+#
+# Some comments here
+#
+
+# This serves as an example of an "empty" script, so
+# please do not add any real code here, thank you :)
+
+#DEBHELPER#
+
+exit 0
diff --git a/nokia-lintian/testset/scripts/debian/rules b/nokia-lintian/testset/scripts/debian/rules
new file mode 100755 (executable)
index 0000000..55af295
--- /dev/null
@@ -0,0 +1,98 @@
+#!/usr/bin/make -f
+
+tmp=debian/tmp
+
+build:
+
+binary-arch:
+       echo "Hi, in an arch: all package, I am a bug!"
+
+binary-indep:
+       install -d $(tmp)/usr/bin/
+       install -d $(tmp)/etc/X11/Xsession.d/
+       install -d $(tmp)/etc/init.d/
+       install -d $(tmp)/etc/csh/login.d/
+       install -d $(tmp)/etc/fish.d/
+       install -d $(tmp)/usr/share/scripts/
+       install -d $(tmp)/usr/share/doc/scripts/
+       install -d $(tmp)/usr/lib/python2.3/site-packages/
+       install -d $(tmp)/usr/lib/cgi-bin
+       install -d $(tmp)/usr/src/scripts
+       install -d $(tmp)/DEBIAN
+
+       install -m 755 csh-foo $(tmp)/etc/csh/login.d/ 
+       install -m 755 envfoo $(tmp)/usr/bin/
+       install -m 755 fish-foo $(tmp)/etc/fish.d/
+       install -m 755 jruby-broken $(tmp)/usr/bin/
+       install -m 755 pyfoo $(tmp)/usr/bin/
+       install -m 755 py2foo $(tmp)/usr/bin/
+       install -m 755 perlfoo $(tmp)/usr/bin/
+       install -m 755 rubyfoo $(tmp)/usr/bin/
+       install -m 755 make-foo $(tmp)/usr/bin/
+       install -m 755 lefty-foo $(tmp)/usr/bin/
+       install -m 4751 perlfoo $(tmp)/usr/bin/suidperlfoo2
+       install -m 755 sh-broken $(tmp)/usr/bin/
+       install -m 4555 suidperlfoo $(tmp)/usr/bin/
+       install -m 755 tkfoo $(tmp)/usr/bin/
+       install -m 755 wishfoo $(tmp)/usr/bin/
+       install -m 644 xsession-test $(tmp)/etc/X11/Xsession.d/
+
+# Permissions here aren't part of what's being tested, but let us exercise
+# some other errors.
+       install -m 755 perl-bizarre-1 $(tmp)/usr/bin/
+       install -m 750 perl-bizarre-2 $(tmp)/usr/bin/
+       install -m 754 perl-bizarre-3 $(tmp)/usr/bin/
+       install -m 705 guile-bizarre $(tmp)/usr/bin/
+
+# First one should produce a warning; second one shouldn't.
+       install -m 755 gccbug.dpatch $(tmp)/usr/share/scripts/
+       install -m 755 gccbug.dpatch $(tmp)/usr/src/scripts/
+
+       install -m 644 init-skeleton $(tmp)/etc/init.d/skeleton
+       install -m 755 init-no-lsb $(tmp)/etc/init.d/no-lsb
+       install -m 755 init-lsb-broken $(tmp)/etc/init.d/lsb-broken
+       install -m 755 init-lsb-other $(tmp)/etc/init.d/lsb-other
+
+       install -m 755 phpfoo $(tmp)/usr/share/scripts/
+       sed 's/php$$/php5/' phpfoo > $(tmp)/usr/share/scripts/php5foo
+       chmod 755 $(tmp)/usr/share/scripts/php5foo
+
+       echo "#!/usr/bin/perl" >> $(tmp)/usr/share/scripts/foobar.in
+       chmod 644 $(tmp)/usr/share/scripts/foobar.in
+
+       touch $(tmp)/usr/share/scripts/mono.exe
+       chmod 755 $(tmp)/usr/share/scripts/mono.exe
+
+       echo "#!/bin/sh" > $(tmp)/usr/share/scripts/foo\$$bar
+       chmod 755 $(tmp)/usr/share/scripts/foo\$$bar
+
+       echo "#!/bin/sh" > $(tmp)/usr/lib/cgi-bin/cgi-script
+       chmod 755 $(tmp)/usr/lib/cgi-bin/cgi-script
+
+       echo "#!/bin/sh" > $(tmp)/usr/bin/test.sh
+       chmod 755 $(tmp)/usr/bin/test.sh
+
+# Should produce complaints about a missing debhelper dependency, but not a
+# missing Python dependency.
+       dh_python
+
+       touch $(tmp)/usr/lib/python2.3/site-packages/test.pyc
+       install -m 644 debian/changelog $(tmp)/usr/share/doc/scripts/changelog.Debian
+       gzip -9 $(tmp)/usr/share/doc/scripts/changelog.Debian
+       install -m 644 debian/copyright $(tmp)/usr/share/doc/scripts/copyright
+
+       install -m 644 debian/scripts.conffiles $(tmp)/DEBIAN/conffiles
+       install -m 755 debian/preinst $(tmp)/DEBIAN/preinst
+       install -m 755 debian/postinst $(tmp)/DEBIAN/postinst
+       install -m 755 debian/postrm $(tmp)/DEBIAN/postrm
+       touch $(tmp)/DEBIAN/prerm
+       chmod 755 $(tmp)/DEBIAN/prerm
+       dpkg-gencontrol -isp
+       dpkg --build $(tmp) ..
+
+binary: binary-arch binary-indep
+
+clean:
+       rm -rf debian/files $(tmp) debian/substvars
+
+.PHONY: build binary-arch binary-indep binary clean
diff --git a/nokia-lintian/testset/scripts/debian/scripts.conffiles b/nokia-lintian/testset/scripts/debian/scripts.conffiles
new file mode 100644 (file)
index 0000000..01a371a
--- /dev/null
@@ -0,0 +1,6 @@
+/etc/init.d/lsb-broken
+/etc/init.d/lsb-other
+/etc/init.d/no-lsb
+/etc/X11/Xsession.d/xsession-test
+/etc/csh/login.d/csh-foo
+/etc/fish.d/fish-foo
diff --git a/nokia-lintian/testset/scripts/debian/watch b/nokia-lintian/testset/scripts/debian/watch
new file mode 100644 (file)
index 0000000..5a587ad
--- /dev/null
@@ -0,0 +1,6 @@
+# watch file with upstream version mangling
+
+version=2
+opts="uversionmangle=s/$/ds/" \
+http://qa.debian.org/watch/sf.php?project=foo scripts\.([\d.]+)\.tar\.gz
+
diff --git a/nokia-lintian/testset/scripts/envfoo b/nokia-lintian/testset/scripts/envfoo
new file mode 100755 (executable)
index 0000000..e005037
--- /dev/null
@@ -0,0 +1,4 @@
+#! /bin/env python
+
+if __name__ == '__main__':
+       print 'Hi there'
diff --git a/nokia-lintian/testset/scripts/fish-foo b/nokia-lintian/testset/scripts/fish-foo
new file mode 100644 (file)
index 0000000..7f59139
--- /dev/null
@@ -0,0 +1,2 @@
+#! /usr/bin/fish
+
diff --git a/nokia-lintian/testset/scripts/gccbug.dpatch b/nokia-lintian/testset/scripts/gccbug.dpatch
new file mode 100755 (executable)
index 0000000..65cbf37
--- /dev/null
@@ -0,0 +1,39 @@
+#! /bin/sh -e
+
+# DP: Use sensible-editor instead of vi as fallback editor
+
+# Taken from gcc-4.1-source.  Chokes bash -n (due to the patch) despite being
+# a valid dpatch, so don't warn about it if it's in /usr/src.
+
+dir=
+if [ $# -eq 3 -a "$2" = '-d' ]; then
+    pdir="-d $3"
+    dir="$3/"
+elif [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch)
+        patch $pdir -f --no-backup-if-mismatch -p0 < $0
+        ;;
+    -unpatch)
+        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
+        ;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1
+esac
+exit 0
+
+--- gcc/gccbug.in~     2003-03-01 00:51:42.000000000 +0100
++++ gcc/gccbug.in      2003-03-02 12:08:36.000000000 +0100
+@@ -134,7 +134,7 @@
+ # If they don't have a preferred editor set, then use
+ if [ -z "$VISUAL" ]; then
+   if [ -z "$EDITOR" ]; then
+-    EDIT=vi
++    EDIT=/usr/bin/sensible-editor
+   else
+     EDIT="$EDITOR"
+   fi
diff --git a/nokia-lintian/testset/scripts/guile-bizarre b/nokia-lintian/testset/scripts/guile-bizarre
new file mode 100644 (file)
index 0000000..70e2c74
--- /dev/null
@@ -0,0 +1,6 @@
+#! /bin/sh
+# -*- scheme -*-
+exec guile -s $0 $*
+# Seen in the wild as build-guile-gtk in libguilegtk-1.2-dev (0.31-5.1)
+# Tests script_is_evil_and_wrong
+!#
diff --git a/nokia-lintian/testset/scripts/init-lsb-broken b/nokia-lintian/testset/scripts/init-lsb-broken
new file mode 100644 (file)
index 0000000..c2d3c29
--- /dev/null
@@ -0,0 +1,34 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          bad-lsb
+#  Required-Start:    $local_fs $remote_fs
+# Required-Stop:     
+# Default-Start:     1 2 3 4 5
+# Default-Stop:      S 0 1 6 X
+# Short-Description: Example initscript
+#                    but this can't be continued
+# Description:       An example of a bad LSB section in an init script.
+#                    This continuation is allowed (with spaces).
+#                      This one is too (with tabs).
+# X-Debian-Foo:      Some unknown but valid keyword.
+# Foo:               Some invalid keyword.
+
+# Whoops, no terminating line.
+
+# And then we have this duplicate section.
+### BEGIN INIT INFO
+# Required-Start:    This one doesn't count.
+### END INIT INFO
+
+# Hey, look at all of those missing actions!  But stop isn't missing.
+case "$1" in
+  start|stop)
+       echo "Blah"
+       ;;
+  *)
+       echo "Usage: foo start" >&2
+       exit 3
+       ;;
+esac
+
+:
diff --git a/nokia-lintian/testset/scripts/init-lsb-other b/nokia-lintian/testset/scripts/init-lsb-other
new file mode 100644 (file)
index 0000000..adb4795
--- /dev/null
@@ -0,0 +1,22 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          lsb-other
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Description:       This is another LSB script test, which has a missing
+#  Short-Description.
+### END INIT INFO
+
+case "$1" in
+  start|stop|restart|reload|force-reload)
+        echo "Blah"
+        ;;
+  *)
+        echo "Usage: foo start" >&2
+        exit 3
+        ;;
+esac
+
+:
diff --git a/nokia-lintian/testset/scripts/init-no-lsb b/nokia-lintian/testset/scripts/init-no-lsb
new file mode 100644 (file)
index 0000000..6b994dd
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/sh
+# No LSB section, but otherwise okay.  (Well, the messages are bad, but we
+# don't check that yet.)
+
+case "$1" in
+  start)
+       echo "Blah starting"
+       ;;
+  stop)
+        echo "Blah stopping"
+        ;;
+  restart|force-reload)
+        echo "Blah restarting"
+        ;;
+esac
+
+:
diff --git a/nokia-lintian/testset/scripts/init-skeleton b/nokia-lintian/testset/scripts/init-skeleton
new file mode 100644 (file)
index 0000000..55f05c0
--- /dev/null
@@ -0,0 +1,155 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          skeleton
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      S 0 1 6
+# Short-Description: Example initscript
+# Description:       This file should be used to construct scripts to be
+#                    placed in /etc/init.d.
+### END INIT INFO
+
+# Author: Foo Bar <foobar@baz.org>
+#
+# Please remove the "Author" lines above and replace them
+# with your own name if you copy and modify this script.
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="Description of the service"
+NAME=daemonexecutablename
+DAEMON=/usr/sbin/$NAME
+DAEMON_ARGS="--options args"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+       # Return
+       #   0 if daemon has been started
+       #   1 if daemon was already running
+       #   2 if daemon could not be started
+       start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+               || return 1
+       start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+               $DAEMON_ARGS \
+               || return 2
+       # Add code here, if necessary, that waits for the process to be ready
+       # to handle requests from services started subsequently which depend
+       # on this one.  As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+       # Return
+       #   0 if daemon has been stopped
+       #   1 if daemon was already stopped
+       #   2 if daemon could not be stopped
+       #   other if a failure occurred
+       start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+       RETVAL="$?"
+       [ "$RETVAL" = 2 ] && return 2
+       # Wait for children to finish too if this is a daemon that forks
+       # and if the daemon is only ever run from this initscript.
+       # If the above conditions are not satisfied then add some other code
+       # that waits for the process to drop all resources that could be
+       # needed by services started subsequently.  A last resort is to
+       # sleep for some time.
+       start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+       [ "$?" = 2 ] && return 2
+       # Many daemons don't delete their pidfiles when they exit.
+       rm -f $PIDFILE
+       return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+       #
+       # If the daemon can reload its configuration without
+       # restarting (for example, when it is sent a SIGHUP),
+       # then implement that here.
+       #
+       start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+       return 0
+}
+
+case "$1" in
+  start)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+       do_start
+       case "$?" in
+               0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
+  stop)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+       do_stop
+       case "$?" in
+               0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+               2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+       esac
+       ;;
+  #reload|force-reload)
+       #
+       # If do_reload() is not implemented then leave this commented out
+       # and leave 'force-reload' as an alias for 'restart'.
+       #
+       #log_daemon_msg "Reloading $DESC" "$NAME"
+       #do_reload
+       #log_end_msg $?
+       #;;
+  restart|force-reload)
+       #
+       # If the "reload" option is implemented then remove the
+       # 'force-reload' alias
+       #
+       log_daemon_msg "Restarting $DESC" "$NAME"
+       do_stop
+       case "$?" in
+         0|1)
+               do_start
+               case "$?" in
+                       0) log_end_msg 0 ;;
+                       1) log_end_msg 1 ;; # Old process is still running
+                       *) log_end_msg 1 ;; # Failed to start
+               esac
+               ;;
+         *)
+               # Failed to stop
+               log_end_msg 1
+               ;;
+       esac
+       ;;
+  *)
+       #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+       echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+       exit 3
+       ;;
+esac
+
+:
diff --git a/nokia-lintian/testset/scripts/jruby-broken b/nokia-lintian/testset/scripts/jruby-broken
new file mode 100644 (file)
index 0000000..56f574d
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/bin/jruby
+# There's no non-versioned jruby, so this should be an error.
diff --git a/nokia-lintian/testset/scripts/lefty-foo b/nokia-lintian/testset/scripts/lefty-foo
new file mode 100644 (file)
index 0000000..52c003e
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/local/bin/lefty
+
diff --git a/nokia-lintian/testset/scripts/make-foo b/nokia-lintian/testset/scripts/make-foo
new file mode 100644 (file)
index 0000000..6b787b5
--- /dev/null
@@ -0,0 +1,3 @@
+#!/usr/bin/make
+
+
diff --git a/nokia-lintian/testset/scripts/perl-bizarre-1 b/nokia-lintian/testset/scripts/perl-bizarre-1
new file mode 100644 (file)
index 0000000..fc632c8
--- /dev/null
@@ -0,0 +1,11 @@
+#! /bin/sh
+eval '(exit $?0)' && eval 'PERL_BADLANG=x;export PERL_BADLANG;: \
+;exec perl -x -S -- "$0" ${1+"$@"};#'if 0;
+eval 'setenv PERL_BADLANG x;exec perl -x -S -- "$0" $argv:q;#'.q+
+#!perl -w
+package Htex::a2ping;  $0=~/(.*)/s;unshift@INC,'.';do($1);die$@if$@;__END__+if !1;
+# This Perl script was generated by JustLib2 at Wed Apr 23 09:14:13 2003.
+# Don't touch/remove any lines above; http://www.inf.bme.hu/~pts/justlib
+
+# The above was actually seen in the wild and stresses the
+# script_is_evil_and_wrong test.
diff --git a/nokia-lintian/testset/scripts/perl-bizarre-2 b/nokia-lintian/testset/scripts/perl-bizarre-2
new file mode 100644 (file)
index 0000000..afd9cfe
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+eval 'exec /usr/bin/perl -wS $0 ${1+"$@"}'
+    if $running_under_some_shell;
+
+# I'm someone following perlrun except without using the Perl #! line.
+# Now something to choke bash.
+while (<>) { if (/%#/) { print } }
diff --git a/nokia-lintian/testset/scripts/perl-bizarre-3 b/nokia-lintian/testset/scripts/perl-bizarre-3
new file mode 100644 (file)
index 0000000..44baf75
--- /dev/null
@@ -0,0 +1,6 @@
+eval '(exit $?0)' && eval 'exec perl -wS $0 ${1+"$@"}'
+& eval 'exec /usr/bin/perl -wS $0 $argv:q'
+    if $running_under_some_shell;
+
+# More utterly bizarreness from perlrun.  This one even doesn't work if
+# there's a valid #! line on the first line.  I don't understand why....
diff --git a/nokia-lintian/testset/scripts/perlfoo b/nokia-lintian/testset/scripts/perlfoo
new file mode 100644 (file)
index 0000000..5b27ed0
--- /dev/null
@@ -0,0 +1,3 @@
+#! /usr/bin/perl
+
+print "Hello, World!";
diff --git a/nokia-lintian/testset/scripts/phpfoo b/nokia-lintian/testset/scripts/phpfoo
new file mode 100644 (file)
index 0000000..e0595e6
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/php
+<html>
+<head>
+<title>Dumb PHP script</title>
+</head>
+<body><? print(Date("l F d, Y")); ?></body>
+</html>
diff --git a/nokia-lintian/testset/scripts/py2foo b/nokia-lintian/testset/scripts/py2foo
new file mode 100755 (executable)
index 0000000..ee6c873
--- /dev/null
@@ -0,0 +1,4 @@
+#! /usr/bin/env python2.2
+
+if __name__ == '__main__':
+       print 'Hi there'
diff --git a/nokia-lintian/testset/scripts/pyfoo b/nokia-lintian/testset/scripts/pyfoo
new file mode 100755 (executable)
index 0000000..1e7f192
--- /dev/null
@@ -0,0 +1,4 @@
+#! /usr/bin/env python
+
+if __name__ == '__main__':
+       print 'Hi there'
diff --git a/nokia-lintian/testset/scripts/rubyfoo b/nokia-lintian/testset/scripts/rubyfoo
new file mode 100644 (file)
index 0000000..8024605
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/ruby1.8
+
+# Ok, that example is really pathetic, but until we have
+# some better code in checks/scripts, it will do
diff --git a/nokia-lintian/testset/scripts/sh-broken b/nokia-lintian/testset/scripts/sh-broken
new file mode 100644 (file)
index 0000000..7b79074
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+if fi
diff --git a/nokia-lintian/testset/scripts/suidperlfoo b/nokia-lintian/testset/scripts/suidperlfoo
new file mode 100644 (file)
index 0000000..bcbc471
--- /dev/null
@@ -0,0 +1,3 @@
+#! /usr/bin/suidperl
+
+print "Hello, World!";
diff --git a/nokia-lintian/testset/scripts/tkfoo b/nokia-lintian/testset/scripts/tkfoo
new file mode 100755 (executable)
index 0000000..533595a
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Insane amount of empty lines and comments
+
+#
+#                                          
+#
+#
+
+#
+#
+
+#
+#
+#
+
+#
+#
+   
+#
+# This line makes the next one a comment in Tcl \
+exec wish "$0" -- ${1+"$@"}
+
+# lintian should not check the following for syntax
+# if it detects the line above correctly
+# Code snippet taken from eTkTab
+
+if { [array names prefs keybindings] != "" } {
+  # Read in the file
+   array set unparsed_bindings [ read_settings_file $prefs(keybindings)]
+}
diff --git a/nokia-lintian/testset/scripts/wishfoo b/nokia-lintian/testset/scripts/wishfoo
new file mode 100644 (file)
index 0000000..035c9ad
--- /dev/null
@@ -0,0 +1,4 @@
+#!/usr/bin/wish
+#
+# This is not actually a wish script, here to force a test of wish
+# dependencies.
diff --git a/nokia-lintian/testset/scripts/xsession-test b/nokia-lintian/testset/scripts/xsession-test
new file mode 100644 (file)
index 0000000..ca49d72
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo "Foo."
diff --git a/nokia-lintian/testset/scripts_6ds.orig.tar.gz b/nokia-lintian/testset/scripts_6ds.orig.tar.gz
new file mode 100644 (file)
index 0000000..dbb2f89
Binary files /dev/null and b/nokia-lintian/testset/scripts_6ds.orig.tar.gz differ
diff --git a/nokia-lintian/testset/tags.binary b/nokia-lintian/testset/tags.binary
new file mode 100644 (file)
index 0000000..7819d9c
--- /dev/null
@@ -0,0 +1,133 @@
+E: binary source: debian-rules-missing-required-target binary-indep
+E: binary: debian-changelog-file-missing-or-wrong-name
+E: binary: debian-news-file-uses-obsolete-national-encoding at line 3
+E: binary: depends-on-x-metapackage pre-depends: xorg
+E: binary: desktop-entry-missing-required-key /usr/share/applications/goodbye.desktop Name
+E: binary: doc-base-document-field-ends-in-whitespace binary:1
+E: binary: doc-base-file-duplicated-format binary:36 html
+E: binary: doc-base-file-lacks-required-field binary:22 files
+E: binary: doc-base-file-lacks-required-field binary:26 files
+E: binary: doc-base-file-lacks-required-field binary:26 format
+E: binary: doc-base-file-no-format binary:26
+E: binary: doc-base-file-no-format-section space :0
+E: binary: doc-base-file-no-index binary:35
+E: binary: doc-base-file-references-missing-file binary:17 /usr/share/doc/binary/binary.sgml.gz
+E: binary: doc-base-file-references-missing-file binary:21 /usr/share/doc/binary/binary.txt
+E: binary: doc-base-file-references-missing-file binary:25 /usr/share/doc/binary/html/ch4.html
+E: binary: doc-base-file-references-missing-file binary:31 /usr/share/doc/binary/hml/*.html
+E: binary: doc-base-file-references-missing-file binary:34 /usr/share/info/binary.info.gz
+E: binary: doc-base-file-unknown-field binary:12 unknown
+E: binary: doc-base-file-unknown-field binary:18 unknown
+E: binary: doc-base-file-uses-obsolete-national-encoding binary:8
+E: binary: doc-base-index-references-multiple-files binary:25
+E: binary: doc-base-invalid-document-field binary:1 binary!docs  
+E: binary: executable-desktop-file /usr/share/applications/goodbye.desktop 0755
+E: binary: file-directly-in-usr-share usr/share/baz
+E: binary: lengthy-symlink usr/share/doc/binary/html/ch2.html ../html/./ch1.html
+E: binary: menu-item-missing-required-tag needs /usr/lib/menu/binary:6
+E: binary: menu-item-missing-required-tag needs /usr/share/menu/binary:6
+E: binary: menu-item-missing-required-tag section /usr/lib/menu/binary:1
+E: binary: menu-item-missing-required-tag section /usr/share/menu/binary:1
+E: binary: menu-method-should-include-menu-h etc/menu-methods/lintian
+E: binary: non-wm-in-windowmanager-menu-section x11 /usr/lib/menu/binary:4
+E: binary: non-wm-in-windowmanager-menu-section x11 /usr/share/menu/binary:4
+E: binary: non-wm-module-in-wm-modules-menu-section wm /usr/lib/menu/binary:22
+E: binary: non-wm-module-in-wm-modules-menu-section wm /usr/share/menu/binary:22
+E: binary: postinst-does-not-call-installdocs usr/share/doc-base/space 
+E: binary: postinst-does-not-call-updatemenus usr/share/menu/binary
+E: binary: postrm-does-not-call-updatemenus usr/share/menu/binary
+E: binary: prerm-does-not-call-installdocs usr/share/doc-base/space 
+E: binary: statically-linked-binary ./usr/bin/static-hello
+E: binary: su-wrapper-without--c /usr/lib/menu/binary:2 su-to-root
+E: binary: su-wrapper-without--c /usr/lib/menu/binary:3 sux
+E: binary: su-wrapper-without--c /usr/share/menu/binary:2 su-to-root
+E: binary: su-wrapper-without--c /usr/share/menu/binary:3 sux
+E: binary: suidregister-used-in-maintainer-script postinst
+E: binary: symlink-contains-spurious-segments usr/share/doc/binary/html/ch2.html ../html/./ch1.html
+E: binary: unstripped-binary-or-object ./usr/bin/hello
+I: binary source: xs-vcs-header-in-debian-control xs-vcs-browser
+I: binary: arch-dep-package-has-big-usr-share
+I: binary: binary-has-unneeded-section ./usr/bin/hello-static .comment
+I: binary: desktop-entry-contains-encoding-key /usr/share/applications/goodbye.desktop:11 Encoding
+I: binary: desktop-entry-contains-encoding-key /usr/share/applications/hello.desktop:13 Encoding
+I: binary: no-md5sums-control-file
+W: binary source: ancient-standards-version 3.2.1 (current is 3.8.0)
+W: binary source: debian-rules-ignores-make-clean-error line 12
+W: binary source: debian-rules-uses-pwd line 9
+W: binary source: maintainer-upload-has-incorrect-version-number 4-1.1
+W: binary source: native-package-with-dash-version
+W: binary source: not-binnmuable-all-depends-any binary-data -> binary
+W: binary source: not-binnmuable-any-depends-all binary -> binary-data
+W: binary source: substvar-source-version-is-deprecated binary
+W: binary source: substvar-source-version-is-deprecated binary-data
+W: binary-data: control-file-is-empty md5sums
+W: binary: binary-without-manpage usr/bin/hello
+W: binary: binary-without-manpage usr/bin/hello-static
+W: binary: binary-without-manpage usr/bin/hello.static
+W: binary: binary-without-manpage usr/bin/iminusrbin
+W: binary: binary-without-manpage usr/bin/static-hello
+W: binary: changelog-file-not-compressed changelog
+W: binary: changelog-news-debian-mismatch distribution unstable != UNRELEASED
+W: binary: changelog-news-debian-mismatch urgency low != high
+W: binary: debian-copyright-file-uses-obsolete-national-encoding at line 13
+W: binary: debian-news-entry-has-strange-distribution UNRELEASED
+W: binary: description-contains-homepage
+W: binary: desktop-command-not-in-package /usr/share/applications/goodbye.desktop goodbye
+W: binary: desktop-entry-contains-unknown-key /usr/share/applications/goodbye.desktop:5 SpecialTag
+W: binary: desktop-entry-contains-unknown-key /usr/share/applications/goodbye.desktop:7 icon
+W: binary: desktop-entry-file-has-crs /usr/share/applications/hello.desktop:7
+W: binary: desktop-entry-invalid-category WeirdStuff /usr/share/applications/goodbye.desktop
+W: binary: desktop-entry-uses-reserved-category Screensaver /usr/share/applications/goodbye.desktop
+W: binary: doc-base-abstract-field-separator-extra-whitespaces binary:7
+W: binary: doc-base-file-unknown-format binary:20 esp
+W: binary: doc-base-unknown-section binary:11 Non/Existant
+W: binary: executable-not-elf-or-script ./usr/bin/iminusrbin
+W: binary: executable-not-elf-or-script ./usr/share/applications/goodbye.desktop
+W: binary: file-in-unusual-dir usr/bar
+W: binary: file-in-unusual-dir usr/bar2
+W: binary: file-in-unusual-dir usr/foo
+W: binary: file-name-ends-in-whitespace usr/share/doc-base/space 
+W: binary: menu-command-not-in-package /usr/lib/menu/binary:18 imnothere
+W: binary: menu-command-not-in-package /usr/lib/menu/binary:20 cfdisk
+W: binary: menu-command-not-in-package /usr/lib/menu/binary:4 xfdisk
+W: binary: menu-command-not-in-package /usr/lib/menu/binary:7 /imnothere
+W: binary: menu-command-not-in-package /usr/share/menu/binary:18 imnothere
+W: binary: menu-command-not-in-package /usr/share/menu/binary:20 cfdisk
+W: binary: menu-command-not-in-package /usr/share/menu/binary:4 xfdisk
+W: binary: menu-command-not-in-package /usr/share/menu/binary:7 /imnothere
+W: binary: menu-file-in-usr-lib usr/lib/menu/binary
+W: binary: menu-item-creates-new-section Applications/System /usr/lib/menu/binary:2
+W: binary: menu-item-creates-new-section Applications/System /usr/share/menu/binary:2
+W: binary: menu-item-creates-new-section Apps/System /usr/lib/menu/binary:7
+W: binary: menu-item-creates-new-section Apps/System /usr/share/menu/binary:7
+W: binary: menu-item-creates-new-section WindowManagers/Modules /usr/lib/menu/binary:13
+W: binary: menu-item-creates-new-section WindowManagers/Modules /usr/share/menu/binary:13
+W: binary: menu-item-needs-tag-has-unknown-value wm /usr/lib/menu/binary:5
+W: binary: menu-item-needs-tag-has-unknown-value wm /usr/share/menu/binary:5
+W: binary: menu-item-uses-apps-section /usr/lib/menu/binary:7
+W: binary: menu-item-uses-apps-section /usr/share/menu/binary:7
+W: binary: menu-item-uses-windowmanagers-section /usr/lib/menu/binary:13
+W: binary: menu-item-uses-windowmanagers-section /usr/share/menu/binary:13
+W: binary: old-fsf-address-in-copyright-file
+W: binary: package-contains-hardlink usr/bar2 -> usr/share/baz
+W: binary: package-contains-upstream-install-documentation usr/share/doc/binary/INSTALL
+W: binary: possible-gpl-code-linked-with-openssl
+W: binary: spelling-error-in-description debian Debian
+W: binary: spelling-error-in-doc-base-abstract-field binary:10 speling spelling
+W: binary: spelling-error-in-doc-base-title-field binary:2 debian Debian
+W: binary: spelling-error-in-news-debian speling spelling
+W: binary: spelling-error-in-news-debian usefull useful
+W: binary: su-to-root-with-usr-sbin /usr/lib/menu/binary:4
+W: binary: su-to-root-with-usr-sbin /usr/share/menu/binary:4
+W: binary: su-wrapper-not-su-to-root /usr/lib/menu/binary:3 sux
+W: binary: su-wrapper-not-su-to-root /usr/share/applications/hello.desktop kdesu
+W: binary: su-wrapper-not-su-to-root /usr/share/menu/binary:3 sux
+W: binary: superfluous-clutter-in-homepage <http://lintian.debian.org/>
+W: binary: symlink-should-be-relative usr/share/doc/binary/html/ch3.html /usr/share/doc/binary/htm/ch1.html
+W: binary: syntax-error-in-debian-changelog line 16 "couldn't parse date The, 15 Apr 2004 23:33:51 +0200"
+W: binary: syntax-error-in-debian-news-file line 12 "badly formatted trailer line"
+W: binary: syntax-error-in-debian-news-file line 12 "found eof where expected more change data or trailer"
+W: binary: unquoted-string-in-menu-item /usr/lib/menu/binary needs:1
+W: binary: unquoted-string-in-menu-item /usr/lib/menu/binary needs:2
+W: binary: unquoted-string-in-menu-item /usr/share/menu/binary needs:1
+W: binary: unquoted-string-in-menu-item /usr/share/menu/binary needs:2
diff --git a/nokia-lintian/testset/tags.binary.sed b/nokia-lintian/testset/tags.binary.sed
new file mode 100644 (file)
index 0000000..20f3a17
--- /dev/null
@@ -0,0 +1 @@
+s/arch-dep-package-has-big-usr-share .*kB .*%/arch-dep-package-has-big-usr-share/
diff --git a/nokia-lintian/testset/tags.cdbs-test b/nokia-lintian/testset/tags.cdbs-test
new file mode 100644 (file)
index 0000000..6693542
--- /dev/null
@@ -0,0 +1,11 @@
+E: cdbs-test source: clean-should-be-satisfied-by-build-depends debhelper
+E: cdbs-test source: missing-python-build-dependency
+I: cdbs-test source: build-depends-without-arch-dep yada
+I: cdbs-test source: package-lacks-versioned-build-depends-on-debhelper 5
+W: cdbs-test source: debian-watch-file-declares-multiple-versions line 3
+W: cdbs-test source: debian-watch-file-unknown-version 4
+W: cdbs-test source: no-human-maintainers
+W: cdbs-test source: out-of-date-standards-version 3.7.3 (current is 3.8.0)
+W: cdbs-test source: package-has-a-duplicate-build-relation cdbs, cdbs
+W: cdbs-test: debian-changelog-line-too-long line 1
+W: cdbs-test: description-contains-duplicated-word bla bla bla
diff --git a/nokia-lintian/testset/tags.copyright b/nokia-lintian/testset/tags.copyright
new file mode 100644 (file)
index 0000000..72005ab
--- /dev/null
@@ -0,0 +1,22 @@
+E: copyright.compressed: copyright-file-compressed
+E: copyright.full-apache-2: copyright-file-contains-full-apache-2-license
+E: copyright.full-gfdl: copyright-file-contains-full-gfdl-license
+E: copyright.full-gfdl: copyright-should-refer-to-common-license-file-for-gfdl
+E: copyright.full-gpl: copyright-file-contains-full-gpl-license
+E: copyright.full-gpl: copyright-should-refer-to-common-license-file-for-gpl
+E: copyright.iso-8859-1: copyright-refers-to-old-directory
+E: copyright.misc-errors: copyright-refers-to-compressed-license usr/share/common-licenses/BSD.gz
+E: copyright.misc-errors: copyright-refers-to-incorrect-directory usr/share/common-licences
+E: copyright.misc-errors: copyright-refers-to-old-directory
+E: copyright.old-style: FSSTND-dir-in-usr usr/doc/
+E: copyright.old-style: old-style-copyright-file
+E: copyright.symlink: copyright-file-is-symlink
+W: copyright.compressed: copyright-without-copyright-notice
+W: copyright.full-apache-2: copyright-without-copyright-notice
+W: copyright.iso-8859-1: debian-copyright-file-uses-obsolete-national-encoding at line 3
+W: copyright.misc-errors: copyright-contains-dh-make-perl-boilerplate
+W: copyright.misc-errors: copyright-has-url-from-dh_make-boilerplate
+W: copyright.misc-errors: copyright-lists-upstream-authors-with-dh_make-boilerplate
+W: copyright.misc-errors: debian-copyright-line-too-long line 20
+W: copyright.old-style: copyright-without-copyright-notice
+W: copyright.symlink: copyright-without-copyright-notice
diff --git a/nokia-lintian/testset/tags.debconf b/nokia-lintian/testset/tags.debconf
new file mode 100644 (file)
index 0000000..0400300
--- /dev/null
@@ -0,0 +1,72 @@
+E: debconf source: declares-possibly-conflicting-debhelper-compat-versions rules=4 compat=4
+E: debconf source: missing-dh_python-build-dependency
+E: debconf-test: extended-description-is-empty
+E: debconf-test: mismatch-translated-choices debconf/testmulti-escape choices-de.utf-8
+E: debconf-test: no-template-description debconf/no-description
+E: debconf-test: no-template-type debconf/language
+E: debconf-test: unknown-debconf-priority config:10 LOW
+E: debconf-test: unknown-debconf-priority config:11 normal
+E: debconf-udeb udeb: udeb-postinst-must-not-call-ldconfig
+I: debconf source: package-needs-python-policy-debhelper
+I: debconf-test-noscripts: unused-debconf-template debconf/test
+I: debconf-test: debconf-error-requires-versioned-depends debconf/error
+I: debconf-test: unused-debconf-template debconf/1st-person
+I: debconf-test: unused-debconf-template debconf/error
+I: debconf-test: unused-debconf-template debconf/internal
+I: debconf-test: unused-debconf-template debconf/language
+I: debconf-test: unused-debconf-template debconf/no-description
+I: debconf-test: unused-debconf-template debconf/should-be-boolean
+I: debconf-test: unused-debconf-template debconf/should-be-no-longer-a-problem
+I: debconf-test: unused-debconf-template debconf/testboolean
+I: debconf-test: unused-debconf-template debconf/testmulti
+I: debconf-test: unused-debconf-template debconf/testmulti-escape
+I: debconf-test: unused-debconf-template debconf/testnote
+I: debconf-test: unused-debconf-template debconf/teststring
+I: debconf-test: unused-debconf-template debconf/translate
+I: debconf-udeb udeb: unused-debconf-template debian-installer/debconf-udeb/title
+W: debconf source: debian-rules-calls-debhelper-in-odd-order dh_makeshlibs (line 49)
+W: debconf source: debian-rules-calls-debhelper-in-odd-order dh_makeshlibs (line 53)
+W: debconf source: debian-rules-sets-DH_COMPAT line 3
+W: debconf source: dpatch-build-dep-but-no-patch-list debconf
+W: debconf source: invalid-po-file debian/po/fr.po
+W: debconf source: invalid-po-file debian/po/sample-file.po
+W: debconf source: maintainer-script-lacks-debhelper-token debian/debconf-test.postinst
+W: debconf source: misnamed-po-file debian/po/lang.po
+W: debconf source: misnamed-po-file debian/po/sample-file.po
+W: debconf source: newer-debconf-templates
+W: debconf source: stray-translated-debconf-templates debconf-test.templates.de
+W: debconf source: translated-default-field debconf-test.templates: 67
+W: debconf source: translated-default-field debconf-test.templates: 72
+W: debconf source: unknown-encoding-in-po-file debian/po/fr.po
+W: debconf-test-noscripts: copyright-contains-dh_make-todo-boilerplate
+W: debconf-test-noscripts: no-debconf-config
+W: debconf-test-noscripts: old-fsf-address-in-copyright-file
+W: debconf-test-noscripts: postrm-does-not-purge-debconf
+W: debconf-test-postinst: copyright-contains-dh_make-todo-boilerplate
+W: debconf-test-postinst: no-debconf-config
+W: debconf-test-postinst: old-fsf-address-in-copyright-file
+W: debconf-test-postinst: possible-debconf-note-abuse postinst:6 debconf/test
+W: debconf-test-postinst: postinst-uses-db-input
+W: debconf-test-preinst: copyright-contains-dh_make-todo-boilerplate
+W: debconf-test-preinst: loads-obsolete-confmodule preinst:5 /usr/share/debconf/confmodule.sh
+W: debconf-test-preinst: missing-debconf-dependency-for-preinst
+W: debconf-test-preinst: old-fsf-address-in-copyright-file
+W: debconf-test-preinst: possible-debconf-note-abuse preinst:9 debconf/test
+W: debconf-test: copyright-contains-dh_make-todo-boilerplate
+W: debconf-test: making-assumptions-about-interfaces-in-templates debconf/testboolean
+W: debconf-test: malformed-prompt-in-templates debconf/teststring
+W: debconf-test: malformed-question-in-templates debconf/should-be-no-longer-a-problem
+W: debconf-test: malformed-question-in-templates debconf/testboolean
+W: debconf-test: malformed-title-in-templates debconf/testnote
+W: debconf-test: old-fsf-address-in-copyright-file
+W: debconf-test: possible-debconf-note-abuse config:19 debconf/test
+W: debconf-test: possible-debconf-note-abuse postinst:8 debconf/test
+W: debconf-test: select-with-boolean-choices debconf/should-be-boolean
+W: debconf-test: too-long-extended-description-in-templates debconf/teststring
+W: debconf-test: too-long-short-description-in-templates debconf/testnote
+W: debconf-test: using-first-person-in-templates debconf/1st-person
+W: debconf-test: using-imperative-form-in-templates debconf/1st-person
+W: debconf-test: using-imperative-form-in-templates debconf/should-be-boolean
+W: debconf-test: using-question-in-extended-description-in-templates debconf/testboolean
+W: debconf-udeb udeb: missing-debconf-dependency
+X: debconf source: template-uses-unsplit-choices debconf-test - debconf/testmulti-escape
diff --git a/nokia-lintian/testset/tags.debug b/nokia-lintian/testset/tags.debug
new file mode 100644 (file)
index 0000000..1ad1d02
--- /dev/null
@@ -0,0 +1,35 @@
+E: debug source: build-depends-indep-without-arch-indep
+E: debug source: version-substvar-for-external-package libhello0-dbg -> libhello
+E: hello: pkg-has-symbols-control-file-but-no-shared-libs
+E: hello: statically-linked-binary ./usr/bin/hello.dbg
+E: hello: unstripped-binary-or-object ./usr/bin/hello.dbg
+E: libhello0-dbg: binary-with-bad-dynamic-table ./usr/lib/libhello.so.dbg
+E: libhello0-dbg: missing-dependency-on-libc needed by ./usr/lib/debug/lib/libhello.so.0.0 and 1 others
+E: libhello0-dbg: sharedobject-in-library-directory-missing-soname usr/lib/libhello.so.dbg
+E: libhello0: duplicate-entry-in-symbols-control-file libhello 0
+E: libhello0: invalid-template-id-in-symbols-file 11
+E: libhello0: invalid-template-id-in-symbols-file 13
+E: libhello0: invalid-template-id-in-symbols-file 4
+E: libhello0: symbols-declared-but-not-shlib libhello 2
+E: libhello0: syntax-error-in-symbols-file 1
+E: libhello0: syntax-error-in-symbols-file 10
+E: libhello0: syntax-error-in-symbols-file 14
+E: libhello0: syntax-error-in-symbols-file 18
+E: libhello0: syntax-error-in-symbols-file 3
+E: libhello0: syntax-error-in-symbols-file 4
+E: libhello0: syntax-error-in-symbols-file 8
+E: libhello0: unknown-meta-field-in-symbols-file Build-Dep-Foo, line 10
+W: debug source: ancient-standards-version 3.7.0 (current is 3.8.0)
+W: debug source: changelog-should-not-mention-nmu
+W: debug source: debhelper-script-needs-versioned-build-depends dh_icons (>= 5.0.51~)
+W: debug source: debian-rules-sets-DH_COMPAT line 5
+W: debug source: timewarp-standards-version (2006-03-05 < 2006-04-26)
+W: hello: binary-without-manpage usr/bin/hello
+W: hello: binary-without-manpage usr/bin/hello.dbg
+W: libhello0-dbg: dbg-package-missing-depends libhello0
+W: libhello0-dbg: debug-file-should-use-detached-symbols ./usr/lib/debug/lib/libhello.so.0.0
+W: libhello0-dbg: shared-lib-without-dependency-information ./usr/lib/libhello.so.dbg
+W: libhello0: symbols-declares-dependency-on-other-package libhello0c2 (>= 1.2)
+W: libhello0: symbols-declares-dependency-on-other-package libhello2 #MINVER#
+W: libhello0: symbols-declares-dependency-on-other-package libhello2 (>= 1:2.3)
+W: libhello0: unused-shlib-entry-in-symbols-control-file libhello 2
diff --git a/nokia-lintian/testset/tags.description b/nokia-lintian/testset/tags.description
new file mode 100644 (file)
index 0000000..150012a
--- /dev/null
@@ -0,0 +1,29 @@
+E: description source: debian-rules-missing-required-target binary-arch
+E: description-bar: description-contains-invalid-control-statement
+E: description-bar: description-synopsis-is-empty
+E: description-bar: no-copyright-file
+E: description-baz: no-copyright-file
+E: description-foo: description-contains-tabs
+E: description-foo: description-too-long
+E: description-foo: no-copyright-file
+E: description: description-contains-invalid-control-statement
+E: description: description-contains-tabs
+E: description: description-is-debmake-template
+E: description: description-starts-with-package-name
+E: description: no-copyright-file
+I: description-bar: no-md5sums-control-file
+I: description-baz: no-md5sums-control-file
+I: description-foo: no-md5sums-control-file
+I: description: no-md5sums-control-file
+W: description source: native-package-with-dash-version
+W: description-bar: extended-description-line-too-long
+W: description-foo: description-starts-with-leading-spaces
+W: description-foo: possible-unindented-list-in-extended-description
+W: description: changelog-not-compressed-with-max-compression changelog.Debian.gz
+W: description: debian-changelog-file-contains-obsolete-user-emacs-settings
+W: description: description-contains-duplicated-word All all all
+W: description: description-contains-duplicated-word The the
+W: description: description-contains-duplicated-word matched matched matched
+W: description: description-contains-duplicated-word of of
+W: description: description-contains-duplicated-word these these
+W: description: description-synopsis-might-not-be-phrased-properly
diff --git a/nokia-lintian/testset/tags.dh-test b/nokia-lintian/testset/tags.dh-test
new file mode 100644 (file)
index 0000000..9c6e4a4
--- /dev/null
@@ -0,0 +1,15 @@
+E: dh-test: description-is-dh_make-template
+E: dh-test: helper-templates-in-copyright
+E: dh-test: section-is-dh_make-template
+W: dh-test source: ancient-standards-version 3.6.2 (current is 3.8.0)
+W: dh-test source: debian-rules-ignores-make-clean-error line 48
+W: dh-test source: debian-rules-sets-DH_COMPAT line 12
+W: dh-test source: dh_suidregister-is-obsolete
+W: dh-test source: dh_testversion-is-deprecated
+W: dh-test source: native-package-with-dash-version
+W: dh-test source: package-uses-deprecated-debhelper-compat-version 3
+W: dh-test: copyright-without-copyright-notice
+W: dh-test: maintainer-script-empty postinst
+W: dh-test: new-package-should-close-itp-bug
+W: dh-test: readme-debian-contains-debmake-template
+W: dh-test: wrong-bug-number-in-closes l3:#nnnn
diff --git a/nokia-lintian/testset/tags.dh7-minimal b/nokia-lintian/testset/tags.dh7-minimal
new file mode 100644 (file)
index 0000000..c4a9800
--- /dev/null
@@ -0,0 +1 @@
+W: dh7-minimal source: newer-standards-version 3.9.0 (current is 3.8.0)
diff --git a/nokia-lintian/testset/tags.dh7-test b/nokia-lintian/testset/tags.dh7-test
new file mode 100644 (file)
index 0000000..15cf288
--- /dev/null
@@ -0,0 +1,6 @@
+W: dh7-test source: changelog-should-mention-nmu
+W: dh7-test source: debhelper-script-needs-versioned-build-depends dh (>= 7)
+W: dh7-test source: debian-watch-file-should-mangle-version
+W: dh7-test source: no-human-maintainers
+W: dh7-test source: source-nmu-has-incorrect-version-number 1.dfsg-1
+W: dh7-test: new-package-should-close-itp-bug
diff --git a/nokia-lintian/testset/tags.diffs b/nokia-lintian/testset/tags.diffs
new file mode 100644 (file)
index 0000000..b258eda
--- /dev/null
@@ -0,0 +1,36 @@
+E: diffs source: debian-files-list-in-source
+E: diffs: arch-independent-package-contains-binary-or-object ./usr/bin/diffs
+E: diffs: missing-dependency-on-libc needed by ./usr/bin/diffs
+E: diffs: no-copyright-file
+E: diffs: unstripped-binary-or-object ./usr/bin/diffs
+I: diffs source: build-depends-without-arch-dep dpatch
+I: diffs source: debian-watch-file-is-missing
+I: diffs source: diff-contains-editor-backup-file binary.c~
+I: diffs source: source-contains-bts-control-dir .ditrack
+I: diffs source: source-contains-git-control-dir .git
+I: diffs source: source-contains-svn-commit-file svn-commit.tmp
+I: diffs: no-md5sums-control-file
+W: diffs source: ancient-standards-version 3.5.9 (current is 3.8.0)
+W: diffs source: configure-generated-file-in-source config.cache
+W: diffs source: configure-generated-file-in-source config.log
+W: diffs source: configure-generated-file-in-source config.status
+W: diffs source: configure-generated-file-in-source subdir-bad/config.cache
+W: diffs source: configure-generated-file-in-source subdir-bad/config.log
+W: diffs source: configure-generated-file-in-source subdir-bad/config.status
+W: diffs source: configure-generated-file-in-source subdir-good/config.cache
+W: diffs source: configure-generated-file-in-source subdir-good/config.log
+W: diffs source: configure-generated-file-in-source subdir-good/config.status
+W: diffs source: diff-contains-bzr-control-dir .bzr
+W: diffs source: diff-contains-cvs-conflict-copy .#binary.c.1.34
+W: diffs source: diff-contains-substvars debian/substvars
+W: diffs source: patch-system-but-direct-changes-in-diff .#binary.c.1.34
+W: diffs source: patch-system-but-direct-changes-in-diff .bzr/dummy
+W: diffs source: patch-system-but-direct-changes-in-diff binary.c~
+W: diffs: binary-without-manpage usr/bin/diffs
+W: diffs: possible-missing-colon-in-closes Closes #1239124
+W: diffs: possible-missing-colon-in-closes Closes 456712
+W: diffs: possible-missing-colon-in-closes Closes Bug# 123893
+W: diffs: wrong-bug-number-in-closes l6:#nnnnnn
+W: diffs: wrong-bug-number-in-closes l7:#123nnn
+W: diffs: wrong-bug-number-in-closes l8:#foo
+W: diffs: wrong-bug-number-in-closes l9:#bar
diff --git a/nokia-lintian/testset/tags.empty b/nokia-lintian/testset/tags.empty
new file mode 100644 (file)
index 0000000..d931b74
--- /dev/null
@@ -0,0 +1,31 @@
+E: empty source: debian-rules-missing-required-target binary-arch
+E: empty source: maintainer-address-missing empty
+E: empty source: no-standards-version-field
+E: empty-docs: maintainer-address-missing empty
+E: empty-docs: no-copyright-file
+E: empty-docs: package-has-no-description
+E: empty: maintainer-address-missing empty
+E: empty: no-copyright-file
+E: empty: package-has-no-description
+E: libempty-perl: maintainer-address-missing empty
+E: libempty-perl: no-copyright-file
+E: libempty-perl: package-has-no-description
+E: python-empty: maintainer-address-missing empty
+E: python-empty: no-copyright-file
+E: python-empty: package-has-no-description
+W: empty source: changelog-should-mention-nmu
+W: empty source: maintainer-not-full-name empty
+W: empty source: no-section-field-for-source
+W: empty source: source-nmu-has-incorrect-version-number 2
+W: empty-docs: doc-package-should-be-section-doc empty-docs
+W: empty-docs: maintainer-not-full-name empty
+W: empty-docs: no-priority-field
+W: empty: maintainer-not-full-name empty
+W: empty: no-priority-field
+W: empty: no-section-field
+W: libempty-perl: maintainer-not-full-name empty
+W: libempty-perl: no-priority-field
+W: libempty-perl: perl-package-should-be-section-perl libempty-perl
+W: python-empty: maintainer-not-full-name empty
+W: python-empty: no-priority-field
+W: python-empty: python-package-should-be-section-python python-empty
diff --git a/nokia-lintian/testset/tags.etcfiles b/nokia-lintian/testset/tags.etcfiles
new file mode 100644 (file)
index 0000000..c0c4ac9
--- /dev/null
@@ -0,0 +1,18 @@
+E: etcfiles source: debian-rules-missing-required-target binary-arch
+E: etcfiles: file-in-etc-not-marked-as-conffile /etc/improper
+E: etcfiles: file-in-etc-not-marked-as-conffile /etc/improper-link
+E: etcfiles: malformed-md5sums-control-file line 4
+E: etcfiles: md5sum-mismatch etc/improper
+E: etcfiles: md5sum-mismatch etc/proper
+E: etcfiles: md5sums-lists-nonexisting-file usr/bin/foo
+E: etcfiles: no-copyright-file
+E: only-etcfiles: extended-description-is-empty
+W: etcfiles source: ancient-standards-version 3.5.0 (current is 3.8.0)
+W: etcfiles source: not-binnmuable-all-depends-any only-etcfiles -> etcfiles
+W: etcfiles: changelog-file-not-compressed changelog
+W: etcfiles: file-missing-in-md5sums etc/improper-link
+W: etcfiles: file-missing-in-md5sums usr/share/doc/etcfiles/changelog
+W: etcfiles: non-etc-file-marked-as-conffile /var/lib/foo
+W: etcfiles: package-contains-hardlink etc/improper -> etc/improper-link
+W: etcfiles: readme-debian-mentions-usr-doc line 2
+W: etcfiles: run-parts-cron-filename-contains-full-stop etc/cron.daily/cronfile-contains.fullstop
diff --git a/nokia-lintian/testset/tags.filenames b/nokia-lintian/testset/tags.filenames
new file mode 100644 (file)
index 0000000..88e5325
--- /dev/null
@@ -0,0 +1,139 @@
+E: filename-games: no-copyright-file
+E: filename-games: package-section-games-but-contains-no-game
+E: filenames: bad-menu-file-name usr/lib/menu/menu
+E: filenames: bad-menu-file-name usr/share/menu/menu
+E: filenames: dir-or-file-in-srv srv/foo/
+E: filenames: dir-or-file-in-srv srv/foo/bar
+E: filenames: dir-or-file-in-var-www var/www/foo
+E: filenames: file-in-etc-not-marked-as-conffile /etc/gconf/schemas/test.schema
+E: filenames: lengthy-symlink usr/lib/filenames/symlink4wrong ../filenames/symlink2
+E: filenames: lengthy-symlink usr/share/doc/filenames/version.txt.gz ../filenames/doc/version6.txt.gz
+E: filenames: no-copyright-file
+E: filenames: non-standard-toplevel-dir files/
+E: filenames: package-contains-ancient-file usr/lib/perl5/foo/ancient.pm 1975-01-01
+E: filenames: package-installs-file-to-usr-x11r6 usr/X11R6/
+E: filenames: package-installs-file-to-usr-x11r6-bin usr/X11R6/bin/
+E: filenames: package-installs-file-to-usr-x11r6-bin usr/X11R6/bin/testxbin2
+E: filenames: package-installs-packlist usr/lib/perl5/foo/.packlist
+E: filenames: postinst-does-not-call-installdocs usr/share/doc-base/filenames
+E: filenames: postinst-does-not-call-updatemenus usr/share/menu/menu
+E: filenames: postrm-does-not-call-updatemenus usr/share/menu/menu
+E: filenames: prerm-does-not-call-installdocs usr/share/doc-base/filenames
+E: filenames: subdir-in-usr-bin usr/bin/bin/
+E: filenames: symlink-contains-spurious-segments usr/lib/filenames/symlink5wrong ../menu/../somethingelse
+E: filenames: symlink-contains-spurious-segments usr/lib/filenames/symlink6wrong ./file4
+E: filenames: symlink-contains-spurious-segments usr/lib/filenames/symlink7wrong ../menu/./something
+E: filenames: symlink-ends-with-slash usr/lib/filenames/symlink9wrong ../menu/something/
+E: filenames: symlink-has-double-slash usr/lib/filenames/symlink8wrong ../menu//something
+E: filenames: symlink-has-too-many-up-segments usr/lib/filenames/symlink2wrong ../../../../etc/symlink
+E: filenames: symlink-should-be-absolute usr/lib/filenames/symlink10wrong ../../..
+E: filenames: symlink-should-be-absolute usr/lib/filenames/symlink1wrong ../../../etc/symlink
+E: filenames: use-of-compat-symlink usr/bin/X11/
+E: filenames: use-of-compat-symlink usr/bin/X11/testxbin
+E: filenames: wrong-file-owner-uid-or-gid usr/lib/filenames/wrong-owner-0:2001 0/2001
+E: filenames: wrong-file-owner-uid-or-gid usr/lib/filenames/wrong-owner-100:0 100/0
+E: filenames: wrong-file-owner-uid-or-gid usr/lib/filenames/wrong-owner-30001:65535 30001/65535
+E: filenames: wrong-file-owner-uid-or-gid usr/lib/filenames/wrong-owner-65535:65001 65535/65001
+E: more-filename-games: no-copyright-file
+I: filename-games: no-md5sums-control-file
+I: filenames: file-in-usr-something-x11-without-pre-depends usr/include/X11/
+I: filenames: no-md5sums-control-file
+I: more-filename-games: no-md5sums-control-file
+W: filename-games: binary-without-manpage usr/bin/test-game
+W: filename-games: no-priority-field
+W: filename-games: package-contains-empty-directory usr/games/
+W: filenames source: ancient-standards-version 3.1.1 (current is 3.8.0)
+W: filenames source: diff-contains-arch-control-dir .arch-ids
+W: filenames source: diff-contains-arch-control-dir {arch}
+W: filenames source: diff-contains-arch-inventory-file files/.arch-inventory
+W: filenames source: diff-contains-bts-control-dir debian/.be
+W: filenames source: diff-contains-bzr-control-dir .bzr
+W: filenames source: diff-contains-cvs-conflict-copy files/.#Maelstrom Sound.1.1.1
+W: filenames source: diff-contains-cvs-control-dir CVS
+W: filenames source: diff-contains-svk-commit-file files/svk-commitsEr9P.tmp
+W: filenames source: diff-contains-svn-commit-file files/svn-commit.tmp
+W: filenames source: diff-contains-svn-conflict-file files/Maelstrom Sounce.r121
+W: filenames source: diff-contains-svn-control-dir .svn
+W: filenames source: no-section-field-for-source
+W: filenames: bad-permissions-for-ali-file usr/lib/ada/adalib/test.ali
+W: filenames: binary-without-manpage usr/X11R6/bin/testxbin2
+W: filenames: binary-without-manpage usr/bin/X11/testxbin
+W: filenames: binary-without-manpage usr/bin/mh/read
+W: filenames: debian-news-file-not-compressed usr/share/doc/filenames/NEWS.Debian
+W: filenames: desktop-file-in-wrong-dir usr/share/gnome/apps/System/foo.desktop
+W: filenames: embedded-javascript-library usr/share/filenames/jquery.js
+W: filenames: embedded-javascript-library usr/share/filenames/jquery.lite.js
+W: filenames: embedded-javascript-library usr/share/filenames/jquery.min.js
+W: filenames: embedded-javascript-library usr/share/filenames/jquery.pack.js
+W: filenames: embedded-javascript-library usr/share/filenames/mochikit.js
+W: filenames: embedded-javascript-library usr/share/filenames/prototype-1.2.3.4.js
+W: filenames: embedded-javascript-library usr/share/filenames/prototype.js
+W: filenames: embedded-javascript-library usr/share/filenames/prototype.js.gz
+W: filenames: embedded-javascript-library usr/share/filenames/scriptaculous.js
+W: filenames: executable-not-elf-or-script ./usr/bin/bin/bad
+W: filenames: executable-not-elf-or-script ./usr/bin/mh/read
+W: filenames: extra-license-file usr/share/pixmaps/COPYING
+W: filenames: extra-license-file usr/share/pixmaps/license.foo
+W: filenames: extra-license-file usr/share/pixmaps/license.txt
+W: filenames: file-in-unusual-dir files/ .tif
+W: filenames: file-in-unusual-dir files/".tif
+W: filenames: file-in-unusual-dir files/'\\ 
+W: filenames: file-in-unusual-dir files/.#Maelstrom Sound.1.1.1
+W: filenames: file-in-unusual-dir files/.arch-inventory
+W: filenames: file-in-unusual-dir files/.cvsignore
+W: filenames: file-in-unusual-dir files/Maelstrom Sounce.r121
+W: filenames: file-in-unusual-dir files/Maelstrom Sound
+W: filenames: file-in-unusual-dir files/Maelstrom Sound.mine
+W: filenames: file-in-unusual-dir files/svk-commitsEr9P.tmp
+W: filenames: file-in-unusual-dir files/svn-commit.tmp
+W: filenames: file-in-unusual-dir srv/foo/bar
+W: filenames: file-in-usr-lib-sgml usr/lib/sgml/package
+W: filenames: file-name-ends-in-whitespace files/'\\ 
+W: filenames: macos-ds-store-file-in-package usr/share/doc/filenames/.DS_Store
+W: filenames: macos-resource-fork-file-in-package usr/share/doc/filenames/._NEWS.Debian
+W: filenames: menu-file-in-usr-lib usr/lib/menu/menu
+W: filenames: no-priority-field
+W: filenames: no-section-field
+W: filenames: non-standard-dir-perm usr/lib/filenames/readonly/ 0555 != 0755
+W: filenames: package-contains-bts-control-dir usr/lib/perl5/.be/
+W: filenames: package-contains-bts-control-dir usr/lib/perl5/.ditrack/
+W: filenames: package-contains-devhelp-file-without-symlink usr/share/doc/filenames/bad-devhelp/c.devhelp.gz
+W: filenames: package-contains-empty-directory usr/lib/perl5/.arch-ids/
+W: filenames: package-contains-empty-directory usr/lib/perl5/.be/
+W: filenames: package-contains-empty-directory usr/lib/perl5/.bzr/
+W: filenames: package-contains-empty-directory usr/lib/perl5/.ditrack/
+W: filenames: package-contains-empty-directory usr/lib/perl5/.svn/
+W: filenames: package-contains-empty-directory usr/lib/perl5/CVS/
+W: filenames: package-contains-empty-directory usr/lib/perl5/{arch}/
+W: filenames: package-contains-linda-override usr/share/linda/overrides/filenames
+W: filenames: package-contains-readme-for-other-platform-or-distro usr/share/doc/filenames/README.macosx
+W: filenames: package-contains-vcs-control-dir usr/lib/perl5/.arch-ids/
+W: filenames: package-contains-vcs-control-dir usr/lib/perl5/.bzr/
+W: filenames: package-contains-vcs-control-dir usr/lib/perl5/.svn/
+W: filenames: package-contains-vcs-control-dir usr/lib/perl5/CVS/
+W: filenames: package-contains-vcs-control-dir usr/lib/perl5/{arch}/
+W: filenames: package-contains-vcs-control-file files/.arch-inventory
+W: filenames: package-contains-vcs-control-file files/.cvsignore
+W: filenames: package-contains-vcs-control-file usr/lib/perl5/foo/.gitignore
+W: filenames: package-contains-vcs-control-file usr/lib/perl5/foo/.hg_archival.txt
+W: filenames: package-contains-vcs-control-file usr/lib/perl5/foo/.hgignore
+W: filenames: package-contains-vcs-control-file usr/lib/perl5/foo/.hgtags
+W: filenames: package-installs-into-etc-gconf-schemas etc/gconf/schemas/test.schema
+W: filenames: package-installs-nonbinary-perl-in-usr-lib-perl5 usr/lib/perl5/foo/ancient.pm
+W: filenames: package-installs-nonbinary-perl-in-usr-lib-perl5 usr/lib/perl5/foo/bar.pm
+W: filenames: svk-commit-file-in-package files/svk-commitsEr9P.tmp
+W: filenames: svn-commit-file-in-package files/svn-commit.tmp
+W: filenames: symlink-is-self-recursive usr/lib/filenames/symlink10wrong ../../..
+W: filenames: symlink-is-self-recursive usr/lib/filenames/symlink5ok+warn ..
+W: filenames: symlink-is-self-recursive usr/lib/filenames/symlink6ok+warn .
+W: filenames: symlink-is-self-recursive usr/lib/filenames/symlink7ok+warn /
+W: filenames: symlink-should-be-relative usr/lib/filenames/symlink3wrong /usr/lib/filenames/symlink2
+W: filenames: windows-thumbnail-database-in-package usr/share/doc/filenames/Thumbs.db
+W: filenames: wrong-name-for-debian-news-file usr/share/doc/filenames/news.debian.gz
+W: filenames: zero-byte-file-in-doc-directory usr/share/doc/filenames/NEWS.Debian
+W: filenames: zero-byte-file-in-doc-directory usr/share/doc/filenames/README.macosx
+W: filenames: zero-byte-file-in-doc-directory usr/share/doc/filenames/examples/very_interesting_example2.gz
+W: filenames: zero-byte-file-in-doc-directory usr/share/doc/filenames/news.debian.gz
+W: more-filename-games: binary-without-manpage usr/bin/another-test-game
+W: more-filename-games: binary-without-manpage usr/games/yet-another-test-game
+W: more-filename-games: package-section-games-but-has-usr-bin
diff --git a/nokia-lintian/testset/tags.foo++ b/nokia-lintian/testset/tags.foo++
new file mode 100644 (file)
index 0000000..3a1ff76
--- /dev/null
@@ -0,0 +1,24 @@
+E: foo++ source: build-info-in-binary-control-file-section Package foo++
+E: foo++ source: debian-control-file-uses-obsolete-national-encoding at line 19
+E: foo++ source: malformed-dm-upload-allowed no
+E: foo++ source: uploader-address-is-on-localhost Jeroen van Wolffelaar<jeroen@localhost.localdomain>
+E: foo++ source: uploader-address-malformed I am afraid of spam and think this helps <no_spam_please AT debian.org>
+E: foo++ source: uploader-address-malformed Marc 'HE' Brockschmidt <he@unknown>
+E: foo++ source: uploader-address-malformed Yama@gotchi
+E: foo++ source: uploader-address-missing Josip
+E: foo++ source: uploader-name-missing Yama@gotchi
+E: foo++ source: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
+E: foo++-helper: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
+E: foo++: debian-changelog-file-contains-debmake-default-email-address he@unknown
+E: foo++: debian-changelog-file-uses-obsolete-national-encoding at line 11
+E: foo++: no-copyright-file
+E: foo++: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
+I: foo++: no-md5sums-control-file
+W: foo++ source: ancient-standards-version 3.1.1 (current is 3.8.0)
+W: foo++ source: debian-watch-file-in-native-package
+W: foo++ source: debian-watch-file-unknown-version 0
+W: foo++ source: uploader-address-looks-weird Jeroen van Wolffelaar<jeroen@localhost.localdomain>
+W: foo++ source: uploader-not-full-name Frank
+W: foo++ source: uploader-not-full-name Josip
+W: foo++: latest-debian-changelog-entry-without-new-date
+W: foo++: readme-debian-contains-debmake-default-email-address
diff --git a/nokia-lintian/testset/tags.libbaz b/nokia-lintian/testset/tags.libbaz
new file mode 100644 (file)
index 0000000..62e9de9
--- /dev/null
@@ -0,0 +1,67 @@
+E: libbaz source: not-binnmuable-any-depends-any libbaz1-dev -> libbaz1
+E: libbaz1-dev: missing-dependency-on-libc needed by ./usr/lib/perl5/auto/Foo/Foo.so
+E: libbaz1: control-file-has-bad-permissions shlibs 0755 != 0644
+E: libbaz1: control-file-has-bad-permissions symbols 0755 != 0644
+E: libbaz1: debian-changelog-file-missing-or-wrong-name
+E: libbaz1: duplicate-entry-in-shlibs-control-file libdoesntexist2 1.0
+E: libbaz1: duplicate-entry-in-shlibs-control-file udeb: libdoesntexist2 1.0
+E: libbaz1: file-directly-in-usr-share-doc usr/share/doc/README.Debian
+E: libbaz1: ldconfig-symlink-missing-for-shlib usr/lib/libbaz2.so.1.0 usr/lib/libfoo2.so.1.0.3b libbaz2.so.1.0
+E: libbaz1: ldconfig-symlink-missing-for-shlib usr/lib/libbaz3.so.1 usr/lib/libbaz3.so.1.0.3b libbaz3.so.1
+E: libbaz1: maintainer-shell-script-fails-syntax-check postinst
+E: libbaz1: missing-dependency-on-perlapi
+E: libbaz1: postinst-must-call-ldconfig usr/lib/libfoo2.so.1.0.3b
+E: libbaz1: sharedobject-in-library-directory-missing-soname usr/lib/libbaz1.so.1.0.3b
+E: libbaz1: shlib-missing-in-control-file libbaz2 1.0 for usr/lib/libfoo2.so.1.0.3b
+E: libbaz1: shlib-with-executable-bit usr/lib/libfoo2.so.1.0.3b 0755
+E: libbaz1: shlib-with-non-pic-code usr/lib/libbaz3.so.1.0.3b
+E: libbaz1: symbols-declared-but-not-shlib libbaz 2
+E: libbaz1: symbols-file-contains-current-version-with-debian-revision on symbol pw
+E: libbaz1: unstripped-binary-or-object ./usr/lib/libbaz1.so.1.0.3b
+E: libbaz1: unstripped-binary-or-object ./usr/lib/libbaz3.so.1.0.3b
+E: libbaz1: unstripped-binary-or-object ./usr/lib/libfoo2.so.1.0.3b
+E: libbaz2-dbg: debian-changelog-file-missing
+E: libbaz2-dev: debian-changelog-file-missing-or-wrong-name
+E: libbaz2: debian-changelog-file-missing-or-wrong-name
+I: ia32-libbaz2: no-symbols-control-file usr/lib/i486-linux-gnu/libbaz2.so.1.0.3b
+I: libbaz source: package-lacks-versioned-build-depends-on-debhelper 5
+I: libbaz1-dev: binary-has-unneeded-section ./usr/lib/perl5/auto/Foo/Foo.so .comment
+I: libbaz1-dev: no-md5sums-control-file
+I: libbaz1: binary-has-unneeded-section ./usr/lib/perl5/auto/Foo/Foo.so .comment
+I: libbaz1: no-md5sums-control-file
+I: libbaz2-dbg: no-md5sums-control-file
+I: libbaz2-dev: no-md5sums-control-file
+I: libbaz2: no-md5sums-control-file
+I: libbaz2: no-symbols-control-file usr/lib/libbaz2.so.1.0.3b
+N: 4 tags overridden (4 warnings)
+W: ia32-libbaz2: new-package-should-close-itp-bug
+W: libbaz source: ancient-standards-version 3.2.1 (current is 3.8.0)
+W: libbaz source: changelog-should-mention-nmu
+W: libbaz source: native-package-with-dash-version
+W: libbaz source: source-nmu-has-incorrect-version-number 1-1
+W: libbaz source: substvar-source-version-is-deprecated libbaz2-dev
+W: libbaz1-dev: dev-package-should-be-section-libdevel libbaz1-dev
+W: libbaz1-dev: package-contains-empty-directory usr/include/
+W: libbaz1: missing-depends-line
+W: libbaz1: new-package-should-close-itp-bug
+W: libbaz1: package-name-doesnt-match-sonames libbaz2-1.0 libbaz3-1
+W: libbaz1: postinst-should-not-set-usr-doc-link
+W: libbaz1: shlib-missing-in-symbols-control-file libbaz2 1.0 for usr/lib/libfoo2.so.1.0.3b
+W: libbaz1: shlib-missing-in-symbols-control-file libbaz3 1 for usr/lib/libbaz3.so.1.0.3b
+W: libbaz1: shlibs-declares-dependency-on-other-package libbaz1 (>> 1-1)
+W: libbaz1: shlibs-declares-dependency-on-other-package libbaz2
+W: libbaz1: symbols-file-contains-debian-revision on symbol pw and 1 others
+W: libbaz1: unused-shlib-entry-in-control-file libbaz2 1.1
+W: libbaz1: unused-shlib-entry-in-control-file libbaz4 1
+W: libbaz1: unused-shlib-entry-in-control-file libbaz5 1
+W: libbaz1: unused-shlib-entry-in-control-file libdoesntexist2 1.0
+W: libbaz1: unused-shlib-entry-in-control-file udeb: libdoesntexist2 1.0
+W: libbaz1: unused-shlib-entry-in-symbols-control-file libbaz 2
+W: libbaz1: zero-byte-file-in-doc-directory usr/share/doc/README.Debian
+W: libbaz2-dbg: debug-package-should-be-priority-extra libbaz2-dbg
+W: libbaz2-dev: changelog-file-not-compressed changelog
+W: libbaz2-dev: dev-package-should-be-section-libdevel libbaz2-dev
+W: libbaz2-dev: new-package-should-close-itp-bug
+W: libbaz2: debian-changelog-file-is-a-symlink
+W: libbaz2: package-name-doesnt-match-sonames libbaz2-1.0
+W: libbaz2: symlink-should-be-relative usr/share/doc/libbaz2/changelog.gz /usr/share/doc/lintian/changelog.gz
diff --git a/nokia-lintian/testset/tags.maintainer-scripts b/nokia-lintian/testset/tags.maintainer-scripts
new file mode 100644 (file)
index 0000000..80cc1b6
--- /dev/null
@@ -0,0 +1,152 @@
+E: maintainer-scripts source: malformed-dm-upload-allowed Yes
+E: maintainer-scripts source: orphaned-package-should-not-have-uploaders
+E: maintainer-scripts source: wrong-debian-qa-group-name QA group <packages@qa.debian.org>
+E: maintainer-scripts: control-file-has-bad-permissions config 0644 != 0755
+E: maintainer-scripts: debconf-config-not-executable
+E: maintainer-scripts: debian-changelog-file-contains-invalid-email-address jeroen@mordor
+E: maintainer-scripts: forbidden-config-interpreter #!/usr/bin/python
+E: maintainer-scripts: init.d-script-not-included-in-package /etc/init.d/foo
+E: maintainer-scripts: install-sgmlcatalog-deprecated postinst:100
+E: maintainer-scripts: install-sgmlcatalog-deprecated postrm:46
+E: maintainer-scripts: interpreter-without-predep control/config #!/usr/bin/python
+E: maintainer-scripts: maintainer-script-calls-init-script-directly prerm:55
+E: maintainer-scripts: maintainer-script-does-not-check-for-existence-of-wm-menu-config postinst:33
+E: maintainer-scripts: maintainer-script-modifies-inetd-conf postinst:93
+E: maintainer-scripts: maintainer-script-modifies-inetd-conf postinst:94
+E: maintainer-scripts: maintainer-script-modifies-netbase-managed-file postinst:85 /etc/services
+E: maintainer-scripts: maintainer-script-modifies-netbase-managed-file postinst:86 /etc/protocols
+E: maintainer-scripts: maintainer-script-modifies-netbase-managed-file postinst:87 /etc/rpc
+E: maintainer-scripts: maintainer-script-removes-device-files postrm:39
+E: maintainer-scripts: maintainer-script-removes-device-files postrm:40
+E: maintainer-scripts: maintainer-script-uses-dpkg-status-directly postinst
+E: maintainer-scripts: maintainer-shell-script-fails-syntax-check prerm
+E: maintainer-scripts: no-copyright-file
+E: maintainer-scripts: postrm-contains-additional-updaterc.d-calls /etc/init.d/bar
+E: maintainer-scripts: postrm-does-not-call-updaterc.d-for-init.d-script /etc/init.d/foo
+E: maintainer-scripts: preinst-calls-updaterc.d bar
+E: maintainer-scripts: prerm-calls-updaterc.d foo
+E: maintainer-scripts: wrong-debian-qa-group-name QA group <packages@qa.debian.org>
+I: maintainer-scripts: no-md5sums-control-file
+I: maintainer-scripts: output-of-updaterc.d-not-redirected-to-dev-null bar postrm
+W: maintainer-scripts source: ancient-standards-version 3.1.1 (current is 3.8.0)
+W: maintainer-scripts source: changelog-should-mention-qa
+W: maintainer-scripts source: debian-watch-file-in-native-package
+W: maintainer-scripts source: debian-watch-file-should-mangle-version
+W: maintainer-scripts source: debian-watch-file-unknown-version 4
+W: maintainer-scripts source: package-uses-deprecated-debhelper-compat-version 1
+W: maintainer-scripts source: qa-upload-has-incorrect-version-number 7+dfsg-0.1
+W: maintainer-scripts: ancient-dpkg-epoch-check preinst:8
+W: maintainer-scripts: ancient-dpkg-long-filenames-check preinst:9
+W: maintainer-scripts: ancient-dpkg-multi-conrep-check preinst:10
+W: maintainer-scripts: ancient-dpkg-predepends-check preinst:7
+W: maintainer-scripts: config-does-not-load-confmodule
+W: maintainer-scripts: deprecated-chown-usage postinst:167 'chown -R root.root'
+W: maintainer-scripts: deprecated-chown-usage postinst:35 'chown root.root'
+W: maintainer-scripts: gconftool-used-in-maintainer-script postinst:70
+W: maintainer-scripts: info-documents-not-removed
+W: maintainer-scripts: init.d-script-not-marked-as-conffile /etc/init.d/foo
+W: maintainer-scripts: maintainer-script-calls-deprecated-wm-menu-config postinst:33
+W: maintainer-scripts: maintainer-script-empty config
+W: maintainer-scripts: maintainer-script-hides-init-failure postinst:57
+W: maintainer-scripts: maintainer-script-needs-depends-on-gconf2 postinst
+W: maintainer-scripts: maintainer-script-needs-depends-on-ucf postinst
+W: maintainer-scripts: maintainer-script-needs-depends-on-xml-core postinst
+W: maintainer-scripts: missing-debconf-dependency
+W: maintainer-scripts: no-debconf-templates
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:110 '${H[@]}'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:145 'echo -e'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:146 '${!foo}'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:148 'select foo'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:151 '    exec -l'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:152 '    exec -c'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:153 '    exec -a'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:155 'let '
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:156 'test -a'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:157 '$RANDOM'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:16 '. /usr/share/lintian/shell foo'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:17 '. "$(dirname $0)/shell"'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:20 'read'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:22 'H[0]='
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:23 '${H[0]}'
+W: maintainer-scripts: possible-bashism-in-maintainer-script postinst:25 '${H[@]}'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:102 '  echo "abc\nxyz"'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:103 '  echo 'xyz\rabc''
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:106 '  echo -e'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:107 '  echo -ne'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:108 '  echo -e'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:111 'foobar.() {'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:112 '  suspend '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:114 '  caller '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:115 '  complete '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:116 '  compgen '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:117 '  declare '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:120 '.foobar() {'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:121 '  typeset '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:122 '  disown '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:123 '  builtin '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:124 '  set -B'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:125 '  alias -p'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:126 '  unalias -a'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:131 'ulimit'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:132 'shopt'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:133 'type '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:134 'time '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:135 'dirs'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:136 ' <(tac a)'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:138 'pushd'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:140 'local foo='
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:141 'local -x'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:143 'popd'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:145 'readonly -f'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:147 '/dev/tcp'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:149 'export -x'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:153 'sh -D'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:154 'sh --foo'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:155 'sh +O'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:158 ' {a,b}'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:166 ' foo.bar()'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:171 'foobar@()    '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:19 '[ "$2" == '
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:23 'function foo('
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:26 '&>'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:29 'source $FOO'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:31 'trap "echo hi" EXIT HUP 3'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:33 '[['
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:34 '    kill -HUP'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:52 '${line:3:1}'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:62 'read -x foo'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:63 'read -x'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:66 'read'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:68 'echo "a\\b"'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:69 'echo 'a\nb''
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:71 '${UID'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:72 '$EUID'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:73 '$SHLVL'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:74 '$DIRSTACK'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:75 '$SECONDS'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:77 '$BASH_FOO'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:78 '$SHELLOPTS'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:79 '$PIPESTATUS'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:81 '<<<'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:84 'VAR+='
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:87 '  echo -n -e'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:88 '  echo -e'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:89 '  echo -en'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:90 '  echo -ne'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:95 'ech.os() {'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:97 '>&bar'
+W: maintainer-scripts: possible-bashism-in-maintainer-script prerm:98 '>& bar'
+W: maintainer-scripts: possibly-insecure-handling-of-tmp-files-in-maintainer-script postinst:52
+W: maintainer-scripts: possibly-insecure-handling-of-tmp-files-in-maintainer-script postrm:39
+W: maintainer-scripts: postinst-does-not-load-confmodule
+W: maintainer-scripts: postinst-should-not-set-usr-doc-link
+W: maintainer-scripts: postrm-does-not-purge-debconf
+W: maintainer-scripts: postrm-has-useless-call-to-ldconfig
+W: maintainer-scripts: read-in-maintainer-script postinst:20
+W: maintainer-scripts: read-in-maintainer-script prerm:62
+W: maintainer-scripts: read-in-maintainer-script prerm:63
+W: maintainer-scripts: read-in-maintainer-script prerm:64
+W: maintainer-scripts: read-in-maintainer-script prerm:65
+W: maintainer-scripts: read-in-maintainer-script prerm:66
+W: maintainer-scripts: start-stop-daemon-in-maintainer-script postinst:161
+W: maintainer-scripts: update-alternatives-remove-called-in-postrm
diff --git a/nokia-lintian/testset/tags.manpages b/nokia-lintian/testset/tags.manpages
new file mode 100644 (file)
index 0000000..f975ba6
--- /dev/null
@@ -0,0 +1,69 @@
+E: manpages: bad-link-to-undocumented-manpage usr/share/man/man1/sbin-binary.1.gz
+E: manpages: empty-manual-page usr/X11R6/man/man1/rstartd.1x.gz
+E: manpages: empty-manual-page usr/X11R6/man/man6/X11R6-binary.man
+E: manpages: empty-manual-page usr/share/man/de/man1/binary-without-english-manpage.1
+E: manpages: empty-manual-page usr/share/man/man1/usr-bin-binary-alt.1.gz
+E: manpages: empty-manual-page usr/share/man/man1/usr-bin-binary.1
+E: manpages: empty-manual-page usr/share/man/man1/usr-sbin-binary.1.gz
+E: manpages: empty-manual-page usr/share/man/man6/usr-games-binary.6.gz
+E: manpages: executable-manpage usr/share/man/de/man1/binary-without-english-manpage.1
+E: manpages: info-document-not-compressed usr/share/info/broken
+E: manpages: info-document-not-compressed-with-gzip usr/share/info/baz.broken.gz
+E: manpages: info-document-not-compressed-with-max-compression usr/share/info/bar.gz
+E: manpages: malformed-override but-this-is-just-broken!
+E: manpages: malformed-override manpages:
+E: manpages: manpage-has-wrong-extension usr/X11R6/man/man6/X11R6-binary.man
+E: manpages: manpage-is-dh_make-template usr/share/man/man1/program.1.gz
+E: manpages: manpage-not-compressed usr/X11R6/man/man6/X11R6-binary.man
+E: manpages: manpage-not-compressed usr/share/man/de/man1/binary-without-english-manpage.1
+E: manpages: manpage-not-compressed usr/share/man/man1/usr-bin-binary.1
+E: manpages: manpage-not-compressed-with-gzip usr/X11R6/man/man1/rstartd.1x.gz
+E: manpages: manpage-not-compressed-with-gzip usr/share/man/man1/usr-bin-binary-alt.1.gz
+E: manpages: manpage-not-compressed-with-gzip usr/share/man/man1/usr-sbin-binary.1.gz
+E: manpages: manpage-not-compressed-with-max-compression usr/share/man/man6/usr-games-binary.6.gz
+E: manpages: package-installs-file-to-usr-x11r6 usr/X11R6/
+E: manpages: package-installs-file-to-usr-x11r6 usr/X11R6/man/
+E: manpages: package-installs-file-to-usr-x11r6 usr/X11R6/man/man1/
+E: manpages: package-installs-file-to-usr-x11r6 usr/X11R6/man/man1/rstartd.1x.gz
+E: manpages: package-installs-file-to-usr-x11r6 usr/X11R6/man/man6/
+E: manpages: package-installs-file-to-usr-x11r6 usr/X11R6/man/man6/X11R6-binary.man
+E: manpages: package-installs-file-to-usr-x11r6-bin usr/X11R6/bin/
+E: manpages: package-installs-file-to-usr-x11r6-bin usr/X11R6/bin/rstartd
+E: manpages: stray-directory-in-manpage-directory usr/share/man/man1/not-a-man-page.1.gz/
+E: manpages: subdir-in-usr-bin usr/bin/bin/
+E: manpages: x11-games-should-be-in-usr-games usr/X11R6/man/man6/X11R6-binary.man
+I: manpages: hyphen-used-as-minus-sign usr/share/man/man3/include.3.gz:11
+I: manpages: hyphen-used-as-minus-sign usr/share/man/man3/include.3.gz:12
+I: manpages: hyphen-used-as-minus-sign usr/share/man/man3/include.3.gz:13
+I: manpages: hyphen-used-as-minus-sign usr/share/man/man3/include.3.gz:14
+I: manpages: hyphen-used-as-minus-sign usr/share/man/man3/include.3.gz:9
+I: manpages: unused-override foo-tag-that-does-not-exist
+N: 2 tags overridden (1 error, 1 info)
+W: manpages source: ancient-standards-version 3.2.1 (current is 3.8.0)
+W: manpages source: binary-nmu-debian-revision-in-source 4-0.0.1
+W: manpages source: changelog-should-mention-nmu
+W: manpages source: source-nmu-has-incorrect-version-number 4-0.0.1
+W: manpages: binary-nmu-uses-old-version-style 4-0.0.1
+W: manpages: binary-without-english-manpage usr/bin/binary-without-english-manpage
+W: manpages: executable-not-elf-or-script ./usr/bin/bin/bad
+W: manpages: executable-not-elf-or-script ./usr/bin/binary-without-english-manpage
+W: manpages: executable-not-elf-or-script ./usr/bin/usr-bin-binary-alt
+W: manpages: executable-not-elf-or-script ./usr/sbin/usr-sbin-binary
+W: manpages: executable-not-elf-or-script ./usr/share/man/de/man1/binary-without-english-manpage.1
+W: manpages: info-document-has-wrong-extension usr/share/info/baz.broken.gz
+W: manpages: info-document-missing-dir-section usr/share/info/bar.gz
+W: manpages: info-documents-not-removed
+W: manpages: install-info-not-called-with-quiet-option
+W: manpages: link-to-undocumented-manpage usr/share/man/man1/bin-binary.1.gz
+W: manpages: link-to-undocumented-manpage usr/share/man/man3/function.3.gz
+W: manpages: manpage-has-bad-whatis-entry usr/X11R6/man/man1/rstartd.1x.gz
+W: manpages: manpage-has-bad-whatis-entry usr/X11R6/man/man6/X11R6-binary.man
+W: manpages: manpage-has-bad-whatis-entry usr/share/man/man1/usr-bin-binary-alt.1.gz
+W: manpages: manpage-has-bad-whatis-entry usr/share/man/man1/usr-bin-binary.1
+W: manpages: manpage-has-bad-whatis-entry usr/share/man/man1/usr-sbin-binary.1.gz
+W: manpages: manpage-has-bad-whatis-entry usr/share/man/man6/usr-games-binary.6.gz
+W: manpages: manpage-has-errors-from-man usr/share/man/man1/test.1p.gz 12: warning: `dep' not defined (probable missing space after `de')
+W: manpages: manpage-has-errors-from-man usr/share/man/man3/included.3.gz 6: warning: `zY' not defined
+W: manpages: manpage-has-useless-whatis-entry usr/share/man/man1/true.1.gz
+W: manpages: manpage-locale-dir-country-specific usr/share/man/de_DE/man1/test-utf8-chars.1p.gz
+W: manpages: package-contains-empty-directory usr/share/man/man1/not-a-man-page.1.gz/
diff --git a/nokia-lintian/testset/tags.non-us b/nokia-lintian/testset/tags.non-us
new file mode 100644 (file)
index 0000000..7868cd0
--- /dev/null
@@ -0,0 +1,13 @@
+E: broken-crypto: no-copyright-file
+E: crypto-app: changelog-file-missing-in-native-package
+E: non-us source: section-category-mismatch Package broken-crypto
+E: non-us source: section-category-mismatch Package nonfree-crypto-app
+E: nonfree-crypto-app: no-copyright-file
+E: patented-app: no-copyright-file
+I: crypto-app: no-md5sums-control-file
+I: patented-app: no-md5sums-control-file
+I: patented-app: non-us-spelling
+W: broken-crypto: unknown-section non-US/admin
+W: non-us source: ancient-standards-version 3.1.1 (current is 3.8.0)
+W: non-us source: no-section-field-for-source
+W: patented-app: latest-debian-changelog-entry-without-new-version
diff --git a/nokia-lintian/testset/tags.relations b/nokia-lintian/testset/tags.relations
new file mode 100644 (file)
index 0000000..78aefeb
--- /dev/null
@@ -0,0 +1,69 @@
+E: relations source: build-conflicts-with-build-dependency bar [alpha test]
+E: relations source: build-conflicts-with-build-dependency debmake [!powerpc]
+E: relations source: build-depends-on-build-essential build-depends-indep
+E: relations source: build-depends-on-essential-package-without-using-version build-depends-indep: bash
+E: relations source: build-depends-on-essential-package-without-using-version build-depends: findutils
+E: relations source: build-depends-on-obsolete-package build-depends-indep: debmake
+E: relations source: build-depends-on-obsolete-package build-depends-indep: gs
+E: relations source: depends-on-build-essential-package-without-using-version libc6-dev [build-depends: libc6-dev]
+E: relations source: depends-on-build-essential-package-without-using-version make [build-depends-indep: make]
+E: relations source: invalid-arch-string-in-source-relation test [build-conflicts: bar [alpha test]]
+E: relations source: missing-build-dependency libmodule-build-perl
+E: relations source: section-category-mismatch Package relations-multiple-libs
+E: relations-multiple-libs: conflicts-with-dependency depends libpng2
+E: relations-multiple-libs: depends-on-obsolete-package recommends: gs
+E: relations-multiple-libs: depends-on-obsolete-package recommends: gs-gpl
+E: relations-multiple-libs: depends-on-obsolete-package suggests: x-dev
+E: relations-multiple-libs: description-synopsis-is-duplicated
+E: relations-multiple-libs: package-depends-on-multiple-libpng-versions libpng2 libpng3
+E: relations-multiple-libs: package-depends-on-multiple-libstdc-versions libstdc++2.10 libstdc++2.10-glibc2.2 libstdc++3.0
+E: relations-multiple-libs: package-depends-on-multiple-tcl-versions tcl8.0 tcl8.2
+E: relations-multiple-libs: package-depends-on-multiple-tk-versions tk8.2 tk8.3
+E: relations-multiple-libs: package-depends-on-multiple-tkx-versions tkx8.2 tkx8.3
+E: relations-multiple-libs: usr-share-doc-symlink-without-dependency relations
+E: relations: bad-version-in-relation conflicts: foobar (<< 5&5)
+E: relations: conflicts-with-dependency depends foo
+E: relations: conflicts-with-dependency depends relations
+E: relations: depends-on-essential-package-without-using-version depends: coreutils
+E: relations: depends-on-essential-package-without-using-version depends: dpkg
+E: relations: depends-on-obsolete-package recommends: gs
+E: relations: needlessly-depends-on-awk pre-depends
+E: relations: no-copyright-file
+I: relations source: build-depends-without-arch-dep arch-test1
+I: relations source: build-depends-without-arch-dep arch-test2
+I: relations source: build-depends-without-arch-dep bar
+I: relations source: build-depends-without-arch-dep findutils
+I: relations source: build-depends-without-arch-dep foo
+I: relations source: build-depends-without-arch-dep libc6-dev
+I: relations source: build-depends-without-arch-dep mail-transport-agent
+I: relations-multiple-libs: ored-depends-on-obsolete-package suggests: gs
+I: relations: ored-depends-on-obsolete-package recommends: gs-aladdin
+W: relations source: bad-homepage lintian.debian.org
+W: relations source: build-depends-on-1-revision build-depends-indep: libfoo (>= 1.2-1)
+W: relations source: package-depends-on-itself relations depends
+W: relations source: package-depends-on-itself relations-multiple-libs recommends
+W: relations source: package-has-a-duplicate-build-relation foo (= 3) [!amd64 !i386], foo (<< 4) [!amd64 !i386]
+W: relations source: package-has-a-duplicate-build-relation perl, perl (>= 5.0)
+W: relations source: quilt-build-dep-but-no-series-file relations
+W: relations source: redundant-origin-field
+W: relations source: stronger-dependency-implies-weaker relations depends -> recommends dpkg
+W: relations source: stronger-dependency-implies-weaker relations depends -> recommends null
+W: relations source: stronger-dependency-implies-weaker relations pre-depends -> depends gawk | awk
+W: relations source: stronger-dependency-implies-weaker relations recommends -> suggests some-other-package
+W: relations source: stronger-dependency-implies-weaker relations-multiple-libs depends -> recommends ${shlibs:Depends}
+W: relations source: timewarp-standards-version (2007-12-02 < 2007-12-03)
+W: relations source: virtual-package-depends-without-real-package-depends build-depends: mail-transport-agent
+W: relations-multiple-libs: bad-homepage lintian.debian.org
+W: relations-multiple-libs: breaks-without-version libpng2
+W: relations-multiple-libs: description-synopsis-might-not-be-phrased-properly
+W: relations-multiple-libs: package-uses-breaks
+W: relations-multiple-libs: redundant-bugs-field
+W: relations-multiple-libs: redundant-origin-field
+W: relations: bad-homepage lintian.debian.org
+W: relations: depends-on-old-emacs recommends: emacs21
+W: relations: package-relation-with-self depends: relations (<< 3)
+W: relations: package-relation-with-self replaces: relations
+W: relations: redundant-bugs-field
+W: relations: redundant-origin-field
+W: relations: virtual-package-depends-without-real-package-depends depends: mail-transport-agent
+W: relations: virtual-package-depends-without-real-package-depends pre-depends: awk
diff --git a/nokia-lintian/testset/tags.scripts b/nokia-lintian/testset/tags.scripts
new file mode 100644 (file)
index 0000000..ae381e3
--- /dev/null
@@ -0,0 +1,73 @@
+E: scripts source: dpatch-index-references-non-existent-patch 01_not_here_right_now.dpatch
+E: scripts source: dpatch-index-references-non-existent-patch 01_some_other_patch_thats_not_in_the_package.dpatch
+E: scripts source: package-uses-debhelper-but-lacks-build-depends
+E: scripts: calls-suidperl-directly ./usr/bin/suidperlfoo
+E: scripts: copyright-file-lacks-pointer-to-perl-license
+E: scripts: duplicate-updaterc.d-calls-in-postrm lsb-other
+E: scripts: init.d-script-does-not-implement-required-option /etc/init.d/lsb-broken force-reload
+E: scripts: init.d-script-does-not-implement-required-option /etc/init.d/lsb-broken restart
+E: scripts: init.d-script-has-duplicate-lsb-section /etc/init.d/lsb-broken
+E: scripts: init.d-script-has-unterminated-lsb-section /etc/init.d/lsb-broken:15
+E: scripts: missing-dep-for-interpreter lefty => graphviz (./usr/bin/lefty-foo)
+E: scripts: php-script-but-no-phpX-cli-dep ./usr/share/scripts/php5foo
+E: scripts: php-script-but-no-phpX-cli-dep ./usr/share/scripts/phpfoo
+E: scripts: python-script-but-no-python-dep ./usr/bin/py2foo
+E: scripts: python-script-but-no-python-dep ./usr/bin/pyfoo
+E: scripts: shell-script-fails-syntax-check ./usr/bin/sh-broken
+E: scripts: suid-perl-script-but-no-perl-suid-dep ./usr/bin/suidperlfoo2
+E: scripts: wrong-path-for-interpreter #!/bin/ruby1.8 != /usr/bin/ruby1.8 (./usr/bin/rubyfoo)
+E: scripts: wrong-path-for-interpreter #!/usr/local/bin/lefty != /usr/bin/lefty (./usr/bin/lefty-foo)
+E: scripts_6ds-1ubuntu0.5.10.1_i386.changes: bad-ubuntu-distribution-in-changes-file unstable
+I: scripts source: debian-watch-file-should-dversionmangle-not-uversionmangle
+I: scripts: init.d-script-missing-lsb-short-description /etc/init.d/lsb-other
+I: scripts: no-md5sums-control-file
+W: scripts source: ancient-standards-version 3.2.1 (current is 3.8.0)
+W: scripts source: binary-arch-rules-but-pkg-is-arch-indep
+W: scripts source: debian-watch-file-uses-deprecated-sf-redirector-method
+W: scripts source: dpatch-missing-description 02_i_dont_have_a_description.patch
+W: scripts source: maintainer-script-lacks-debhelper-token debian/postinst
+W: scripts source: maintainer-script-lacks-debhelper-token debian/postrm
+W: scripts source: package-uses-deprecated-debhelper-compat-version 1
+W: scripts source: uses-dh-python-with-no-pycompat
+W: scripts: binary-without-manpage usr/bin/envfoo
+W: scripts: binary-without-manpage usr/bin/guile-bizarre
+W: scripts: binary-without-manpage usr/bin/jruby-broken
+W: scripts: binary-without-manpage usr/bin/lefty-foo
+W: scripts: binary-without-manpage usr/bin/make-foo
+W: scripts: binary-without-manpage usr/bin/perl-bizarre-1
+W: scripts: binary-without-manpage usr/bin/perl-bizarre-2
+W: scripts: binary-without-manpage usr/bin/perl-bizarre-3
+W: scripts: binary-without-manpage usr/bin/perlfoo
+W: scripts: binary-without-manpage usr/bin/py2foo
+W: scripts: binary-without-manpage usr/bin/pyfoo
+W: scripts: binary-without-manpage usr/bin/rubyfoo
+W: scripts: binary-without-manpage usr/bin/sh-broken
+W: scripts: binary-without-manpage usr/bin/suidperlfoo
+W: scripts: binary-without-manpage usr/bin/suidperlfoo2
+W: scripts: binary-without-manpage usr/bin/test.sh
+W: scripts: binary-without-manpage usr/bin/tkfoo
+W: scripts: binary-without-manpage usr/bin/wishfoo
+W: scripts: control-file-is-empty prerm
+W: scripts: executable-is-not-world-readable usr/bin/guile-bizarre 0705 != 0755
+W: scripts: executable-is-not-world-readable usr/bin/perl-bizarre-2 0750 != 0755
+W: scripts: executable-is-not-world-readable usr/bin/suidperlfoo2 4751
+W: scripts: executable-not-elf-or-script ./usr/bin/perl-bizarre-3
+W: scripts: init-d-script-stops-in-s-runlevel /etc/init.d/lsb-broken
+W: scripts: init-d-script-stops-in-s-runlevel /etc/init.d/skeleton
+W: scripts: init.d-script-has-bad-lsb-line /etc/init.d/lsb-broken:4
+W: scripts: init.d-script-has-bad-lsb-line /etc/init.d/lsb-broken:9
+W: scripts: init.d-script-has-bad-stop-runlevel /etc/init.d/lsb-broken X
+W: scripts: init.d-script-has-conflicting-start-stop /etc/init.d/lsb-broken 1
+W: scripts: init.d-script-has-unknown-lsb-keyword /etc/init.d/lsb-broken:14 foo
+W: scripts: init.d-script-missing-lsb-keyword /etc/init.d/lsb-broken required-start
+W: scripts: init.d-script-missing-lsb-section /etc/init.d/no-lsb
+W: scripts: init.d-script-not-marked-as-conffile /etc/init.d/skeleton
+W: scripts: maintainer-script-empty preinst
+W: scripts: non-standard-executable-perm usr/bin/perl-bizarre-3 0754 != 0755
+W: scripts: non-standard-setuid-executable-perm usr/bin/suidperlfoo 4555
+W: scripts: package-installs-python-pyc usr/lib/python2.3/site-packages/test.pyc
+W: scripts: script-uses-bin-env ./usr/bin/envfoo
+W: scripts: script-with-language-extension usr/bin/test.sh
+W: scripts: setuid-binary usr/bin/suidperlfoo 4555 root/root
+W: scripts: setuid-binary usr/bin/suidperlfoo2 4751 root/root
+W: scripts: unusual-interpreter ./usr/bin/jruby-broken #!/usr/bin/jruby
diff --git a/nokia-lintian/unpack/list-binpkg b/nokia-lintian/unpack/list-binpkg
new file mode 100755 (executable)
index 0000000..2b86596
--- /dev/null
@@ -0,0 +1,200 @@
+#!/usr/bin/perl -w
+# list-binpkg -- lintian helper script
+
+# Copyright (C) 1998 Christian Schwarz
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+# turn file buffering off:
+$| = 1;
+
+# parse command line options
+if ($#ARGV == -1) {
+    print "list-binpkg [-v] <output-list-file>\n";
+    print "options:\n";
+    print "   -v  verbose\n";
+    exit 0;
+}
+
+my $verbose = 0;
+my $output_file = undef;
+my $pkgdata = undef; # WTF?
+
+while (my $arg = shift) {
+    if ($arg =~ s,^-,,o) {
+       if ($arg eq 'v') {
+           $verbose = 1;
+       } else {
+           print STDERR "error: unknown command line argument: $arg\n";
+           exit 1;
+       }
+    } else {
+       if ($output_file) {
+           print STDERR "error: too many command line arguments: $arg\n";
+           exit 1;
+       }
+       $output_file = $arg;
+    }
+}
+
+unless ($output_file) {
+    print STDERR "error: no output file specified\n";
+    exit 1;
+}
+
+# import perl libraries
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Read_pkglists;
+use vars qw(%binary_info $BINLIST_FORMAT); # from the above
+use Pipeline;
+use Util;
+
+# get variables out of environment
+my $LINTIAN_ARCHIVEDIR = $ENV{'LINTIAN_ARCHIVEDIR'};
+my $LINTIAN_DIST = $ENV{'LINTIAN_DIST'};
+my $LINTIAN_ARCH = $ENV{'LINTIAN_ARCH'};
+my $LINTIAN_SECTION = $ENV{'LINTIAN_SECTION'};
+my $LINTIAN_LAB = $ENV{'LINTIAN_LAB'};
+
+# read old list file (this command does nothing if the file does not exist)
+read_bin_list($output_file,1);
+
+my %pkgfile;
+# map filenames to package names
+for my $pkg (keys %binary_info) {
+    $pkgfile{$binary_info{$pkg}->{'file'}} = $pkg;
+}
+
+# open output file
+open(OUT, '>', $output_file)
+    or fail("cannot open list file $output_file for writing: $!");
+print OUT "$BINLIST_FORMAT\n";
+
+# parse Packages file to get list of packages
+my $packages = "$LINTIAN_ARCHIVEDIR/dists/$LINTIAN_DIST/$LINTIAN_SECTION/".
+               "binary-$LINTIAN_ARCH/Packages";
+if (-e $packages) {
+       print "N: Parsing $packages ...\n" if $verbose;
+       open(IN, '<', $packages) or fail("cannot open Packages file $packages: $!");
+} elsif (-e "$packages.gz") {
+       print "N: Parsing $packages.gz ...\n" if $verbose;
+       open (IN, '-|', 'gzip', '-dc', "$packages.gz")
+           or fail("cannot open Packages file $packages.gz: $!");
+} else {
+       fail("No packages file $packages");
+}
+
+my $line;
+my %packages;
+my $total = 0;
+
+while (!eof(IN)) {
+    do { $line = <IN> } until ($line =~ m/^Architecture: (.*)$/m);
+    my $arch = $1;
+    do { $line = <IN> } until ($line =~ m/^Filename: (.*)$/m);
+    my $deb_file = $1;
+    do { $line = <IN> } until ($line =~ m/^\s*$/m);
+
+    my @stat;
+    # get timestamp...
+    unless (@stat = stat "$LINTIAN_ARCHIVEDIR/$deb_file") {
+       print "E: general: cannot stat $LINTIAN_ARCHIVEDIR/$deb_file\n";
+       next;
+    }
+    my $timestamp = $stat[9];
+    my ($status, $pkg, $data);
+
+    # was package already included in last list?
+    if (exists $pkgfile{$deb_file}) {
+       # yes!
+       $pkg = $pkgfile{$deb_file};
+       $data = $binary_info{$pkg};
+
+       # file changed since last run?
+       if ($timestamp == $data->{'timestamp'}) {
+           # no.
+           $status = 'unchanged';
+       } else {
+           $status = 'changed';
+           delete $binary_info{$pkg};
+       }
+    } else {
+       # new package, get info
+       $status = 'new';
+    }
+
+    if (($status eq 'new') or ($status eq 'changed')) {
+       if (defined $pkgdata) {
+           # avoid collecting the info twice
+           $data = $pkgdata;
+       } else {
+           $data = &safe_get_deb_info($deb_file);
+       }
+       next if not defined $data;
+       $pkg = $data->{'package'};
+    }
+
+    # check for duplicates
+    if (exists $packages{$pkg}) {
+       print "E: general: duplicate-binary-package $pkg\n";
+       next;
+    }
+
+    # write entry to output file
+    print OUT join(';',
+                  $pkg,
+                  $data->{'version'},
+                  $data->{'source'},
+                  $deb_file,
+                  $timestamp,
+                  ),"\n";
+    printf "N: Listed %s binary package %s %s\n",$status,$pkg,$data->{'version'} if $verbose;
+
+    # remove record from hash
+    delete $binary_info{$pkg} if $status eq 'unchanged';
+    $packages{$pkg} = 1;
+    $total++;
+}
+close(IN) or fail("cannot close input pipe: $!");
+close(OUT) or fail("cannot close output pipe: $!");
+
+if ($verbose) {
+    # all packages that are still included in %binary_info have disappeared from the archive...
+    for my $pkg (sort keys %binary_info) {
+       print "N: Removed binary package $pkg from list\n";
+    }
+    printf "N: Listed %d binary packages\n",$total;
+}
+
+exit 0;
+
+sub safe_get_deb_info {
+    # use eval when calling get_deb_info, since we don't want to `die' just
+    # because of a single broken package
+    my $data;
+    eval { $data = get_deb_info("$LINTIAN_ARCHIVEDIR/$_[0]"); };
+    if ($@) {
+       # error!
+       print STDERR "$@\n";
+       print "E: general: bad-binary-package $_[0]\n";
+       return undef;
+    }
+    $data->{'source'} or ($data->{'source'} = $data->{'package'});
+    return $data;
+}
diff --git a/nokia-lintian/unpack/list-srcpkg b/nokia-lintian/unpack/list-srcpkg
new file mode 100755 (executable)
index 0000000..9564f69
--- /dev/null
@@ -0,0 +1,196 @@
+#!/usr/bin/perl -w
+# list-srcpkg -- lintian helper script
+
+# Copyright (C) 1998 Christian Schwarz
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+# turn file buffering off:
+$| = 1;
+
+# parse command line options
+if ($#ARGV == -1) {
+  print "list-srcpkg [-v] <output-list-file>\n";
+  print "options:\n";
+  print "   -v  verbose\n";
+  exit 0;
+}
+
+my $verbose = 0;
+my $output_file = undef;
+
+while (my $arg = shift) {
+  if ($arg =~ s,^-,,o) {
+    if ($arg eq 'v') {
+      $verbose = 1;
+    } else {
+      print STDERR "error: unknown command line argument: $arg\n";
+      exit 1;
+    }
+  } else {
+    if ($output_file) {
+      print STDERR "error: too many command line arguments: $arg\n";
+      exit 1;
+    }
+    $output_file = $arg;
+  }
+}
+unless ($output_file) {
+  print STDERR "error: no output file specified\n";
+  exit 1;
+}
+
+# import perl libraries
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Read_pkglists;
+use vars qw(%source_info $SRCLIST_FORMAT); # from the above
+use Util;
+
+# get variables out of environment
+my $LINTIAN_ARCHIVEDIR = $ENV{'LINTIAN_ARCHIVEDIR'};
+my $LINTIAN_DIST = $ENV{'LINTIAN_DIST'};
+my $LINTIAN_LAB = $ENV{'LINTIAN_LAB'};
+my $LINTIAN_SECTION = $ENV{'LINTIAN_SECTION'};
+
+# read old list file (this command does nothing if the file does not exist)
+read_src_list($output_file,1);
+
+my %pkgfile;
+# map filenames to package names
+for my $pkg (keys %source_info) {
+  $pkgfile{$source_info{$pkg}->{'file'}} = $pkg;
+}
+
+# open output file
+open(OUT, '>', $output_file) or fail("cannot open list file $output_file for writing: $!");
+print OUT "$SRCLIST_FORMAT\n";
+
+# parse Sources.gz to get list of packages
+my $sources = "$LINTIAN_ARCHIVEDIR/dists/$LINTIAN_DIST/$LINTIAN_SECTION/source/Sources.gz";
+print "N: Parsing $sources ...\n" if $verbose;
+open(IN, '-|', 'zcat', $sources) or fail("Cannot open input pipe from zcat $sources: $!");
+
+my $line;
+my %packages;
+my $total = 0;
+
+while (!eof(IN)) {
+  do { $line = <IN> } until ($line =~ m/^Directory: (.*)$/m);
+  my $pkg_dir = $1;
+  do { $line = <IN> } until ($line =~ m/^ [0-9a-f]{32} [0-9]+ (.+\.dsc)$/m);
+  my $dsc_file = "$pkg_dir/$1";
+  do { $line = <IN> } until ($line =~ m/^\s*$/m);
+
+  my @stat;
+  # get timestamp...
+  unless (@stat = stat "$LINTIAN_ARCHIVEDIR/$dsc_file") {
+    warn "E: general: cannot stat file $LINTIAN_ARCHIVEDIR/$dsc_file: $!\n";
+    next;
+  }
+  my $timestamp = $stat[9];
+
+  my ($status,$pkg,$data);
+
+  # was package already included in last list?
+  if (exists $pkgfile{$dsc_file}) {
+    # yes!
+    $pkg = $pkgfile{$dsc_file};
+    $data = $source_info{$pkg};
+
+    # file changed since last run?
+    if ($timestamp == $data->{'timestamp'}) {
+      # no.
+      $status = 'unchanged';
+    } else {
+      $status = 'changed';
+      delete $source_info{$pkg};
+    }
+  } else {
+    # new package, get info
+    $status = 'new';
+  }
+
+  if (($status eq 'new') or ($status eq 'changed')) {
+    # use eval when calling get_dsc_info, since we don't want to `die' just
+    # because of a single broken package
+    eval { $data = get_dsc_info("$LINTIAN_ARCHIVEDIR/$dsc_file"); };
+    if ($@) {
+      # error!
+      print STDERR "$@\n";
+      print "E: general: bad-source-package $dsc_file\n";
+      next;
+    }
+    my @f = (); 
+    for my $fs (split(/\n/,$data->{'files'})) {
+      next if $fs =~ /^\s*$/o;
+      my @t = split(/\s+/o,$fs);
+      push(@f,$t[2]);
+    }
+    $data->{'files'} = join(',',@f);
+    $data->{'standards-version'} ||= "";
+    $pkg = $data->{'source'};
+  }
+
+  # check for duplicates
+  if (exists $packages{$pkg}) {
+    print "E: general: duplicate-source-package $pkg\n";
+    next;
+  }
+
+  # write entry to output file
+  for (qw/version maintainer uploaders architecture standards-version binary files/) {
+    $data->{$_} =~ tr/;\n/_ / if $data->{$_};
+  }
+  print OUT join(';',
+                $pkg,
+                $data->{'version'},
+                $data->{'maintainer'},
+                 $data->{'uploaders'} || '',
+                 $data->{'architecture'},
+                 $data->{'standards-version'},
+                 $data->{'binary'},
+                 $data->{'files'},
+                 $dsc_file,
+                $timestamp,
+                ),"\n";
+  printf "N: Listed %s source package %s %s\n",$status,$pkg,$data->{'version'} if $verbose;
+
+  # remove record from hash
+  delete $source_info{$pkg} if $status eq 'unchanged';
+  $packages{$pkg} = 1;
+  $total++;
+}
+close(IN) or fail("cannot close input pipe: $!");
+close(OUT) or fail("cannot close output pipe: $!");
+
+if ($verbose) {
+  # all packages that are still included in %source_info have disappeared from the archive...
+  for my $pkg (sort keys %source_info) {
+    print "N: Removed source package $pkg from list\n";
+  }
+  printf "N: Listed %d source packages\n",$total;
+}
+
+exit 0;
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 2
+# End:
+# vim: syntax=perl sw=2 sts=2 ts=2 et shiftround
diff --git a/nokia-lintian/unpack/list-udebpkg b/nokia-lintian/unpack/list-udebpkg
new file mode 100755 (executable)
index 0000000..333ecd2
--- /dev/null
@@ -0,0 +1,201 @@
+#!/usr/bin/perl -w
+# list-udebpkg -- lintian helper script
+
+# Copyright (C) 1998 Christian Schwarz
+# Copyright (C) 2004 Frank Lichtenheld
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+
+# turn file buffering off:
+$| = 1;
+
+# parse command line options
+if ($#ARGV == -1) {
+    print "list-udebpkg [-v] <output-list-file>\n";
+    print "options:\n";
+    print "   -v  verbose\n";
+    exit 0;
+}
+
+my $verbose = 0;
+my $output_file = undef;
+my $pkgdata = undef; # WTF?
+
+while (my $arg = shift) {
+    if ($arg =~ s,^-,,o) {
+       if ($arg eq 'v') {
+           $verbose = 1;
+       } else {
+           print STDERR "error: unknown command line argument: $arg\n";
+           exit 1;
+       }
+    } else {
+       if ($output_file) {
+           print STDERR "error: too many command line arguments: $arg\n";
+           exit 1;
+       }
+       $output_file = $arg;
+    }
+}
+
+unless ($output_file) {
+    print STDERR "error: no output file specified\n";
+    exit 1;
+}
+
+# import perl libraries
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Read_pkglists;
+use vars qw(%udeb_info $UDEBLIST_FORMAT); # from the above
+use Pipeline;
+use Util;
+
+# get variables out of environment
+my $LINTIAN_ARCHIVEDIR = $ENV{'LINTIAN_ARCHIVEDIR'};
+my $LINTIAN_DIST = $ENV{'LINTIAN_DIST'};
+my $LINTIAN_ARCH = $ENV{'LINTIAN_ARCH'};
+my $LINTIAN_SECTION = $ENV{'LINTIAN_SECTION'};
+my $LINTIAN_LAB = $ENV{'LINTIAN_LAB'};
+
+# read old list file (this command does nothing if the file does not exist)
+read_udeb_list($output_file,1);
+
+my %pkgfile;
+# map filenames to package names
+for my $pkg (keys %udeb_info) {
+    $pkgfile{$udeb_info{$pkg}->{'file'}} = $pkg;
+}
+
+# open output file
+open(OUT, '>', $output_file)
+    or fail("cannot open list file $output_file for writing: $!");
+print OUT "$UDEBLIST_FORMAT\n";
+
+# parse Packages file to get list of packages
+my $packages = "$LINTIAN_ARCHIVEDIR/dists/$LINTIAN_DIST/$LINTIAN_SECTION/".
+               "debian-installer/binary-$LINTIAN_ARCH/Packages";
+if (-e $packages) {
+    print "N: Parsing $packages ...\n" if $verbose;
+    open(IN, '<', $packages) or fail("cannot open Packages file $packages: $!");
+} elsif (-e "$packages.gz") {
+    print "N: Parsing $packages.gz ...\n" if $verbose;
+    open(IN, '-|', 'gzip', '-dc', "$packages.gz")
+        or fail("cannot open Packages file $packages.gz: $!");
+} else {
+    fail("No packages file $packages");
+}
+
+my $line;
+my %packages;
+my $total = 0;
+
+while (!eof(IN)) {
+    do { $line = <IN> } until ($line =~ m/^Architecture: (.*)$/m);
+    my $arch = $1;
+    do { $line = <IN> } until ($line =~ m/^Filename: (.*)$/m);
+    my $deb_file = $1;
+    do { $line = <IN> } until ($line =~ m/^\s*$/m);
+
+    my @stat;
+    # get timestamp...
+    unless (@stat = stat "$LINTIAN_ARCHIVEDIR/$deb_file") {
+       print "E: general: cannot stat $LINTIAN_ARCHIVEDIR/$deb_file\n";
+       next;
+    }
+    my $timestamp = $stat[9];
+    my ($status, $pkg, $data);
+
+    # was package already included in last list?
+    if (exists $pkgfile{$deb_file}) {
+       # yes!
+       $pkg = $pkgfile{$deb_file};
+       $data = $udeb_info{$pkg};
+
+       # file changed since last run?
+       if ($timestamp == $data->{'timestamp'}) {
+           # no.
+           $status = 'unchanged';
+       } else {
+           $status = 'changed';
+           delete $udeb_info{$pkg};
+       }
+    } else {
+       # new package, get info
+       $status = 'new';
+    }
+
+    if (($status eq 'new') or ($status eq 'changed')) {
+       if (defined $pkgdata) {
+           # avoid collecting the info twice
+           $data = $pkgdata;
+       } else {
+           $data = &safe_get_deb_info($deb_file);
+       }
+       next if not defined $data;
+       $pkg = $data->{'package'};
+    }
+
+    # check for duplicates
+    if (exists $packages{$pkg}) {
+       print "E: general: duplicate-udeb-package $pkg\n";
+       next;
+    }
+
+    # write entry to output file
+    print OUT join(';',
+                  $pkg,
+                  $data->{'version'},
+                  $data->{'source'},
+                  $deb_file,
+                  $timestamp,
+                  ),"\n";
+    printf "N: Listed %s udeb package %s %s\n",$status,$pkg,$data->{'version'} if $verbose;
+
+    # remove record from hash
+    delete $udeb_info{$pkg} if $status eq 'unchanged';
+    $packages{$pkg} = 1;
+    $total++;
+}
+close(IN) or fail("cannot close input pipe: $!");
+close(OUT) or fail("cannot close output pipe: $!");
+
+if ($verbose) {
+    # all packages that are still included in %udeb_info have disappeared from the archive...
+    for my $pkg (sort keys %udeb_info) {
+       print "N: Removed udeb package $pkg from list\n";
+    }
+    printf "N: Listed %d udeb packages\n",$total;
+}
+
+exit 0;
+
+sub safe_get_deb_info {
+    # use eval when calling get_deb_info, since we don't want to `die' just
+    # because of a single broken package
+    my $data;
+    eval { $data = get_deb_info("$LINTIAN_ARCHIVEDIR/$_[0]"); };
+    if ($@) {
+       # error!
+       print STDERR "$@\n";
+       print "E: general: bad-udeb-package $_[0]\n";
+       return undef;
+    }
+    $data->{'source'} or ($data->{'source'} = $data->{'package'});
+    return $data;
+}
diff --git a/nokia-lintian/unpack/unpack-binpkg-l1 b/nokia-lintian/unpack/unpack-binpkg-l1
new file mode 100755 (executable)
index 0000000..b2d8e6c
--- /dev/null
@@ -0,0 +1,109 @@
+#!/usr/bin/perl
+# unpack-binpkg-l1 -- lintian unpack script (binary packages level 1)
+#
+# syntax: unpack-binpkg-l1 <base-dir> <deb-file>
+#
+# Note that <deb-file> must be specified with absolute path.
+
+# Copyright (C) 1998 Christian Schwarz
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use vars qw($verbose);
+
+($#ARGV == 1) or die "syntax: unpack-binpkg-l1 <base-dir> <deb-file>";
+my $base_dir = shift;
+my $file = shift;
+
+# import perl libraries
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+use Util;
+
+# stat $file
+(my @stat = stat $file) or fail("$file: cannot stat: $!");
+
+# create directory in lab
+print "N: Creating directory $base_dir ...\n" if $verbose;
+mkdir("$base_dir", 0777) or fail("mkdir $base_dir: $!");
+mkdir("$base_dir/control", 0777) or fail("mkdir $base_dir/control: $!");
+mkdir("$base_dir/fields", 0777) or fail("mkdir $base_dir/fields: $!");
+symlink($file,"$base_dir/deb") or fail("symlink: $!");
+
+# The following calls use knowledge of the .deb format for speed
+
+# (replaces dpkg-deb -e)
+# extract control files' tarball
+pipeline((sub { exec 'ar', 'p', $file, 'control.tar.gz' }),
+        (sub { exec 'gzip', '-dc' }),
+        "$base_dir/control.tar") == 0
+    or fail();
+
+# extract the tarball's contents
+spawn("tar", "xf", "$base_dir/control.tar", "-C", "$base_dir/control") == 0
+    or fail();
+
+# create index of control.tar.gz
+pipeline((sub { exec "tar", "tvf", "$base_dir/control.tar" }),
+        (sub { exec "sort", "-k", "6" }),
+        "$base_dir/control-index") == 0
+    or fail();
+
+# clean up control.tar
+unlink("$base_dir/control.tar") or fail();
+
+# fix permissions
+spawn("chmod", "-R", "u+rX,o-w", "$base_dir/control") == 0
+    or fail();
+
+# (replaces dpkg-deb -c)
+# create index file for package
+pipeline((sub { exec "dpkg-deb", "--fsys-tarfile", $file }),
+        (sub { exec "tar", "tfv", "-" }),
+        (sub { exec "sed", "-e", "s/^h/-/" }),
+        (sub { exec "sort", "-k", "6" }),
+        "$base_dir/index") == 0
+    or fail();
+
+# (replaces dpkg-deb -c)
+# create index file for package with owner IDs instead of names
+pipeline((sub { exec "dpkg-deb", "--fsys-tarfile", $file }),
+        (sub { exec "tar", "--numeric-owner", "-tvf", "-" }),
+        (sub { exec "sed", "-e", "s/^h/-/" }),
+        (sub { exec "sort", "-k", "6" }),
+        "$base_dir/index-owner-id") == 0
+    or fail();
+
+# get package control information
+my $data = (read_dpkg_control("$base_dir/control/control"))[0];
+$data->{'source'} or ($data->{'source'} = $data->{'package'});
+
+# create control field files
+for my $field (keys %$data) {
+    my $field_file = "$base_dir/fields/$field";
+    open(F, '>', $field_file) or fail("cannot open file $field_file for writing: $!");
+    print F $data->{$field},"\n";
+    close(F);
+}
+
+# create symlink to source package
+$data->{'source'} =~ s/\s*\(.*\)\s*$//;
+symlink("../../source/$data->{'source'}","$base_dir/source")
+    or fail("symlink: $!");
+
+exit 0;
diff --git a/nokia-lintian/unpack/unpack-binpkg-l2 b/nokia-lintian/unpack/unpack-binpkg-l2
new file mode 100755 (executable)
index 0000000..1b42604
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/perl
+# unpack-binpkg-l2 -- lintian unpack script (binary packages level 2)
+#
+# syntax: unpack-binpkg-l <base-dir>
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use vars qw($verbose);
+
+($#ARGV == 0) or fail("syntax: unpack-binpkg-l2 <base-dir>");
+my $base_dir = shift;
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+print "N: Unpacking binary packages in directory $base_dir ...\n" if $verbose;
+mkdir("$base_dir/unpacked", 0777) or fail();
+
+# avoid using dpkg-deb -x; this pipeline is far faster.  I got a factor 2
+# improvement on large debs, and factor 1.5 on small debs.  I heard
+# it's because dpkg-deb syncs while writing.  -- Richard
+
+pipeline((sub { exec 'dpkg-deb', '--fsys-tarfile', "$base_dir/deb" }),
+        (sub { exec 'tar', 'xf', '-', '-C', "$base_dir/unpacked" })) == 0
+    or fail();
+
+# fix permissions
+spawn('chmod', '-R', 'u+rwX,go-w', "$base_dir/unpacked") == 0 or fail();
+
+exit 0;
+
+# -------------------------------
+
+sub fail {
+  if ($_[0]) {
+    print STDERR "internal error: $_[0]\n";
+  } elsif ($!) {
+    print STDERR "internal error: $!\n";
+  } else {
+    print STDERR "internal error.\n";
+  }
+  exit 1;
+}
diff --git a/nokia-lintian/unpack/unpack-srcpkg-l1 b/nokia-lintian/unpack/unpack-srcpkg-l1
new file mode 100755 (executable)
index 0000000..4b9c237
--- /dev/null
@@ -0,0 +1,74 @@
+#!/usr/bin/perl
+# unpack-srcpkg-l1 -- lintian unpack script (source packages level 1)
+#
+# syntax: unpack-srcpkg-l1 <base-dir> <dsc-file>
+#
+# Note, that <dsc-file> must be specified with absolute path.
+
+# Copyright (C) 1998 Christian Schwarz
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use vars qw($verbose);
+
+($#ARGV == 1) or die "syntax: unpack-srcpkg-l1 <base-dir> <dsc-file>";
+my $base_dir = shift;
+my $file = shift;
+
+# import perl libraries
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Util;
+
+use File::Basename;
+
+# stat $file
+(my @stat = stat $file) or fail("$file: cannot stat: $!");
+
+# get package control information
+my $data = get_dsc_info($file);
+
+# create directory in lab
+print "N: Creating directory $base_dir ...\n" if $verbose;
+mkdir("$base_dir", 0777) or fail("mkdir $base_dir: $!");
+mkdir("$base_dir/fields", 0777) or fail("mkdir $base_dir/fields: $!");
+
+# create control field files
+for my $field (keys %$data) {
+  my $field_file = "$base_dir/fields/$field";
+  open(F, '>', $field_file) or fail("cannot open file $field_file for writing: $!");
+  print F $data->{$field},"\n";
+  close(F);
+}
+
+# Install symbolic links to source package files
+my $dir = dirname($file);
+my $name = basename($file);
+symlink($file,"$base_dir/dsc") or fail("cannot symlink dsc file: $!");
+for my $fs (split(/\n/,$data->{'files'})) {
+  next if $fs =~ /^\s*$/o;
+  my @t = split(/\s+/o,$fs);
+  symlink("$dir/$t[2]","$base_dir/$t[2]") or fail("cannot symlink file $t[2]: $!");
+}
+
+# Create symbolic links to binary packages
+mkdir("$base_dir/binary", 0777) or fail("mkdir $base_dir/binary: $!");
+for my $bin (split(/,\s+/o,$data->{'binary'})) {
+  symlink("../../../binary/$bin", "$base_dir/binary/$bin") or fail("cannot symlink binary package $bin: $!");
+}
+
+exit 0;
diff --git a/nokia-lintian/unpack/unpack-srcpkg-l2 b/nokia-lintian/unpack/unpack-srcpkg-l2
new file mode 100755 (executable)
index 0000000..7316e6a
--- /dev/null
@@ -0,0 +1,75 @@
+#!/usr/bin/perl
+# unpack-srcpkg-l2 -- lintian unpack script (source packages level 2)
+#
+# syntax: unpack-srcpkg-l2 <base-dir>
+
+# Copyright (C) 1998 Christian Schwarz and Richard Braakman
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+use strict;
+use vars qw($verbose);
+use FileHandle;
+
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Pipeline;
+
+($#ARGV == 0) or fail("syntax: unpack-srcpkg-l2 <base-dir>");
+my $base_dir = shift;
+
+print "N: Unpacking source package in directory $base_dir ...\n" if $verbose;
+chdir($base_dir);
+
+# We can't use spawn yet because older versions of dpkg-source print things
+# out even with -q.  This can be fixed to use spawn once that newer version of
+# dpkg is in oldstable.
+my $pid = fork;
+if (not defined $pid) {
+    fail("cannot fork: $!");
+} elsif ($pid == 0) {
+    open(STDOUT, '>', '/dev/null');
+    exec('dpkg-source', '-q', '-x', 'dsc', 'unpacked');
+} else {
+    waitpid($pid, 0);
+    unless ($? == 0) {
+        fail("cannot run dpkg-source: $!");
+    }
+}
+
+# fix permissions
+spawn('chmod', '-R', 'u+rwX,o+rX,o-w', 'unpacked') == 0 or fail();
+
+exit 0;
+
+# -------------------------------
+
+sub fail {
+  if ($_[0]) {
+    print STDERR "internal error: $_[0]\n";
+  } elsif ($!) {
+    print STDERR "internal error: $!\n";
+  } else {
+    print STDERR "internal error.\n";
+  }
+  exit 1;
+}
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 ts=4 et shiftround