[SCM] Debian package checker branch, master, updated. 2.5.3-40-g9826c1f
The following commit has been merged in the master branch:
commit 9826c1f0af9319c6e6e6afab7fd0e2a28362ab84
Author: Jakub Wilk <jwilk@debian.org>
Date: Sun Oct 2 10:38:19 2011 +0200
Detect missing dependencies for dh sequences
Changes to the original patch:
- Add test case
- Do not emit missing-build-dependency for dh sequences to avoid
duplicate tags for the same issue.
Acked-by: Niels Thykier <niels@thykier.net>
diff --git a/checks/debhelper b/checks/debhelper
index 1ad4b6a..477da07 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -41,6 +41,8 @@ my $maint_commands = Lintian::Data->new ('debhelper/maint_commands');
my $dh_commands_depends = Lintian::Data->new ('debhelper/dh_commands', '=');
my $filename_configs = Lintian::Data->new ('debhelper/filename-config-files');
my $dh_ver_deps = Lintian::Data->new ('debhelper/dh_commands-manual', qr/\|\|/o);
+my $dh_addons = Lintian::Data->new ('debhelper/dh_addons', '=');
+my $dh_addons_manual = Lintian::Data->new ('debhelper/dh_addons-manual', qr/\|\|/o);
# 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
@@ -69,6 +71,7 @@ my $usescdbs = '';
my $seendhcleank = '';
my $overridetargets = 0;
my %missingbdeps;
+my %missingbdeps_addons;
my $maybe_skipping;
my $dhcompatvalue;
@@ -150,6 +153,17 @@ while (<RULES>) {
$seencommand = 1;
$needbuilddepends = 1;
$needtomodifyscripts = 1;
+ while (m/\s--with(?:=|\s+)(\S+)/go) {
+ for my $addon (split(m/,/o, $1)) {
+ $addon =~ y,-,_,;
+ my $depends =
+ $dh_addons_manual->value($addon) ||
+ $dh_addons->value($addon);
+ if (defined $depends) {
+ $missingbdeps_addons{$depends} = $addon;
+ }
+ }
+ }
} elsif (m,^include\s+/usr/share/cdbs/1/rules/debhelper.mk,) {
$seencommand = 1;
$needbuilddepends = 1;
@@ -330,6 +344,10 @@ while (my ($dep, $command) = each %missingbdeps) {
tag 'missing-build-dependency-for-dh_-command', "$command=$dep"
unless ($bdepends_noarch->implies($dep));
}
+while (my ($dep, $addon) = each %missingbdeps_addons) {
+ tag 'missing-build-dependency-for-dh-addon', "$addon => $dep"
+ unless ($bdepends_noarch->implies($dep));
+}
unless ($bdepends->implies("debhelper (>= $level~)")){
diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index 791b605..1c2e63f 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -190,6 +190,13 @@ Info: The source package appears to be using a dh_ command but doesn't build
depend on the package that actually provides it. If it uses it, it must
build depend on it.
+Tag: missing-build-dependency-for-dh-addon
+Severity: important
+Certainty: possible
+Info: The source package appears to be using a dh addon but doesn't build
+ depend on the package that actually provides it. If it uses it, it must
+ build depend on it.
+
Tag: debhelper-script-needs-versioned-build-depends
Severity: normal
Certainty: certain
diff --git a/checks/rules b/checks/rules
index 9d81ce5..f746279 100644
--- a/checks/rules
+++ b/checks/rules
@@ -76,13 +76,12 @@ my @RULE_CLEAN_DEPENDS =
(
[ 'ant | ant1.7' => qr'^\t\s*(\S+=\S+\s+)*ant\s' ],
[ debhelper => qr'^\t\s*dh_.+' ],
- [ 'dh-ocaml, ocaml-nox | ocaml' => qr'^\t\s*(?:dh_ocamlinit|dh\s.*--with(?:=|\s+)(?:\S+,)*ocaml)\s' ],
+ [ 'dh-ocaml, ocaml-nox | ocaml' => qr'^\t\s*dh_ocamlinit\s' ],
[ dpatch => qr'^\t\s*(\S+=\S+\s+)*dpatch\s' ],
[ 'po-debconf' => qr'^\t\s*debconf-updatepo\s' ],
[ $PYTHON_DEPEND => qr'^\t\s*python\s', 'missing-python-build-dependency' ],
[ $PYTHON3_DEPEND => qr'^\t\s*python3\s', 'missing-python-build-dependency' ],
[ $ANYPYTHON_DEPEND => qr'\ssetup\.py\b', 'missing-python-build-dependency' ],
- [ quilt => qr'^\t\s*dh\s.*--with(?:=|\s+)(?:\S+,)*quilt' ],
[ quilt => qr'^\t\s*(\S+=\S+\s+)*quilt\s' ],
[ yada => qr'^\t\s*yada\s' ],
);
diff --git a/data/debhelper/dh_addons b/data/debhelper/dh_addons
new file mode 100644
index 0000000..44680a5
--- /dev/null
+++ b/data/debhelper/dh_addons
@@ -0,0 +1,40 @@
+autoreconf=dh-autoreconf
+autotools_dev=autotools-dev
+bash_completion=bash-completion
+cli=cli-common-dev
+cli_nant=cli-common-dev
+components=pkg-components
+config_model=libconfig-model-perl
+d_i=dh-di
+dkms=dkms
+dpatch=dpatch
+eclipse_helper=javahelper
+germinate=germinate
+gnome=gnome-pkg-tools
+javahelper=javahelper
+jh_maven_repo_helper=maven-repo-helper
+kde=pkg-kde-tools
+lisp=dh-lisp
+lv2config=lv2core
+maven_repo_helper=maven-repo-helper
+ocaml=dh-ocaml
+perl_dbi=libdbi-perl
+phppear=pkg-php-tools
+pkgkde_symbolshelper=pkg-kde-tools
+pydeb=python-van.pydeb
+pyppd=pyppd
+python2=python
+python3=python3
+python_central=python-central
+python_support=debhelper
+quilt=quilt
+rdoc=ruby-pkg-tools
+ruby=gem2deb
+scour=python-scour
+sodeps=pkg-kde-tools
+sphinxdoc=python-sphinx
+tex=tex-common
+xine=libxine-dev
+xsf=xserver-xorg-dev
+xul_ext=mozilla-devscripts
+xulrunner=xulrunner-dev
diff --git a/data/debhelper/dh_addons-manual b/data/debhelper/dh_addons-manual
new file mode 100644
index 0000000..2d53647
--- /dev/null
+++ b/data/debhelper/dh_addons-manual
@@ -0,0 +1,16 @@
+# Manually maintained list of dependencies needed for dh addons. This overrides
+# information from data/debhelper/dh_addons (the latter file is automatically
+# generated).
+#
+# Please keep this sorted.
+
+dpatch||dpatch (>= 2.0.32~)
+gnome||gnome-pkg-tools (>= 0.17)
+jh_maven_repo_helper||maven-repo-helper (>= 1.6~)
+lv2config||lv2core (>= 4.0-2~)
+maven_repo_helper||maven-repo-helper (>= 1.5~)
+python2||python | python-all | python-dev | python-add-dev
+python3||python3 | python3-all | python3-dev | python3-all-dev
+python_support||python-support
+sphinxdoc||python-sphinx (>= 1.0.7+dfsg)
+xsf||xserver-xorg-dev (>= 2:1.9.4)
diff --git a/debian/changelog b/debian/changelog
index 8caa0a1..d15852f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,9 @@
lintian (2.5.4) UNRELEASED; urgency=low
+ * Summary of tag changes:
+ + Added:
+ - missing-build-dependency-for-dh-addon
+
* checks/*:
+ [JW] Replace common_data.pm with Lintian::Check.
* checks/binaries:
@@ -9,9 +13,11 @@ lintian (2.5.4) UNRELEASED; urgency=low
+ [JW] Merged into Lintian::Check.
* checks/cruft:
+ [NT] Escape path when using them in regexes. (Closes: #642902)
- * checks/dehelper:
+ * checks/dehelper{,.desc}:
+ [JW,NT] Check for versioned dependencies for some dh_commands.
(Closes: #641035)
+ + [JW] Detect missing dependencies for using dh sequences.
+ (Closes: #613327)
* checks/files{,.desc}:
+ [JW] Suggest the usage of "-delete" rather than "| xargs rm -f".
(Closes: #641983)
@@ -20,6 +26,8 @@ lintian (2.5.4) UNRELEASED; urgency=low
* checks/rules:
+ [JW] Fixed false negative "missing-build-dependency" when using
"dh --with=X" rather than "dh --with X". (Closes: #643714)
+ + [NT] Do not emit missing-build-dependency for missing dh sequences,
+ since the new tag will handle those.
* checks/scripts:
+ [RA] Exclude files ending in *.erb from several shell script
checks. ERB is a Ruby templating language, so these will probably
diff --git a/private/refresh-debhelper-data b/private/refresh-debhelper-data
index 8b189fb..04c0385 100755
--- a/private/refresh-debhelper-data
+++ b/private/refresh-debhelper-data
@@ -45,8 +45,9 @@ fi
readonly lintian_data="$(readlink -f "$1")"
readonly contents="$(readlink -f "$2")"
-readonly dh_regex='^usr/bin/dh_.'
-readonly dh_perl_regex='^usr/bin/(dh_[^\s]+)\s+[\w-]+/([^,]+).*'
+readonly dh_regex='^(usr/bin/dh_|usr/share/perl5/Debian/Debhelper/Sequence/).'
+readonly dh_command_perl_regex='^usr/bin/(dh_[^\s]+)\s+[\w-]+/([^,]+).*'
+readonly dh_addon_perl_regex='^usr/share/perl5/Debian/Debhelper/Sequence/([^\s]+)\.pm\s+[\w-]+/([^,]+).*'
offline=0
[ -d "$lintian_data" ] || {
@@ -86,7 +87,7 @@ if [ $offline -eq 1 ]; then
which "$command" 2>&1 1>/dev/null || exit 2
$command -E "$dh_regex" "$contents" \
- | perl -p -w -E 's#'"$dh_perl_regex"'#$1=$2#g;' \
+ | perl -p -w -E 's#'"$dh_command_perl_regex"'#$1=$2#g;' \
| sort > "$new_commands"
cmp -s "$known_commands" "$new_commands"
exit
@@ -103,13 +104,16 @@ else
wget dists/sid/Contents-i386.gz
zgrep -E "$dh_regex" Contents-i386.gz > dh_entries
cat dh_entries \
- | perl -p -w -E 's#'"$dh_perl_regex"'#$1=$2#g;' \
+ | perl -n -w -E 's#'"$dh_command_perl_regex"'#$1=$2# and print' \
| LC_ALL=C sort > dh_commands
cat dh_entries \
- | perl -p -w -E 's#'"$dh_perl_regex"'#$2#g;' \
+ | perl -n -w -E 's#'"$dh_addon_perl_regex"'#$1=$2# and print' \
+ | LC_ALL=C sort > dh_addons
+ cat dh_commands \
+ | cut -d '=' -f 2 \
| LC_ALL=C sort -u > dh_packages
- for f in commands packages; do
+ for f in commands addons packages; do
rf="$lintian_data/debhelper/dh_$f"
[ ! -f "$rf" ] ||
mv "$rf" "${rf}.old"
diff --git a/t/COVERAGE b/t/COVERAGE
index f8ce7cd..9aa5dad 100644
--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,5 +1,5 @@
-Last generated 2011-09-16
-Coverage: 731/937 (78.01%), w. legacy tests: 849/937 (90.61%)
+Last generated 2011-10-02
+Coverage: 732/938 (78.04%), w. legacy tests: 850/938 (90.62%)
The following tags are not tested by the test suite:
diff --git a/t/tests/rules-dh-with-quilt/debian/debian/rules b/t/tests/debhelper-dh-with-quilt/debian/debian/rules
similarity index 100%
rename from t/tests/rules-dh-with-quilt/debian/debian/rules
rename to t/tests/debhelper-dh-with-quilt/debian/debian/rules
diff --git a/t/tests/rules-dh-with-quilt/desc b/t/tests/debhelper-dh-with-quilt/desc
similarity index 52%
rename from t/tests/rules-dh-with-quilt/desc
rename to t/tests/debhelper-dh-with-quilt/desc
index 98833de..5b77a7c 100644
--- a/t/tests/rules-dh-with-quilt/desc
+++ b/t/tests/debhelper-dh-with-quilt/desc
@@ -1,5 +1,5 @@
-Testname: rules-dh-with-quilt
+Testname: debhelper-dh-with-quilt
Sequence: 6000
Version: 1.0
Description: Check dependency requirements for dh --with quilt
-Test-For: missing-build-dependency
+Test-For: missing-build-dependency-for-dh-addon
diff --git a/t/tests/debhelper-dh-with-quilt/tags b/t/tests/debhelper-dh-with-quilt/tags
new file mode 100644
index 0000000..6680f2e
--- /dev/null
+++ b/t/tests/debhelper-dh-with-quilt/tags
@@ -0,0 +1 @@
+E: debhelper-dh-with-quilt source: missing-build-dependency-for-dh-addon quilt => quilt
diff --git a/t/tests/rules-dh-with-quilt/tags b/t/tests/rules-dh-with-quilt/tags
deleted file mode 100644
index de1c956..0000000
--- a/t/tests/rules-dh-with-quilt/tags
+++ /dev/null
@@ -1 +0,0 @@
-E: rules-dh-with-quilt source: missing-build-dependency quilt
--
Debian package checker
Reply to: