summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorModestas Vainius <modestas@vainius.eu>2009-06-30 16:04:50 +0300
committerModestas Vainius <modestas@vainius.eu>2009-06-30 16:07:28 +0300
commite406fc18cd733342b04c1bf70352988d6e9007a1 (patch)
tree9063c507552c4100f246b8e3687d43b5684ae525
parent9a867d7d344bc3c59a3326123f7323655c311d6c (diff)
rmdir_builddir(): use shell commands rather than perl equivalent.
Pass --ignore-fail-on-non-empty option to shell rmddir and later check with -d if the exists to get the same effect. Also drop no act check from rmdir_builddir(), doit() does it for us now. Signed-off-by: Modestas Vainius <modestas@vainius.eu>
-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 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;
}
}
}