From 9b5fc928dd9eb0cf76beae1d9ba2ceae5129f782 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 8 Oct 2001 17:33:47 +0000 Subject: make strong check of rpm file on a removable device for accepting a medium. --- urpm.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/urpm.pm b/urpm.pm index 898711ef..406d61b4 100644 --- a/urpm.pm +++ b/urpm.pm @@ -1594,7 +1594,19 @@ sub upload_source_packages { my $medium = $urpm->{media}[$id]; $media{$id} = undef; if (my ($prefix, $dir) = $medium->{url} =~ /^(removable_[^:]*|file):\/(.*)/) { - until (-e $dir) { + my $count_not_found = sub { + my $not_found; + if (-e $dir) { + foreach (@{$list->[$id]}) { + /^(removable_[^:]*|file):\/(.*\/([^\/]*))/ or next; + -r $2 or ++$not_found; + } + } else { + $not_found = @{$list->[$id]}; + } + return $not_found; + }; + while ($count_not_found->()) { #- the directory given does not exist or may be accessible #- by mounting some other. try to figure out these directory and #- mount everything necessary. -- cgit v1.2.1