diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-02-29 23:50:14 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-02-29 23:50:14 +0000 |
commit | 4d37bebbb47db98088c70d4d4395ca29cef35f8a (patch) | |
tree | 996d38b7735fa03a79be75615dbe6692916d0094 /perl-install/any.pm | |
parent | 6de7bc2092b2c1c7c3bae2b4a7d0c8b59ce5e1d3 (diff) | |
download | drakx-4d37bebbb47db98088c70d4d4395ca29cef35f8a.tar drakx-4d37bebbb47db98088c70d4d4395ca29cef35f8a.tar.gz drakx-4d37bebbb47db98088c70d4d4395ca29cef35f8a.tar.bz2 drakx-4d37bebbb47db98088c70d4d4395ca29cef35f8a.tar.xz drakx-4d37bebbb47db98088c70d4d4395ca29cef35f8a.zip |
no_comment
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r-- | perl-install/any.pm | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 04276b919..b932c4831 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -2,27 +2,41 @@ package any; use diagnostics; use strict; +use vars qw(@users); #-###################################################################################### #- misc imports #-###################################################################################### -use common qw(:system :file); +use common qw(:common :system :file); use commands; use run_program; +#-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); + +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; +} + sub addKdmUsers { my ($prefix, @users) = @_; require timezone; - my @u1 = my @users_male = qw(tie default curly); - my @u2 = my @users_female = qw(brunette girl woman-blond); + my @u1 = @users_male; + my @u2 = @users_female; foreach (@users) { my $l = rand() < timezone::sexProb($_) ? \@u2 : \@u1; my $u = splice(@$l, rand(@$l), 1); #- known biased (see cookbook for better) + addKdmIcon($prefix, $_, $u); eval { commands::cp "$prefix/usr/share/icons/user-$u-mdk.xpm", "$prefix/usr/share/apps/kdm/pics/users/$_.xpm" }; @u1 = @users_male unless @u1; @u2 = @users_female unless @u2; } - eval { commands::cp "-f", "$prefix/usr/share/icons/user-hat-mdk.xpm", "$prefix/usr/share/apps/kdm/pics/users/root.xpm" } unless $::isStandalone; + addKdmIcon($prefix, 'root', 'hat', 'force'); } sub addUsers { @@ -32,8 +46,6 @@ sub addUsers { substInFile { s/^$u\n//; $_ .= "$u\n" if eof } "$msec/user.conf" if -d $msec; } run_program::rooted($prefix, "/etc/security/msec/init-sh/grpuser.sh --refresh"); - - addKdmUsers($prefix, @users); } 1; |