]> err.no Git - dpkg/commitdiff
dpkg-source: use the new Dpkg::Deps module instead of controllib's parsedep
authorRaphael Hertzog <hertzog@debian.org>
Mon, 15 Oct 2007 12:27:27 +0000 (14:27 +0200)
committerRaphael Hertzog <hertzog@debian.org>
Thu, 18 Oct 2007 12:30:16 +0000 (14:30 +0200)
scripts/dpkg-source.pl

index 0e9c61ec0a1d3ba413ad70ef08410cc8c6bb9ad4..baefdea6906b19036906d520329d3532feda4c1c 100755 (executable)
@@ -9,6 +9,7 @@ use Dpkg::ErrorHandling qw(warning warnerror error failure unknown
                            internerr syserr subprocerr usageerr
                            $warnable_error $quiet_warnings);
 use Dpkg::Arch qw(debarch_eq);
+use Dpkg::Deps qw(@src_dep_fields %dep_field_type);
 
 my @filesinarchive;
 my %dirincluded;
@@ -316,10 +317,21 @@ if ($opmode eq 'build') {
            }
            elsif (m/^Uploaders$/i) { ($f{$_}= $v) =~ s/[\r\n]//g; }
            elsif (m/^Build-(Depends|Conflicts)(-Indep)?$/i) {
-               my $dep = parsedep($v, 1);
-               error(_g("error occurred while parsing %s"), $_)
-                   unless defined $dep;
-               $f{$_}= showdep($dep, 1);
+               my $dep;
+               # XXX: Should use %dep_field_type to decide if we parse
+               # as union or not but since case-insensitive matching is
+               # used, I can't rely on $_ to have the very same
+               # capitalization...
+               if (lc($1) eq "depends") {
+                   $dep = Dpkg::Deps::parse($v);
+               } else {
+                   $dep = Dpkg::Deps::parse($v, union => 1);
+               }
+               error(_g("error occurred while parsing %s"), $_) unless defined $dep;
+               my $facts = Dpkg::Deps::KnownFacts->new();
+               $dep->simplify_deps($facts);
+               $dep->sort();
+               $f{$_}= $dep->dump();
            }
             elsif (s/^X[BC]*S[BC]*-//i) { $f{$_}= $v; }
             elsif (m/^(Section|Priority|Files|Bugs)$/i || m/^X[BC]+-/i) { }