diff options
author | Niels Thykier <niels@thykier.net> | 2019-08-16 19:10:46 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2019-08-16 19:18:36 +0000 |
commit | fdd59b09dd46c80967add12b9acfe8311366b426 (patch) | |
tree | 1a560b62ccaebcf08c0766e3343980cbe1152bc3 | |
parent | a610abc6fca411e3e03f9e580c2152470d706bda (diff) | |
download | debhelper-fdd59b09dd46c80967add12b9acfe8311366b426.tar.gz |
Dh_lib.pm: Extract d/control parse logic from getpackages
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r-- | lib/Debian/Debhelper/Dh_Lib.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm index 0ae27474..070f5968 100644 --- a/lib/Debian/Debhelper/Dh_Lib.pm +++ b/lib/Debian/Debhelper/Dh_Lib.pm @@ -1575,18 +1575,20 @@ sub getpackages { $type //= 'all-listed-in-control-file'; - if (%packages_by_type) { - return @{$packages_by_type{$type}}; + if (not %packages_by_type) { + _parse_debian_control(); } + return @{$packages_by_type{$type}}; +} - my $fd; +sub _parse_debian_control { my $package=""; my $arch=""; my $section=""; my $valid_pkg_re = qr{^${PKGNAME_REGEX}$}o; my ($package_type, $multiarch, %seen, @profiles, $source_section, $included_in_build_profile, $cross_type, $cross_target_arch, - %bd_fields, $bd_field_value, %seen_fields); + %bd_fields, $bd_field_value, %seen_fields, $fd); if (exists $ENV{'DEB_BUILD_PROFILES'}) { @profiles=split /\s+/, $ENV{'DEB_BUILD_PROFILES'}; } @@ -1850,8 +1852,6 @@ sub getpackages { } } close($fd); - - return @{$packages_by_type{$type}}; } # Return true if we should use root. |