summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-04-11 01:03:09 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-04-11 01:03:09 +0000
commit3c3fa6b8bbe73214bb3a0ca5a22c012e663f3c49 (patch)
tree06a5144de9c7fccd487998c1d2d4994ca6188d25 /perl-install/install_any.pm
parentfce75ad39ebf4960e752e89fe0d82f3eabe1bf59 (diff)
downloaddrakx-backup-do-not-use-3c3fa6b8bbe73214bb3a0ca5a22c012e663f3c49.tar
drakx-backup-do-not-use-3c3fa6b8bbe73214bb3a0ca5a22c012e663f3c49.tar.gz
drakx-backup-do-not-use-3c3fa6b8bbe73214bb3a0ca5a22c012e663f3c49.tar.bz2
drakx-backup-do-not-use-3c3fa6b8bbe73214bb3a0ca5a22c012e663f3c49.tar.xz
drakx-backup-do-not-use-3c3fa6b8bbe73214bb3a0ca5a22c012e663f3c49.zip
(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
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm41
1 files changed, 40 insertions, 1 deletions
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;