On 2012-07-12 12:41, Niels Thykier wrote: > > Joey Hess wrote: >> There is some potential for speeding up dh. Josh Tripplet and I once >> discussed: >> >> * Having dh optimize out calls to debhelper commands that will be >> no-ops. For a subset of commands, this can be determined just >> by looking for their config files. Some kind of metadata would be >> necessary for dh to tell which commands are in that subset. > > Hi, > > Perhaps the sequence modules could contain such information? This would > allow third-party sequences to take advantage of this optimization as well. > > [...] > > ~Niels >
I have developed a prototype patch for optimizing out unused debhelper
commands from a dh sequence. The basic idea it is to maintain a table
in dh mapping skippable commands to their "pkgfile"-files.
If a command is in the table and none of these files are present (for
any package to be acted on), then the command is skipped. It gives
backwards compatible semantics for add-on sequences (their commands are
not present in the table).
Commands are checked just before they are run, but after their override
targets are run (if any). This allows the build to auto-generate the
files and should be backwards compatible as far as I can tell.
The prototype does /not/ include an API extension for sequence modules
to add their commands to the "auto skip" table. However, it should be
fairly trivial to create and I will happily add it if this approach is
deemed reasonable.
I have included a small print statement to inform when a command is
skipped. I have no strong feelings for whether or not it should stay; I
merely added it to assist the development.
I have included the following skip rules (long lines truncated):
"dh_bugfiles" => [qw(bug-script bug-control bug-presubj)],
"dh_install" => ["install"],
"dh_installcron" => [qw(cron.daily ...)],
"dh_installcatalogs" => ["sgmlcatalogs"],
"dh_installemacsen" => [qw(emacsen-install ...)],
"dh_installexamples" => ["examples"],
"dh_installifupdown" => [qw(if-up if-down ...)],
"dh_installinfo" => ["info"],
"dh_lintian" => ["lintian-overrides"],
"dh_installmenu" => ["menu", "menu-method"],
"dh_ucf" => ["ucf"],
The commands were added based on memory or/and a quick view in the
manpage. It can most likely be extended and (to my knowledge) does not
include commands that may do stuff based on what it is in debian/<pkg>
(but do correct me if I am wrong).
~Niels
sample.patch
Description: application/wine-extension-patch

