summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>1999-12-14 19:01:20 +0000
committerFrancois Pons <fpons@mandriva.com>1999-12-14 19:01:20 +0000
commit927f51ad73f141395cc9d644de0a3b1827513eaf (patch)
treedaf2d3422640b53f1c68f0c383080394ae9264bf
parent5bdd01f0daf81cf97a5d04004adb55a75c58ef6c (diff)
downloaddrakx-927f51ad73f141395cc9d644de0a3b1827513eaf.tar
drakx-927f51ad73f141395cc9d644de0a3b1827513eaf.tar.gz
drakx-927f51ad73f141395cc9d644de0a3b1827513eaf.tar.bz2
drakx-927f51ad73f141395cc9d644de0a3b1827513eaf.tar.xz
drakx-927f51ad73f141395cc9d644de0a3b1827513eaf.zip
*** empty log message ***
-rw-r--r--perl-install/fs.pm12
-rw-r--r--perl-install/install2.pm10
-rw-r--r--perl-install/install_any.pm40
3 files changed, 43 insertions, 19 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index a7180aad9..46f569589 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -238,7 +238,7 @@ sub write_fstab($;$$) {
isNfs($_) and $dir = '', $options ||= 'ro,rsize=8192,wsize=8192';
#- keep in mind the new line for fstab.
- @new{($_->{mntpoint}, $_->{"$dir$_->{device}"})} = undef;
+ @new{($_->{mntpoint}, "$dir$_->{device}")} = undef;
#- tested? devices::make("$prefix/$dir$_->{device}") if $_->{device} && $dir && !$_->{noMakeDevice};
eval { devices::make("$prefix/$dir$_->{device}") } if $_->{device} && $dir;
@@ -247,21 +247,23 @@ sub write_fstab($;$$) {
[ ( $_->{device} =~ /^\// ? $_->{device} : "$dir$_->{device}" ),
$_->{mntpoint}, type2fs($_->{type}), $options, $freq, $passno ];
- } grep { $_->{mntpoint} && type2fs($_->{type}) &&
+ } grep { $_->{mntpoint} && type2fs($_->{type}) && !isFat($_) &&
! exists $new{$_->{mntpoint}} && ! exists $new{"/dev/$_->{device}"} } @$fstab;
#- inserts dos/win partitions in fstab.
#- backward compatible win kdeicons script to handle upgrade correctly?
+ #- take into account an already provided mount point.
unshift @to_add,
map_index {
my $i = $::i ? $::i + 1 : '';
my $device = $_->{device} =~ /^\/dev\/(.*)$/ ? $1 : $_->{device};
+ my $mntpoint = $_->{mntpoint} ? $_->{mntpoint} : "/mnt/DOS_$device";
#- keep in mind the new line for fstab.
- @new{("/mnt/DOS_$device", "/dev/$device")} = undef;
+ @new{($mntpoint, "/dev/$device")} = undef;
- mkdir "$prefix/mnt/DOS_$device", 0755 or log::l("failed to mkdir $prefix/mnt/DOS_$device: $!");
- [ "/dev/$device", "/mnt/DOS_$device", "vfat", "user,exec,conv=auto", 0, 0 ];
+ mkdir "$prefix/$mntpoint", 0755 or log::l("failed to mkdir $prefix/$mntpoint: $!");
+ [ "/dev/$device", $mntpoint, "vfat", "user,exec,conv=auto", 0, 0 ];
} grep { isFat($_) &&
! exists $new{"/dev/$_->{device}"} } @$fstab;
diff --git a/perl-install/install2.pm b/perl-install/install2.pm
index f326ad1dc..006fc3901 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -356,10 +356,6 @@ sub doInstallStep {
$o->beforeInstallPackages;
$o->installPackages($o->{packages});
$o->afterInstallPackages;
-
- #- make icons for KDE.
- log::l("updating kde icons according to available devices");
- install_any::kdeicons_postinstall($o->{prefix});
}
#------------------------------------------------------------------------------
sub miscellaneous {
@@ -617,6 +613,12 @@ sub main {
fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount});
modules::write_conf("$o->{prefix}/etc/conf.modules", 'append');
+ #- update language and icons for KDE.
+ log::l("updating language for kde");
+ install_any::kdelang_postinstall($o->{prefix});
+ log::l("updating kde icons according to available devices");
+ install_any::kdeicons_postinstall($o->{prefix});
+
install_any::lnx4win_postinstall($o->{prefix}) if $o->{lnx4win};
install_any::killCardServices();
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 7b5a38863..da0a773a2 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -533,23 +533,18 @@ sub template2userfile($$$$%) {
}
}
-sub kderc_largedisplay($) {
- my ($prefix) = @_;
+sub update_userkderc($$$) {
+ my ($prefix, $cat, $subst) = @_;
foreach ("/etc/skel", "/root", list_home()) {
my ($inputfile, $outputfile) = ("$prefix$_/.kderc", "$prefix$_/.kderc.new");
- my %subst = ( contrast => "Contrast=7\n",
- kfmiconstyle => "kfmIconStyle=Large\n",
- kpaneliconstyle => "kpanelIconStyle=Normal\n", #- to change to Large when icons looks better
- kdeiconstyle => "KDEIconStyle=Large\n",
- );
-
+ my %subst = %$subst;
local *INFILE; local *OUTFILE;
open INFILE, $inputfile or return;
open OUTFILE, ">$outputfile" or return;
print OUTFILE map {
- if (my $i = /^\s*\[KDE\]/ ... /^\s*\[/) {
+ if (my $i = /^\s*\[$cat\]/i ... /^\s*\[/) {
if (/^\s*(\w*)=/ && $subst{lc($1)}) {
delete $subst{lc($1)};
} else {
@@ -559,12 +554,34 @@ sub kderc_largedisplay($) {
$_;
}
} <INFILE>;
+ print OUTFILE "[$cat]\n", values %subst if values %subst; #- if categorie has not been found above.
unlink $inputfile;
rename $outputfile, $inputfile;
}
}
+sub kderc_largedisplay($) {
+ my ($prefix) = @_;
+
+ update_userkderc($prefix, 'KDE', {
+ contrast => "Contrast=7\n",
+ kfmiconstyle => "kfmIconStyle=Large\n",
+ kpaneliconstyle => "kpanelIconStyle=Normal\n", #- to change to Large when icons looks better
+ kdeiconstyle => "KDEIconStyle=Large\n",
+ });
+}
+
+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",
+ });
+}
+
sub kdeicons_postinstall($) {
my ($prefix) = @_;
@@ -593,8 +610,11 @@ sub kdeicons_postinstall($) {
my %toreplace = ( id => $1 );
template2userfile($prefix, "/usr/share/floppy.kdelnk.in", "Desktop/floppy$2.kdelnk", 1, %toreplace);
} elsif (/^\/dev\/(\S+)\s+\/mnt\/DOS_ (\S*)\s+/x) {
- my %toreplace = ( device => $1, id => $2 );
+ my %toreplace = ( device => $1, id => $2, mntpoint => "/mnt/DOS_$2" );
template2userfile($prefix, "/usr/share/Dos_.kdelnk.in", "Desktop/Dos_$2.kdelnk", 1, %toreplace);
+ } elsif (/^\/dev\/(\S+)\s+(\S*)\s+vfat\s+/x) {
+ my %toreplace = ( device => $1, id => $1, mntpoint => $2 );
+ template2userfile($prefix, "/usr/share/Dos_.kdelnk.in", "Desktop/Dos_$1.kdelnk", 1, %toreplace);
}
}
}