diff options
author | Niels Thykier <niels@thykier.net> | 2017-07-16 16:25:57 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-07-22 18:56:11 +0000 |
commit | 10ce039c7072412dbc8a9286e5a520f97203d3af (patch) | |
tree | d9c034ca01423f5127c925601eafa555b9c3b895 | |
parent | 1a629d47954baaabc53929b0d661391e1f3498a2 (diff) | |
download | debhelper-10ce039c7072412dbc8a9286e5a520f97203d3af.tar.gz |
dh_clean+dh_prep: Use default_sourcedir instead of d/tmp
Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-x | dh_clean | 8 | ||||
-rwxr-xr-x | dh_prep | 10 |
2 files changed, 9 insertions, 9 deletions
@@ -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; @@ -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; |