diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-06-30 13:04:34 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-06-30 13:04:34 -0400 |
commit | 4d89e21ab24a1a3a9c4ae1de8424805742f1d763 (patch) | |
tree | 8e6b361ee1589614822ce46e6864596d175de909 | |
parent | 220fc31652cf112b333c195cde759fe5f04d182f (diff) | |
parent | e406fc18cd733342b04c1bf70352988d6e9007a1 (diff) |
Merge commit 'remotes/modestas/buildsystems' into buildsystems
-rw-r--r-- | Debian/Debhelper/Buildsystem.pm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Debian/Debhelper/Buildsystem.pm b/Debian/Debhelper/Buildsystem.pm index 9730928d..62c45b5d 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; } } } |