From aaf182ce4dd27e7ab847e8cf35f1e97210c07be2 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 24 Feb 2008 10:49:35 +0000 Subject: create hide_password() (to be used in urpm::main_loop to remove duplication) --- urpm/download.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'urpm/download.pm') 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, @_); } -- cgit v1.2.1