summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-08-13 08:45:03 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-08-13 08:45:03 +0000
commit3b45a4d068946cab7f6918a77556106e3e1f2b40 (patch)
treea664d9dff8b921f692396899221b4766f73fbd55 /perl-install/install_any.pm
parenta0daddd28e284027822506dab2117b01d20dae2f (diff)
downloaddrakx-3b45a4d068946cab7f6918a77556106e3e1f2b40.tar
drakx-3b45a4d068946cab7f6918a77556106e3e1f2b40.tar.gz
drakx-3b45a4d068946cab7f6918a77556106e3e1f2b40.tar.bz2
drakx-3b45a4d068946cab7f6918a77556106e3e1f2b40.tar.xz
drakx-3b45a4d068946cab7f6918a77556106e3e1f2b40.zip
One further step towards the ftp supplementary media
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index c889e3620..56a5de2ec 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -62,6 +62,7 @@ sub relGetFile($) {
if (my ($arch) = m|\.([^\.]*)\.rpm$|) {
$_ = "$::o->{packages}{mediums}{$asked_medium}{rpmsdir}/$_";
s/%{ARCH}/$arch/g;
+ s,^/+,,g;
}
$_;
}
@@ -178,7 +179,7 @@ sub errorOpeningFile($) {
$::o->{packages}{mediums}{$asked_medium}{selected} = undef;
#- on cancel, we can expect the current medium to be undefined too,
- #- this enable remounting if selecting a package back.
+ #- this enables remounting if selecting a package back.
$current_medium = 'unknown';
return;
@@ -197,7 +198,7 @@ sub getFile {
crypto::getFile($f);
} elsif ($current_method eq "ftp") {
require ftp;
- ftp::getFile($rel);
+ ftp::getFile($rel, @{ $::o->{packages}{mediums}{$asked_medium}{ftp_prefix} || [] });
} elsif ($current_method eq "http") {
require http;
http::getFile(($ENV{URLPREFIX} || $o_altroot) . "/$rel");
@@ -208,7 +209,7 @@ sub getFile {
my $f2 = "$postinstall_rpms/$f";
$o_altroot ||= '/tmp/image';
$f2 = "$o_altroot/$rel" if !$postinstall_rpms || !-e $f2;
- $f2 = $rel if $rel =~ m!^/! && !-e $f2; #- not a relative path
+ #- $f2 = "/$rel" if !$::o->{packages}{mediums}{$asked_medium}{rpmsdir} && !-e $f2; #- not a relative path, should not be necessary with new media layout
my $F; open($F, $f2) && $F;
}
} || errorOpeningFile($f);
@@ -448,6 +449,10 @@ sub selectSupplMedia {
if ($supplmedium) {
log::l("read suppl hdlist (via $suppl_method)");
$supplmedium->{prefix} = $url; #- for install_urpmi
+ if ($suppl_method eq 'ftp') {
+ $url =~ m!^ftp://(?:(.*?)(?::(.*?))?@)?([^/]+)/(.*)!;
+ $supplmedium->{ftp_prefix} = [ $3, $4, $1, $2 ]; #- for getFile
+ }
$supplmedium->{selected} = 1;
$supplmedium->{method} = $suppl_method;
$supplmedium->{with_hdlist} = 'media_info/hdlist.cz'; #- for install_urpmi