Bug#542747: [frontend] check mismatch between Distribution and Changes in *.changes

2017-02-23 Thread Simon McVittie
On Thu, 20 Aug 2009 at 23:07:38 -0700, Russ Allbery wrote:
> While we can't easily check for mismatches between the *.changes file
> and the debian/changelog file in the source package, the latter is
> copied into *.changes as the Changes field.  We can therefore check
> whether the distribution in the first line of the Changes field matches
> the Distribution.

This has come up on -devel again, which reminded me that this didn't get
merged. Please could a maintainer review it? I believe it's ready (unless
the requirements for a new Lintian check have changed significantly since
I last revised it in 2015).

ssh://git.debian.org/git/users/smcv/lintian.git changes-vs-changes

If alterations are needed, I will try to do them quickly.

For tl;dr purposes, a reminder of what it will typically emit:

> # sbuild -d unstable, debian/changelog says experimental
> # (the case you typically have to fix with epochs)
> E: mypackage changes: distribution-and-experimental-mismatch unstable
> 
> # sbuild -d unstable, debian/changelog says UNRELEASED
> E: mypackage changes: unreleased-changes
> 
> # sbuild -d stable, debian/changelog says unstable
> # (or other distributions known to Lintian)
> W: mypackage changes: distribution-and-changes-mismatch stable unstable

Regards,
S



Bug#542747: [frontend] check mismatch between Distribution and Changes in *.changes

2010-05-27 Thread Simon McVittie
On Sun, 06 Dec 2009 at 05:04:49 +0100, Cyril Brulebois wrote:
 Russ Allbery r...@debian.org (20/08/2009):
  I think we only want to do this check if the first line of the
  Changes file says UNRELEASED, since there are valid use cases for a
  mismatch otherwise.
 
 Personally, I would have *really* ***loved*** to have such a check in
 place. #559659 led me to upload a few dozens of packages to the wrong
 distribution, without having a fighting chance since lintian said
 nothing.
 
 As a “compromise” with what you were proposing, I guess it could be an
 E: in the UNRELEASED case, and a W: in other cases?

Having managed to upload an experimental package to unstable *again*, I've
written a Lintian check for this. It specifically looks for an
unstable/experimental mismatch and reports it as important/certain;
other apparent mismatches are normal/possible, because Russ said
there are valid use cases (I'm not sure what they are, perhaps you could
add them to the .desc?). Adding a specific check for UNRELEASED would
probably be good too.

The parsing is a bit suspicious because I couldn't work out how to make
Lintian cross-reference debian/changelog with the changes file, so I'm
just using the Changes field and a regex. It's better than nothing, though...

Simon


signature.asc
Description: Digital signature


Bug#542747: [frontend] check mismatch between Distribution and Changes in *.changes

2010-05-27 Thread Simon McVittie
On Thu, 27 May 2010 at 13:22:31 +0100, Simon McVittie wrote:
 Having managed to upload an experimental package to unstable *again*, I've
 written a Lintian check for this.

... which I then failed to attach.
From e6d3e117882c97af2dd5748c95d78eec98e574bd Mon Sep 17 00:00:00 2001
From: Simon McVittie s...@debian.org
Date: Thu, 27 May 2010 13:14:23 +0100
Subject: [PATCH] Bug #540294: add a check for mismatched .changes and Changes: distribution

---
 checks/changes-file  |   15 +++
 checks/changes-file.desc |   14 ++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/checks/changes-file b/checks/changes-file
index 887d19e..34c25d6 100644
--- a/checks/changes-file
+++ b/checks/changes-file
@@ -25,6 +25,8 @@ use Util;
 use Lintian::Tags qw(tag);
 use Lintian::Check qw(check_maintainer);
 
