Bug#746744: lintian: Disable missing-classpath when dealing with a non java library
Package: lintian
Version: 2.5.22.1
Severity: wishlist
Hello,
The attached patch disables missing-classpath when dealing with a Java
binaries (or non java library).
We had this false positive with visualvm.
Thanks
sylvestre
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (900, 'testing'), (600, 'unstable'), (500, 'stable-updates'), (500, 'stable'), (300, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.13-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages lintian depends on:
ii binutils 2.24-4
ii bzip2 1.0.6-5
ii diffstat 1.58-1
ii file 1:5.17-1
ii gettext 0.18.3.2-1
ii hardening-includes 2.5
ii intltool-debian 0.35.0+20060710.1
ii libapt-pkg-perl 0.1.29+b1
ii libarchive-zip-perl 1.37-2
ii libclass-accessor-perl 0.34-1
ii libclone-perl 0.36-1
ii libdpkg-perl 1.17.6
ii libemail-valid-perl 1.192-1
ii libfile-basedir-perl 0.03-1
ii libipc-run-perl 0.92-1
ii liblist-moreutils-perl 0.33-2
ii libparse-debianchangelog-perl 1.2.0-1
ii libtext-levenshtein-perl 0.06~01-2
ii libtimedate-perl 2.3000-1
ii liburi-perl 1.60-1
ii man-db 2.6.6-1
ii patchutils 0.3.2-3
ii perl [libdigest-sha-perl] 5.18.2-2+b1
ii t1utils 1.37-2
Versions of packages lintian recommends:
pn libperlio-gzip-perl <none>
ii perl-modules [libautodie-perl] 5.18.2-2
Versions of packages lintian suggests:
pn binutils-multiarch <none>
ii dpkg-dev 1.17.6
ii libhtml-parser-perl 3.71-1+b1
pn libtext-template-perl <none>
pn libyaml-perl <none>
ii xz-utils 5.1.1alpha+20120614-2
-- no debconf information
>From e125d9661cc803ed7be6e3c56c7f1dc4ea32eaab Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <sylvestre@debian.org>
Date: Fri, 2 May 2014 14:52:52 +0200
Subject: [PATCH] [SL] missing-classpath should be disabled on Java binaries
---
checks/java.pm | 2 +-
debian/changelog | 1 +
t/tests/java-classpath/debian/debian/binary-using-java.jlibs | 1 +
t/tests/java-classpath/debian/debian/control.in | 11 +++++++++++
t/tests/java-classpath/debian/debian/rules | 1 +
5 files changed, 15 insertions(+), 1 deletion(-)
create mode 100644 t/tests/java-classpath/debian/debian/binary-using-java.jlibs
diff --git a/checks/java.pm b/checks/java.pm
index 5e7eac1..c815c18 100644
--- a/checks/java.pm
+++ b/checks/java.pm
@@ -231,7 +231,7 @@ sub run {
}
}
- if ($has_jars && $need_cp) {
+ if ($has_jars && $need_cp && $pkg =~ /^lib[^\s,]+-java$/) {
# Only tag if there is at least one jar file and one strong
# java dependency and no classpath/osgi. Technically there
# should be no reason to have a strong relation with a java
diff --git a/debian/changelog b/debian/changelog
index 0d70935..a55f0dc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -30,6 +30,7 @@ lintian (2.5.23) UNRELEASED; urgency=medium
+ [SL] Catch uses of Java8 byte code. (Closes: #743384).
+ [SL] Warn that the suggests/recommends on libservlet[\d\.]+-java is
needless (Closes: #743453)
+ + [SL] missing-classpath should be disabled on Java binaries
+ [NT] Exclude some jar files from "codeless-jar" tag based
on the basename of the jar file. This is intended to
reduce the number of codeless jars for source/doc jars in
diff --git a/t/tests/java-classpath/debian/debian/binary-using-java.jlibs b/t/tests/java-classpath/debian/debian/binary-using-java.jlibs
new file mode 100644
index 0000000..5e5f31e
--- /dev/null
+++ b/t/tests/java-classpath/debian/debian/binary-using-java.jlibs
@@ -0,0 +1 @@
+cp-missing-2.jar
diff --git a/t/tests/java-classpath/debian/debian/control.in b/t/tests/java-classpath/debian/debian/control.in
index 115ceaf..b1231c7 100644
--- a/t/tests/java-classpath/debian/debian/control.in
+++ b/t/tests/java-classpath/debian/debian/control.in
@@ -24,3 +24,14 @@ Description: {$description} - relative
installed.
.
Test for relative classpaths.
+
+
+Package: binary-using-java
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}, libdepends-java
+Description: {$description} - binary
+ This is a test package designed to test various aspects of the
+ java-related QA code in lintian. This package should not be
+ installed.
+ .
+ Test for classpaths in binary.
diff --git a/t/tests/java-classpath/debian/debian/rules b/t/tests/java-classpath/debian/debian/rules
index 17a2e14..1d7125d 100755
--- a/t/tests/java-classpath/debian/debian/rules
+++ b/t/tests/java-classpath/debian/debian/rules
@@ -5,3 +5,4 @@
override_jh_build:
jh_build --javacopts='-target 1.4' --javacopts='-source 1.4'
+ cp cp-missing.jar cp-missing-2.jar
--
2.0.0.rc0
Reply to: