summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Debhelper/Dh_Getopt.pm8
-rw-r--r--Debian/Debhelper/Dh_Lib.pm38
2 files changed, 38 insertions, 8 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index c610963b..1da5afd2 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -29,18 +29,18 @@ sub showhelp {
# order.
sub AddPackage { my($option,$value)=@_;
if ($option eq 'i' or $option eq 'indep') {
- push @{$options{DOPACKAGES}}, GetPackages('indep');
+ push @{$options{DOPACKAGES}}, getpackages('indep');
$options{DOINDEP}=1;
}
elsif ($option eq 'a' or $option eq 'arch') {
- push @{$options{DOPACKAGES}}, GetPackages('arch');
+ push @{$options{DOPACKAGES}}, getpackages('arch');
$options{DOARCH}=1;
}
elsif ($option eq 'p' or $option eq 'package') {
push @{$options{DOPACKAGES}}, $value;
}
elsif ($option eq 's' or $option eq 'same-arch') {
- push @{$options{DOPACKAGES}}, GetPackages('same');
+ push @{$options{DOPACKAGES}}, getpackages('same');
$options{DOSAME}=1;
}
else {
@@ -184,7 +184,7 @@ sub parseopts {
# built, and there are none of that type.
error("I have no package to build");
}
- push @{$options{DOPACKAGES}},GetPackages();
+ push @{$options{DOPACKAGES}},getpackages();
}
# Remove excluded packages from the list of packages to act on.
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 0eea0180..f42f8bd2 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -12,8 +12,9 @@ use vars qw(@ISA @EXPORT %dh);
@ISA=qw(Exporter);
@EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir
&pkgfile &pkgext &pkgfilename &isnative &autoscript &filearray
- &filedoublearray &GetPackages &basename &dirname &xargs %dh
- &compat &addsubstvar &delsubstvar &excludefile);
+ &filedoublearray &getpackages &basename &dirname &xargs %dh
+ &compat &addsubstvar &delsubstvar &excludefile &is_udeb
+ &udeb_filename);
my $max_compat=4;
@@ -72,7 +73,7 @@ sub init {
$dh{NO_ACT}=1;
}
- my @allpackages=GetPackages();
+ my @allpackages=getpackages();
# Get the name of the main binary package (first one listed in
# debian/control). Only if the main package was not set on the
# command line.
@@ -533,8 +534,14 @@ sub excludefile {
# Must pass "arch" or "indep" or "same" to specify arch-dependant or
# -independant or same arch packages. If nothing is specified, returns all
# packages.
-sub GetPackages {
+# As a side effect, populates %package_arches and %package_types with the
+# types of all packages (not only those returned).
+my (%package_types, %package_arches);
+sub getpackages {
my $type=shift;
+
+ %package_types=();
+ %package_arches=();
$type="" if ! defined $type;
@@ -546,6 +553,7 @@ sub GetPackages {
my $package="";
my $arch="";
+ my $package_type;
my @list=();
my %seen;
open (CONTROL, 'debian/control') ||
@@ -562,12 +570,20 @@ sub GetPackages {
else {
error("debian/control has a duplicate entry for $package");
}
+ $package_type="deb";
}
if (/^Architecture:\s*(.*)/) {
$arch=$1;
}
+ if (/^X[BC]*-Package-Type:\s*(.*)/) {
+ $package_type=$1;
+ }
if (!$_ or eof) { # end of stanza.
+ if ($package) {
+ $package_types{$package}=$package_type;
+ $package_arches{$package}=$arch;
+ }
if ($package &&
(($type eq 'indep' && $arch eq 'all') ||
($type eq 'arch' && $arch ne 'all') ||
@@ -584,4 +600,18 @@ sub GetPackages {
return @list;
}
+sub is_udeb {
+ my $package=shift;
+
+ return $package_types{$package} eq 'udeb';
+}
+
+sub udeb_filename {
+ my $package=shift;
+
+ my $filearch=$package_arches{$package} eq 'all' ? "all" : buildarch();
+ isnative($package); # side effect
+ return "${package}_$dh{VERSION}_$filearch.udeb";
+}
+
1