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');
+ $options{DOSAME}=1;
+ }
else {
error("bad option $option - should never happen!\n");
}
"p=s" => \&AddPackage,
"package=s" => \&AddPackage,
+ "s" => \&AddPackage,
+ "same-arch" => \&AddPackage,
+
"N=s" => \&ExcludePackage,
"no-package=s" => \&ExcludePackage,
# want us to act on them all. Note we have to do this before excluding
# packages out, below.
if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
- if ($options{DOINDEP} || $options{DOARCH}) {
+ if ($options{DOINDEP} || $options{DOARCH} || $options{DOSAME}) {
# User specified that all arch (in)dep package be
# built, and there are none of that type.
error("I have no package to build");
}
# Check to see if an argument on the command line starts with a dash.
- # if so, we need to pass this off to the resource intensive Getopt::Long,
- # which I'd prefer to avoid loading at all if possible.
+ # if so, we need to pass this off to the resource intensive
+ # Getopt::Long, which I'd prefer to avoid loading at all if possible.
my $parseopt=undef;
my $arg;
foreach $arg (@ARGV) {
my @allpackages=GetPackages();
$dh{MAINPACKAGE}=$allpackages[0];
- # Check if packages to build have been specified, if not, fall back to
+ # Check if packages to build have been specified, if not, fall back to
# the default, doing them all.
if (! defined $dh{DOPACKAGES} || ! @{$dh{DOPACKAGES}}) {
- if ($dh{DOINDEP} || $dh{DOARCH}) {
+ if ($dh{DOINDEP} || $dh{DOARCH} || $dh{DOSAME}) {
# User specified that all arch (in)dep package be
# built, and there are none of that type.
error("I have no package to build");
}
# Returns a list of packages in the control file.
-# Must pass "arch" or "indep" to specify arch-dependant or -independant
-# packages. If nothing is specified, returns all packages.
+# 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 { my $type=shift;
$type="" if ! defined $type;
+
+ # Look up the build arch if we need to.
+ my$buildarch='';
+ if ($type eq 'same') {
+ $buildarch=`dpkg --print-architecture` || error($!);
+ chomp $buildarch;
+ }
+
my $package="";
my $arch="";
my @list=();
- open (CONTROL,"<debian/control") ||
+ open (CONTROL,"<debian/control") ||
error("cannot read debian/control: $!\n");
while (<CONTROL>) {
chomp;
if ($package &&
(($type eq 'indep' && $arch eq 'all') ||
($type eq 'arch' && $arch ne 'all') ||
+ ($type eq 'same' && ($arch eq 'any' || $arch =~ /\b$buildarch\b/)) ||
! $type)) {
push @list, $package;
$package="";
update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+if [ "$1" = "configure" ]; then
+ if [ -z "$2" -o "$2" = "<unknown>" ]; then
+ /etc/init.d/#SCRIPT# start
+ fi
+fi
debhelper \- overview of the debhelper commands
.SH SYNOPSIS
.B dh_*
-.I "[-v] [-a] [-i] [--no-act] [-ppackage] [-Npackage] [-Ptmpdir]"
+.I "[-v] [-a] [-i] [-s] [--no-act] [-ppackage] [-Npackage] [-Ptmpdir]"
.SH "DESCRIPTION"
Debhelper is a collection of programs that can be used in debian/rules files
to automate common tasks related to building debian binary packages. All the
.B \-ppackage, \--package=package
Act on the package named "package".
.TP
+.B \-s, \--same-arch
+This is a smarter version of the -a flag, that is used in some rare
+circumstances. It understands that if the control file lists "Architecture: i386"
+for the package, the package should not be acted on on other architectures. So
+this flag makes the command act on all "Architecture: any" packages, as well
+as on any packages that have the current architecture explicitly specified.
+Constrast to the -a flag, which makes the command work on all packages that
+are not architecture independant.
+.TP
.B \-Npackage, \--no-package=package
Do not act on the specified package even if an -a, -i, or -p option lists
the package as one that should be acted on.
.B -a
,
.B -i
-, and
+,
.B -p
+, and
+.B -s
parameters. These parameters are cumulative. If none are given,
debhelper programs default to acting on all packages listed in the control
file.
+debhelper (1.1.20) unstable; urgency=low
+
+ * Added a --same-arch flag, that is useful in the rare case when you have
+ a package that builds only for 1 architecture, as part of a multi-part,
+ multi-architecture source package. (Ie, netscape-dmotif).
+ * Modified dh_installinit -r so it does start the daemon on the initial
+ install (#26680).
+
+ -- Joey Hess <joeyh@master.debian.org> Fri, 2 Oct 1998 15:55:13 -0700
+
debhelper (1.1.19) unstable; urgency=low
* dh_installmanpages: look at basename of man pacges specified on command
# Install in the proper location on my ftp server and web server. Not intended
# for use by anyone except the author.
OLD_VER=$(shell perl -e '<>;<>;while(<>){last if /^ --/};<>;$$_=<>;print m/\((.*?)\)/'<debian/changelog)
-localdist:
+dist:
dpkg-buildpackage -rfakeroot -tc
if [ `hostname` = 'kite' ] ; then \
cp ../debhelper_$(VERSION).tar.gz ../../public; \
# Check if packages to build have been specified, if not, fall back to
# the default, doing them all.
if [ ! "$DH_DOPACKAGES" ]; then
- if [ "$DH_DOINDEP" -o "$DH_DOARCH" ]; then
+ if [ "$DH_DOINDEP" -o "$DH_DOARCH" -o "$DH_DOSAME" ]; then
error "I have no package to build."
fi
DH_DOPACKAGES=`grep ^Package: debian/control | cut -d " " -f 2 | tr "\n" " "`
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
+.PHONY: build clean binary-indep binary-arch binary install