From 3c3fa6b8bbe73214bb3a0ca5a22c012e663f3c49 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 11 Apr 2001 01:03:09 +0000 Subject: (check_prog): if a prog isn't available, try to fetch it via getFile (remove_bigseldom_used): created, purpose: remove unneeded stuff on stage2 to allow a getAndSaveFile. (getAndSaveFile): if only one arg is given, assume the name is the same --- perl-install/install_any.pm | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index f094a0d02..a7e7fd43f 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -142,7 +142,7 @@ sub getFile { } || errorOpeningFile($f); } sub getAndSaveFile { - my ($file, $local) = @_; + my ($file, $local) = @_ == 1 ? ("Mandrake/mdkinst$_[0]", $_[0]) : @_; local *F; open F, ">$local" or return; local $/ = \ (16 * 1024); my $f = ref($file) ? $file : getFile($file) or return; @@ -886,5 +886,44 @@ sub write_fstab { if !$::live; } +my @bigseldom_used_groups = ( + [ qw(pvcreate pvdisplay vgchange vgcreate vgdisplay vgextend vgremove vgscan lvcreate lvdisplay lvremove /lib/liblvm.so) ], +); + +sub check_prog { + my ($f, $prefix) = @_; + + my @l = $f !~ m|^/| ? + map { "$_/$f" } split(":", $ENV{PATH}) : + $f; + return if grep { -x "$prefix$_" } @l; + + #remove_bigseldom_used(); + foreach (@bigseldom_used_groups) { + my ($f_, @l) = map { m|^/| ? $_ : "/usr/bin/$_" } $f, @$_; + if (member($f_, @l)) { + foreach (@l) { + getAndSaveFile("Mandrake/mdkinst$_", "$prefix$_"); + chmod 0755, "$prefix$_"; + } + last; + } + } +} + +sub remove_bigseldom_used { + log::l("remove_bigseldom_used"); + unlink glob_("/usr/share/gtk/themes/$_*") foreach qw(DarkMarble marble3d); + if (ref($::o) =~ /gtk/) { + unlink glob_("/lib/lib$_*") foreach qw(slang newt); + unlink "/usr/bin/perl-install/auto/Newt/Newt.so"; + } else { + unlink glob_("/usr/X11R6/bin/XF*"); + } + unlink(m|^/| ? $_ : "/usr/bin/$_") foreach + ((map { @$_ } @bigseldom_used_groups), + qw(mkreiserfs resize_reiserfs), + ); +} 1; -- cgit v1.2.1