]> err.no Git - dpkg/commitdiff
dpkg-source: Use %dep_field_type for the union option to Dpkg::Deps::parse
authorGuillem Jover <guillem@debian.org>
Mon, 19 Nov 2007 06:31:16 +0000 (08:31 +0200)
committerGuillem Jover <guillem@debian.org>
Mon, 19 Nov 2007 06:31:16 +0000 (08:31 +0200)
Use capit() to normalize the field names, instead of hardcoding them.

ChangeLog
scripts/dpkg-source.pl

index 5e7ec2eb74ee4e571f0f8db8eff359c8f929a5c0..937883f954ac86b4dab1dd1832f845398d8e8353 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-19  Guillem Jover  <guillem@debian.org>
+
+       * scripts/dpkg-source.pl: Use %dep_field_type for the union option
+       to Dpkg::Deps::parse, and use capit() to normalize the field names,
+       instead of hardcoding them.
+
 2007-11-19  Guillem Jover  <guillem@debian.org>
 
        * pkg-deb/build.c (arbitrary_fields): Add Package-Type,
index a32c942b896bb8eae0115c6c4cc462401faa8b23..d9542a917f90839b41a0ad13de5aedc6beb2913b 100755 (executable)
@@ -318,15 +318,8 @@ if ($opmode eq 'build') {
            elsif (m/^Uploaders$/i) { ($f{$_}= $v) =~ s/[\r\n]//g; }
            elsif (m/^Build-(Depends|Conflicts)(-Indep)?$/i) {
                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);
-               }
+               my $type = $dep_field_type{capit($_)};
+               $dep = Dpkg::Deps::parse($v, union =>  $type eq 'union');
                error(_g("error occurred while parsing %s"), $_) unless defined $dep;
                my $facts = Dpkg::Deps::KnownFacts->new();
                $dep->simplify_deps($facts);