From 4f162e192c3563d740490cc99ced1513104ac34c Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 9 Feb 2004 05:24:40 +0000 Subject: 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 --- Debian/Debhelper/Dh_Lib.pm | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'Debian/Debhelper/Dh_Lib.pm') 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 -- cgit v1.2.3