[SCM] Debian package checker branch, master, updated. 2.5.2-6-g82b763e
The following commit has been merged in the master branch:
commit 5eaf7cbd8535f0b5c20986cde5ed1d6db4fc7987
Author: Jakub Wilk <jwilk@debian.org>
Date: Sat Aug 13 15:47:02 2011 +0200
Merge the etcfiles check into conffiles
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/checks/conffiles b/checks/conffiles
index 9a1cd12..fe1ace7 100644
--- a/checks/conffiles
+++ b/checks/conffiles
@@ -1,6 +1,7 @@
# conffiles -- lintian check script -*- perl -*-
# Copyright (C) 1998 Christian Schwarz
+# Copyright (C) 2000 Sean 'Shaleh' Perry
#
# 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
@@ -33,40 +34,55 @@ my $info = shift;
my $cf = $info->control('conffiles');
-# conffiles?
-unless (-f $cf) {
- return 0;
-}
my %conffiles = ();
-open(IN, '<', $cf) or fail("cannot open $cf for reading: $!");
-while (<IN>) {
- chop;
- next if m/^\s*$/;
+if (-f $cf) {
- unless (m,^/,) {
- tag 'relative-conffile', $_;
- $_ = '/' . $_;
- }
- my $file = $_;
- $file =~ s@^/++@@o;
- $conffiles{$file}++;
+ open(IN, '<', $cf) or fail("cannot open $cf for reading: $!");
+ while (<IN>) {
+ chop;
+ next if m/^\s*$/;
- if ($conffiles{$file} > 1) {
- tag 'duplicate-conffile', $file;
- }
+ unless (m,^/,) {
+ tag 'relative-conffile', $_;
+ $_ = '/' . $_;
+ }
+ my $file = $_;
+ $file =~ s@^/++@@o;
+ $conffiles{$file}++;
+
+ if ($conffiles{$file} > 1) {
+ tag 'duplicate-conffile', $file;
+ }
- if (m,^/usr/,) {
- tag 'file-in-usr-marked-as-conffile', $file;
- } else {
- unless (m,^/etc/,) {
- tag 'non-etc-file-marked-as-conffile', $file;
+ if (m,^/usr/,) {
+ tag 'file-in-usr-marked-as-conffile', $file;
+ } else {
+ unless (m,^/etc/,) {
+ tag 'non-etc-file-marked-as-conffile', $file;
+ }
}
+
}
+ close(IN);
+
+}
+# Read package contents...
+foreach my $file (@{$info->sorted_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;
+ }
}
-close(IN);
}
diff --git a/checks/conffiles.desc b/checks/conffiles.desc
index badc6b1..c14bf43 100644
--- a/checks/conffiles.desc
+++ b/checks/conffiles.desc
@@ -37,3 +37,10 @@ Info: The file is listed more than once in your <tt>debian/conffiles</tt> file.
Usually, this is because debhelper (dh_installdeb, compat level 3 or higher)
will add any files in your package located in /etc automatically to the list
of conffiles, so if you do that manually too, you'll get duplicates.
+
+Tag: file-in-etc-not-marked-as-conffile
+Severity: serious
+Certainty: certain
+Ref: policy 10.7
+Info: Files in <tt>/etc</tt> must be marked conffiles if they are included
+ in a package. Otherwise they should be created by maintainer scripts.
diff --git a/checks/etcfiles b/checks/etcfiles
deleted file mode 100644
index 77058b7..0000000
--- a/checks/etcfiles
+++ /dev/null
@@ -1,66 +0,0 @@
-# etcfiles -- lintian check script -*- perl -*-
-
-# Copyright (C) 2000 by Sean 'Shaleh' Perry
-#
-# 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::etcfiles;
-use strict;
-use warnings;
-
-use Util;
-use Lintian::Tags qw(tag);
-
-sub run {
-
-my $pkg = shift;
-my $type = shift;
-my $info = shift;
-
-my %conffiles;
-
-my $conffiles = $info->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 (@{$info->sorted_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;
- }
-}
-
-}
-
-1;
diff --git a/checks/etcfiles.desc b/checks/etcfiles.desc
deleted file mode 100644
index b9e1c72..0000000
--- a/checks/etcfiles.desc
+++ /dev/null
@@ -1,14 +0,0 @@
-Check-Script: etcfiles
-Author: Sean 'Shaleh' Perry <shaleh@debian.org>
-Abbrev: etc
-Type: binary
-Info: Checks if all files in /etc that are shipped with the package are
- marked as conffiles as required by policy.
-Needs-info: bin-pkg-control, index
-
-Tag: file-in-etc-not-marked-as-conffile
-Severity: serious
-Certainty: certain
-Ref: policy 10.7
-Info: Files in <tt>/etc</tt> must be marked conffiles if they are included
- in a package. Otherwise they should be created by maintainer scripts.
diff --git a/profiles/debian/main.profile b/profiles/debian/main.profile
index b856c33..4210259 100644
--- a/profiles/debian/main.profile
+++ b/profiles/debian/main.profile
@@ -4,8 +4,8 @@ Extends: debian/ftp-master-auto-reject
Enable-Tags-From-Check: binaries, changelog-file, changes-file, circular-deps, conffiles,
control-file, control-files, copyright-file, cruft, deb-format, debconf,
debhelper, debian-readme, debian-source-dir, description, duplicate-files,
- etcfiles, fields, filename-length, files, huge-usr-share, infofiles, init.d,
- java, lintian, manpages, md5sums, menu-format, menus, nmu, ocaml, patch-systems,
+ fields, filename-length, files, huge-usr-share, infofiles, init.d, java,
+ lintian, manpages, md5sums, menu-format, menus, nmu, ocaml, patch-systems,
po-debconf, rules, scripts, shared-libs, standards-version, symlinks,
version-substvars, watch-file
diff --git a/t/tests/etcfiles-etc-not-marked/debian/debian/install b/t/tests/conffiles-etc-not-marked/debian/debian/install
similarity index 100%
rename from t/tests/etcfiles-etc-not-marked/debian/debian/install
rename to t/tests/conffiles-etc-not-marked/debian/debian/install
diff --git a/t/tests/etcfiles-etc-not-marked/debian/debian/rules b/t/tests/conffiles-etc-not-marked/debian/debian/rules
similarity index 100%
rename from t/tests/etcfiles-etc-not-marked/debian/debian/rules
rename to t/tests/conffiles-etc-not-marked/debian/debian/rules
diff --git a/t/tests/etcfiles-etc-not-marked/debian/something.conf b/t/tests/conffiles-etc-not-marked/debian/something.conf
similarity index 100%
rename from t/tests/etcfiles-etc-not-marked/debian/something.conf
rename to t/tests/conffiles-etc-not-marked/debian/something.conf
diff --git a/t/tests/etcfiles-etc-not-marked/desc b/t/tests/conffiles-etc-not-marked/desc
similarity index 80%
rename from t/tests/etcfiles-etc-not-marked/desc
rename to t/tests/conffiles-etc-not-marked/desc
index 60b86e7..9edbc51 100644
--- a/t/tests/etcfiles-etc-not-marked/desc
+++ b/t/tests/conffiles-etc-not-marked/desc
@@ -1,4 +1,4 @@
-Testname: etcfiles-etc-not-marked
+Testname: conffiles-etc-not-marked
Sequence: 6000
Version: 1.0
Description: Test checking etc files not being marked as conffiles
diff --git a/t/tests/conffiles-etc-not-marked/tags b/t/tests/conffiles-etc-not-marked/tags
new file mode 100644
index 0000000..18491d6
--- /dev/null
+++ b/t/tests/conffiles-etc-not-marked/tags
@@ -0,0 +1 @@
+E: conffiles-etc-not-marked: file-in-etc-not-marked-as-conffile etc/something.conf
diff --git a/t/tests/etcfiles-etc-not-marked/tags b/t/tests/etcfiles-etc-not-marked/tags
deleted file mode 100644
index 22d97ce..0000000
--- a/t/tests/etcfiles-etc-not-marked/tags
+++ /dev/null
@@ -1 +0,0 @@
-E: etcfiles-etc-not-marked: file-in-etc-not-marked-as-conffile etc/something.conf
--
Debian package checker
Reply to: