summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-24 19:34:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-24 19:34:32 +0000
commit4df7583caa71a35d6d68c373fc0c62d1be6d955b (patch)
treebddf36169b314d82ff20036dea7e47fa4fec5bcd /urpm/download.pm
parent7a606ec3537b2f465f8e06e99b445c756bfcca8f (diff)
downloadurpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.gz
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.bz2
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.tar.xz
urpmi-4df7583caa71a35d6d68c373fc0c62d1be6d955b.zip
re-sync after the big svn loss
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm20
1 files changed, 18 insertions, 2 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index ceb6ffff..e4fed74c 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -617,6 +617,21 @@ sub requested_ftp_http_downloader {
} || $urpm->{global_config}{downloader};
}
+sub parse_url_with_login {
+ my ($url) = @_;
+ $url =~ m!([^:]*)://([^/:\@]*)(:([^/:\@]*))?\@([^/]*)(.*)! &&
+ { proto => $1, login => $2, password => $4, machine => $5, dir => $6 };
+}
+sub url_obscuring_password {
+ my ($url) = @_;
+ my $u = parse_url_with_login($url);
+ if ($u && $u->{password}) {
+ sprintf('%s://xxx:xxx@%s%s', $u->{proto}, $u->{machine}, $u->{dir});
+ } else {
+ $url;
+ }
+}
+
#- $medium can be undef
#- known options: quiet, resume, callback
sub sync {
@@ -632,11 +647,12 @@ sub sync {
$all_options{$cpt} = $urpm->{options}{$cpt} if defined $urpm->{options}{$cpt};
}
- $urpm->{debug}(N("retrieving %s", join(' ', @$files)));
+ my $files_text = join(' ', map { url_obscuring_password($_) } @$files);
+ $urpm->{debug} and $urpm->{debug}(N("retrieving %s", $files_text));
eval {
_sync_webfetch_raw($urpm, $files, \%all_options);
- $urpm->{log}(N("retrieved %s", join(' ', @$files)));
+ $urpm->{log}(N("retrieved %s", $files_text));
1;
};
}