summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-09-02 00:33:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-09-02 00:33:14 +0000
commit99f9df7275444bda7ba09724f8165431393e8dbf (patch)
tree717a4afd8add602b212f323cff604e265063f8c3
parent762713ce55cadc5cac597cbe5ea4e26f4f76fb9c (diff)
downloaddrakx-backup-do-not-use-99f9df7275444bda7ba09724f8165431393e8dbf.tar
drakx-backup-do-not-use-99f9df7275444bda7ba09724f8165431393e8dbf.tar.gz
drakx-backup-do-not-use-99f9df7275444bda7ba09724f8165431393e8dbf.tar.bz2
drakx-backup-do-not-use-99f9df7275444bda7ba09724f8165431393e8dbf.tar.xz
drakx-backup-do-not-use-99f9df7275444bda7ba09724f8165431393e8dbf.zip
no_comment
-rw-r--r--perl-install/any.pm46
-rw-r--r--perl-install/common.pm2
-rw-r--r--perl-install/install_any.pm2
-rw-r--r--perl-install/install_steps.pm2
-rw-r--r--perl-install/install_steps_interactive.pm2
-rwxr-xr-xperl-install/standalone/adduserdrake4
6 files changed, 29 insertions, 29 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index dbe72b38e..512f753fc 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -17,33 +17,33 @@ use run_program;
use modules;
use log;
-#-PO: names (tie, curly...) have corresponding icons for kdm
-my @users_male = (__("tie"), __("default"), __("curly")); #- don't change the names, files correspond to them
-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 facesdir {
+ my ($prefix) = @_;
+ "$prefix/usr/share/faces/";
+}
+sub face2xpm {
+ my ($face, $prefix) = @_;
+ facesdir($prefix) . $face . ".xpm";
+}
+sub facesnames {
+ my ($prefix) = @_;
+ my $dir = facesdir($prefix);
+ grep { -e "$dir/$_.png" } map { /(.*)\.xpm/ } all($dir);
}
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(icon2file($icon, $prefix), $dest) } if $icon;
+ my ($prefix, $user, $icon) = @_;
+ my $dest = "$prefix/usr/share/faces/$user.png";
+ eval { commands::cp("-f", facesdir($prefix) . $icon . ".png", $dest) } if $icon;
}
sub allocUsers {
my ($prefix, @users) = @_;
- require timezone;
- my @u1 = @users_male;
- my @u2 = @users_female;
+ my @m = my @l = facesnames($prefix);
foreach (grep { !$_->{icon} || $_->{icon} eq "automagic" } @users) {
- my $l = rand() < timezone::sexProb($_->{name}) ? \@u2 : \@u1;
- $_->{auto_icon} = splice(@$l, rand(@$l), 1); #- known biased (see cookbook for better)
- @u1 = @users_male unless @u1;
- @u2 = @users_female unless @u2;
+ $_->{auto_icon} = splice(@m, rand(@m), 1); #- known biased (see cookbook for better)
+ log::l("auto_icon is $_->{auto_icon}");
+ @m = @l unless @m;
}
}
@@ -54,10 +54,10 @@ sub addUsers {
allocUsers($prefix, @users);
foreach my $u (@users) {
substInFile { s/^$u->{name}\n//; $_ .= "$u->{name}\n" if eof } "$msec/user.conf" if -d $msec;
- addKdmIcon($prefix, $u->{name}, delete $u->{auto_icon} || $u->{icon}, 'force');
+ addKdmIcon($prefix, $u->{name}, delete $u->{auto_icon} || $u->{icon});
}
run_program::rooted($prefix, "/usr/share/msec/grpuser.sh --refresh");
- addKdmIcon($prefix, 'root', 'hat', 'force');
+# addKdmIcon($prefix, 'root', 'root');
}
sub crypt {
@@ -193,10 +193,10 @@ You can add some more or change the existing ones."),
my @l;
if ($e->{type} eq "image") {
@l = (
-_("Image") => { val => \$e->{kernel_or_dev}, list => [ eval { map { s/$prefix//; $_ } glob_("$prefix/boot/vmlinuz*") } ] },
+_("Image") => { val => \$e->{kernel_or_dev}, list => [ map { s/$prefix//; $_ } glob_("$prefix/boot/vmlinuz*") ] },
_("Root") => { val => \$e->{root}, list => [ map { "/dev/$_->{device}" } @$fstab ], not_edit => !$::expert },
_("Append") => \$e->{append},
-_("Initrd") => { val => \$e->{initrd}, list => [ eval { map { s/$prefix//; $_ } glob_("$prefix/boot/initrd*") } ] },
+_("Initrd") => { val => \$e->{initrd}, list => [ map { s/$prefix//; $_ } glob_("$prefix/boot/initrd*") ] },
_("Read-write") => { val => \$e->{'read-write'}, type => 'bool' }
);
@l = @l[0..5] unless $::expert;
diff --git a/perl-install/common.pm b/perl-install/common.pm
index b0a1a8349..ac64fe54a 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -287,7 +287,7 @@ sub all {
my $d = shift;
local *F;
- opendir F, $d or die "all: can't open dir $d: $!\n";
+ opendir F, $d or return;
my @l = grep { $_ ne '.' && $_ ne '..' } readdir F;
closedir F;
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 48fc1a935..534a24b8c 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -485,7 +485,7 @@ sub kdeicons_postinstall {
}
my @l = list_skels($prefix, 'Desktop/Doc.kdelnk');
- if (my ($lang) = eval { all("$prefix/usr/doc/mandrake") }) {
+ if (my ($lang) = all("$prefix/usr/doc/mandrake")) {
substInFile { s|^(URL=.*?)/?$|$1/$lang/index.html| } @l;
substInFile { s|^(url=/usr/doc/mandrake/)$|$1$lang/index.html| } "$prefix/usr/lib/desktop-links/mandrake.links";
} else {
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index ffba727c8..6c0cc9f53 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -723,7 +723,7 @@ sub setupBootloader($) {
map { run_program::rooted($o->{prefix}, "mkinitrd", "-f", "/boot/initrd-$_->[1]", "--ifneeded", $_->[1]) ;#or
#unlink "$o->{prefix}/boot/initrd-$_->[1]";$_ } grep { $_->[0] && $_->[1] }
$_ } grep { $_->[0] && $_->[1] }
- map { [ m|$o->{prefix}(/boot/vmlinux-(.*))| ] } eval { glob_("$o->{prefix}/boot/vmlinux-*") };
+ map { [ m|$o->{prefix}(/boot/vmlinux-(.*))| ] } glob_("$o->{prefix}/boot/vmlinux-*");
# output "$o->{prefix}/etc/aboot.conf",
# map_index { "$::i:$b->{part_nb}$_ root=$b->{root} $b->{perImageAppend}\n" }
# map { /$o->{prefix}(.*)/ } eval { glob_("$o->{prefix}/boot/vmlinux*") };
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index c7657b187..9305f4d9d 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -659,7 +659,7 @@ sub addUser {
), $::beginner ? () : (
_("Shell") => {val => \$u->{shell}, list => [ any::shells($o->{prefix}) ], not_edit => !$::expert}
), $o->{security} > 3 ? () : (
- _("Icon") => {val => \$u->{icon}, list => [ @any::users ], icon2f => sub { any::icon2file($_[0], $o->{prefix}) } },
+ _("Icon") => {val => \$u->{icon}, list => [ any::facesnames() ], icon2f => sub { any::face2xpm($_[0], $o->{prefix}) } },
),
],
focus_out => sub {
diff --git a/perl-install/standalone/adduserdrake b/perl-install/standalone/adduserdrake
index 4bcd57f91..b3750690f 100755
--- a/perl-install/standalone/adduserdrake
+++ b/perl-install/standalone/adduserdrake
@@ -27,7 +27,7 @@ if (my @l = grep { ! /^-/ } @ARGV) {
exit 0;
}
-my $in = vnew interactive('su');
+my $in = interactive->vnew('su');
my @users;
new:
@@ -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 => [ @any::users ], icon2f => \&any::icon2file },
+ _("Icon") => {val => \$u->{icon}, list => [ any::facesnames() ], icon2f => \&any::face2xpm },
),
],
focus_out => sub {