1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 802-implement-overridedir.dpatch by Eero Häkkinen <eero.hakkinen@nokia.com>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Implement --overridedir OVERRIDEDIR
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
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
20 my $LINTIAN_UNPACK_LEVEL = undef;
21 my $LINTIAN_ARCH = undef;
22 my $LINTIAN_SECTION = undef;
23 +my $LINTIAN_OVERRIDEDIR = undef;
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
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,
42 # ------------------ package selection options
44 $LINTIAN_SECTION = $1;
45 } elsif (m/^\s*LINTIAN_ARCH\s*=\s*(.*\S)\s*$/i) {
47 + } elsif (m/^\s*LINTIAN_OVERRIDEDIR\s*=\s*(.*\S)\s*$/i) {
48 + $LINTIAN_OVERRIDEDIR = $1;
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.)");
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'};
58 # command-line options override everything
59 $LINTIAN_LAB = $OPT_LINTIAN_LAB if $OPT_LINTIAN_LAB;
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;
66 # LINTIAN_ARCH must have a value.
67 unless (defined $LINTIAN_ARCH) {
69 $ENV{'LINTIAN_ARCH'} = "";
72 +if ($LINTIAN_OVERRIDEDIR) {
73 + $ENV{'LINTIAN_OVERRIDEDIR'} = $LINTIAN_OVERRIDEDIR;
75 + $ENV{'LINTIAN_OVERRIDEDIR'} = "";
78 $ENV{'LINTIAN_DEBUG'} = $debug;
80 # determine requested unpack level
82 Tags::set_pkg( $file, $pkg, "", "", $long_type );
84 - unless ($no_override) {
85 - if (open(O, '<', "$base/override")) {
87 + $LINTIAN_OVERRIDEDIR ? "$LINTIAN_OVERRIDEDIR/$long_type/$pkg" : (),
88 + $no_override ? () : "$base/override")
90 + if ( open(O,$override) ) {
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
97 environment variable and the configuration file entry of the same name.
100 +.BR \-\-overridedir " overridedir"
101 +Read additional overrides from
102 +.IR overridedir / type / package
110 +This option overrides the
111 +.B LINTIAN_OVERRIDEDIR
112 +environment variable and the configuration file entry of the same name.
115 .BR \-\-root " rootdir"