summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
authorjoey <joey>2004-02-09 05:24:40 +0000
committerjoey <joey>2004-02-09 05:24:40 +0000
commit4f162e192c3563d740490cc99ced1513104ac34c (patch)
treeb521746cbacfde4afc5af4031b767d1f87101a83 /Debian
parentad3f34f9653fe848816f2af915b9cdd260fc4421 (diff)
r1655: * Added udeb support, as pioneered by di-packages-build. Understands
"XC-Package-Type: udeb" in debian/control. See debhelper(1) for details. * Dh_Lib: add and export is_udeb and udeb_filename * dh_builddeb: name udebs with proper extension * dh_gencontrol: pass -n and filename to dpkg-gencontrol * dh_installdocs, dh_makeshlibs, dh_md5sums, dh_installchangelogs, dh_installexamples, dh_installman, dh_installmanpages: skip udebs * dh_shlibdeps: skip udebs. This may be temporary. * dh_installdeb: do not process conffiles, shlibs, preinsts, postrms, or prerms for udebs. Do not substiture #DEBHELPER# tokens in postinst scripts for udebs. * dh_installdebconf: skip config script for udebs, still do templates
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 c610963..1da5afd 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 0eea018..f42f8bd 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