Rebuild dpkg for 7.0.
[packages/centos6/dpkg.git] / MIRA0001-Allow-parcing-indices-override-files-when-architect.patch
1 From 09efec567e6b0baa835c1921c222a5a967cf193a Mon Sep 17 00:00:00 2001
2 From: Dennis Dmitriev <ddmitriev@mirantis.com>
3 Date: Tue, 19 Aug 2014 18:31:33 +0300
4 Subject: [PATCH] Allow correctly parcing indices/override.* files
5
6 Allow parcing indices/override.* files when architecture
7 prefixes are used in package names there. It allows to use
8 dpkg-scanpackages with Ubuntu repositories.
9
10 Originally, dpkg-scanpackages just skip the following lines because it
11 compares package names without any modification, and cannot find the
12 apropriate package because 'a2jmidid' != 'a2jmidid/amd64'
13 For example, several lines from override.precise.extra.main:
14 ...
15 a2jmidid        Bugs    https://bugs.launchpad.net/ubuntu/+filebug
16 a2jmidid        Origin  Ubuntu
17 a2jmidid/amd64  Task    ubuntustudio-generation, ubuntustudio-recording
18 a2jmidid/armel  Task    ubuntustudio-generation, ubuntustudio-recording
19 a2jmidid/armhf  Task    ubuntustudio-generation, ubuntustudio-recording
20 a2jmidid/i386   Task    ubuntustudio-generation, ubuntustudio-recording
21 a2jmidid/powerpc        Task    ubuntustudio-generation, ubuntustudio-recording
22 ...
23
24 Related-Bug: 1358785
25 ---
26  scripts/dpkg-scanpackages.pl | 7 ++++++-
27  1 file changed, 6 insertions(+), 1 deletion(-)
28
29 diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
30 index 9a3d59c..3d6724b 100755
31 --- a/scripts/dpkg-scanpackages.pl
32 +++ b/scripts/dpkg-scanpackages.pl
33 @@ -143,7 +143,12 @@ sub load_override_extra
34         s/\s+$//;
35         next unless $_;
36  
37 -       my ($p, $field, $value) = split(/\s+/, $_, 3);
38 +       my ($pr, $field, $value) = split(/\s+/, $_, 3);
39 +
40 +        my ($p, $parch) = split(/\//, $pr, 2);
41 +        if (defined($options{arch}) and defined($parch)) {
42 +            next unless ($options{arch} eq $parch);
43 +        }
44  
45         next unless defined($packages{$p});
46  
47 -- 
48 1.8.5.5
49