summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-09-12 12:40:19 +0000
committerFrancois Pons <fpons@mandriva.com>2001-09-12 12:40:19 +0000
commit8e2d8066e8d07fa362e5c3414997d74e3cf6f8e4 (patch)
tree72e4f2c03b722d07be9c4902df2f22493f131c6c /perl-install
parent85dc6a3f209a9224dd27f6f2de65d1ce0cd13c39 (diff)
downloaddrakx-8e2d8066e8d07fa362e5c3414997d74e3cf6f8e4.tar
drakx-8e2d8066e8d07fa362e5c3414997d74e3cf6f8e4.tar.gz
drakx-8e2d8066e8d07fa362e5c3414997d74e3cf6f8e4.tar.bz2
drakx-8e2d8066e8d07fa362e5c3414997d74e3cf6f8e4.tar.xz
drakx-8e2d8066e8d07fa362e5c3414997d74e3cf6f8e4.zip
fix when switching perl version.
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/live_install213
1 files changed, 11 insertions, 2 deletions
diff --git a/perl-install/live_install2 b/perl-install/live_install2
index 5fee58147..c9742231d 100755
--- a/perl-install/live_install2
+++ b/perl-install/live_install2
@@ -4,13 +4,22 @@ my $dir = `pwd`;
chomp $dir;
$dir .= "/../../..";
+#- perl version of the install, we use directly the version we found,
+#- this means there SHOULD BE no module compiled for an older version of perl
+#- which will be used by DrakX.
+my ($version, $arch) = (glob "$dir/usr/lib/perl5/*/*/CORE/libperl.so")[0] =~ m|$dir/usr/lib/perl5/([^/]*)/([^/]*)/CORE/libperl.so|;
+
#- keep it mind the ELF loader to use.
$ENV{LD_LOADER} = "$dir/lib/ld-linux.so.2";
$ENV{LOCPATH}="$dir/usr/share/locale";
$ENV{GCONV_PATH}="$dir/usr/lib/gconv";
-$ENV{PERL5LIB} = join ":", map { "$dir/$_" } @INC;
-$ENV{LD_LIBRARY_PATH} = "$dir/usr/bin:$dir/bin:$dir/sbin:$dir/usr/sbin:$dir/usr/X11R6/bin:$dir/lib:$dir/usr/lib:$dir/usr/lib/perl5/5.6.0/i386-linux/CORE";
+$ENV{PERL5LIB} = join ":", map { "$dir/usr/lib/perl5/$_" } ("$version/$arch",
+ "$version",
+ "site_perl/$version/$arch",
+ "site_perl/$version",
+ "site_perl");
+$ENV{LD_LIBRARY_PATH} = "$dir/usr/bin:$dir/bin:$dir/sbin:$dir/usr/sbin:$dir/usr/X11R6/bin:$dir/lib:$dir/usr/lib:$dir/usr/lib/perl5/$version/$arch/CORE";
$ENV{PATH} = join(":", map { "$dir/$_" } split ":", "/usr/bin:/bin:/sbin:/usr/sbin:/usr/X11R6/bin") . ":$ENV{PATH}";
$ENV{SHARE_PATH} = "$dir/usr/share";
$ENV{RPMRC_FILE} = "$dir/usr/lib/rpm/rpmrc";
opt">}->write($o_xfree4_file) : unlink($o_xfree4_file); } sub empty_config { my ($class) = @_; bless { xfree3 => Xconfig::xfree3->empty_config, xfree4 => Xconfig::xfree4->empty_config }, $class; } sub get_keyboard { get_both('get_keyboard', @_) } sub set_keyboard { set_both('set_keyboard', @_) } sub get_mice { get_both('get_mice', @_) } sub set_mice { set_both('set_mice', @_) } sub get_resolution { get_both('get_resolution', @_) } sub set_resolution { set_both('set_resolution', @_) } sub get_device { get_both('get_device', @_) } sub get_devices { get_both('get_devices', @_) } sub set_devices { set_both('set_devices', @_) } sub set_wacoms { set_both('set_wacoms', @_) } sub get_monitor { get_both('get_monitor', @_) } sub get_monitors { get_both('get_monitors', @_) } sub set_monitors { set_both('set_monitors', @_) } sub is_fbdev { get_both('is_fbdev', @_) } #-############################################################################## #- helpers #-############################################################################## sub get_both { my ($getter, $both) = @_; if (is_empty_array_ref($both->{xfree3})) { $both->{xfree4}->$getter; } elsif (is_empty_array_ref($both->{xfree4})) { $both->{xfree3}->$getter; } else { my @l3 = $both->{xfree3}->$getter; my @l4 = $both->{xfree4}->$getter; merge_values(\@l3, \@l4); } } sub set_both { my ($setter, $both, @l) = @_; $both->{xfree3}->$setter(@l) if !is_empty_array_ref($both->{xfree3}); $both->{xfree4}->$setter(@l) if !is_empty_array_ref($both->{xfree4}); } sub merge_values { my ($l3, $l4) = @_; sub merge_values__hashes { my ($h3, $h4) = @_; $h3 || $h4 or return; $h3 or return $h4; $h4 or return $h3; my %h = %$h4; foreach (keys %$h3) { if (exists $h{$_}) { if (ref($h{$_}) eq 'HASH' && ref($h3->{$_}) eq 'HASH') { #- needed for "Options" of Devices $h{$_} = +{ %{$h3->{$_}}, %{$h{$_}} }; } else { my $s4 = join(", ", deref_array($h{$_})); my $s3 = join(", ", deref_array($h3->{$_})); my $s3_ = join(", ", map { qq("$_") } deref_array($h3->{$_})); if ($s4 eq $s3_) { #- keeping the non-double-quoted value $h{$_} = $h3->{$_}; } else { $s4 eq $s3 or log::l(qq(XFree: conflicting value for $_, "$s4" and "$s3" are different)); } } } else { $h{$_} = $h3->{$_}; } } \%h; } my @r = mapn_(\&merge_values__hashes, $l3, $l4); @r == 1 ? $r[0] : @r; } 1;