summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-01-30 14:59:57 +0000
committerFrancois Pons <fpons@mandriva.com>2002-01-30 14:59:57 +0000
commit10a19b68716ff7247f9d42540364f5bcd51d6e45 (patch)
tree54b4499254d24937e2dbc1aabddc364098d1ab08 /urpm.pm
parent9dd132cd44f24844e06eb0f1b5b177f5a0931a03 (diff)
downloadurpmi-10a19b68716ff7247f9d42540364f5bcd51d6e45.tar
urpmi-10a19b68716ff7247f9d42540364f5bcd51d6e45.tar.gz
urpmi-10a19b68716ff7247f9d42540364f5bcd51d6e45.tar.bz2
urpmi-10a19b68716ff7247f9d42540364f5bcd51d6e45.tar.xz
urpmi-10a19b68716ff7247f9d42540364f5bcd51d6e45.zip
3.2-6mdk
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm30
1 files changed, 14 insertions, 16 deletions
diff --git a/urpm.pm b/urpm.pm
index 449261cf..1e65b6b7 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1791,29 +1791,27 @@ sub upload_source_packages {
my $medium = $urpm->{media}[$id];
$media{$id} = undef;
if (my ($prefix, $dir) = $medium->{url} =~ /^(removable[^:]*|file):\/(.*)/) {
- my $count_not_found = sub {
- my $not_found;
+ my $check_notfound = sub {
if (-e $dir) {
foreach (values %{$list->[$id]}) {
/^(removable_?[^_:]*|file):\/(.*\/([^\/]*))/ or next;
- -r $2 or ++$not_found;
+ -r $2 or return 1;
}
} else {
- $not_found = values %{$list->[$id]};
+ return 2;
}
- return $not_found;
+ return 0;
};
- 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.
- unless ($urpm->try_mounting($dir)) {
- $ask_for_medium or
- $urpm->{fatal}(4, _("medium \"%s\" is not selected", $medium->{name}));
- $urpm->try_umounting($dir); system("eject", $device);
- $ask_for_medium->($medium->{name}, $medium->{removable}) or
- $urpm->{fatal}(4, _("medium \"%s\" is not selected", $medium->{name}));
- }
+ #- the directory given does not exist or may be accessible
+ #- by mounting some other. try to figure out these directory and
+ #- mount everything necessary.
+ $urpm->try_mounting($dir);
+ while ($check_notfound->()) {
+ $ask_for_medium or $urpm->{fatal}(4, _("medium \"%s\" is not selected", $medium->{name}));
+ $urpm->try_umounting($dir); system("eject", $device);
+ $ask_for_medium->($medium->{name}, $medium->{removable}) or
+ $urpm->{fatal}(4, _("medium \"%s\" is not selected", $medium->{name}));
+ $urpm->try_mounting($dir);
}
if (-e $dir) {
my @removable_sources;