diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-12-29 12:06:39 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-12-29 12:06:39 +0000 |
commit | aa5858b87ab4794513743166a4a6f14cee0d0383 (patch) | |
tree | 5c4e21be32a0cbe6f5c98ea8e7eaee17c3b6668c /perl-install/Xconfig | |
parent | 8dd9ef7b5577c53d34568c32541edd17fe7400f5 (diff) | |
download | drakx-aa5858b87ab4794513743166a4a6f14cee0d0383.tar drakx-aa5858b87ab4794513743166a4a6f14cee0d0383.tar.gz drakx-aa5858b87ab4794513743166a4a6f14cee0d0383.tar.bz2 drakx-aa5858b87ab4794513743166a4a6f14cee0d0383.tar.xz drakx-aa5858b87ab4794513743166a4a6f14cee0d0383.zip |
move any::runlevel() to Xconfig::various::runlevel()
Diffstat (limited to 'perl-install/Xconfig')
-rw-r--r-- | perl-install/Xconfig/main.pm | 2 | ||||
-rw-r--r-- | perl-install/Xconfig/various.pm | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/perl-install/Xconfig/main.pm b/perl-install/Xconfig/main.pm index 6baa84f78..b3d291c07 100644 --- a/perl-install/Xconfig/main.pm +++ b/perl-install/Xconfig/main.pm @@ -43,7 +43,7 @@ sub configure_everything_auto_install { &write($raw_X, $X); - any::runlevel(exists $old_X->{xdm} && !$old_X->{xdm} ? 3 : 5); + Xconfig::various::runlevel(exists $old_X->{xdm} && !$old_X->{xdm} ? 3 : 5); } sub configure_everything { 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 { |