+debhelper (7.0.2) UNRELEASED; urgency=low
+
+ * dh: Optimise the case where the binary-arch or binary-indep sequence is
+ run and there are no packages of that type.
+
+ -- Joey Hess <joeyh@debian.org> Thu, 24 Apr 2008 14:10:56 -0400
+
debhelper (7.0.1) unstable; urgency=low
* I lied, one more v7 change slipped in..
# 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_pycompat
+ 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;
# 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;
}