From f4d79d3a194e2c99551fb91e77c663dfb74cb255 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 22 Dec 2017 22:12:16 +0000 Subject: Use sudo when cleaning the chroot directory. --- drakclassic | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drakclassic') 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); } ############################################################################### -- cgit v1.2.1