summaryrefslogtreecommitdiffstats
path: root/drakclassic
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-22 22:12:16 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-22 22:22:20 +0000
commitf4d79d3a194e2c99551fb91e77c663dfb74cb255 (patch)
tree6ff4be39201418b81f2ff220e99e5d30169413c5 /drakclassic
parent9755f9276dc237907104b91198de99d625e3c607 (diff)
downloaddrakiso-f4d79d3a194e2c99551fb91e77c663dfb74cb255.tar
drakiso-f4d79d3a194e2c99551fb91e77c663dfb74cb255.tar.gz
drakiso-f4d79d3a194e2c99551fb91e77c663dfb74cb255.tar.bz2
drakiso-f4d79d3a194e2c99551fb91e77c663dfb74cb255.tar.xz
drakiso-f4d79d3a194e2c99551fb91e77c663dfb74cb255.zip
Use sudo when cleaning the chroot directory.
Diffstat (limited to 'drakclassic')
-rwxr-xr-xdrakclassic8
1 files changed, 7 insertions, 1 deletions
diff --git a/drakclassic b/drakclassic
index da1f875..e120402 100755
--- a/drakclassic
+++ b/drakclassic
@@ -51,7 +51,13 @@ $::force = 0;
sub clean {
my ($build) = @_;
- rm_rf($_) foreach grep { -e $_ } $build->get_builddir, $build->get_system_root;
+
+ if (-e ($build->get_system_root)) {
+ # There shouldn't be anything mounted in the chroot, but play it safe...
+ umount_all_in_chroot($build);
+ system('sudo rm -rf ' . $build->get_system_root);
+ }
+ system('rm -rf ' . $build->get_builddir) if -e ($build->get_builddir);
}
###############################################################################