From: joey Date: Thu, 20 Jun 2002 01:31:47 +0000 (+0000) Subject: r532: * Added --mainpackage= option, of use in some kernel modules packages. X-Git-Tag: version_2.0.101~67 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3c36c2532c3907f0a315d9010654176e8e9fc319;p=debhelper.git r532: * Added --mainpackage= option, of use in some kernel modules packages. * dh_gencontrol only needs to pass -p to dpkg-gencontrol if there is more than one package in debian/control. This makes it a bit more flexible in some cases. --- diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm index 16851a0..37d6f47 100644 --- a/Debian/Debhelper/Dh_Getopt.pm +++ b/Debian/Debhelper/Dh_Getopt.pm @@ -141,6 +141,8 @@ sub parseopts { "autodest" => \$options{AUTODEST}, "h|help" => \&showhelp, + + "mainpackage=s" => \$options{MAINPACKAGE}, "<>" => \&NonOption, ); diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index d1c67b5..f22e817 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -72,10 +72,13 @@ sub init { $dh{NO_ACT}=1; } - # Get the name of the main binary package (first one listed in - # debian/control). my @allpackages=GetPackages(); - $dh{MAINPACKAGE}=$allpackages[0]; + # 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. + if (! exists $dh{MAINPACKAGE} || ! defined $dh{MAINPACKAGE}) { + $dh{MAINPACKAGE}=$allpackages[0]; + } # Check if packages to build have been specified, if not, fall back to # the default, doing them all. diff --git a/debhelper.pod b/debhelper.pod index 7cf755c..dae701c 100644 --- a/debhelper.pod +++ b/debhelper.pod @@ -113,6 +113,13 @@ the package as one that should be acted on. Use "tmpdir" for package build directory. The default is debian/ +=item B<--mainpackage=>I + +This little-used option changes the package which debhelper considers the +"main package", that is, the first one listed in debian/control, and the +one for which debian/foo files can be used instead of the usual +debian/package.foo files. + =back =head1 COMMON DEBHELPER OPTIONS diff --git a/debian/changelog b/debian/changelog index 5e33593..b26894c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +debhelper (4.0.13) unstable; urgency=low + + * Added --mainpackage= option, of use in some kernel modules packages. + * dh_gencontrol only needs to pass -p to dpkg-gencontrol if there is more + than one package in debian/control. This makes it a bit more flexible in + some cases. + + -- Joey Hess Wed, 19 Jun 2002 19:44:12 -0400 + debhelper (4.0.12) unstable; urgency=low * Fixed debconf-utils dependency. diff --git a/dh_gencontrol b/dh_gencontrol index fcb9184..941c9a8 100755 --- a/dh_gencontrol +++ b/dh_gencontrol @@ -53,8 +53,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) { } # Generate and install control file. - doit("dpkg-gencontrol","-l$changelog","-isp","-p$package", - "-Tdebian/${ext}substvars", "-P$tmp",@{$dh{U_PARAMS}}); + my @command="dpkg-gencontrol"; + if (GetPackages() > 1) { + push @command, "-p$package"; + } + doit(@command, "-l$changelog", "-isp", "-Tdebian/${ext}substvars", + "-P$tmp",@{$dh{U_PARAMS}}); # This chmod is only necessary if the user sets the umask to # something odd.