summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-16 18:59:09 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-16 18:59:09 +0000
commit7e35fa33f9c8bdaded1a9f1bfdb086283d909bf3 (patch)
treeeeb86ca8fa82c4bf8264c7ccd17534ec218daa02 /perl-install/interactive.pm
parent95b2e977d7a1bc453591b5a80746df785cbccda2 (diff)
downloaddrakx-7e35fa33f9c8bdaded1a9f1bfdb086283d909bf3.tar
drakx-7e35fa33f9c8bdaded1a9f1bfdb086283d909bf3.tar.gz
drakx-7e35fa33f9c8bdaded1a9f1bfdb086283d909bf3.tar.bz2
drakx-7e35fa33f9c8bdaded1a9f1bfdb086283d909bf3.tar.xz
drakx-7e35fa33f9c8bdaded1a9f1bfdb086283d909bf3.zip
- fix non X + testing + su
- since "interactive" takes care of "format" for type "combo", remove "format" (so that interactive_newt which switch to type "list" don't apply "format" once again)
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r--perl-install/interactive.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index b0bab6637..6cf45ed24 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -77,12 +77,13 @@ sub vnew {
return interactive_http->new;
}
require c;
+ if ($su) {
+ $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
+ $su = '' if $::testing;
+ }
if ($ENV{DISPLAY} && system('/usr/X11R6/bin/xtest') == 0) {
- if ($su) {
- $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
- if ($> && !$::testing) {
- exec("kdesu", "-c", "$0 @ARGV") or die _("kdesu missing");
- }
+ if ($su && $>) {
+ exec("kdesu", "-c", "$0 @ARGV") or die _("kdesu missing");
}
eval { require interactive_gtk };
if (!$@) {
@@ -265,6 +266,7 @@ sub ask_from_normalize {
${$e->{val}} = $li->[0] if ($e->{type} ne 'combo' || $e->{not_edit}) && !member(${$e->{val}}, @$li);
if ($e->{type} eq 'combo' && $e->{format}) {
my @l = map { $e->{format}->($_) } @{$e->{list}};
+ delete $e->{format};
each_index {
${$e->{val}} = $l[$::i] if $_ eq ${$e->{val}};
} @{$e->{list}};