1 # control-files -- lintian check script -*- perl -*-
3 # Copyright (C) 1998 Christian Schwarz and Richard Braakman
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, you can find it on the World Wide
17 # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
18 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21 package Lintian::control_files;
52 'isinstallable', 0755,
60 my %ctrl = $type eq 'udeb' ? %ctrl_udeb : %ctrl_deb;
61 my %ctrl_alt = $type eq 'udeb' ? %ctrl_deb : %ctrl_udeb;
63 # process control-index file
64 open(IN, '<', "control-index") or fail("cannot open control-index file: $!");
68 my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
71 next if $file eq './';
74 $file =~ s/ link to .*//;
77 next if $file eq './';
80 unless ( exists $ctrl{$file} ) {
81 if ( exists $ctrl_alt{$file} ) {
82 tag "not-allowed-control-file", "$file";
85 tag "unknown-control-file", "$file";
90 # I'm not sure about the udeb case
91 if ($type ne 'udeb' and $size == 0) {
92 tag "control-file-is-empty", "$file";
96 # skip `control' control file (that's an exception: dpkg doesn't care and
97 # this file isn't installed on the systems anyways)
98 next if $file eq 'control';
100 $operm = perm2oct($perm);
102 # correct permissions?
103 unless ($operm == $ctrl{$file}) {
104 tag "control-file-has-bad-permissions",
105 sprintf("$file %04o != %04o",$operm,$ctrl{$file});
109 unless ($owner eq 'root/root') {
110 tag "control-file-has-bad-owner", "$file $owner != root/root";
113 # for other maintainer scripts checks, see the scripts check
121 # vim: syntax=perl sw=4 ts=8