The following commit has been merged in the master branch:
commit 121197a1efdb4e19d8b09cdceaea69262f1dd46b
Author: Raphaël Hertzog <[email protected]>
Date:   Fri Aug 14 19:25:07 2009 +0200

    dpkg-scanpackages: add support for extra override file
    
    Based-on-patch-by: Robert Millan <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index 1205d92..f034bda 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,6 +48,8 @@ dpkg (1.15.4) UNRELEASED; urgency=low
     Closes: #537800
   * Fix update-alternatives to mention the correct slave link that can't
     be installed due to a conflicting file instead of quoting the master link.
+  * Add support for extra override file in dpkg-scanpackages. Thanks to Robert
+    Millan for the patch. Closes: #537559
 
   [ Modestas Vainius ]
   * Provide a meaningful label for dpkg-gensymbols diff.
diff --git a/man/dpkg-scanpackages.1 b/man/dpkg-scanpackages.1
index b23bce7..e32c1dd 100644
--- a/man/dpkg-scanpackages.1
+++ b/man/dpkg-scanpackages.1
@@ -77,6 +77,10 @@ Scan for *.\fItype\fP packages, instead of *.deb.
 .BR \-u ", " \-\-udeb
 \fBObsolete\fP alias for \fB-tudeb\fP.
 .TP
+.BR \-e ", " \-\-extraoverride " \fIfile\fP"
+Scan \fIfile\fP to find supplementary overrides. Each line contains 3
+space separated fields: package name, field name to override, new field value.
+.TP
 .BR \-a ", " \-\-arch " \fIarch\fP"
 Use a pattern consisting of \fI*_all.deb\fP and \fI*_arch.deb\fP instead of
 scanning for all debs,
diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index 8540dff..af991c7 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -32,7 +32,7 @@ my @fieldpri = (qw(Package Package-Type Source Version 
Kernel-Version
                    Architecture Subarchitecture Essential Origin Bugs
                    Maintainer Installed-Size Installer-Menu-Item),
                 @pkg_dep_fields, qw(Filename Size), @sums,
-                qw(Section Priority Homepage Description Tag));
+                qw(Section Priority Homepage Description Tag Task));
 
 # This maps the fields into the proper case
 my %field_case;
@@ -46,11 +46,12 @@ my %options = (help            => sub { usage(); exit 0; },
               udeb            => \&set_type_udeb,
               arch            => undef,
               multiversion    => 0,
+              extraoverride   => undef,
              );
 
 my $result = GetOptions(\%options,
                         'help|h|?', 'version', 'type|t=s', 'udeb|u!',
-                        'arch|a=s', 'multiversion|m!');
+                        'arch|a=s', 'multiversion|m!', 'extraoverride|e=s');
 
 sub version {
     printf _g("Debian %s version %s.\n"), $progname, $version;
@@ -66,6 +67,7 @@ Options:
   -u, --udeb               scan for udebs (obsolete alias for -tudeb).
   -a, --arch <arch>        architecture to scan for.
   -m, --multiversion       allow multiple versions of a single package.
+  -e, --extraoverride <file> extra override file
   -h, --help               show this help message.
       --version            show the version.
 "), $progname;
@@ -124,6 +126,28 @@ sub load_override
     close($override_fh);
 }
 
+sub load_override_extra
+{
+    my $override_fh = new IO::File $options{extraoverride}, 'r' or
+        syserr(_g("Couldn't open override file %s"), $options{extraoverride});
+
+    while (<$override_fh>) {
+       s/\#.*//;
+       s/\s+$//;
+       next unless $_;
+
+       my ($p, $field, $value) = split(/\s+/, $_, 3);
+
+       next unless defined($packages{$p});
+
+       for my $package (@{$packages{$p}}) {
+           $$package{$field} = $value;
+       }
+    }
+
+    close($override_fh);
+}
+
 usage() and exit 1 if not $result;
 
 if (not @ARGV >= 1 && @ARGV <= 3) {
@@ -232,6 +256,7 @@ FILE:
 close($find_h);
 
 load_override($override) if defined $override;
+load_override_extra($options{extraoverride}) if defined 
$options{extraoverride};
 
 my @missingover=();
 

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to