summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-02 17:07:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-02 17:07:52 +0000
commitc969e8f1ffb9c9cb8697192021779f077e38a94b (patch)
tree39d3dfd7e74d364ed6fbffbaf24613f1cb893bd1 /perl-install
parent6ae6cf3b4f08444254fd3ed6c28e50036e7a2d6a (diff)
downloaddrakx-c969e8f1ffb9c9cb8697192021779f077e38a94b.tar
drakx-c969e8f1ffb9c9cb8697192021779f077e38a94b.tar.gz
drakx-c969e8f1ffb9c9cb8697192021779f077e38a94b.tar.bz2
drakx-c969e8f1ffb9c9cb8697192021779f077e38a94b.tar.xz
drakx-c969e8f1ffb9c9cb8697192021779f077e38a94b.zip
use any::runlevel()
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/bootlook.pm24
1 files changed, 2 insertions, 22 deletions
diff --git a/perl-install/bootlook.pm b/perl-install/bootlook.pm
index 3094be84c..d1943ec76 100644
--- a/perl-install/bootlook.pm
+++ b/perl-install/bootlook.pm
@@ -47,7 +47,7 @@ my @usernames;
parse_etc_passwd();
my $no_bootsplash;
-my $x_mode = isXlaunched();
+my $x_mode = any::runlevel() == 5;
my $a_mode = -e "/etc/aurora/Monitor" ? 1 : 0;
my $l_mode = isAutologin();
my %auto_mode = get_autologin("");
@@ -337,7 +337,7 @@ Click on Configure to launch the setup wizard.", $lilogrub),
)
),
gtkadd(gtkset_layout(new Gtk::HButtonBox, 'end'),
- gtksignal_connect(new Gtk::Button(N("OK")), clicked => sub { updateInit(); updateAutologin(); updateAurora(); $::isEmbedded ? kill('USR1',$::CCPID) : Gtk->exit(0) }),
+ gtksignal_connect(new Gtk::Button(N("OK")), clicked => sub { any::runlevel($x_mode ? 5 : 3); updateAutologin(); updateAurora(); $::isEmbedded ? kill('USR1',$::CCPID) : Gtk->exit(0) }),
gtksignal_connect(new Gtk::Button(N("Cancel")), clicked => sub { $::isEmbedded ? kill('USR1', $::CCPID) : Gtk->exit(0) })
)
)
@@ -390,26 +390,6 @@ sub print_hello {
}
#-------------------------------------------------------------
-# launch X functions
-#-------------------------------------------------------------
-
-sub isXlaunched {
- my $line;
- local *INITTAB;
- open INITTAB, "/etc/inittab" or die N("can not open /etc/inittab for reading: %s", $!);
- while (<INITTAB>) {
- if (/id:([1-6]):initdefault:/) { $line = $_; last }
- }
- $line =~ s/id:([1-6]):initdefault:/$1/;
- return $line-3;
-}
-
-sub updateInit {
- my $runlevel = $x_mode ? 5 : 3;
- substInFile { s/^id:\d:initdefault:\s*$/id:$runlevel:initdefault:\n/ } "/etc/inittab";
-}
-
-#-------------------------------------------------------------
# aurora functions
#-------------------------------------------------------------