summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/livedrake
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone/livedrake')
-rwxr-xr-xperl-install/standalone/livedrake23
1 files changed, 8 insertions, 15 deletions
diff --git a/perl-install/standalone/livedrake b/perl-install/standalone/livedrake
index 397294543..f93cfefbb 100755
--- a/perl-install/standalone/livedrake
+++ b/perl-install/standalone/livedrake
@@ -2,16 +2,15 @@
use lib qw(/usr/lib/libDrakX);
-use common qw(:common :system);
+use common qw(:common :system :file);
use interactive;
-use mouse;
+use run_program;
use c;
local $_ = join '', @ARGV;
-/-h/ and die "usage: livedrake [--auto] [--testing]\n";
+/-h/ and die "usage: livedrake [--testing]\n";
-$::auto = /-auto/;
$::testing = /-testing/;
$::isStandalone = 1;
@@ -24,29 +23,23 @@ while (! -x "$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/live_install") {
$in->ask_okcancel(_("Change Cd-Rom"),
_("Please insert the Installation Cd-Rom in your drive and press Ok when done.
If you don't have it, press Cancel to avoid live upgrade."), 1) or $in->exit(0);
- eval { fs::mount("/mnt/cdrom") };
+ run_program::run("mount", "/mnt/cdrom");
}
if (-x "$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/live_install") {
chdir "/$cd_mntpoint/Mandrake/mdkinst/usr/bin/perl-install/";
- exec "./live_install";
+ $::testing or exec "./live_install";
}
$in->ask_warn('', _("Unable to start live upgrade !!!\n"));
$in->exit(1);
-sub unlockCdrom(;$) {
+sub ejectCdrom {
my ($cdrom) = @_;
$cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1;
$cdrom or cat_("/etc/fstab") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1;
- eval { $cdrom and ioctl detect_devices::tryOpen($1), c::CDROM_LOCKDOOR(), 0 };
-}
-
-sub ejectCdrom(;$) {
- my ($cdrom) = @_;
- $cdrom or cat_("/proc/mounts") =~ m|(/dev/\S+)\s+/mnt/cdrom\s| and $cdrom = $1;
my $f = eval { $cdrom && detect_devices::tryOpen($cdrom) } or return;
- getFile("XXX"); #- close still opened filehandle
- eval { fs::umount("/mnt/cdrom") };
+ run_program::run("umount", "/mnt/cdrom");
+ ioctl $f, c::CDROM_LOCKDOOR(), 0;
ioctl $f, c::CDROMEJECT(), 1;
}