Added some code to peer into a data structure in Maemian/Schedule.pm. Also added the
[maemian] / nokia-lintian / collection / doc-base-files
1 #!/usr/bin/perl -w
2 # doc-base-files -- lintian collector script
3
4 # Copyright (C) 1998 Richard Braakman
5 # Copyright (C) 2001 Josip Rodin
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, you can find it on the World Wide
19 # Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
20 # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21 # MA 02110-1301, USA.
22
23 use strict;
24
25 ($#ARGV == 1) or fail("syntax: doc-base-files <pkg> <type>");
26 my $pkg = shift;
27 my $type = shift;
28
29 -f "fields/package" or fail("doc-base-files invoked in wrong directory");
30
31 use lib "$ENV{'LINTIAN_ROOT'}/lib";
32 use Pipeline;
33
34 if (-e "doc-base") {
35     spawn('rm', '-rf', 'doc-base') == 0
36         or fail("cannot rm old doc-base directory");
37 }
38
39 if (-d "unpacked/usr/share/doc-base") {
40     spawn('cp', '-a', 'unpacked/usr/share/doc-base', 'doc-base') == 0
41         or fail("cannot copy directory unpacked/usr/share/doc-base");
42 } else {
43     # no doc-base directory
44     mkdir("doc-base", 0777) or fail("cannot mkdir doc-base: $!");
45 }
46
47 exit 0;
48
49 # -----------------------------------
50
51 sub fail {
52     if ($_[0]) {
53         print STDERR "internal error: $_[0]\n";
54     } elsif ($!) {
55         print STDERR "internal error: $!\n";
56     } else {
57         print STDERR "internal error.\n";
58     }
59     exit 1;
60 }