diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-01-10 14:01:37 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-01-10 14:01:37 +0000 |
commit | bdea551682ad304b20003f6f525c1aa9fdc82d5d (patch) | |
tree | ad65d62b82c7afa1bce63c9e400274af9711f7f4 | |
parent | 7f70c4c3113d66a859f9ac037f5c093537adb254 (diff) | |
download | drakx-bdea551682ad304b20003f6f525c1aa9fdc82d5d.tar drakx-bdea551682ad304b20003f6f525c1aa9fdc82d5d.tar.gz drakx-bdea551682ad304b20003f6f525c1aa9fdc82d5d.tar.bz2 drakx-bdea551682ad304b20003f6f525c1aa9fdc82d5d.tar.xz drakx-bdea551682ad304b20003f6f525c1aa9fdc82d5d.zip |
(setAutologin): cleanup
(pack_passwd, unpack_passwd): created
-rw-r--r-- | perl-install/any.pm | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 4cdc24e83..676b6feac 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -243,14 +243,23 @@ arch() !~ /sparc/ ? ( 1; } +my @etc_pass_fields = qw(name pw uid gid realname home shell); +sub unpack_passwd { + my ($l) = @_; + chomp $l; + my %l; @l{@etc_pass_fields} = split ':', $l; + \%l; +} +sub pack_passwd { + my ($l) = @_; + join(':', @$l{@etc_pass_fields}) . "\n"; +} + sub setAutologin { my ($prefix, $user, $desktop) = @_; - if ($user) { - local *F; - open F, ">$prefix/etc/sysconfig/desktop" or die "Can't open $!"; - print F uc($desktop) . "\n"; - close F; - } + + output "$prefix/etc/sysconfig/desktop", uc($desktop), "\n" if $user; + setVarsInSh("$prefix/etc/sysconfig/autologin", { USER => $user, AUTOLOGIN => bool2yesno($user), EXEC => "/usr/X11R6/bin/startx" }); } |