From 4f8a46b36e961d1a64d466a63f3a7ef6c90bafe2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 23 Apr 2008 22:49:22 -0400 Subject: dh_prep: New program, does the same as dh_clean -k (which will be deprecated later). --- dh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'dh') diff --git a/dh b/dh index ab814d7f..330b0152 100755 --- a/dh +++ b/dh @@ -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 -- cgit v1.2.3