Bug#486145: lintian: Please downgrade depends-on-obsolete-package to warning for alternative OR'ed dependencies

2008-06-16 Thread Adam D. Barratt
tags 486145 + patch
thanks

Hi,

On Sun, 2008-06-15 at 14:32 +0200, Raphael Hertzog wrote:
 On Fri, 13 Jun 2008, Kevin B. McCarty wrote:
  For instance, if bar is a known obsolete package, then the following in
  debian/control:
  
  (Build-)Depends: foo | bar
  
  will trigger a Lintian error.
  
  It would be preferable for the severity in this case to be only a
  warning instead of an error.
[...]
 (only speaking of obsolete package in OR, unconditional dependency on
 obsolete package is certainly an error, also the obsolete package should
 never appear in the first position in an OR dependency)

Please find attached a proposed patch for this. I've currently
implemented the new tag as a warning, but that's obviously easily
changeable.

The patch modifies the check logic to use the current tag if the first
package in an ORed dependency is obsolete or if all the alternatives are
obsolete. An obsolete package occurring as the second or subsequent
alternative generates the new tag.

By way of a couple of examples:

Dependency: gs | ghostscript | gs-aladdin
Result: depends-on-obsolete-package gs
ored-depends-on-obsolete-package gs-aladdin

Dependency: gs | gs-aladdin | ghostscript
Result: depends-on-obsolete-package gs
ored-depends-on-obsolete-package gs-aladdin

Dependency: gs | gs-gpl
Result: depends-on-obsolete-package gs
depends-on-obsolete-package gs-gpl

Dependency: ghostscript | gs
Result: ored-depends-on-obsolete-package gs

Regards,

Adam
--- checks/fields.orig	2008-06-16 20:05:37.0 +0100
+++ checks/fields	2008-06-16 20:25:19.0 +0100
@@ -441,7 +441,7 @@
 			if ($data =~ /\|/  ! $is_dep_field($field));
 
 			for my $dep (split /\s*,\s*/, $data) {
-my @alternatives;
+my (@alternatives, @seen_obsolete_packages);
 push @alternatives, [_split_dep($_), $_] for (split /\s*\|\s*/, $dep);
 
 if ($is_dep_field($field)) {
@@ -494,7 +494,7 @@
 	tag bad-relation, $field: $part_d_orig
 	if $rest;
 
-	tag depends-on-obsolete-package, $field: $part_d_orig
+	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
@@ -523,6 +523,15 @@
 	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);
--- checks/fields.desc.orig	2008-06-16 20:06:10.0 +0100
+++ checks/fields.desc	2008-06-16 20:05:47.0 +0100
@@ -374,6 +374,13 @@
 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: warning
+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
--- testset/relations/debian/control.orig	2008-06-16 20:06:59.0 +0100
+++ testset/relations/debian/control	2008-06-16 20:23:05.0 +0100
@@ -2,7 +2,7 @@
 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),
+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]
@@ -23,7 +23,7 @@
 Conflicts: foobar ( 55), 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}
+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.
@@ -36,9 +36,9 @@
 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}
 

Bug#486145: lintian: Please downgrade depends-on-obsolete-package to warning for alternative OR'ed dependencies

2008-06-15 Thread Raphael Hertzog
severity 486145 normal
thanks

Upgrading to normal because lintian is really wrong. It's not just a
wishlist.

On Fri, 13 Jun 2008, Kevin B. McCarty wrote:
 The Lintian build-depends-on-obsolete-package and
 depends-on-obsolete-package checks are useful.  But they make it harder
 to write debian/control to be backport-friendly, that is in such a way
 that only a rebuild on an Etch system with satisfied build-deps (rather
 than editing debian/control) is required when backporting.  This is
 because Lintian checks even alternative packages in OR'ed dependencies.
 
 For instance, if bar is a known obsolete package, then the following in
 debian/control:
 
 (Build-)Depends: foo | bar
 
 will trigger a Lintian error.
 
 It would be preferable for the severity in this case to be only a
 warning instead of an error.

Fully agreed. It should even be I only. Ideally the obsolete package
would be associated with the release were they have been obsoleted so that
the I could be upgraded to W in release + 1 and E in release + 2.

(only speaking of obsolete package in OR, unconditional dependency on
obsolete package is certainly an error, also the obsolete package should
never appear in the first position in an OR dependency)

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#486145: lintian: Please downgrade depends-on-obsolete-package to warning for alternative OR'ed dependencies

2008-06-15 Thread Frank Lichtenheld
On Sun, Jun 15, 2008 at 02:32:01PM +0200, Raphael Hertzog wrote:
 On Fri, 13 Jun 2008, Kevin B. McCarty wrote:
  (Build-)Depends: foo | bar
  
  will trigger a Lintian error.
  
  It would be preferable for the severity in this case to be only a
  warning instead of an error.
 
 Fully agreed. It should even be I only. Ideally the obsolete package
 would be associated with the release were they have been obsoleted so that
 the I could be upgraded to W in release + 1 and E in release + 2.
 
 (only speaking of obsolete package in OR, unconditional dependency on
 obsolete package is certainly an error, also the obsolete package should
 never appear in the first position in an OR dependency)

Note that due to the limitations of sbuild an obsolete package in an
OR'ed dependency in Build-Depends generally is useless. So downgrading
this only makes sense for Dependencies.

Gruesse,
-- 
Frank Lichtenheld [EMAIL PROTECTED]
www: http://www.djpig.de/



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#486145: lintian: Please downgrade depends-on-obsolete-package to warning for alternative OR'ed dependencies

2008-06-15 Thread Russ Allbery
Raphael Hertzog [EMAIL PROTECTED] writes:

 Fully agreed. It should even be I only. Ideally the obsolete package
 would be associated with the release were they have been obsoleted so that
 the I could be upgraded to W in release + 1 and E in release + 2.

The amusing thing is that Lintian has worked like this for years without
anyone noticing since the obsolete package list was horribly old.  The
code that checks this doesn't even know whether it's in an alternative or
not (and never has).

I agree with you that it's not correct the way it is.

-- 
Russ Allbery ([EMAIL PROTECTED])   http://www.eyrie.org/~eagle/



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#486145: lintian: Please downgrade depends-on-obsolete-package to warning for alternative OR'ed dependencies

2008-06-13 Thread Kevin B. McCarty
Package: lintian
Version: 1.24.0
Severity: wishlist

Hi,

The Lintian build-depends-on-obsolete-package and
depends-on-obsolete-package checks are useful.  But they make it harder
to write debian/control to be backport-friendly, that is in such a way
that only a rebuild on an Etch system with satisfied build-deps (rather
than editing debian/control) is required when backporting.  This is
because Lintian checks even alternative packages in OR'ed dependencies.

For instance, if bar is a known obsolete package, then the following in
debian/control:

(Build-)Depends: foo | bar

will trigger a Lintian error.

It would be preferable for the severity in this case to be only a
warning instead of an error.

best regards,

-- 
Kevin B. McCarty [EMAIL PROTECTED]
WWW: http://www.starplot.org/
WWW: http://people.debian.org/~kmccarty/
GPG: public key ID 4F83C751



signature.asc
Description: OpenPGP digital signature