diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2016-09-21 22:52:30 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2016-09-21 22:52:30 +0300 |
commit | 296138c560140868ab58e20a8ff5e86d18b55dfc (patch) | |
tree | e6ac6dbc8ec171e70eac726d4516b7a4e07c22db /dh | |
parent | 3e26a9d6fedea734e30c5cc7ad54adecc5e8c751 (diff) | |
parent | 7ea67c9aace4692efd026c242cc4445881ec5df6 (diff) | |
download | debhelper-296138c560140868ab58e20a8ff5e86d18b55dfc.tar.gz |
Merge https://anonscm.debian.org/git/debhelper/debhelper
Diffstat (limited to 'dh')
-rwxr-xr-x | dh | 75 |
1 files changed, 38 insertions, 37 deletions
@@ -62,6 +62,8 @@ listed, separated by commas. List all available addons. +This can be used without a F<debian/compat> file. + =item B<--no-act> Prints commands that would run for a given sequence, but does not run them. @@ -127,15 +129,6 @@ after a particular debhelper command is run. dh_fixperms chmod 4755 debian/foo/usr/bin/foo -If your package uses autotools and you want to freshen F<config.sub> and -F<config.guess> with newer versions from the B<autotools-dev> package -at build time, you can use some commands provided in B<autotools-dev> -that automate it, like this. - - #!/usr/bin/make -f - %: - dh $@ --with autotools_dev - Python tools are not run by dh by default, due to the continual change in that area. (Before compatibility level v9, dh does run B<dh_pysupport>.) Here is how to use B<dh_python2>. @@ -222,15 +215,23 @@ when building only documentation. If you're curious about B<dh>'s internals, here's how it works under the hood. -Each debhelper command will record when it's successfully run in -F<debian/package.debhelper.log>. (Which B<dh_clean> deletes.) So B<dh> can tell -which commands have already been run, for which packages, and skip running -those commands again. +In compat 10 (or later), B<dh> creates a stamp file +F<debian/debhelper-build-stamp> after the build step(s) are complete +to avoid re-running them. Inside an override target, B<dh_*> commands +will create a log file F<debian/package.debhelper.log> to keep track +of which packages the command(s) have been run for. These log files +are then removed once the override target is complete. -Each time B<dh> is run, it examines the log, and finds the last logged command -that is in the specified sequence. It then continues with the next command -in the sequence. The B<--until>, B<--before>, B<--after>, and B<--remaining> -options can override this behavior. +In compat 9 or earlier, each debhelper command will record +when it's successfully run in F<debian/package.debhelper.log>. (Which +B<dh_clean> deletes.) So B<dh> can tell which commands have already +been run, for which packages, and skip running those commands again. + +Each time B<dh> is run (in compat 9 or earlier), it examines the log, +and finds the last logged command that is in the specified +sequence. It then continues with the next command in the sequence. The +B<--until>, B<--before>, B<--after>, and B<--remaining> options can +override this behavior (though they were removed in compat 10). A sequence can also run dependent targets in debian/rules. For example, the "binary" sequence runs the "install" target. @@ -287,6 +288,15 @@ if (compat(8, 1)) { # (and comes first so python-central loads later and can disable it). unshift @ARGV, "--with=python-support"; } +if (not compat(9, 1)) { + # Enable autoreconf'ing by default in compat 10 or later. Use the + # sequence add-on so existing --without=autoreconf + unshift(@ARGV, "--with=autoreconf"); + # Enable systemd support by default in compat 10 or later. + unshift(@ARGV, "--with=systemd"); +} + +inhibit_log(); init(options => { "until=s" => \$dh{UNTIL}, @@ -311,7 +321,6 @@ init(options => { # Bundling does not work well since there are unknown options. bundling => 0, ); -inhibit_log(); set_buildflags(); warn_deprecated(); @@ -406,9 +415,7 @@ my @i = (qw{ dh_link dh_installwm dh_installxfonts -}, - optional_command('dh_strip_nondeterminism'), -qw{ + dh_strip_nondeterminism dh_compress dh_fixperms }); @@ -1021,10 +1028,16 @@ sub can_skip { foreach my $package (@packages) { foreach my $skipinfo (@skipinfo) { - if ($skipinfo=~/^tmp\((.*)\)$/) { - my $need=$1; - my $tmp=tmpdir($package); - return 0 if -e "$tmp/$need"; + if ($skipinfo=~/^([a-zA-Z0-9-_]+)\((.*)\)$/) { + my $type = $1; + my $need = $2; + if ($type eq 'tmp') { + my $tmp = tmpdir($package); + return 0 if -e "$tmp/$need"; + } else { + # Unknown hint - make no assumptions + return 0; + } } elsif (pkgfile($package, $skipinfo) ne '') { return 0; @@ -1034,18 +1047,6 @@ sub can_skip { return 1; } -sub optional_command { - my ($command) = @_; - - foreach my $dir (split(':', $ENV{'PATH'})) { - if (open(my $h, '<', "$dir/$command")) { - close($h); - return ($command); - } - } - return; -} - sub extract_skipinfo { my $command=shift; |