[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#234202: Missing attachement (was: Lintian watch file support)



Hi,

attached the missing attachement.

Regards,
Patrick
--- Begin Message ---
Tags 234202 + patch
Tags 456629 + patch
thanks

Hi,

attached is patch against the current vcs version of lintian which adds
support for missing watch file detection and missing version mangling
in debian/watch for dfsg-ed packages.

Best Regards,
Patrick

--- End Message ---
Index: checks/watch-file
===================================================================
--- checks/watch-file	(Revision 0)
+++ checks/watch-file	(Revision 0)
@@ -0,0 +1,62 @@
+# watch-file -- lintian check script -*- perl -*-
+#
+# Copyright (C) 2008 Patrick Schoenfeld
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::watch_file;
+use strict;
+use lib "$ENV{'LINTIAN_ROOT'}/checks/";
+use common_data;
+use Dep;
+use Util;
+use Tags;
+
+sub run {
+
+my $pkg = shift;
+my $type = shift;
+
+open (VERSION, '< fields/version') or fail("cannot open fields/version: $!");
+chomp(my $version = <VERSION>);
+close VERSION;
+my $native = (! -f "${pkg}_${version}.diff.gz");
+
+if (!$native) {
+    if (!-f "debfiles/watch") {
+	tag "debian-watch-file-is-missing", "";
+    }
+    else {
+        if ($version =~ /dfsg/) {
+	    my $mangle_option_found = 0;
+	    open(WATCH_FILE, "< debfiles/watch") or fail("cannot open watch file for reading: $!");
+	    while(<WATCH_FILE>) {
+		if (/opts="*(uversionmangle|dversionmangle)/) {
+		    $mangle_option_found = 1;
+		}
+	    }
+
+	    if ($mangle_option_found != 1) {
+		tag "debian-watch-file-does-not-reflect-dfsg-version", "";
+	    }
+	}
+    }
+}
+}
+1;
+#
+# vim: syntax=perl sw=4 ts=4 noet shiftround
Index: checks/watch-file.desc
===================================================================
--- checks/watch-file.desc	(Revision 0)
+++ checks/watch-file.desc	(Revision 0)
@@ -0,0 +1,28 @@
+Check-Script: watch-file
+Author: Patrick Schoenfeld <schoenfeld@in-medisa-res.com>
+Abbrev: watch
+Type: source
+Unpack-Level: 1
+Needs-Info: debfiles
+Info: This script checks debian/watch files in source packages
+
+Tag: debian-watch-file-is-missing
+Type: info
+Ref: 4.11
+Info: The source package misses a <tt>debian/watch</tt> file.
+ This file is used to detect newer upstream versions in an automatical manner.
+ It is used by the Debian External Health Status project and others. Its highly
+ recommended to include a watch file in a package to support this.
+ .
+ See the uscan(1) manpage (part of devscripts) for details.
+
+Tag: debian-watch-file-does-not-reflect-dfsg-version
+Type: warning
+Info: The version of the package contains the dfsg string, which indicates that
+ the upstream source has been changed in order to comply with the
+ Debian Free Software Guidelines, but the watch file does not include any
+ mangling option. Therefore the watch file is likely to be useless,
+ as comparing the upstream version with the current local version will result
+ in false results.
+ .
+ See the uscan(1) manpage (part of devscripts) for details.

Reply to: