diff options
author | Antoine Ginies <aginies@mandriva.com> | 2004-08-02 07:47:32 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2004-08-02 07:47:32 +0000 |
commit | 9df3c29c00a16c9fd7c5348692d9bdb94bd1f8de (patch) | |
tree | 40792c0b784defb1d35640911f24b3f507ce8eb5 | |
parent | cd4f6d058a0df6ed2049424397336bcda8fd7529 (diff) | |
download | drakwizard-9df3c29c00a16c9fd7c5348692d9bdb94bd1f8de.tar drakwizard-9df3c29c00a16c9fd7c5348692d9bdb94bd1f8de.tar.gz drakwizard-9df3c29c00a16c9fd7c5348692d9bdb94bd1f8de.tar.bz2 drakwizard-9df3c29c00a16c9fd7c5348692d9bdb94bd1f8de.tar.xz drakwizard-9df3c29c00a16c9fd7c5348692d9bdb94bd1f8de.zip |
use run_command_and_log
-rw-r--r-- | installsrv_wizard/Installsrv.pm | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/installsrv_wizard/Installsrv.pm b/installsrv_wizard/Installsrv.pm index ca5549a6..c95c2f21 100644 --- a/installsrv_wizard/Installsrv.pm +++ b/installsrv_wizard/Installsrv.pm @@ -20,7 +20,8 @@ # package MDK::Wizard::Installsrv; -use lib qw(/usr/lib/libDrakX); +#use lib qw(/usr/lib/libDrakX); +#use ugtk2 qw(:ask :helpers :wrappers :create :dialogs); use strict; use standalone; use common; @@ -35,12 +36,13 @@ my $wiz = new MDK::Wizard::Wizcommon; my $INSTALLDIR = "/var/install/"; my $NFSEXPORTS = "/etc/exports"; my $WWWDIR = "/var/www/html"; +my $testy; my $o = { name => 'MDK Install Server Wizard', var => { - DESTDIR => '/var/install/10', - SOURCEDIR => '/mnt/nfs/10', + DESTDIR => '/var/install/clic', + SOURCEDIR => '/home/nis/install/clic', }, needed_rpm => [ 'nfs-utils', 'apache2' ], defaultimage => "$ENV{__WIZ_HOME__}/installsrv_wizard/images/Install.png" @@ -91,9 +93,13 @@ $o->{pages} = { { label => N("Enable NFS install server:"), fixed_val => \$o->{var}{nfs} }, { label => N("Enable HTTP install server:"), fixed_val => \$o->{var}{http} }, ], - post => \&do_it, - next => 'end', + complete => \&do_it, + next => 'wait', }, + wait => { + name => N("Configuring your system, please wait..."), + next => 'end', + }, end => { name => N("Congratulations, Mandrake Install server is now ready. You can now configure a DHCP server with PXE support, and a PXE server. So it will be very easy to install Mandrake through a network."), end => 1, @@ -104,10 +110,10 @@ $o->{pages} = { sub add_install_dir { - if (any { /$INSTALLDIR/ } cat_($NFSEXPORTS)) { + if (any { /$o->{var}{DESTDIR}/ } cat_($NFSEXPORTS)) { print " - " . $NFSEXPORTS . " ready\n"; } else { - append_to_file($NFSEXPORTS, "$INSTALLDIR *(async,rw,no_root_squash)\n"); + append_to_file($NFSEXPORTS, "$->{var}{DESTDIR} *(async,rw,no_root_squash)\n"); check_started($_) foreach qw(nfs nfsd); } } @@ -139,12 +145,13 @@ sub cp_data { sub do_it { return if $::testing; - my $in = 'interactive'->vnew('su', 'Install server'); - my $w = $in->wait_message(N("Install Server"), N("Copying data to destination directory, can take a while....")); - cp_data($o->{var}{SOURCEDIR}, $o->{var}{DESTDIR}); + my $S = $o->{var}{SOURCEDIR}; + my $D = $o->{var}{DESTDIR}; + if (! -d $D) { mkdir_p($D) } + run_command_and_log("cp -avf $S/* $D", "Copying data $S/* $D"); add_install_dir(); add_http_link($o->{var}{DESTDIR}); - undef $w; + return 0; } sub new { |