summaryrefslogtreecommitdiffstats
path: root/tools/drakx-in-chroot
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2014-10-23 00:21:03 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-10-23 00:21:31 +0200
commitf4cd3076f00884833aff775414c1132237be922e (patch)
tree5ccc74b2026918574bf4fd2f6205cd80f119da1b /tools/drakx-in-chroot
parenta7065e441c7f46cf430ad9f2aa4ea6f7e48906ac (diff)
downloaddrakx-f4cd3076f00884833aff775414c1132237be922e.tar
drakx-f4cd3076f00884833aff775414c1132237be922e.tar.gz
drakx-f4cd3076f00884833aff775414c1132237be922e.tar.bz2
drakx-f4cd3076f00884833aff775414c1132237be922e.tar.xz
drakx-f4cd3076f00884833aff775414c1132237be922e.zip
try harder to umount everything when sg went havroc
Diffstat (limited to 'tools/drakx-in-chroot')
-rwxr-xr-xtools/drakx-in-chroot4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/drakx-in-chroot b/tools/drakx-in-chroot
index e289ebbaf..dbc319052 100755
--- a/tools/drakx-in-chroot
+++ b/tools/drakx-in-chroot
@@ -56,6 +56,9 @@ if ($>) {
$ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
}
+my @mounts;
+my $_b = before_leaving { sys("$sudo umount $_") foreach reverse @mounts };
+
undef $ENV{TMPDIR}; # prevent packdrake faillure on creating temporary files
if (-d $SLASH_LOCATION) {
@@ -200,6 +203,7 @@ sub create_initial_symlinks() {
sub mount {
my ($from, $mntpt, @opts) = @_;
+ push @mounts, $mntpt;
sys("$sudo mount $from $mntpt " . join(' ', @opts));
}