From 9196af928cf0e41c734e1fd8116418ae4184e045 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 28 Aug 2007 04:24:06 +0300 Subject: [PATCH] Cleanup second pass parsing of dependency fields --- ChangeLog | 6 ++++++ scripts/dpkg-gencontrol.pl | 18 ++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index aefeb62b..143d0035 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-08-28 Guillem Jover + + * scripts/dpkg-gencontrol.pl: Add comments about the second pass + parsing for dependency fields. Remove handling of uninteresting fields + in the second pass parsing. + 2007-08-24 Guillem Jover * scripts/dpkg-gencontrol.pl: Allow a package stanza to override the diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl index 9a9524b3..868d6401 100755 --- a/scripts/dpkg-gencontrol.pl +++ b/scripts/dpkg-gencontrol.pl @@ -160,6 +160,7 @@ for $_ (keys %fi) { if (m/^(Package|Description|Homepage|Essential|Optional)$/) { $f{$_}= $v; } elsif (exists($pkg_dep_fields{$_})) { + # Delay the parsing until later } elsif (m/^Section$|^Priority$/) { $spvalue{$_}= $v; } elsif (m/^Architecture$/) { @@ -213,25 +214,18 @@ $f{'Version'} = $forceversion if defined($forceversion); &init_substvars; init_substvar_arch(); +# Process dependency fields in a second pass, now that substvars have been +# initialized. + for $_ (keys %fi) { my $v = $fi{$_}; - if (s/^C //) { - } elsif (s/^C$myindex //) { - if (m/^(Package|Description|Essential|Optional)$/) { - } elsif (exists($pkg_dep_fields{$_})) { + if (s/^C$myindex //) { + if (exists($pkg_dep_fields{$_})) { my $dep = parsedep(substvars($v), 1, 1); &error(sprintf(_g("error occurred while parsing %s"), $_)) unless defined $dep; $f{$_}= showdep($dep, 0); - } elsif (m/^Section$|^Priority$/) { - } elsif (m/^Architecture$/) { - } elsif (s/^X[CS]*B[CS]*-//i) { - } elsif (!m/^X[CS]+-/i) { } - } elsif (m/^C\d+ /) { - } elsif (s/^L //) { - } elsif (m/o:/) { - } else { } } -- 2.39.5