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

[SCM] Debian package checker branch, master, updated. 2.3.3-45-g5eb50bf



The following commit has been merged in the master branch:
commit 605002a29c854d19ed4e9968e99e35f70a5043c4
Author: Raphaël Hertzog <hertzog@debian.org>
Date:   Wed Mar 3 20:26:23 2010 +0100

    New check script debian-source-dir
    
    This script is meant to contain all checks made on debian/source/* files.
    This initial implementation only covers debian/source/format.

diff --git a/checks/etcfiles b/checks/debian-source-dir
similarity index 52%
copy from checks/etcfiles
copy to checks/debian-source-dir
index bc61715..8c4281d 100644
--- a/checks/etcfiles
+++ b/checks/debian-source-dir
@@ -1,6 +1,6 @@
-# etcfiles -- lintian check script -*- perl -*-
+# debian/source directory content -- lintian check script -*- perl -*-
 
-# Copyright (C) 2000 by Sean 'Shaleh' Perry
+# Copyright (C) 2010 by Raphaël Hertzog
 #
 # 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
@@ -18,47 +18,44 @@
 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
 # MA 02110-1301, USA.
 
-package Lintian::etcfiles;
+package Lintian::debian_source_dir;
 use strict;
-use Util;
+
+use Lintian::Data;
 use Lintian::Tags qw(tag);
 
+our %KNOWN_FORMATS = (
+    "1.0" => 1,
+    "2.0" => 1,
+    "3.0 (quilt)" => 1,
+    "3.0 (native)" => 1,
+    "3.0 (git)" => 1,
+    "3.0 (bzr)" => 1,
+);
+
 sub run {
 
 my $pkg = shift;
 my $type = shift;
 my $info = shift;
 
-my %conffiles;
-
-my $conffiles = "control/conffiles";
-
-# load conffiles
-if (open(IN, '<', $conffiles)) {
-    while (<IN>) {
-	chop;
-	next if m/^\s*$/o;
-	s,^/,,;
-	$conffiles{$_} = 1;
-    }
-    close(IN);
-}
-
-# Read package contents...
-foreach my $file (sort keys %{$info->index}) {
-    my $index_info = $info->index->{$file};
-    next unless $file =~ m,^etc, and $index_info->{type}=~ m/^[-h]/;
-
-    # If there is a /etc/foo, it must be a conffile (with a few exceptions).
-    if (not exists($conffiles{$file})
-	and $file !~ m,/README$,
-	and $file ne 'etc/init.d/skeleton'
-	and $file ne 'etc/init.d/rc'
-	and $file ne 'etc/init.d/rcS') {
-	tag "file-in-etc-not-marked-as-conffile", "/$file";
-    }
+if (-e "debfiles/source/format") {
+    open(FORMAT, "<", "debfiles/source/format") or
+	fail("cannot read debian/source/format: $!");
+    my $format = <FORMAT>;
+    chomp $format;
+    tag "unknown-source-format", $format unless $KNOWN_FORMATS{$format};
+    tag "using-old-source-format" if $format eq "1.0";
+} else {
+    tag "missing-debian-source-format";
 }
 
 }
 
 1;
+
+# Local Variables:
+# indent-tabs-mode: t
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 ts=8 noet shiftround
diff --git a/checks/debian-source-dir.desc b/checks/debian-source-dir.desc
new file mode 100644
index 0000000..0399012
--- /dev/null
+++ b/checks/debian-source-dir.desc
@@ -0,0 +1,43 @@
+Check-Script: debian-source-dir
+Author: Raphaël Hertzog <hertzog@debian.org>
+Abbrev: dsd
+Type: source
+Info: This script looks for mistakes in debian/source/* files.
+Needs-Info: debfiles
+
+Tag: missing-debian-source-format
+Severity: normal
+Certainty: certain
+Info: With the introduction of new source formats, it's now recommended to
+ explicitly select the desired source format in debian/source/format.
+ .
+ If you don't have a good reason to stick with the old format,
+ you should switch to "3.0 (quilt)" (for packages with a separate
+ upstream tarball) or to "3.0 (native)" (for Debian native packages).
+ .
+ If you plan to keep using the old format, you should still create
+ that file and put "1.0" in it. In that case, you are invited to get in
+ touch with debian-dpkg@lists.debian.org to discuss the (technical) reasons
+ why the new formats do not suit you.
+Ref: dpkg-source(1), http://wiki.debian.org/Projects/DebSrc3.0
+
+Tag: unknown-source-format
+Severity: serious
+Certainty: certain
+Info: debian/source/format contains an unknown source format. The
+ formats officially supported by Debian are "3.0 (quilt)", "3.0 (native)"
+ and "1.0". dpkg-source additionnaly supports "2.0", "3.0 (git)" and
+ "3.0 (bzr)".
+Ref: dpkg-source(1)
+
+Tag: using-old-source-format
+Severity: pedantic
+Certainty: certain
+Info: The source package is still using the old source format "1.0" while
+ "3.0 (quilt)" and "3.0 (native)" are the recommended formats for use
+ within Debian.
+ .
+ See http://wiki.debian.org/Projects/DebSrc3.0 for basic information about
+ updating packages to use the new source formats.
+Ref: dpkg-source(1)
+

-- 
Debian package checker


Reply to: