summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig/various.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-29 12:06:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-29 12:06:39 +0000
commitaa5858b87ab4794513743166a4a6f14cee0d0383 (patch)
tree5c4e21be32a0cbe6f5c98ea8e7eaee17c3b6668c /perl-install/Xconfig/various.pm
parent8dd9ef7b5577c53d34568c32541edd17fe7400f5 (diff)
downloaddrakx-backup-do-not-use-aa5858b87ab4794513743166a4a6f14cee0d0383.tar
drakx-backup-do-not-use-aa5858b87ab4794513743166a4a6f14cee0d0383.tar.gz
drakx-backup-do-not-use-aa5858b87ab4794513743166a4a6f14cee0d0383.tar.bz2
drakx-backup-do-not-use-aa5858b87ab4794513743166a4a6f14cee0d0383.tar.xz
drakx-backup-do-not-use-aa5858b87ab4794513743166a4a6f14cee0d0383.zip
move any::runlevel() to Xconfig::various::runlevel()
Diffstat (limited to 'perl-install/Xconfig/various.pm')
-rw-r--r--perl-install/Xconfig/various.pm16
1 files changed, 13 insertions, 3 deletions
diff --git a/perl-install/Xconfig/various.pm b/perl-install/Xconfig/various.pm
index 5b1ae7a45..a89be0373 100644
--- a/perl-install/Xconfig/various.pm
+++ b/perl-install/Xconfig/various.pm
@@ -7,7 +7,6 @@ use Xconfig::card;
use Xconfig::default;
use Xconfig::resolution_and_depth;
use common;
-use any;
sub info {
@@ -46,9 +45,20 @@ sub various {
1;
}
+sub runlevel {
+ my ($runlevel) = @_;
+ my $f = "$::prefix/etc/inittab";
+ -r $f or log::l("missing inittab!!!"), return;
+ if ($runlevel) {
+ substInFile { s/^id:\d:initdefault:\s*$/id:$runlevel:initdefault:\n/ } $f if !$::testing;
+ } else {
+ cat_($f) =~ /^id:(\d):initdefault:\s*$/ && $1;
+ }
+}
+
sub choose_xdm {
my ($in, $auto) = @_;
- my $xdm = $::isStandalone ? any::runlevel() == 5 : 1;
+ my $xdm = $::isStandalone ? runlevel() == 5 : 1;
if (!$auto || $::isStandalone) {
$in->set_help('configureXxdm') if !$::isStandalone;
@@ -57,7 +67,7 @@ sub choose_xdm {
N("I can setup your computer to automatically start the graphical interface (XFree) upon booting.
Would you like XFree to start when you reboot?"), $xdm) or return;
}
- any::runlevel($xdm ? 5 : 3);
+ runlevel($xdm ? 5 : 3);
}
sub tvout {