summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-07 09:01:16 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-07 09:01:16 +0000
commitfe54a6db3de92aac15f54c9a712193e3a1b1510c (patch)
tree7317b8180f6c875aa89a9174db5d4ab7204061f2 /perl-install
parentd4c9c02a053b920628c507c203cd907fe7f3f26a (diff)
downloaddrakx-fe54a6db3de92aac15f54c9a712193e3a1b1510c.tar
drakx-fe54a6db3de92aac15f54c9a712193e3a1b1510c.tar.gz
drakx-fe54a6db3de92aac15f54c9a712193e3a1b1510c.tar.bz2
drakx-fe54a6db3de92aac15f54c9a712193e3a1b1510c.tar.xz
drakx-fe54a6db3de92aac15f54c9a712193e3a1b1510c.zip
install_urpmi() wasn't writing proper urls when having read an hdlists
file for a networked supplementary media
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_any.pm25
-rw-r--r--perl-install/pkgs.pm9
2 files changed, 20 insertions, 14 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index df88349df..fc9f1c3da 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -439,7 +439,7 @@ sub selectSupplMedia {
useMedium($medium_name);
#- probe for an hdlists file and then look for all hdlists listed herein
- eval { pkgs::psUsingHdlists($o, $suppl_method, "/mnt/cdrom/", $o->{packages}, $medium_name) };
+ eval { pkgs::psUsingHdlists($o, $suppl_method, "/mnt/cdrom", $o->{packages}, $medium_name) };
log::l("psUsingHdlists failed: $@") if $@;
#- copy latest compssUsers.pl and rpmsrate somewhere locally
@@ -467,7 +467,7 @@ sub selectSupplMedia {
useMedium($medium_name);
require "$suppl_method.pm";
#- first, try to find an hdlists file
- eval { pkgs::psUsingHdlists($o, $suppl_method, "$url/", $o->{packages}, $medium_name) };
+ eval { pkgs::psUsingHdlists($o, $suppl_method, $url, $o->{packages}, $medium_name, \&setup_suppl_medium) };
if ($@) {
log::l("psUsingHdlists failed: $@");
} else {
@@ -506,14 +506,7 @@ sub selectSupplMedia {
close $f;
if ($supplmedium) {
log::l("read suppl hdlist (via $suppl_method)");
- $supplmedium->{prefix} = $url; #- for install_urpmi
- if ($suppl_method eq 'ftp') {
- $url =~ m!^ftp://(?:(.*?)(?::(.*?))?@)?([^/]+)/(.*)!
- and $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
+ setup_suppl_medium($supplmedium, $url, $suppl_method);
} else {
log::l("no suppl hdlist");
}
@@ -525,6 +518,18 @@ sub selectSupplMedia {
return $suppl_method;
}
+sub setup_suppl_medium {
+ my ($supplmedium, $url, $suppl_method) = @_;
+ $supplmedium->{prefix} = $url; #- for install_urpmi
+ if ($suppl_method eq 'ftp') {
+ $url =~ m!^ftp://(?:(.*?)(?::(.*?))?@)?([^/]+)/(.*)!
+ and $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
+}
+
sub setPackages {
my ($o, $rebuild_needed) = @_;
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 848a21a76..6b35fb093 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -378,9 +378,9 @@ sub psUpdateHdlistsDeps {
}
sub psUsingHdlists {
- my ($o, $method, $o_hdlistsfile, $o_packages, $o_initialmedium) = @_;
+ my ($o, $method, $o_hdlistsprefix, $o_packages, $o_initialmedium, $o_callback) = @_;
my $prefix = $o->{prefix};
- my $listf = install_any::getFile($o_hdlistsfile . 'media/media_info/hdlists')
+ my $listf = install_any::getFile($o_hdlistsprefix ? "$o_hdlistsprefix/media/media_info/hdlists" : 'media/media_info/hdlists')
or die "no hdlists found";
my ($suppl_CDs, $deselectionAllowed) = (0, 0);
if (!$o_packages) {
@@ -406,7 +406,7 @@ sub psUsingHdlists {
m/^\s*(noauto:)?(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die qq(invalid hdlist description "$_" in hdlists file);
push @hdlists, [ $2, $medium_name, $3, $4, !$1,
#- hdlist path, suppl CDs are mounted on /mnt/cdrom :
- $o_hdlistsfile ? "$o_hdlistsfile/media/media_info/$2" : undef,
+ $o_hdlistsprefix ? "$o_hdlistsprefix/media/media_info/$2" : undef,
];
$cdsuppl ? ($medium_name = ($medium_name + 1) . 's') : ++$medium_name;
}
@@ -415,7 +415,8 @@ sub psUsingHdlists {
foreach my $h (@hdlists) {
#- make sure the first medium is always selected!
#- by default select all image.
- psUsingHdlist($prefix, $method, $o_packages, @$h);
+ my $supplmedium = psUsingHdlist($prefix, $method, $o_packages, @$h);
+ $o_callback and $o_callback->($supplmedium, $o_hdlistsprefix, $method);
}
log::l("psUsingHdlists read " . int(@{$o_packages->{depslist}}) .