diff options
author | Florent Villard <warly@mandriva.com> | 2006-03-09 12:01:57 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-03-09 12:01:57 +0000 |
commit | 8b25373999e1751e5fe1858a3d87f16ccf1a20a2 (patch) | |
tree | 5e2e3e5a340e3a83355f2a7bdcd8b79a25debafb /mdkupdate | |
parent | 22bd1f46fc40f7542f6328cc1f12a1a8fe618f2f (diff) | |
download | mgaonline-8b25373999e1751e5fe1858a3d87f16ccf1a20a2.tar mgaonline-8b25373999e1751e5fe1858a3d87f16ccf1a20a2.tar.gz mgaonline-8b25373999e1751e5fe1858a3d87f16ccf1a20a2.tar.bz2 mgaonline-8b25373999e1751e5fe1858a3d87f16ccf1a20a2.tar.xz mgaonline-8b25373999e1751e5fe1858a3d87f16ccf1a20a2.zip |
use curl for https; escape uri to encode @
Diffstat (limited to 'mdkupdate')
-rwxr-xr-x | mdkupdate | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -25,6 +25,7 @@ use POSIX; use lib qw(/usr/lib/libDrakX /usr/lib/libDrakX/drakfirsttime); use common; use interactive; +use URI::Escape; use mdkonline; use urpm; @@ -48,7 +49,7 @@ my $logfile = '/var/tmp/mdkupdate.log'; my $currentrpm = "$confdir/rpm_qa_installed_current"; my $afterrpm = "$confdir/rpm_qa_installed_after"; -my $startpage = 'http://start.mandriva.com/bundle/'; +my $startpage = 'http://start.mandriva.com/'; my $VERSION = "3"; my $YEARS = "2002-2006"; @@ -167,7 +168,9 @@ You need to update to a newer version. You can get a new one from http://start.m $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}}@!; + my $encoded_login = uri_escape($bundle_vars{USER}); + my $encoded_pass = uri_escape($bundle_vars{PASS}); + $mirror->{url} =~ s!^([^:]*)://!\1://$encoded_login:$encoded_pass@!; } else { # unknown method, aborting $in->ask_warn(N("Error"), N("This bundle is not well formated. Aborting.")); $in->exit(1); @@ -268,8 +271,8 @@ sub add_media { my ($media_name, $mirror, $hdlist, $option) = @_; eval { system "/usr/sbin/urpmi.removemedia", $media_name; - # use wget because curl doesn't handle nicely passwords (at least the way it's called from urpmi); - system "/usr/sbin/urpmi.addmedia", if_($option, $option), '--wget', $media_name, $mirror, "with", $hdlist; + # use curl because wget sometime fail on https url + system "/usr/sbin/urpmi.addmedia", if_($option, $option), '--curl', $media_name, $mirror, "with", $hdlist; }; $@ and die "Problem adding bundle media with urpmi"; } |