summaryrefslogtreecommitdiffstats
path: root/mdkupdate
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2006-03-08 19:56:25 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2006-03-08 19:56:25 +0000
commita0f7ac72d6be86049e90113c9c2af296b0ea91d4 (patch)
tree32fb891e9c993e8c857364a38e9b43d27b43d534 /mdkupdate
parent131b608016f7d04d3486e06da3b7144fed1fec5b (diff)
downloadmgaonline-a0f7ac72d6be86049e90113c9c2af296b0ea91d4.tar
mgaonline-a0f7ac72d6be86049e90113c9c2af296b0ea91d4.tar.gz
mgaonline-a0f7ac72d6be86049e90113c9c2af296b0ea91d4.tar.bz2
mgaonline-a0f7ac72d6be86049e90113c9c2af296b0ea91d4.tar.xz
mgaonline-a0f7ac72d6be86049e90113c9c2af296b0ea91d4.zip
handle new SOAP interface with the MdvOnline server
Diffstat (limited to 'mdkupdate')
-rwxr-xr-xmdkupdate16
1 files changed, 15 insertions, 1 deletions
diff --git a/mdkupdate b/mdkupdate
index 22f103fc..894af7f0 100755
--- a/mdkupdate
+++ b/mdkupdate
@@ -159,7 +159,21 @@ You need to update to a newer version. You can get a new one from http://start.m
my @bundles;
my $w = $in->wait_message(N("Please wait"), N("Preparing..."));
my ($mirrors, $bundle) = ($bundle_info->{data}{mirrors}, $bundle_info->{data}{bundle});
- my %mirrors = map { split(';', $_, 2) } @$mirrors;
+ foreach my $mirror (@$mirrors) {
+ next if $mirror->{mode} eq 'anon'; # nothing to do
+ if ($mirror->{mode} eq 'auth') {
+ # add "user:pass@" substring if needed:
+ # user password & login provided by server on those provided with the bundle:
+ $bundle_vars{PASS} = "dfgdfg"; # FIXME
+ $bundle_vars{USER} = $mirror->{user} if $mirror->{user};
+ $bundle_vars{PASS} = $mirror->{pass} if $mirror->{pass};
+ $mirror->{url} =~ s!^([^:]*)://!\1://${bundle_vars{USER}}:${bundle_vars{PASS}}@!;
+ } else { # unknown method, aborting
+ $in->ask_warn(N("Error"), N("This bundle is not well formated. Aborting."));
+ $in->exit(1);
+ }
+ }
+ my %mirrors = map { $_->{name} => join('@', grep { $_ } $_->{auth}, $_->{url}) } @$mirrors;
add_media($_, $mirrors{$_}, 'media_info/synthesis.hdlist.cz', '') foreach keys %mirrors;
$bundle =~ s/-[^-]*-[^-]*\.[^.]*\.rpm$//;
push @bundles, $bundle;