From 6279d17c19cb7ce69c9a76978a261f7fb4cb8f26 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 12 Mar 2003 07:14:27 +0000 Subject: - 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...) --- perl-install/standalone/drakedm | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'perl-install') 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); -- cgit v1.2.1