From 10ce039c7072412dbc8a9286e5a520f97203d3af Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 16 Jul 2017 16:25:57 +0000 Subject: dh_clean+dh_prep: Use default_sourcedir instead of d/tmp Signed-off-by: Niels Thykier --- dh_clean | 8 ++++---- dh_prep | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dh_clean b/dh_clean index 11a00df0..8b7d4aa5 100755 --- a/dh_clean +++ b/dh_clean @@ -90,11 +90,12 @@ if ($dh{K_FLAG}) { # Remove the debhelper stamp file rm_files('debian/debhelper-build-stamp') if not $dh{D_FLAG}; -my (@clean_files, @clean_dirs); +my (@clean_files, @clean_dirs, %seen); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $ext=pkgext($package); + my $source_dir = default_sourcedir($package); if (! $dh{D_FLAG}) { push(@clean_files, "debian/${ext}substvars") @@ -108,6 +109,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) { push(@clean_dirs , "${tmp}/") unless excludefile($tmp); + push(@clean_dirs, "${source_dir}/") + if (not $seen{$source_dir}++ and not excludefile($source_dir)); } @@ -173,9 +176,6 @@ if (! $dh{D_FLAG}) { \\( -type d -a -name autom4te.cache -prune -exec rm -rf {} + \\) \\)"); } -doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && - ! excludefile("debian/tmp"); - if (!compat(6) && !$dh{K_FLAG}) { my @stamp_files = glob('*-stamp'); rm_files(@stamp_files) if @stamp_files; diff --git a/dh_prep b/dh_prep index 518b6eb7..718d8d92 100755 --- a/dh_prep +++ b/dh_prep @@ -42,11 +42,12 @@ multiple times to build up a list of things to exclude. init(); -my (@clean_files, @clean_dirs); +my (@clean_files, @clean_dirs, %seen); foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my $ext=pkgext($package); + my $source_dir = default_sourcedir($package); push(@clean_files, "debian/${ext}substvars") unless excludefile("debian/${ext}substvars"); @@ -58,11 +59,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) { push(@clean_dirs, "debian/.debhelper/generated/${package}/"); push(@clean_dirs , "${tmp}/") unless excludefile($tmp); -} - -push(@clean_dirs, 'debian/tmp') if -x 'debian/tmp' && - ! excludefile("debian/tmp"); + push(@clean_dirs, "${source_dir}/") + if (not $seen{$source_dir}++ and not excludefile($source_dir)); +} xargs(\@clean_files, 'rm', '-f', '--') if @clean_files; xargs(\@clean_dirs, 'rm', '-fr', '--') if @clean_dirs; -- cgit v1.2.3