Bug#834290: Warn about libraries with excessive priority?

2017-12-17 Thread Chris Lamb
Hi Josh,

> I've attached a patch implementing this.

Thanks so much; I've applied and pushed it to Git here:

  https://anonscm.debian.org/git/lintian/lintian.git/commit/?
id=41599f6d0b2f23e013886fe7d4e214a865ed6a4f


Best wishes,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#834290: Warn about libraries with excessive priority?

2017-12-16 Thread Josh Triplett
On Sat, Dec 16, 2017 at 09:51:48AM +, Chris Lamb wrote:
> Fixed in Git:
> 
>   
> https://anonscm.debian.org/git/lintian/lintian.git/commit/?id=588cbc9069b53c8be4ca6e66e010cfb507b095e6

Thanks for the fix; however, this doesn't look like it covers the cases I
originally reported. This covers packages matching /^lib.+-dev$/ in
section "libdevel"; I certainly agree that the tag also applies there.
However, I originally proposed also applying this to packages in section
"libs" matching /^lib/ and not /-bin$/ , and I reviewed every package
matching that test to make sure there were no false positives.

I've attached a patch implementing this.

- Josh Triplett
>From 48c06e8d04bf8ba5e4e7c96f0e6243faa1fe5d44 Mon Sep 17 00:00:00 2001
From: Josh Triplett 
Date: Sat, 16 Dec 2017 09:12:16 -0800
Subject: [PATCH] excessive-priority-for-library-package: Handle non-dev
 packages too

Exclude packages ending in -bin (for libc-bin and future-proofing) and
libc packages.

Expand the test accordingly.
---
 checks/fields.pm   |  6 +++--
 .../debian/debian/control.in   | 27 +-
 .../tags   |  1 +
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/checks/fields.pm b/checks/fields.pm
index f5cb67123..37c4a906d 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -593,8 +593,10 @@ sub run {
   unless $KNOWN_PRIOS->known($priority);
 
 tag 'excessive-priority-for-library-package', $priority
-  if $pkg =~ m/^lib.+-dev$/o
-  and $info->field('section', '') eq 'libdevel'
+  if $pkg =~ m/^lib/o
+  and $pkg !~ m/-bin$/o
+  and $pkg !~ m/^libc[0-9.]+$/o
+  and any { $_ eq $info->field('section', '') } qw(libdevel libs)
   and any { $_ eq $priority } qw(required important standard);
 }
 
diff --git a/t/tests/fields-excessive-priority-for-library-package/debian/debian/control.in b/t/tests/fields-excessive-priority-for-library-package/debian/debian/control.in
index 7cc798109..2bb8a6964 100644
--- a/t/tests/fields-excessive-priority-for-library-package/debian/debian/control.in
+++ b/t/tests/fields-excessive-priority-for-library-package/debian/debian/control.in
@@ -5,6 +5,16 @@ Standards-Version: {$standards_version}
 Build-Depends: {$build_depends}
 Rules-Requires-Root: no
 
+Package: lib{$source}42
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Priority: important
+Description: {$description} (lib)
+ 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.
+
 Package: lib{$source}-dev
 Architecture: {$architecture}
 Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
@@ -15,6 +25,21 @@ Description: {$description} (dev)
  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.
+ .
+ (This is a dev package.)
+
+Package: lib{$source}-false-positive-bin
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Section: libdevel
+Priority: required
+Description: {$description} (false positive bin)
+ 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.
+ .
+ (This is a -bin false positive)
 
 Package: lib{$source}-false-positive-dev
 Architecture: {$architecture}
@@ -27,4 +52,4 @@ Description: {$description} (false positive)
  things.  It should not be installed like a regular package.  It may
  be an empty package.
  .
- (This is a false positive)
+ (This is a -dev false positive)
diff --git a/t/tests/fields-excessive-priority-for-library-package/tags b/t/tests/fields-excessive-priority-for-library-package/tags
index 22cee044d..1b388a49c 100644
--- a/t/tests/fields-excessive-priority-for-library-package/tags
+++ b/t/tests/fields-excessive-priority-for-library-package/tags
@@ -1 +1,2 @@
 W: libfields-excessive-priority-for-library-package-dev: excessive-priority-for-library-package standard
+W: libfields-excessive-priority-for-library-package42: excessive-priority-for-library-package important
-- 
2.15.1



Bug#834290: Warn about libraries with excessive priority?

2017-12-16 Thread Chris Lamb
tags 834290 + pending
thanks

Fixed in Git:

  
https://anonscm.debian.org/git/lintian/lintian.git/commit/?id=588cbc9069b53c8be4ca6e66e010cfb507b095e6


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-



Bug#834290: Warn about libraries with excessive priority?

2016-08-14 Thread Josh Triplett
Package: lintian
Version: 2.5.46
Severity: wishlist

Now that Lintian no longer warns about dependencies on packages with
lower priorities, I think it would make sense for Lintian to warn about
library packages with excessively high priorities.  In general, a
library package should only get pulled in on a system because some other
package depends on it; no library package needs installation on a system
where nothing uses it.  Given that, I don't think it makes sense for any
library package to have a priority higher than "optional".

More concretely: I'd propose a warning on packages in section "libs"
with names matching "^lib.*" and not "-bin$", that have a priority of
"required", "important", or "standard".

I've reviewed every single package in Debian that would match that rule,
and I can confirm that it would produce zero false positives.

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.7.0-rc7-amd64 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lintian depends on:
ii  binutils  2.27-5
ii  bzip2 1.0.6-8
ii  diffstat  1.61-1
ii  file  1:5.28-4
ii  gettext   0.19.8.1-1
ii  hardening-includes2.8+nmu2
ii  intltool-debian   0.35.0+20060710.4
ii  libapt-pkg-perl   0.1.29+b5
ii  libarchive-zip-perl   1.59-1
ii  libclass-accessor-perl0.34-1
ii  libclone-perl 0.38-2
ii  libdata-alias-perl1.20-1+b1
ii  libdpkg-perl  1.18.10
ii  libemail-valid-perl   1.200-1
ii  libfile-basedir-perl  0.07-1
ii  libipc-run-perl   0.94-1
ii  liblist-moreutils-perl0.416-1
ii  libparse-debianchangelog-perl 1.2.0-10
ii  libperl5.22 [libdigest-sha-perl]  5.22.2-3
ii  libtext-levenshtein-perl  0.13-1
ii  libtimedate-perl  2.3000-2
ii  liburi-perl   1.71-1
ii  libyaml-libyaml-perl  0.41-6+b1
ii  man-db2.7.5-1
ii  patchutils0.3.4-1
ii  perl  5.22.2-3
ii  t1utils   1.39-2
ii  xz-utils  5.1.1alpha+20120614-2.1

Versions of packages lintian recommends:
ii  dpkg 1.18.10
pn  libperlio-gzip-perl  
ii  perl 5.22.2-3
ii  perl-modules-5.22 [libautodie-perl]  5.22.2-3

Versions of packages lintian suggests:
pn  binutils-multiarch 
ii  dpkg-dev   1.18.10
ii  libhtml-parser-perl3.72-2
pn  libtext-template-perl  

-- no debconf information