From 0c0cb9890b271b7bc53cc6d53b8d5bf01545a819 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 20 Nov 2006 15:42:08 +0000 Subject: have same _guess_hdlist_suffix parameters(), and simplify --- urpm.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'urpm.pm') diff --git a/urpm.pm b/urpm.pm index 45133f7e..61464704 100644 --- a/urpm.pm +++ b/urpm.pm @@ -1063,9 +1063,8 @@ sub reconfig_urpmi { } sub _guess_hdlist_suffix { - my ($dir) = @_; - my ($suffix) = $dir =~ m!\bmedia/(\w+)/*\Z!; - $suffix; + my ($url) = @_; + $url =~ m!\bmedia/(\w+)/*\Z! && $1; } sub _hdlist_suffix { @@ -1389,7 +1388,7 @@ this could happen if you mounted manually the directory when creating the medium #- try to probe for possible with_hdlist parameter, unless #- it is already defined (and valid). if ($options->{probe_with} && (!$medium->{with_hdlist} || ! -e "$dir/$medium->{with_hdlist}")) { - foreach (_probe_with_try_list(_guess_hdlist_suffix($dir), $options->{probe_with})) { + foreach (_probe_with_try_list(_guess_hdlist_suffix($medium->{url}), $options->{probe_with})) { -e "$dir/$_" or next; if (file_size("$dir/$_") > 32) { $medium->{with_hdlist} = $_; -- cgit v1.2.1