diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 11:40:22 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 11:40:22 +0000 |
commit | e150804292cf6f19c2a37b08ccd1b5989e1a584c (patch) | |
tree | fcf98d183f924024ef0887583f11043171189546 /urpm.pm | |
parent | 7488d786aac5d572d34c69f30c8b6aad7fdb4848 (diff) | |
download | urpmi-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
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 27 |
1 files changed, 13 insertions, 14 deletions
@@ -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. |