+use Parse::DebianChangelog;
+
 my $check_checksums = $main::check_checksums;
 
 sub run {
@@ -73,6 +75,19 @@ if (defined $info-field('distribution')) {
 	# bad distribution entry
 	tag(bad-distribution-in-changes-file, $distribution);
 	}
+
+	my $changes = $info-field('changes');
+	# first line
+	$changes =~ s/^\s+//;
+	$changes =~ s/\n.*//s;
+
+	if ($distribution eq 'unstable'  $changes =~ m/\)\s*experimental\s*;/) {
+	tag(unstable-in-changes-experimental-in-changelog);
+	}
+	elsif ($changes !~ m/^[^\n]+\)\s*\Q$distribution\E\s*;/) {
+	tag(distribution-in-changes-does-not-match-changelog,
+		$distribution / $changes);
+	}
 }
 
 if ($#distributions  0) {
diff --git a/checks/changes-file.desc b/checks/changes-file.desc
index 5356ae2..346f59d 100644
--- a/checks/changes-file.desc
+++ b/checks/changes-file.desc
@@ -128,3 +128,17 @@ Certainty: certain
 Info: The Changed-By address includes localhost(.localdomain), which is
  an invalid e-mail address.
 Ref: policy 5.6.2
+
+Tag: unstable-in-changes-experimental-in-changelog
+Severity: important
+Certainty: certain
+Info: The tt.changes/tt file is for an upload to unstable, but the
+ ttChanges/tt field copied from ttdebian/changelog/tt indicates that
+ experimental was intended.
+
+Tag: distribution-in-changes-does-not-match-changelog
+Severity: normal
+Certainty: possible
+Info: The distribution in the tt.changes/tt file, and the distribution
+ in the ttChanges/tt field copied from ttdebian/changelog/tt, do not
+ match.
-- 
1.7.1



signature.asc
Description: Digital signature


Bug#542747: [frontend] check mismatch between Distribution and Changes in *.changes

2009-12-05 Thread Cyril Brulebois
Russ Allbery r...@debian.org (20/08/2009):
 I think we only want to do this check if the first line of the
 Changes file says UNRELEASED, since there are valid use cases for a
 mismatch otherwise.

Personally, I would have *really* ***loved*** to have such a check in
place. #559659 led me to upload a few dozens of packages to the wrong
distribution, without having a fighting chance since lintian said
nothing.

As a “compromise” with what you were proposing, I guess it could be an
E: in the UNRELEASED case, and a W: in other cases?

Mraw,
KiBi.


signature.asc
Description: Digital signature


Bug#542747: [frontend] check mismatch between Distribution and Changes in *.changes

2009-08-21 Thread Russ Allbery
Package: lintian
Version: 2.2.14
Severity: wishlist

While we can't easily check for mismatches between the *.changes file
and the debian/changelog file in the source package, the latter is
copied into *.changes as the Changes field.  We can therefore check
whether the distribution in the first line of the Changes field matches
the Distribution.

I think we only want to do this check if the first line of the Changes
file says UNRELEASED, since there are valid use cases for a mismatch
otherwise.  But in the UNRELEASED case, that means that someone forgot
to update debian/changelog and only modified what went into the
Distribution header, which deserves a tag.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686-bigmem (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lintian depends on:
ii  binutils  2.19.51.20090723-1 The GNU assembler, linker and bina
ii  diffstat  1.47-1 produces graph of changes introduc
ii  dpkg-dev  1.15.3.1   Debian package development tools
ii  file  5.03-1 Determines file type using magic
ii  gettext   0.17-6 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  libipc-run-perl   0.84-1 Perl module for running processes
ii  libparse-debianchange 1.1.1-2parse Debian changelogs and output
ii  libtimedate-perl  1.1600-9   Time and date functions for Perl
ii  liburi-perl   1.37+dfsg-1Manipulates and accesses URI strin
ii  man-db2.5.5-3on-line manual pager
ii  perl [libdigest-sha-p 5.10.0-24  Larry Wall's Practical Extraction 

lintian recommends no packages.

Versions of packages lintian suggests:
pn  binutils-multiarchnone (no description available)
ii  libtext-template-perl 1.45-1 Text::Template perl module
ii  man-db2.5.5-3on-line manual pager

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org