diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-10-04 15:11:19 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-10-04 15:11:19 +0000 |
commit | cc134c0d627b3bcf3d60867aa4012a643b756679 (patch) | |
tree | 909a600247265dbfb0e0841df32522cfede70a35 /perl-install | |
parent | bc48dff8f55a68b2e5b12d36fdf5e93eded3d2a5 (diff) | |
download | drakx-cc134c0d627b3bcf3d60867aa4012a643b756679.tar drakx-cc134c0d627b3bcf3d60867aa4012a643b756679.tar.gz drakx-cc134c0d627b3bcf3d60867aa4012a643b756679.tar.bz2 drakx-cc134c0d627b3bcf3d60867aa4012a643b756679.tar.xz drakx-cc134c0d627b3bcf3d60867aa4012a643b756679.zip |
- fix configuring kdeglobals (was broken because of /etc/kderc using
udpate-alternatives which use absolute symlinks)
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/common.pm | 15 | ||||
-rw-r--r-- | perl-install/install/NEWS | 3 | ||||
-rw-r--r-- | perl-install/lang.pm | 8 |
3 files changed, 24 insertions, 2 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index a249f72b7..6bcd0889e 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -164,6 +164,21 @@ sub formatTime { } } +sub expand_symlinks_with_absolute_symlinks_in_prefix { + my ($prefix, $link) = @_; + + my ($first, @l) = split '/', $link; + $first eq '' or die "expand_symlinks: $link is relative\n"; + my ($f, $l); + foreach (@l) { + $f .= "/$_"; + while ($l = readlink "$prefix$f") { + $f = $l =~ m!^/! ? $l : MDK::Common::File::concat_symlink($f, "../$l"); + } + } + "$prefix$f"; +} + sub expand_symlinks_but_simple { my ($f) = @_; my $link = readlink($f); diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 0a7121cf3..2be66d32c 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,3 +1,6 @@ +- fix configuring kdeglobals (was broken because of /etc/kderc using + udpate-alternatives which use absolute symlinks) + Version 10.4.233 - 4 October 2007, by Pascal "Pixel" Rigaux - use /dev/cdrom in fstab, but do not write corresponding udev rule diff --git a/perl-install/lang.pm b/perl-install/lang.pm index e33d9ac95..fbe28b1f4 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -1134,8 +1134,12 @@ sub write { )); eval { - my %dir_defaults = read_gnomekderc("$::prefix/etc/kderc", 'Directories-default'); - my $confdir = $::prefix . ($b_user_only ? "$ENV{HOME}/.kde" : first(split(',', $dir_defaults{prefixes})) || "/etc/kde") . '/share/config'; + my $confdir = $::prefix . ($b_user_only ? "$ENV{HOME}/.kde" : do { + my $kderc = $::prefix ? common::expand_symlinks_with_absolute_symlinks_in_prefix($::prefix, '/etc/kderc') : '/etc/kderc'; + log::l("reading $kderc"); + my %dir_defaults = read_gnomekderc($kderc, 'Directories-default'); + first(split(',', $dir_defaults{prefixes})) || "/etc/kde" + }) . '/share/config'; -d $confdir or die 'not configuring kde config files since it is not installed/used'; |