=head1 SYNOPSIS
-B<dh> sequence [B<--until> I<cmd>] [B<--before> I<cmd>] [B<--after> I<cmd>] [B<--remaining> [S<I<debhelper options>>]
+B<dh> sequence [B<--until> I<cmd>] [B<--before> I<cmd>] [B<--after> I<cmd>] [B<--remaining>] [S<I<debhelper options>>]
=head1 DESCRIPTION
binary-arch sequences are passed the "-a" option to ensure they only work
on architecture dependent packages.
-Options passed to dh are passed on to each command it runs. This can be
-used to set an option like "-v" or "-X" or "-N", as well as for more
-specialised options.
-
Each debhelper command will record when it's successfully run in
debian/package.debhelper.log. (Which dh_clean deletes.) So dh can tell
which commands have already been run, for which packages, and skip running
Run all commands in the sequence that have yet to be run.
+=back
+
+All other options passed to dh are passed on to each command it runs. This
+can be used to set an option like "-v" or "-X" or "-N", as well as for more
+specialised options.
+
=head1 COMMAND SPECIFICATION
I<cmd> can be a full name of a debhelper command, or a substring. It'll first
#!/usr/bin/make -f
%:
- dh %@
+ dh $@
This is a simple rules file that is a good starting place for customisation.
(It's also available in F</usr/share/doc/debhelper/examples/rules.simple>
# and continue
dh install --after dh_fixperms
-It's also fine to run debhelper commands before starting a dh sequence.
-Just be sure to use the B<--remaining> option to ensure that commands
-that normally come before those in the sequence are still run.
+It's also fine to run debhelper commands early. Just make sure that at
+least dh_prep is run from the squence first, and be sure to use the
+B<--remaining> option to ensure that commands that normally come before
+those in the sequence are still run.
install:
+ dh install --until dh_prep
dh_installdocs README TODO
dh_installchangelogs Changes
dh install --remaining
# Third-party commands can be listed in the sequences, but should be
# listed here as well. They will not be run if not present.
-my %thirdparty=(
- dh_pycompat => 1,
- dh_pysupport => 1,
-);
+my %thirdparty=map { $_ => 1 } qw{
+ dh_pycentral
+ dh_pysupport
+};
# Get the sequence of commands to run.
if (! @ARGV) {
}
my @sequence=@{$sequences{$sequence}};
+# The list of all packages that can be acted on.
+my @packages=@{$dh{DOPACKAGES}};
+
# Get the options to pass to commands in the sequence.
# Filter out options intended only for this program.
my @options;
if ($sequence eq 'binary-arch') {
push @options, "-a";
+ # as an optimisation, remove from the list any packages
+ # that are not arch dependent
+ my %arch_packages = map { $_ => 1 } getpackages("arch");
+ @packages = grep { $arch_packages{$_} } @packages;
}
elsif ($sequence eq 'binary-indep') {
push @options, "-i";
+ # ditto optimisation for arch indep
+ my %indep_packages = map { $_ => 1 } getpackages("indep");
+ @packages = grep { $indep_packages{$_} } @packages;
}
while (@ARGV_orig) {
my $opt=shift @ARGV_orig;
shift @ARGV_orig;
next;
}
- elsif ($opt =~ /^--?(remaining|(after|until|before)=)/) {
+ elsif ($opt =~ /^--?(no-act|remaining|(after|until|before)=)/) {
next;
}
push @options, $opt;
# Figure out at what point in the sequence to start for each package.
my %logged;
my %startpoint;
-foreach my $package (@{$dh{DOPACKAGES}}) {
+foreach my $package (@packages) {
my @log=loadlog($package);
if ($dh{AFTER}) {
# Run commands in the sequence that come after the
foreach my $i (0..$stoppoint) {
# Figure out which packages need to run this command.
my @exclude;
- foreach my $package (@{$dh{DOPACKAGES}}) {
+ foreach my $package (@packages) {
if ($startpoint{$package} > $i ||
$logged{$package}{$sequence[$i]}) {
push @exclude, $package;
}
}
- if (@exclude eq @{$dh{DOPACKAGES}}) {
+ if (@exclude eq @packages) {
# Command already done for all packages.
next;
}