summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>1999-12-20 16:47:41 +0000
committerFrancois Pons <fpons@mandriva.com>1999-12-20 16:47:41 +0000
commitee55d090aa6af13799c803588369418d4fcb5897 (patch)
tree87ab853b47b835f25deac9a4fc99298c2d3733e9 /perl-install/install_any.pm
parent65929aa8e5b2e999d820ca22c577099eec25c628 (diff)
downloaddrakx-ee55d090aa6af13799c803588369418d4fcb5897.tar
drakx-ee55d090aa6af13799c803588369418d4fcb5897.tar.gz
drakx-ee55d090aa6af13799c803588369418d4fcb5897.tar.bz2
drakx-ee55d090aa6af13799c803588369418d4fcb5897.tar.xz
drakx-ee55d090aa6af13799c803588369418d4fcb5897.zip
*** empty log message ***
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm39
1 files changed, 31 insertions, 8 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 39ee33259..2479686fd 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -525,7 +525,7 @@ sub list_passwd() {
}
sub list_home() {
- map { $_->[7] } grep { $_->[2] >= 501 } list_passwd();
+ map { $_->[7] } grep { $_->[2] >= 500 } list_passwd();
}
sub template2userfile($$$$%) {
@@ -545,23 +545,23 @@ sub update_userkderc($$$) {
foreach ("/etc/skel", "/root", list_home()) {
my ($inputfile, $outputfile) = ("$prefix$_/.kderc", "$prefix$_/.kderc.new");
- my %subst = %$subst;
+ my %tosubst = (%$subst);
local *INFILE; local *OUTFILE;
open INFILE, $inputfile or return;
open OUTFILE, ">$outputfile" or return;
print OUTFILE map {
if (my $i = /^\s*\[$cat\]/i ... /^\s*\[/) {
- if (/^\s*(\w*)=/ && $subst{lc($1)}) {
- delete $subst{lc($1)};
+ if (/^\s*(\w*)=/ && $tosubst{lc($1)}) {
+ delete $tosubst{lc($1)};
} else {
- ($i > 1 && /^\s*\[/ && join '', values %subst). $_;
+ ($i > 1 && /^\s*\[/ && join '', values %tosubst). $_;
}
} else {
$_;
}
} <INFILE>;
- print OUTFILE "[$cat]\n", values %subst if values %subst; #- if categorie has not been found above.
+ print OUTFILE "[$cat]\n", values %tosubst if values %tosubst; #- if categorie has not been found above.
unlink $inputfile;
rename $outputfile, $inputfile;
@@ -582,9 +582,9 @@ sub kderc_largedisplay($) {
sub kdelang_postinstall($) {
my ($prefix) = @_;
my %i18n = getVarsFromSh("$prefix/etc/sysconfig/i18n");
- my $lang = $i18n{LANG} eq 'se' ? 'sv' : $i18n{LANG};
- update_userkderc($prefix, 'Locale', { language => "Language=$lang\n" });
+ #- remove existing reference to $lang.
+ update_userkderc($prefix, 'Locale', { language => "Language=\n" });
}
sub kdeicons_postinstall($) {
@@ -630,4 +630,27 @@ sub kdeicons_postinstall($) {
}
}
+sub move_desktop_file($) {
+ my ($prefix) = @_;
+ my @toMove = qw(doc.kdelnk news.kdelnk updates.kdelnk home.kdelnk printer.kdelnk floppy.kdelnk cdrom.kdelnk);
+
+ foreach ("/etc/skel", "/root", list_home()) {
+ my $dir = "$prefix$_";
+ if (-d "$dir/Desktop") {
+ my @toSubst = glob_("$dir/Desktop/.*\.rpmorig");
+
+ push @toSubst, "$dir/Desktop/$_" foreach @toMove;
+
+ #- remove any existing save in Trash of each user and
+ #- move appropriate file there after an upgrade.
+ foreach (@toSubst) {
+ my $basename = basename($_);
+
+ unlink "$dir/Desktop/Trash/$basename";
+ rename $_, "$dir/Desktop/Trash/$basename";
+ }
+ }
+ }
+}
+
1;