diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-24 10:49:35 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-24 10:49:35 +0000 |
commit | aaf182ce4dd27e7ab847e8cf35f1e97210c07be2 (patch) | |
tree | bf42faa605c52a6d782208439a4c038bef8b6a4c /urpm/download.pm | |
parent | 7e26db01876f166892d77bf36aaf5868f6cf3fc9 (diff) | |
download | urpmi-aaf182ce4dd27e7ab847e8cf35f1e97210c07be2.tar urpmi-aaf182ce4dd27e7ab847e8cf35f1e97210c07be2.tar.gz urpmi-aaf182ce4dd27e7ab847e8cf35f1e97210c07be2.tar.bz2 urpmi-aaf182ce4dd27e7ab847e8cf35f1e97210c07be2.tar.xz urpmi-aaf182ce4dd27e7ab847e8cf35f1e97210c07be2.zip |
create hide_password() (to be used in urpm::main_loop to remove duplication)
Diffstat (limited to 'urpm/download.pm')
-rw-r--r-- | urpm/download.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/urpm/download.pm b/urpm/download.pm index 2d2ee2e1..be891bcb 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -206,14 +206,19 @@ sub _error { die "$msg\n"; } +sub hide_password { + my ($url) = @_; + $url =~ s|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)|$1xxxx$2|; #- if needed... + $url; +} + sub propagate_sync_callback { my $options = shift; if (ref($options) && $options->{callback}) { my $mode = shift; if ($mode =~ /^(?:start|progress|end)$/) { my $file = shift; - $file =~ s|([^:]*://[^/:\@]*:)[^/:\@]*(\@.*)|$1xxxx$2|; #- if needed... - return $options->{callback}($mode, $file, @_); + return $options->{callback}($mode, hide_password($file), @_); } else { return $options->{callback}($mode, @_); } |