From f079a3331b25116c1fd3bb901be12e8052670b81 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 19 Nov 2007 08:31:16 +0200 Subject: [PATCH] dpkg-source: Use %dep_field_type for the union option to Dpkg::Deps::parse Use capit() to normalize the field names, instead of hardcoding them. --- ChangeLog | 6 ++++++ scripts/dpkg-source.pl | 11 ++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e7ec2eb..937883f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-11-19 Guillem Jover + + * 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 * pkg-deb/build.c (arbitrary_fields): Add Package-Type, diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index a32c942b..d9542a91 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -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); -- 2.39.5