summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-07-16 16:25:57 +0000
committerNiels Thykier <niels@thykier.net>2017-07-22 18:56:11 +0000
commit10ce039c7072412dbc8a9286e5a520f97203d3af (patch)
treed9c034ca01423f5127c925601eafa555b9c3b895
parent1a629d47954baaabc53929b0d661391e1f3498a2 (diff)
downloaddebhelper-10ce039c7072412dbc8a9286e5a520f97203d3af.tar.gz
dh_clean+dh_prep: Use default_sourcedir instead of d/tmp
Signed-off-by: Niels Thykier <niels@thykier.net>
-rwxr-xr-xdh_clean8
-rwxr-xr-xdh_prep10
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;