Author: rra
Date: 2008-06-05 03:42:59 +0200 (Thu, 05 Jun 2008)
New Revision: 1336

Modified:
   trunk/checks/fields
   trunk/checks/fields.desc
   trunk/debian/changelog
   trunk/testset/tags.relations
Log:
* checks/fields:
  + [RA] Syntax-check Breaks like other relationship fields.  Warn if
    any packages use Breaks for right now.  Only check for duplicate
    libraries and Tcl versions in dependency fields, not Breaks,
    Conflicts, and other similar fields.  Warn if Breaks is used without
    a version.  Check that Breaks is not inconsistent with other
    dependency fields.

Modified: trunk/checks/fields
===================================================================
--- trunk/checks/fields 2008-06-05 01:30:14 UTC (rev 1335)
+++ trunk/checks/fields 2008-06-05 01:42:59 UTC (rev 1336)
@@ -421,7 +421,7 @@
                $debugpackage = 1;
                $debugbase = $1;
        }
-       for my $field (qw(depends pre-depends recommends suggests conflicts 
provides replaces)) {
+       for my $field (qw(depends pre-depends recommends suggests conflicts 
provides replaces breaks)) {
                if (open(FH, '<', "fields/$field")) {
                        #Get data and clean it
                        my $data = <FH>;
@@ -434,6 +434,8 @@
 
                        my $is_dep_field = sub { grep { $_ eq $_[0] } 
qw(depends pre-depends recommends suggests) };
 
+                       tag "package-uses-breaks" if $field eq "breaks";
+
                        tag "alternates-not-allowed", "$field"
                            if ($data =~ /\|/ && ! &$is_dep_field($field));
 
@@ -441,12 +443,20 @@
                                my @alternatives;
                                push @alternatives, [_split_dep($_), $_] for 
(split /\s*\|\s*/, $dep);
 
-                               push @seen_libstdcs, $alternatives[0]->[0] if 
defined $known_libstdcs{$alternatives[0]->[0]};
-                               push @seen_tcls, $alternatives[0]->[0] if 
defined $known_tcls{$alternatives[0]->[0]};
-                               push @seen_tclxs, $alternatives[0]->[0] if 
defined $known_tclxs{$alternatives[0]->[0]};
-                               push @seen_tks, $alternatives[0]->[0] if 
defined $known_tks{$alternatives[0]->[0]};
-                               push @seen_tkxs, $alternatives[0]->[0] if 
defined $known_tkxs{$alternatives[0]->[0]};
-                               push @seen_libpngs, $alternatives[0]->[0] if 
defined $known_libpngs{$alternatives[0]->[0]};
+                               if (&$is_dep_field($field)) {
+                                       push @seen_libstdcs, 
$alternatives[0]->[0]
+                                           if defined 
$known_libstdcs{$alternatives[0]->[0]};
+                                       push @seen_tcls, $alternatives[0]->[0]
+                                           if defined 
$known_tcls{$alternatives[0]->[0]};
+                                       push @seen_tclxs, $alternatives[0]->[0]
+                                           if defined 
$known_tclxs{$alternatives[0]->[0]};
+                                       push @seen_tks, $alternatives[0]->[0]
+                                           if defined 
$known_tks{$alternatives[0]->[0]};
+                                       push @seen_tkxs, $alternatives[0]->[0]
+                                           if defined 
$known_tkxs{$alternatives[0]->[0]};
+                                       push @seen_libpngs, 
$alternatives[0]->[0]
+                                           if defined 
$known_libpngs{$alternatives[0]->[0]};
+                               }
 
                                # Only for (Pre-)?Depends.
                                tag 
"virtual-package-depends-without-real-package-depends", "$field: 
$alternatives[0]->[0]"
@@ -468,6 +478,9 @@
                                        tag "versioned-provides", "$part_d_orig"
                                            if ($field eq "provides" && 
$d_version->[0]);
 
+                                       tag "breaks-without-version", 
"$part_d_orig"
+                                           if ($field eq "breaks" && 
!$d_version->[0]);
+
                                        tag "obsolete-relation-form", "$field: 
$part_d_orig"
                                            if ($d_version && grep { 
$d_version->[0] eq $_ } ("<", ">"));
 
@@ -528,14 +541,15 @@
        tag "dbg-package-missing-depends", $debugbase
                if ($debugpackage && !$debugfound);
 
-       # If Conflicts is set, make sure it's not inconsistent with the other
-       # dependency fields.
-       if ($fields{conflicts}) {
+       # If Conflicts or Breaks is set, make sure it's not inconsistent with
+       # the other dependency fields.
+       for my $conflict (qw/conflicts breaks/) {
+               next unless $fields{$conflict};
                for my $field (qw(depends pre-depends recommends suggests)) {
                        next unless $parsed{$field};
-                       for my $conflict (split /\s*,\s*/, $fields{conflicts}) {
-                               tag "conflicts-with-dependency", $conflict
-                                   if Dep::implies($parsed{$field}, 
Dep::parse($conflict));
+                       for my $package (split /\s*,\s*/, $fields{$conflict}) {
+                               tag "conflicts-with-dependency", $field, 
$package
+                                   if Dep::implies($parsed{$field}, 
Dep::parse($package));
                        }
                }
        }

Modified: trunk/checks/fields.desc
===================================================================
--- trunk/checks/fields.desc    2008-06-05 01:30:14 UTC (rev 1335)
+++ trunk/checks/fields.desc    2008-06-05 01:42:59 UTC (rev 1336)
@@ -636,10 +636,25 @@
 
 Tag: conflicts-with-dependency
 Type: error
-Ref: 7.3
+Ref: policy 7.4
 Info: The package seems to conflict with one of its dependencies,
- recommendations, or suggestions.
+ recommendations, or suggestions by listing it in Conflicts or Breaks.
 
+Tag: package-uses-breaks
+Type: warning
+Ref: policy 7.3
+Info: This package uses the Breaks control field.  This control field
+ should not be used until the stable release of Debian supports Breaks.
+
+Tag: breaks-without-version
+Type: warning
+Ref: policy 7.3
+Info: This package declares a Breaks relationship with another package
+ that has no version number.  Normally, Breaks should be used to indicate
+ an incompatibility with a specific version of another package, or with
+ all versions predating a fix.  If the two packages can never be installed
+ at the same time, Conflicts should normally be uesd instead.
+
 Tag: bad-menu-item
 Type: error
 Info: The field Installer-Menu-Item should only contain positive integer

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-06-05 01:30:14 UTC (rev 1335)
+++ trunk/debian/changelog      2008-06-05 01:42:59 UTC (rev 1336)
@@ -6,6 +6,13 @@
     + [RA] Check for self-dependencies in the source package since the
       current dpkg-gencontrol silently fixes them but they may indicate
       other problems.  Thanks, Patrick Matthäi.  (Closes: #471740)
+  * checks/fields:
+    + [RA] Syntax-check Breaks like other relationship fields.  Warn if
+      any packages use Breaks for right now.  Only check for duplicate
+      libraries and Tcl versions in dependency fields, not Breaks,
+      Conflicts, and other similar fields.  Warn if Breaks is used without
+      a version.  Check that Breaks is not inconsistent with other
+      dependency fields.
   * checks/md5sums:
     + [FL] Don't complain about missing md5sums file if the
       package only contains conffiles.  (Closes: #482869)

Modified: trunk/testset/tags.relations
===================================================================
--- trunk/testset/tags.relations        2008-06-05 01:30:14 UTC (rev 1335)
+++ trunk/testset/tags.relations        2008-06-05 01:42:59 UTC (rev 1336)
@@ -9,6 +9,7 @@
 E: relations source: invalid-arch-string-in-source-relation test 
[build-conflicts: bar [alpha test]]
 E: relations source: missing-build-dependency libmodule-build-perl
 E: relations source: section-category-mismatch Package relations-multiple-libs
+E: relations-multiple-libs: conflicts-with-dependency depends libpng2
 E: relations-multiple-libs: description-synopsis-is-duplicated
 E: relations-multiple-libs: package-depends-on-multiple-libpng-versions 
libpng2 libpng3
 E: relations-multiple-libs: package-depends-on-multiple-libstdc-versions 
libstdc++2.10 libstdc++2.10-glibc2.2 libstdc++3.0
@@ -17,8 +18,8 @@
 E: relations-multiple-libs: package-depends-on-multiple-tkx-versions tkx8.2 
tkx8.3
 E: relations-multiple-libs: usr-share-doc-symlink-without-dependency relations
 E: relations: bad-version-in-relation conflicts: foobar (<< 5&5)
-E: relations: conflicts-with-dependency foo
-E: relations: conflicts-with-dependency relations
+E: relations: conflicts-with-dependency depends foo
+E: relations: conflicts-with-dependency depends relations
 E: relations: depends-on-essential-package-without-using-version depends: 
coreutils
 E: relations: depends-on-essential-package-without-using-version depends: dpkg
 E: relations: needlessly-depends-on-awk pre-depends
@@ -45,7 +46,9 @@
 W: relations source: stronger-dependency-implies-weaker 
relations-multiple-libs depends -> recommends ${shlibs:Depends}
 W: relations source: virtual-package-depends-without-real-package-depends 
build-depends: mail-transport-agent
 W: relations-multiple-libs: bad-homepage lintian.debian.org
+W: relations-multiple-libs: breaks-without-version libpng2
 W: relations-multiple-libs: description-synopsis-might-not-be-phrased-properly
+W: relations-multiple-libs: package-uses-breaks
 W: relations-multiple-libs: redundant-bugs-field
 W: relations-multiple-libs: redundant-origin-field
 W: relations: bad-homepage lintian.debian.org


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

Reply via email to