diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-03-12 07:14:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-03-12 07:14:27 +0000 |
commit | 6279d17c19cb7ce69c9a76978a261f7fb4cb8f26 (patch) | |
tree | c98c966328e0c7e65db654c0a136ccc16c5eb295 /perl-install/standalone | |
parent | f8948d807a4b0019d0757b2b90edb712b60916db (diff) | |
download | drakx-6279d17c19cb7ce69c9a76978a261f7fb4cb8f26.tar drakx-6279d17c19cb7ce69c9a76978a261f7fb4cb8f26.tar.gz drakx-6279d17c19cb7ce69c9a76978a261f7fb4cb8f26.tar.bz2 drakx-6279d17c19cb7ce69c9a76978a261f7fb4cb8f26.tar.xz drakx-6279d17c19cb7ce69c9a76978a261f7fb4cb8f26.zip |
- check if dm package is installed and install it if needed
- use format instead of reverse() (not a big slow down but small rivers make
big ones and it makes gc happier...)
Diffstat (limited to 'perl-install/standalone')
-rw-r--r-- | perl-install/standalone/drakedm | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/perl-install/standalone/drakedm b/perl-install/standalone/drakedm index 064fffded..c59de5f93 100644 --- a/perl-install/standalone/drakedm +++ b/perl-install/standalone/drakedm @@ -27,10 +27,10 @@ my $in = 'interactive'->vnew('su'); my $cfg_file = '/etc/sysconfig/desktop'; -my %dm = ('GNOME' => 'GDM (GNOME Display Manager)', - 'KDM' => 'KDM (KDE Display Manager)', - 'KDE' => 'MdkKDM (Mandrake Display Manager)', - 'XDM' => 'XDM (X Display Manager)', +my %dm = ('GNOME' => [ 'GDM (GNOME Display Manager)', '/usr/bin/gdm', 'gdm' ], + 'KDM' => [ 'KDM (KDE Display Manager)', '/usr/bin/kdm', 'kdebase-kdm' ], + 'KDE' => [ 'MdkKDM (Mandrake Display Manager)', '/usr/bin/mdkkdm', 'mdkkdm' ], + 'XDM' => [ 'XDM (X Display Manager)', '/usr/bin/X11/xdm', 'XFree86' ], ); my $dm = 'KDE'; @@ -39,22 +39,28 @@ foreach (cat_($cfg_file)) { $dm = uc($1) if /^DISPLAYMANAGER=(.*)$/; } -if (my $new_dm = $in->ask_from_list_(N("Choosing a display manager"), - formatAlaTeX(N("X11 Display Manager allows you to graphically log +if ($in->ask_from(N("Choosing a display manager"), + formatAlaTeX(N("X11 Display Manager allows you to graphically log into your system with the X Window System running and supports running several different X sessions on your local machine at the same time.")), - [ sort values %dm ], - $dm{$dm} - ) + [ + { + list => [ sort keys %dm ], + val => \$dm, + type => 'list', + format => sub { $dm{$_[0]}[0] }, + ort => 1, + } + ] + ) ) { - $new_dm = { reverse %dm }->{$new_dm}; log::explanations("modified file $cfg_file"); substInFile { s/^(DISPLAYMANAGER)=.*(\n|)//; s/^\n//g; - $_ .= "\nDISPLAYMANAGER=$new_dm\n" if eof; + $_ .= "\nDISPLAYMANAGER=$dm\n" if eof; } $cfg_file; + $in->do_pkgs->install($dm{$dm}[2]) unless -x $dm{$dm}[1]; } - $in->exit(0); |