summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-01-10 14:01:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-01-10 14:01:37 +0000
commitbdea551682ad304b20003f6f525c1aa9fdc82d5d (patch)
treead65d62b82c7afa1bce63c9e400274af9711f7f4 /perl-install/any.pm
parent7f70c4c3113d66a859f9ac037f5c093537adb254 (diff)
downloaddrakx-backup-do-not-use-bdea551682ad304b20003f6f525c1aa9fdc82d5d.tar
drakx-backup-do-not-use-bdea551682ad304b20003f6f525c1aa9fdc82d5d.tar.gz
drakx-backup-do-not-use-bdea551682ad304b20003f6f525c1aa9fdc82d5d.tar.bz2
drakx-backup-do-not-use-bdea551682ad304b20003f6f525c1aa9fdc82d5d.tar.xz
drakx-backup-do-not-use-bdea551682ad304b20003f6f525c1aa9fdc82d5d.zip
(setAutologin): cleanup
(pack_passwd, unpack_passwd): created
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm21
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" });
}