summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-06-30 13:04:34 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-06-30 13:04:34 -0400
commit4d89e21ab24a1a3a9c4ae1de8424805742f1d763 (patch)
tree8e6b361ee1589614822ce46e6864596d175de909
parent220fc31652cf112b333c195cde759fe5f04d182f (diff)
parente406fc18cd733342b04c1bf70352988d6e9007a1 (diff)
Merge commit 'remotes/modestas/buildsystems' into buildsystems
-rw-r--r--Debian/Debhelper/Buildsystem.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/Debian/Debhelper/Buildsystem.pm b/Debian/Debhelper/Buildsystem.pm
index 9730928..62c45b5 100644
--- a/Debian/Debhelper/Buildsystem.pm
+++ b/Debian/Debhelper/Buildsystem.pm
@@ -320,20 +320,20 @@ sub rmdir_builddir {
my $only_empty=shift;
if ($this->get_builddir()) {
my $buildpath = $this->get_buildpath();
- if (-d $buildpath && ! $dh{NO_ACT}) {
- my @spdir = File::Spec->splitdir($this->get_build_rel2sourcedir());
+ if (-d $buildpath) {
+ my @dir = File::Spec->splitdir($this->get_build_rel2sourcedir());
my $peek;
- if (!$only_empty) {
+ if (not $only_empty) {
doit("rm", "-rf", $buildpath);
- pop @spdir;
+ pop @dir;
}
# If build directory is relative and had 2 or more levels, delete
- # empty parent directories until the source directory level.
+ # empty parent directories until the source or top directory level.
if (not File::Spec->file_name_is_absolute($buildpath)) {
- while (($peek=pop(@spdir)) && $peek ne '.' && $peek ne '..') {
- my $dir = $this->get_sourcepath(File::Spec->catdir(@spdir, $peek));
- verbose_print("rmdir $dir");
- last if ! rmdir($dir);
+ while (($peek=pop @dir) && $peek ne '.' && $peek ne '..') {
+ my $dir = $this->get_sourcepath(File::Spec->catdir(@dir, $peek));
+ doit("rmdir", "--ignore-fail-on-non-empty", $dir);
+ last if -d $dir;
}
}
}