summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/Makefile2
-rw-r--r--perl-install/Xconfigurator.pm2
-rw-r--r--perl-install/any.pm7
-rw-r--r--perl-install/common.pm7
-rw-r--r--perl-install/install2.pm4
-rw-r--r--perl-install/install_any.pm8
-rw-r--r--perl-install/install_interactive.pm13
-rw-r--r--perl-install/install_steps_interactive.pm27
-rw-r--r--perl-install/interactive_gtk.pm30
-rw-r--r--perl-install/keyboard.pm5
-rw-r--r--perl-install/modules.pm2
-rw-r--r--perl-install/partition_table.pm8
-rw-r--r--perl-install/pkgs.pm26
-rwxr-xr-xperl-install/standalone/XFdrake2
-rwxr-xr-xperl-install/standalone/adduserdrake6
-rwxr-xr-xperl-install/standalone/keyboarddrake12
16 files changed, 103 insertions, 58 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile
index 4bbfc189c..801007cda 100644
--- a/perl-install/Makefile
+++ b/perl-install/Makefile
@@ -24,7 +24,7 @@ $(DIRS):
$(MAKE) -C $@
test_pms: verify_c
- ./perl2fcalls -excludec -excluderesize_fat::c_rewritten install2
+ ./perl2fcalls -excludec -excluderesize_fat::c_rewritten install2 standalone/keyboarddrake standalone/XFdrake
for i in install2 install_steps_*.pm; do perl -cw -I. $$i; done
test_all: test_pms
diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm
index 4ca5ee20d..8ab708853 100644
--- a/perl-install/Xconfigurator.pm
+++ b/perl-install/Xconfigurator.pm
@@ -475,7 +475,7 @@ sub autoDefaultDepth($$) {
return 24 if $card->{identifier} =~ /SiS/;
- return 16 if $card->{type} =~ /Voodoo/ && ! ($card->{type} =~ /Voodoo5/);
+ return 16 if $card->{type} =~ /Voodoo (?!5)/x;
for ($card->{server}) {
/FBDev/ and return 16; #- this should work by default, FBDev is allowed only if install currently uses it at 16bpp.
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 1a1414920..3edfc176d 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -21,11 +21,16 @@ my @users_male = (__("tie"), __("default"), __("curly")); #- don't change the na
my @users_female = (__("brunette"), __("girl"), __("woman-blond"));
@users = (@users_male, @users_female, __("automagic"));
+sub icon2file {
+ my ($icon, $prefix) = @_;
+ "$prefix/usr/share/icons/user-$icon-mdk.xpm";
+}
+
sub addKdmIcon {
my ($prefix, $user, $icon, $force) = @_;
my $dest = "$prefix/usr/share/apps/kdm/pics/users/$user.xpm";
unlink $dest if $force;
- eval { commands::cp("$prefix/usr/share/icons/user-$icon-mdk.xpm", $dest) } if $icon;
+ eval { commands::cp(icon2file($icon, $prefix), $dest) } if $icon;
}
sub allocUsers {
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 851cf6971..b0a1a8349 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- common => [ qw(__ even odd arch better_arch compat_arch min max sqr sum and_ or_ sign product bool invbool listlength bool2text bool2yesno text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref) ],
+ common => [ qw(__ even odd arch better_arch compat_arch min max sqr sum and_ or_ sign product bool invbool listlength bool2text bool2yesno text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref next_val_in_array) ],
functional => [ qw(fold_left compose mapgrep map_index grep_index find_index map_each grep_each list2kv map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie combine) ],
file => [ qw(dirname basename touch all glob_ cat_ output symlinkf chop_ mode typeFromMagic expand_symlinks) ],
system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableRam availableMemory removeXiBSuffix template2file template2userfile update_userkderc list_skels formatTime unix2dos setVirtual) ],
@@ -602,6 +602,11 @@ sub df {
map { $_ * ($blocksize / 1024) } $size, $free;
}
+sub next_val_in_array {
+ my ($v, $l) = @_;
+ my %l = mapn { @_ } $l, [ @$l[1..$#$l], $l->[0] ];
+ $l{$v};
+}
#-######################################################################################
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index 6e7498b63..9ccb77ab2 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -56,7 +56,7 @@ my (%installSteps, @orderedInstallSteps);
configureServices => [ __("Configure services"), 1, 1, '!$::expert', "installPackages" ],
configurePrinter => [ __("Configure printer"), 1, 0, '', "installPackages" ],
setRootPassword => [ __("Set root password"), 1, 1, '', "formatPartitions" ],
- addUser => [ __("Add a user"), 1, 1, '' ],
+ addUser => [ __("Add a user"), 1, 1, '', "installPackages" ],
arch() !~ /alpha/ ? (
createBootdisk => [ __("Create a bootdisk"), 1, 0, '$::o->{lnx4win} && !$::expert', "installPackages" ],
) : (),
@@ -238,7 +238,7 @@ sub selectKeyboard {
return unless $o->{isUpgrade} || !$::beginner || $clicked;
- $o->{keyboard} = (keyboard::read($o->{prefix}))[0] if $o->{isUpgrade} && !$clicked && $o->{keyboard_unsafe};
+ $o->{keyboard} = keyboard::read($o->{prefix}) if $o->{isUpgrade} && !$clicked && $o->{keyboard_unsafe};
$o->selectKeyboard;
#- if we go back to the selectKeyboard, you must rewrite
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 38434cb91..7fccfb7a2 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -296,7 +296,7 @@ sub setPackages($) {
($o->{compssUsers}, $o->{compssUsersSorted}) = pkgs::readCompssUsers($o->{packages}, $o->{compss});
my @l = ();
- push @l, "kapm", "kcmlaptop" if $o->{pcmcia};
+ push @l, "kapm", "kcmlaptop", "DrakProfile", "DrakSync" if $o->{pcmcia};
push @l, "Device3Dfx", "XFree86-glide-module" if detect_devices::matching_desc('Voodoo');
push @l, "Glide_V5" if detect_devices::matching_desc('Voodoo 5');
push @l, "Glide_V3-DRI" if detect_devices::matching_desc('Voodoo 3');
@@ -668,9 +668,9 @@ sub getHds {
$o->{hds} = catch_cdie { fsedit::hds(\@drives, $flags) }
sub {
$ok = 0;
- log::l("error reading partition table: $@");
- my ($err) = $@ =~ /(.*) at /;
- $flags->{readonly} && $f_err and $f_err->($err);
+ my $err = $@; $err =~ s/ at (.*?)$//;
+ log::l("error reading partition table: $err");
+ !$flags->{readonly} && $f_err and $f_err->($err);
};
if (is_empty_array_ref($o->{hds}) && $o->{autoSCSI}) {
diff --git a/perl-install/install_interactive.pm b/perl-install/install_interactive.pm
index fd7e85024..074f8aff5 100644
--- a/perl-install/install_interactive.pm
+++ b/perl-install/install_interactive.pm
@@ -52,10 +52,14 @@ sub partitionWizardSolutions {
# each solution is a [ score, text, function ], where the function retunrs true if succeeded
- if (fsedit::free_space(grep { partition_table::can_raw_add($_) } @$hds) > $min_linux and !$readonly) {
+ my @good_hds = grep { partition_table::can_raw_add($_) } @$hds;
+ if (fsedit::free_space(@good_hds) > $min_linux and !$readonly) {
$solutions{free_space} = [ 20, _("Use free space"), sub { fsedit::auto_allocate($hds, $o->{partitions}); 1 } ]
} else {
- push @wizlog, _("Not enough free space to allocate new partitions");
+ push @wizlog, _("Not enough free space to allocate new partitions") . ": " .
+ (@good_hds ?
+ fsedit::free_space(@good_hds) . " < $min_linux" :
+ "no harddrive on which partitions can be added") if !$readonly;
}
if (@$fstab) {
@@ -269,10 +273,11 @@ sub setup_thiskind {
}
@l = map { $_->{description} } @l;
while (1) {
+ my ($msg_type) = $type =~ /(.*)|/;
my $msg = @l ?
- [ _("Found %s %s interfaces", join(", ", @l), $type),
+ [ _("Found %s %s interfaces", join(", ", @l), $msg_type),
_("Do you have another one?") ] :
- _("Do you have any %s interfaces?", $type);
+ _("Do you have any %s interfaces?", $msg_type);
my $opt = [ __("Yes"), __("No") ];
push @$opt, __("See hardware info") if $::expert;
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 51a5cf094..712fc5584 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -84,7 +84,7 @@ sub selectKeyboard($) {
$o->{keyboard});
delete $o->{keyboard_unsafe};
}
- if ($::expert) {
+ if ($::expert && ref($o) !~ /newt/) { #- newt is buggy with big windows :-(
my %langs; $langs{$_} = 1 foreach @{$o->{langs}};
$o->ask_many_from_list_ref('',
_("You can choose other languages that will be available after install"),
@@ -201,7 +201,7 @@ sub ask_mntpoint_s {
$o->ask_from_entries_refH('',
_("Choose the mount points"),
[ map { partition_table_raw::description($_) =>
- { val => \$_->{mntpoint}, list => [ '', fsedit::suggestions_mntpoint([]) ] }
+ { val => \$_->{mntpoint}, not_edit => 0, list => [ '', fsedit::suggestions_mntpoint([]) ] }
} @fstab ]) or return;
}
$o->SUPER::ask_mntpoint_s($fstab);
@@ -215,10 +215,14 @@ sub doPartitionDisks {
install_any::getHds($o, sub {
my ($err) = @_;
$warned = 1;
- if ($o->ask_okcancel(_("Error"),
-[_("I can't read your partition table, it's too corrupted for me :(
-I'll try to go on blanking bad partitions and ALL DATA will be lost
-(%s)"), $err])) {
+ if ($o->ask_yesorno(_("Error"),
+_("I can't read your partition table, it's too corrupted for me :(
+I can try to go on blanking bad partitions (ALL DATA will be lost!).
+The other solution is to disallow DrakX to modify the partition table.
+(the error is %s)
+
+Do you agree to loose all the partitions?
+", $err))) {
0;
} else {
$o->{partitioning}{readonly} = 1;
@@ -338,7 +342,7 @@ sub choosePackages {
$l[2] > $l[1] + 200 or splice(@l, 1, 1); #- not worth proposing too alike stuff
$l[1] > $l[0] + 100 or splice(@l, 0, 1);
my @text = (__("Minimum (%dMB)"), __("Recommended (%dMB)"), __("Complete (%dMB)"));
- $o->ask_from_listf('', 'TODOMESSAGE', sub { _ ($text[$_[1]], $_[0]) }, \@l) * sqr(1024);
+ $o->ask_from_listf('', _("Select the size you want to install"), sub { _ ($text[$_[1]], $_[0]) }, \@l) * sqr(1024);
} else {
$o->chooseSizeToInstall($packages, $min_size, $max_size, $availableC, $individual) || goto &choosePackages;
}
@@ -651,6 +655,10 @@ sub configurePrinter {
printerdrake::auto_detect($o) or return;
}
+ #- bring interface up for installing ethernet packages but avoid ppp by default,
+ #- else the guy know what he is doing...
+ #install_interactive::upNetwork($o, 'pppAvoided');
+
#- take default configuration, this include choosing the right system
#- currently used by the system.
eval { add2hash($o->{printer} ||= {}, printer::getinfo($o->{prefix})) };
@@ -739,8 +747,8 @@ sub addUser {
_("Password (again)") => {val => \$u->{password2}, hidden => 1},
), $::beginner ? () : (
_("Shell") => {val => \$u->{shell}, list => [ any::shells($o->{prefix}) ], not_edit => !$::expert}
- ), $o->{security} > 3 || $::beginner ? () : (
- _("Icon") => {val => \$u->{icon}, list => [ map { translate($_) } @any::users ], not_edit => 1 },
+ ), $o->{security} > 3 ? () : (
+ _("Icon") => {val => \$u->{icon}, list => [ @any::users ], icon2f => sub { any::icon2file($_[0], $o->{prefix}) } },
),
],
focus_out => sub {
@@ -754,7 +762,6 @@ sub addUser {
$u->{name} or $o->ask_warn('', _("Please give a user name")), return (1,0);
$u->{name} =~ /^[a-z0-9_-]+$/ or $o->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0);
member($u->{name}, map { $_->{name} } @{$o->{users}}) and $o->ask_warn('', _("This user name is already added")), return (1,0);
- $u->{icon} = untranslate($u->{icon}, @any::users);
return 0;
},
)) {
diff --git a/perl-install/interactive_gtk.pm b/perl-install/interactive_gtk.pm
index d4de36eb6..c332f9559 100644
--- a/perl-install/interactive_gtk.pm
+++ b/perl-install/interactive_gtk.pm
@@ -175,9 +175,25 @@ sub ask_from_entries_refW {
my $ignore = 0; #-to handle recursivity
my $w = my_gtk->new($title_, %$o);
+ $w->sync; # for XPM's creation
+
+ my $set_icon = sub {
+ my ($i, $button) = @_;
+ gtkdestroy($i->{icon});
+ my $f = $i->{icon2f}->(${$i->{val}});
+ $i->{icon} = -e $f ?
+ new Gtk::Pixmap(gtkcreate_xpm($w->{window}, $f)) :
+ new Gtk::Label(translate(${$i->{val}}));
+ $button->add($i->{icon});
+ $i->{icon}->show;
+ };
+
#-the widgets
my @widgets = map {
my $i = $_;
+
+ $i->{type} = "iconlist" if $i->{type} eq "list" && $i->{not_edit} && $i->{icon2f};
+
if ($i->{type} eq "list") {
my $w = new Gtk::Combo;
$w->set_use_arrows_always(1);
@@ -185,6 +201,14 @@ sub ask_from_entries_refW {
$w->set_popdown_strings(@{$i->{list}});
$w->disable_activate;
$w;
+ } elsif ($i->{type} eq "iconlist") {
+ my $w = new Gtk::Button;
+ $w->signal_connect(clicked => sub {
+ ${$i->{val}} = next_val_in_array(${$i->{val}}, $i->{list});
+ $set_icon->($i, $w);
+ });
+ $set_icon->($i, $w);
+ gtkpack_(new Gtk::HBox(0,10), 1, new Gtk::HBox(0,0), 0, $w, 1, new Gtk::HBox(0,0), );
} elsif ($i->{type} eq "bool") {
my $w = Gtk::CheckButton->new($i->{text});
$w->set_active(${$i->{val}});
@@ -209,7 +233,7 @@ sub ask_from_entries_refW {
my @updates = mapn {
my ($w, $ref) = @_;
sub {
- $ref->{type} =~ /bool|range/ and return;
+ $ref->{type} =~ /bool|range|iconlist/ and return;
${$ref->{val}} = widget($w, $ref)->get_text;
};
} \@widgets, $val;
@@ -217,10 +241,9 @@ sub ask_from_entries_refW {
my @updates_inv = mapn {
my ($w, $ref) = @_;
sub {
+ $ref->{type} =~ /iconlist/ and return;
$ref->{type} eq "bool" ?
$w->set_active(${$ref->{val}}) :
- $ref->{type} eq "bool" ?
- $w->get_adjustment->set_value(${$ref->{val}}) :
widget($w, $ref)->set_text(${$ref->{val}})
};
} \@widgets, $val;
@@ -298,7 +321,6 @@ sub ask_from_entries_refW {
return 1;
}
};
- #$w->{ok}->signal_connect(clicked => $callback)
$w->main($callback);
} else {
$w->main();
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm
index 1aacbbd8b..7cce0d1ff 100644
--- a/perl-install/keyboard.pm
+++ b/perl-install/keyboard.pm
@@ -285,9 +285,10 @@ sub write {
sub read {
my ($prefix) = @_;
-
my %keyf = getVarsFromSh("$prefix/etc/sysconfig/keyboard");
- map { keyboard2kmap($_) eq $keyf{KEYTABLE} || $_ eq $keyf{KEYTABLE} ? $_ : (); } keys %keyboards;
+ my $keytable = $keyf{KEYTABLE};
+ keyboard2kmap($_) eq $keytable and return $_ foreach keys %keyboards;
+ $keyboards{$keytable} ? $keytable : 'us_intl';
}
#-######################################################################################
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index 947108057..42c2a8171 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -384,7 +384,7 @@ sub load {
load_raw([ $name, @options ]);
}
if ($name eq "usb-storage") {
- sleep(2);
+ sleep(2);
-d "/proc/scsi/usb" or return;
$conf{"usb-storage"}{"post-install"} = "modprobe usbkbd; modprobe keybdev";
}
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index feecaa33f..aae124ba5 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -427,7 +427,7 @@ sub read_extended {
@{$hd->{extended}} > 100 and die "oops, seems like we're looping here :( (or you have more than 100 extended partitions!)";
@{$pt->{normal}} <= 1 or die "more than one normal partition in extended partition";
- @{$pt->{normal}} >= 1 or die "no normal partition in extended partition";
+ @{$pt->{normal}} >= 1 or cdie "no normal partition in extended partition";
$pt->{normal} = $pt->{normal}[0];
#- in case of extended partitions, the start sector is local to the partition or to the first extended_part!
$pt->{normal}{start} += $pt->{start};
@@ -632,8 +632,8 @@ sub next_start($$) {
sub can_raw_add {
my ($hd) = @_;
- $_->{size} || $_->{type} or return foreach @{$hd->{primary}{raw}};
- 1;
+ $_->{size} || $_->{type} or return 1 foreach @{$hd->{primary}{raw}};
+ 0;
}
sub raw_add {
my ($raw, $part) = @_;
@@ -663,7 +663,7 @@ sub load($$;$) {
my %h; @h{@fields2save} = @$h;
- $h{totalsectors} == $hd->{totalsectors} or $force or cdie("Bad totalsectors");
+ $h{totalsectors} == $hd->{totalsectors} or $force or cdie "bad totalsectors";
#- unsure we don't modify totalsectors
local $hd->{totalsectors};
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index d77093ac9..956498cd5 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -30,6 +30,7 @@ use c;
10 => __("maybe"),#__("useless"),
0 => __("maybe"),#__("garbage"),
#- if the package requires locales-LANG and LANG is chosen, rating += 90
+#- if the package is in %by_lang and the corresponding LANG is chosen, rating += 90 (see %by_lang below)
-10 => __("i18n (important)"), #- every install in the corresponding lang have these packages
-20 => __("i18n (very nice)"), #- every beginner/custom install in the corresponding lang have theses packages
-30 => __("i18n (nice)"),
@@ -38,18 +39,6 @@ use c;
#- HACK: rating += 10 if the group is selected and it is not a kde package (aka name !~ /^k/)
#- HACK: rating += 1 if the group is selected and it is a kde package (aka name !~ /^k/)
-
-@skip_list = qw(
-XFree86-8514 XFree86-AGX XFree86-Mach32 XFree86-Mach64 XFree86-Mach8 XFree86-Mono
-XFree86-P9000 XFree86-S3 XFree86-S3V XFree86-SVGA XFree86-W32 XFree86-I128
-XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs
-MySQL MySQL_GPL mod_php3 midgard postfix metroess metrotmpl
-kernel-linus kernel-secure kernel-fb kernel-BOOT
-hackkernel hackkernel-BOOT hackkernel-fb hackkernel-headers
-hackkernel-pcmcia-cs hackkernel-smp hackkernel-smp-fb
-autoirpm autoirpm-icons numlock
-);
-
%by_lang = (
'ar' => [ 'acon' ],
#'be_BE.CP1251' => [ 'fonts-ttf-cyrillic' ],
@@ -89,6 +78,17 @@ autoirpm autoirpm-icons numlock
'zh_TW.Big5' => [ 'rxvt-CLE', 'taipeifonts', 'fonts-ttf-big5' ],
);
+@skip_list = qw(
+XFree86-8514 XFree86-AGX XFree86-Mach32 XFree86-Mach64 XFree86-Mach8 XFree86-Mono
+XFree86-P9000 XFree86-S3 XFree86-S3V XFree86-SVGA XFree86-W32 XFree86-I128
+XFree86-Sun XFree86-SunMono XFree86-Sun24 XFree86-3DLabs
+MySQL MySQL_GPL mod_php3 midgard postfix metroess metrotmpl
+kernel-linus kernel-secure kernel-fb kernel-BOOT
+hackkernel hackkernel-BOOT hackkernel-fb hackkernel-headers
+hackkernel-pcmcia-cs hackkernel-smp hackkernel-smp-fb
+autoirpm autoirpm-icons numlock
+);
+
@preferred = qw(perl-GTK postfix ghostscript-X vim-minimal kernel ispell-en);
#- constant for small transaction.
@@ -197,7 +197,7 @@ sub extractHeaders($$$) {
#- original size wich is absurd, this point is named D below.
my $A = -1.922e-05;
my $B = 1.18411;
-my $C = 23.2; #- doesn't take hdlist's into account as getAvailableSpace will do it.
+my $C = 13.2; #- doesn't take hdlist's into account as getAvailableSpace will do it.
my $D = (-sqrt(sqr($B - 1) - 4 * $A * $C) - ($B - 1)) / 2 / $A; #- $A is negative so a positive solution is with - sqrt ...
sub correctSize { $_[0] < $D ? ($A * $_[0] + $B) * $_[0] + $C : $_[0] } #- size correction in MB.
sub invCorrectSize { $_[0] < $D ? (sqrt(sqr($B) + 4 * $A * ($_[0] - $C)) - $B) / 2 / $A : $_[0]; } #- size correction in MB.
diff --git a/perl-install/standalone/XFdrake b/perl-install/standalone/XFdrake
index 072f770a1..fd6940c1b 100755
--- a/perl-install/standalone/XFdrake
+++ b/perl-install/standalone/XFdrake
@@ -43,7 +43,7 @@ my $f = "/usr/X11R6/lib/X11/Cards";
-e $f or system("urpmi --auto XFree86 XFree86-75dpi-fonts");
-e $f or die "install XFree86 first!\n";
-my $in = vnew interactive('su');
+my $in = interactive->vnew('su');
`pidof xfs` > 0 or system("/etc/rc.d/init.d/xfs start");
diff --git a/perl-install/standalone/adduserdrake b/perl-install/standalone/adduserdrake
index 6cd88bf32..4bcd57f91 100755
--- a/perl-install/standalone/adduserdrake
+++ b/perl-install/standalone/adduserdrake
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-use lib qw(/usr/lib/libDrakX);
+use lib ".";# qw(/usr/lib/libDrakX);
use common qw(:common :functional :system :file);
use interactive;
@@ -44,7 +44,7 @@ if ($in->ask_from_entries_refH(
), $::beginner ? () : (
_("Shell") => {val => \$u->{shell}, list => \@shells, not_edit => !$::expert}
), $security > 3 ? () : (
- _("Icon") => {val => \$u->{icon}, list => [ map { translate($_) } @any::users ], not_edit => 1 },
+ _("Icon") => {val => \$u->{icon}, list => [ @any::users ], icon2f => \&any::icon2file },
),
],
focus_out => sub {
@@ -58,7 +58,7 @@ if ($in->ask_from_entries_refH(
$u->{name} or $in->ask_warn('', _("Please give a user name")), return (1,0);
$u->{name} =~ /^[a-z0-9_-]+$/ or $in->ask_warn('', _("The user name must contain only lower cased letters, numbers, `-' and `_'")), return (1,0);
member($u->{name}, map { $_->{name} } @users) and $in->ask_warn('', _("This user name is already added")), return (1,0);
- $u->{icon} = untranslate($u->{icon}, @any::users);
+ print $u->{icon}, "\n";
return 0;
},
)) {
diff --git a/perl-install/standalone/keyboarddrake b/perl-install/standalone/keyboarddrake
index 016202c68..004b135b6 100755
--- a/perl-install/standalone/keyboarddrake
+++ b/perl-install/standalone/keyboarddrake
@@ -16,13 +16,13 @@ local $_ = join '', @ARGV;
$::expert = /-expert/;
$::isStandalone = 1;
-my $in = vnew interactive('su');
+my $in = interactive->vnew('su');
-my $keyboard = keyboard::text2keyboard(
- $in->ask_from_list_(_("Keyboard"),
- _("What is your keyboard layout?"),
- [ keyboard::list() ],
- keyboard::keyboard2text(keyboard::read(''))));
+my $keyboard = $o->ask_from_listf_(_("Keyboard"),
+ _("Please, choose your keyboard layout."),
+ \&keyboard::keyboard2text,
+ [ keyboard::xmodmaps() ],
+ keyboard::read());
my $isNotDelete = $::expert && !$in->ask_yesorno("BackSpace", "Do you want the BackSpace to return Delete in console?", 1);