summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-08-22 01:10:13 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-08-22 01:10:13 +0000
commit1a996ceb744f490f0183099640e7a1eb3ad039c1 (patch)
tree7e599599dc2cd1601dc1f86b7db223ceebc562a9 /perl-install/install_any.pm
parente2df2b17c50af038bbfe15f5b6dd9a21c532ae5b (diff)
downloaddrakx-1a996ceb744f490f0183099640e7a1eb3ad039c1.tar
drakx-1a996ceb744f490f0183099640e7a1eb3ad039c1.tar.gz
drakx-1a996ceb744f490f0183099640e7a1eb3ad039c1.tar.bz2
drakx-1a996ceb744f490f0183099640e7a1eb3ad039c1.tar.xz
drakx-1a996ceb744f490f0183099640e7a1eb3ad039c1.zip
no_comment
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm42
1 files changed, 24 insertions, 18 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 16e32b465..3c5c6801c 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -112,32 +112,38 @@ sub errorOpeningFile($) {
return;
}
sub getFile {
- local $^W = 0;
- if ($::o->{method} && $::o->{method} eq "ftp") {
- require ftp;
- *install_any::getFile = sub { ftp::getFile($_[0]) or errorOpeningFile($_[0]) };
- } elsif ($::o->{method} && $::o->{method} eq "http") {
- require http;
- *install_any::getFile = sub { http::getFile($_[0]) or errorOpeningFile($_[0]) };
- } else {
- *install_any::getFile = sub {
+ my ($f, $method) = @_;
+ my $rel = install_any::relGetFile($f);
+ log::l("getFile $f ($method) relGetFile $rel");
+ do {
+ if ($method =~ /crypto/i) {
+ require crypto;
+ log::l("crypto::getFile $f");
+ crypto::getFile($f);
+ } elsif ($method eq "ftp") {
+ require ftp;
+ ftp::getFile($rel);
+ } elsif ($method eq "http") {
+ require http;
+ http::getFile($rel);
+ } else {
#- try to open the file, but examine if it is present in the repository, this allow
#- handling changing a media when some of the file on the first CD has been copied
#- to other to avoid media change...
- log::l("getFile /tmp/rhimage/" . relGetFile($_[0]));
- open GETFILE, "/tmp/rhimage/" . relGetFile($_[0]) or
- $postinstall_rpms and open GETFILE, "$postinstall_rpms/$_[0]" or return errorOpeningFile($_[0]);
+ my $f2 = "$postinstall_rpms/$f";
+ $f2 = "/tmp/rhimage/$rel" unless -e $f2;
+ log::l("local getFile $f2");
+ open GETFILE, $f2;
*GETFILE;
- };
- }
- goto &getFile;
+ }
+ } or errorOpeningFile($f);
}
sub getAndSaveFile {
my ($file, $local) = @_;
log::l("getAndSaveFile $file $local");
local *F; open F, ">$local" or return;
local $/ = \ (16 * 1024);
- my $f = getFile($file) or return;
+ my $f = ref($file) ? $file : getFile($file) or return;
local $_;
while (<$f>) { syswrite F, $_ }
1;
@@ -621,10 +627,10 @@ sub suggest_mount_points {
next if $uniq && fsedit::mntpoint2part($mnt, \@parts);
$part->{mntpoint} = $mnt;
- # try to find other mount points via fstab
+ #- try to find other mount points via fstab
fs::get_mntpoints_from_fstab(\@parts, $d) if $mnt eq '/';
}
- $_->{mntpoint} || fsedit::suggest_part($_, $hds) foreach @parts;
+#- $_->{mntpoint} || fsedit::suggest_part($_, $hds) foreach @parts;
$_->{mntpoint} and log::l("suggest_mount_points: $_->{device} -> $_->{mntpoint}") foreach @parts;
}