+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,
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);