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 Maemian::control_files;
44 isinstallable => 0755,
56 my %ctrl = $type eq 'udeb' ? %ctrl_udeb : %ctrl_deb;
57 my %ctrl_alt = $type eq 'udeb' ? %ctrl_deb : %ctrl_udeb;
59 # process control-index file
60 open(IN, '<', "control-index") or fail("cannot open control-index file: $!");
64 my ($perm,$owner,$size,$date,$time,$file) = split(' ', $_, 6);
67 next if $file eq './';
70 $file =~ s/ link to .*//;
73 next if $file eq './';
76 unless ( exists $ctrl{$file} ) {
77 if ( exists $ctrl_alt{$file} ) {
78 tag "not-allowed-control-file", "$file";
81 tag "unknown-control-file", "$file";
86 # I'm not sure about the udeb case
87 if ($type ne 'udeb' and $size == 0) {
88 tag "control-file-is-empty", "$file";
92 # skip `control' control file (that's an exception: dpkg doesn't care and
93 # this file isn't installed on the systems anyways)
94 next if $file eq 'control';
96 $operm = perm2oct($perm);
98 # correct permissions?
99 unless ($operm == $ctrl{$file}) {
100 tag "control-file-has-bad-permissions",
101 sprintf("$file %04o != %04o",$operm,$ctrl{$file});
105 unless ($owner eq 'root/root') {
106 tag "control-file-has-bad-owner", "$file $owner != root/root";
109 # for other maintainer scripts checks, see the scripts check
117 # vim: syntax=perl sw=4 ts=8