summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-13 11:40:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-13 11:40:22 +0000
commite150804292cf6f19c2a37b08ccd1b5989e1a584c (patch)
treefcf98d183f924024ef0887583f11043171189546
parent7488d786aac5d572d34c69f30c8b6aad7fdb4848 (diff)
downloadurpmi-e150804292cf6f19c2a37b08ccd1b5989e1a584c.tar
urpmi-e150804292cf6f19c2a37b08ccd1b5989e1a584c.tar.gz
urpmi-e150804292cf6f19c2a37b08ccd1b5989e1a584c.tar.bz2
urpmi-e150804292cf6f19c2a37b08ccd1b5989e1a584c.tar.xz
urpmi-e150804292cf6f19c2a37b08ccd1b5989e1a584c.zip
simplify $check_notfound in copy_packages_of_removable_media
-rw-r--r--urpm.pm27
1 files changed, 13 insertions, 14 deletions
diff --git a/urpm.pm b/urpm.pm
index 50a63a4b..eb46bab3 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2624,22 +2624,21 @@ sub copy_packages_of_removable_media {
#- examine if given medium is already inside a removable device.
my $check_notfound = sub {
my ($id, $dir, $removable) = @_;
- $dir and $urpm->try_mounting($dir, $removable);
- if (!$dir || -e $dir) {
- foreach (values %{$list->[$id]}) {
- chomp;
- my $dir_ = analyse_url__file_if_local($_) or next;
- $dir_ =~ m!/.*/! or next; #- is this really needed??
- unless ($dir) {
- $dir = $dir_;
- $urpm->try_mounting($dir, $removable);
- }
- -r $dir_ or return 1;
+ if ($dir) {
+ $urpm->try_mounting($dir, $removable);
+ -e $dir or return 2;
+ }
+ foreach (values %{$list->[$id]}) {
+ chomp;
+ my $dir_ = analyse_url__file_if_local($_) or next;
+ $dir_ =~ m!/.*/! or next; #- is this really needed??
+ unless ($dir) {
+ $dir = $dir_;
+ $urpm->try_mounting($dir, $removable);
}
- } else {
- return 2;
+ -r $dir_ or return 1;
}
- return 0;
+ 0;
};
#- removable media have to be examined to keep mounted the one that has
#- more packages than others.