summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2020-05-10 12:16:46 +0000
committerNiels Thykier <niels@thykier.net>2022-10-03 05:59:18 +0000
commit71ba52f458d5d173091b32d038751e144e385b5e (patch)
tree5006bfbe788c3c77d66bbbeb14beb89083483816
parentd39d8548d8dc7c5f2550a8af11e8330952d1f5c9 (diff)
Dh_Lib: Add package_type function
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--lib/Debian/Debhelper/Dh_Lib.pm18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm
index 3e56d51f..10907f12 100644
--- a/lib/Debian/Debhelper/Dh_Lib.pm
+++ b/lib/Debian/Debhelper/Dh_Lib.pm
@@ -124,6 +124,7 @@ qw(
package_multiarch
package_section
package_arch
+ package_type
process_pkg
compute_doc_main_package
isnative
@@ -2163,17 +2164,24 @@ sub package_cross_type {
return $package_cross_type{$package} // 'host';
}
+sub package_type {
+ my ($package) = @_;
+
+ if (! exists $package_types{$package}) {
+ warning "package $package is not in control info";
+ return DEFAULT_PACKAGE_TYPE;
+ }
+ return $package_types{$package};
+}
+
# Return true if a given package is really a udeb.
sub is_udeb {
my $package=shift;
- if (! exists $package_types{$package}) {
- warning "package $package is not in control info";
- return 0;
- }
- return $package_types{$package} eq 'udeb';
+ return package_type($package) eq 'udeb';
}
+
sub process_pkg {
my ($package) = @_;
state %packages_to_process = map { $_ => 1 } @{$dh{DOPACKAGES}};