summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--perl-install/install/NEWS1
-rwxr-xr-xtools/drakx-in-chroot4
2 files changed, 5 insertions, 0 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index b76115f30..0f741f8a3 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,6 +1,7 @@
- drakx-in-chroot:
o document --stage2-update in --help
o mount /dev -o ro
+ o try harder to umount everything when sg went havroc
Version 16.43 - 20 October 2014
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));
}