Bug#593837: [new check] Use of openjdk-6-doc/classpath-doc in B-D instead of default-jdk-doc
Package: lintian
Version: 2.4.3
Severity: wishlist
Tags: patch
Hi
I have created a new check to test if a package B-D(-I) on openjdk-6-doc
or classpath-doc instead of the default-jdk-doc. The rationale is that
default-jdk-doc is a meta package that will pull a system level jdk
documentation (javadoc) and put it in a unified location (using symlinks).
Using default-jdk-doc also allows us to later switch to a newer doc (e.g
openjdk-7-doc) by simply updating default-jdk-doc and not a lot java
packages.
The tag description may need some improvement and the check itself is
done in the part checking all the Build-{Depends*,Conflicts*} fields.
It may make more sense to move it into a part only checking B-D{,-I},
but I could not find such a part and honestly could not see why you
would ever need to Build-Conflict on a doc package.
The check comes with a simple test case to catch the openjdk-6-doc
case.
~Niels
*** 0001-Add-check-for-build-depending-on-specific-system-jav.patch
>From 995d68ba31dab3fa80cdab5e839bfb21d927025c Mon Sep 17 00:00:00 2001
From: Niels Thykier <niels@thykier.net>
Date: Sat, 21 Aug 2010 14:15:32 +0200
Subject: [PATCH] Add check for build-depending on specific system javadoc instead
of default-jdk-doc
---
checks/fields | 4 ++++
checks/fields.desc | 8 ++++++++
t/tests/fields-java/debian/debian/control.in | 16 ++++++++++++++++
t/tests/fields-java/debian/debian/install | 1 +
t/tests/fields-java/debian/some-file | 2 ++
t/tests/fields-java/desc | 6 ++++++
t/tests/fields-java/tags | 1 +
7 files changed, 38 insertions(+), 0 deletions(-)
create mode 100644 t/tests/fields-java/debian/debian/control.in
create mode 100644 t/tests/fields-java/debian/debian/install
create mode 100644 t/tests/fields-java/debian/some-file
create mode 100644 t/tests/fields-java/desc
create mode 100644 t/tests/fields-java/tags
diff --git a/checks/fields b/checks/fields
index 5b4b5e7..5161ae2 100644
--- a/checks/fields
+++ b/checks/fields
@@ -726,6 +726,10 @@ if ($type eq "source") {
}
}
+ if($d_pkg =~ m/openjdk-\d+-doc/o or $d_pkg eq 'classpath-doc'){
+ tag 'build-depends-on-specific-java-doc-package', $d_pkg;
+ }
+
tag 'conflicting-negation-in-source-relation', "$field: $part_d_orig"
unless (not $d_arch or $d_arch->[1] == 0 or $d_arch->[1] eq @{ $d_arch->[0] });
diff --git a/checks/fields.desc b/checks/fields.desc
index eff85cc..2a77b7e 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -992,3 +992,11 @@ Info: The given package appears to have a Python development package
If you are building a Python extension instead, you should have
development packages listed in Build-Depends, but normally there should
be at least one Architecture: any package.
+
+Tag: build-depends-on-specific-java-doc-package
+Severity: normal
+Certainty: certain
+Info: The given package declares a build dependency on either openjdk-
+ X-doc or classpath-doc instead of using default-jdk-doc. default-jdk-doc
+ provides a symlink to the API via /usr/share/default-jdk-doc/api.
+
diff --git a/t/tests/fields-java/debian/debian/control.in b/t/tests/fields-java/debian/debian/control.in
new file mode 100644
index 0000000..8dbc64a
--- /dev/null
+++ b/t/tests/fields-java/debian/debian/control.in
@@ -0,0 +1,16 @@
+Source: {$srcpkg}
+Priority: extra
+Section: java
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 7.0.50~), openjdk-6-doc
+
+Package: lib{$srcpkg}-java
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description}
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
+
diff --git a/t/tests/fields-java/debian/debian/install b/t/tests/fields-java/debian/debian/install
new file mode 100644
index 0000000..6c37889
--- /dev/null
+++ b/t/tests/fields-java/debian/debian/install
@@ -0,0 +1 @@
+some-file usr/share/lintian
diff --git a/t/tests/fields-java/debian/some-file b/t/tests/fields-java/debian/some-file
new file mode 100644
index 0000000..7bf08f7
--- /dev/null
+++ b/t/tests/fields-java/debian/some-file
@@ -0,0 +1,2 @@
+This file is installed into /usr/share/lintian just to ensure that this
+package doesn't look like a metapackage for the dependency checks.
diff --git a/t/tests/fields-java/desc b/t/tests/fields-java/desc
new file mode 100644
index 0000000..12e1005
--- /dev/null
+++ b/t/tests/fields-java/desc
@@ -0,0 +1,6 @@
+Testname: fields-java
+Sequence: 6000
+Version: 1.0
+Description: General tests for java package (build) dependencies
+Test-For:
+ build-depends-on-specific-java-doc-package
diff --git a/t/tests/fields-java/tags b/t/tests/fields-java/tags
new file mode 100644
index 0000000..4f3321f
--- /dev/null
+++ b/t/tests/fields-java/tags
@@ -0,0 +1 @@
+W: fields-java source: build-depends-on-specific-java-doc-package openjdk-6-doc
--
1.7.1
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages lintian depends on:
ii binutils 2.20.1-12 The GNU assembler, linker and bina
ii diffstat 1.53-1 produces graph of changes introduc
ii dpkg-dev 1.15.7.2 Debian package development tools
ii file 5.04-5 Determines file type using "magic"
ii gettext 0.18.1.1-1 GNU Internationalization utilities
ii intltool-debian 0.35.0+20060710.1 Help i18n of RFC822 compliant conf
ii libapt-pkg-perl 0.1.24 Perl interface to libapt-pkg
ii libclass-accessor-perl 0.34-1 Perl module that automatically gen
ii libipc-run-perl 0.89-1 Perl module for running processes
ii libparse-debianchangel 1.1.1-2.1 parse Debian changelogs and output
ii libtimedate-perl 1.2000-1 collection of modules to manipulat
ii liburi-perl 1.54-1 module to manipulate and access UR
ii locales 2.11.2-2 Embedded GNU C Library: National L
ii man-db 2.5.7-3 on-line manual pager
ii perl [libdigest-sha-pe 5.10.1-14 Larry Wall's Practical Extraction
lintian recommends no packages.
Versions of packages lintian suggests:
pn binutils-multiarch <none> (no description available)
ii libtext-template-perl 1.45-1 Text::Template perl module
ii man-db 2.5.7-3 on-line manual pager
-- no debconf information
Reply to: