diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-04-23 22:49:22 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-04-23 22:49:22 -0400 |
commit | 4f8a46b36e961d1a64d466a63f3a7ef6c90bafe2 (patch) | |
tree | 5bbb9dde41b2c9d87c7b544e7e3adeded0b7863d /dh | |
parent | 28f84cd5c972f683506bee5f201cd93a2c09ee56 (diff) |
dh_prep: New program, does the same as dh_clean -k (which will be deprecated later).
Diffstat (limited to 'dh')
-rwxr-xr-x | dh | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -172,6 +172,7 @@ that normally come before those in the sequence are still run. my @ARGV_orig=@ARGV; init(); +inhibit_log(); # Definitions of sequences. my %sequences; @@ -188,7 +189,7 @@ $sequences{clean} = [qw{ }]; $sequences{install} = [@{$sequences{build}}, qw{ dh_testroot - dh_clean + dh_prep dh_installdirs dh_auto_install @@ -291,6 +292,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) { # Run commands in the sequence that come after the # specified command. $startpoint{$package}=command_pos($dh{AFTER}, @sequence) + 1; + # Write a dummy log entry indicating that the specified + # command was, in fact, run. This handles the case where + # no commands remain to run after it, communicating to + # future dh instances that the specified command should not + # be run again. + writelog($package, $sequence[$startpoint{$package}-1]); } elsif ($dh{REMAINING}) { # Start at the beginning so all remaining commands will get @@ -352,11 +359,6 @@ sub run { my $command=shift; my @options=@_; - # dh_clean -k is a special case - if ($command eq 'dh_clean' && $sequence ne 'clean') { - unshift @options, "-k"; - } - # If a third party command is not in /usr/bin, don't try to run it. if ($thirdparty{$command} && ! -x "/usr/bin/$command") { return; @@ -390,6 +392,16 @@ sub loadlog { close LOG; return @log; } + +sub writelog { + my $package=shift; + my $cmd=shift; + my $ext=pkgext($package); + + open(LOG, ">>", "debian/${ext}debhelper.log") || error("failed to write to log"); + print LOG $cmd."\n"; + close LOG; +} =head1 SEE ALSO |