Added some code to peer into a data structure in Maemian/Schedule.pm. Also added the
[maemian] / nokia-lintian / debian / patches / 802-implement-overridedir.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 802-implement-overridedir.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Implement --overridedir OVERRIDEDIR
6
7 @DPATCH@
8 diff -urNad lintian-1.23.8~/frontend/lintian lintian-1.23.8/frontend/lintian
9 --- lintian-1.23.8~/frontend/lintian    2006-09-14 16:32:02.000000000 +0300
10 +++ lintian-1.23.8/frontend/lintian     2006-09-14 16:32:02.000000000 +0300
11 @@ -60,6 +60,7 @@
12  my $OPT_LINTIAN_DIST = "";     #string for the --dist option
13  my $OPT_LINTIAN_ARCH = "";     #string for the --arch option
14  my $OPT_LINTIAN_SECTION = "";  #string for the --release option
15 +my $OPT_LINTIAN_OVERRIDEDIR = ""; #string for the --overridedir option
16  # These options can also be used via default or environment variables
17  my $LINTIAN_CFG = "";          #config file to use
18  our $LINTIAN_ROOT;             #location of the lintian modules
19 @@ -93,6 +94,7 @@
20  my $LINTIAN_UNPACK_LEVEL = undef;
21  my $LINTIAN_ARCH = undef;
22  my $LINTIAN_SECTION = undef;
23 +my $LINTIAN_OVERRIDEDIR = undef;
24  # }}}
25  
26  # {{{ Setup Code
27 @@ -156,6 +158,7 @@
28      --dist DIST               scan packages in this distribution (e.g. sid)
29      --section RELEASE         scan packages in this section (e.g. main)
30      --arch ARCH               scan packages with architecture ARCH
31 +    --overridedir OVERRIDEDIR location of centrally managed override files
32      --root ROOTDIR            use ROOTDIR instead of /usr/share/lintian
33  Package selection options:
34      -a, --all                 process all packages in distribution
35 @@ -296,6 +299,7 @@
36                "dist=s" => \$OPT_LINTIAN_DIST,
37                "section=s" => \$OPT_LINTIAN_SECTION,
38                "arch=s" => \$OPT_LINTIAN_ARCH,
39 +              "overridedir=s" => \$OPT_LINTIAN_OVERRIDEDIR,
40                "root=s" => \$LINTIAN_ROOT,
41  
42                # ------------------ package selection options
43 @@ -393,6 +397,8 @@
44             $LINTIAN_SECTION = $1;
45         } elsif (m/^\s*LINTIAN_ARCH\s*=\s*(.*\S)\s*$/i) {
46             $LINTIAN_ARCH = $1;
47 +       } elsif (m/^\s*LINTIAN_OVERRIDEDIR\s*=\s*(.*\S)\s*$/i) {
48 +           $LINTIAN_OVERRIDEDIR = $1;
49         } else {
50             fail("syntax error in configuration file: $_","(Note, that the syntax of the configuration file has been changed\nwith Lintian v0.3.0. In most cases, you don't need a configuration\nfile anymore -- just remove it.)");
51         }
52 @@ -407,6 +413,7 @@
53  $LINTIAN_UNPACK_LEVEL = $ENV{'LINTIAN_UNPACK_LEVEL'} if $ENV{'LINTIAN_UNPACK_LEVEL'};
54  $LINTIAN_SECTION = $ENV{'LINTIAN_SECTION'} if $ENV{'LINTIAN_SECTION'};
55  $LINTIAN_ARCH = $ENV{'LINTIAN_ARCH'} if $ENV{'LINTIAN_ARCH'};
56 +$LINTIAN_OVERRIDEDIR = $ENV{'LINTIAN_OVERRIDEDIR'} if $ENV{'LINTIAN_OVERRIDEDIR'};
57  
58  # command-line options override everything
59  $LINTIAN_LAB = $OPT_LINTIAN_LAB if $OPT_LINTIAN_LAB;
60 @@ -414,6 +421,7 @@
61  $LINTIAN_DIST = $OPT_LINTIAN_DIST if $OPT_LINTIAN_DIST;
62  $LINTIAN_SECTION = $OPT_LINTIAN_SECTION if $OPT_LINTIAN_SECTION;
63  $LINTIAN_ARCH = $OPT_LINTIAN_ARCH if $OPT_LINTIAN_ARCH;
64 +$LINTIAN_OVERRIDEDIR = $OPT_LINTIAN_OVERRIDEDIR if $OPT_LINTIAN_OVERRIDEDIR;
65  
66  # LINTIAN_ARCH must have a value.
67  unless (defined $LINTIAN_ARCH) {
68 @@ -471,6 +479,12 @@
69      $ENV{'LINTIAN_ARCH'} = "";
70  }
71  
72 +if ($LINTIAN_OVERRIDEDIR) {
73 +    $ENV{'LINTIAN_OVERRIDEDIR'} = $LINTIAN_OVERRIDEDIR;
74 +} else {
75 +    $ENV{'LINTIAN_OVERRIDEDIR'} = "";
76 +}
77 +
78  $ENV{'LINTIAN_DEBUG'} = $debug;
79  
80  # determine requested unpack level
81 @@ -1275,6 +1289,9 @@
82         Tags::set_pkg( $file, $pkg, "", "", $long_type );
83  
84 -       unless ($no_override) {
85 -            if (open(O, '<', "$base/override")) {
86 +        for my $override (
87 +           $LINTIAN_OVERRIDEDIR ? "$LINTIAN_OVERRIDEDIR/$long_type/$pkg" : (),
88 +           $no_override ? () : "$base/override")
89 +            {
90 +               if ( open(O,$override) ) {
91                  while (<O>) {
92                      chomp;
93 diff -urNad lintian-1.23.8~/man/lintian.1 lintian-1.23.8/man/lintian.1
94 --- lintian-1.23.8~/man/lintian.1       2006-09-14 16:32:02.000000000 +0300
95 +++ lintian-1.23.8/man/lintian.1        2006-09-14 16:34:11.000000000 +0300
96 @@ -243,6 +243,21 @@
97  environment variable and the configuration file entry of the same name.
98  
99  .TP
100 +.BR \-\-overridedir " overridedir"
101 +Read additional overrides from
102 +.IR overridedir / type / package
103 +where
104 +.I type
105 +is either
106 +.BR binary ,
107 +.BR source
108 +or
109 +.BR udeb .
110 +This option overrides the
111 +.B LINTIAN_OVERRIDEDIR
112 +environment variable and the configuration file entry of the same name.
113 +
114 +.TP
115  .BR \-\-root " rootdir"
116  Look for
117  .BR lintian 's