summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-10-08 17:33:47 +0000
committerFrancois Pons <fpons@mandriva.com>2001-10-08 17:33:47 +0000
commit9b5fc928dd9eb0cf76beae1d9ba2ceae5129f782 (patch)
tree8680caa6b87c045e6ddbad5425b631f39e0b587b
parent4fe91335bb07dcff1ecf8174cfd0170dfd632739 (diff)
downloadurpmi-9b5fc928dd9eb0cf76beae1d9ba2ceae5129f782.tar
urpmi-9b5fc928dd9eb0cf76beae1d9ba2ceae5129f782.tar.gz
urpmi-9b5fc928dd9eb0cf76beae1d9ba2ceae5129f782.tar.bz2
urpmi-9b5fc928dd9eb0cf76beae1d9ba2ceae5129f782.tar.xz
urpmi-9b5fc928dd9eb0cf76beae1d9ba2ceae5129f782.zip
make strong check of rpm file on a removable device for accepting a medium.
-rw-r--r--urpm.pm14
1 files changed, 13 insertions, 1 deletions
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.