diff options
-rw-r--r-- | urpm/get_pkgs.pm | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm index 80210457..b2f4ad68 100644 --- a/urpm/get_pkgs.pm +++ b/urpm/get_pkgs.pm @@ -43,19 +43,16 @@ sub selected2list { if (! -s $filepath) { unlink $filepath; #- this file should be removed or is already empty. } else { - my $filename = basename($filepath); - if (keys(%{$file2fullnames{$filename} || {}}) > 1) { - $urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\"", $filename)); - } elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) { - my ($fullname) = keys(%{$file2fullnames{$filename} || {}}); - if (defined(my $id = delete $fullname2id{$fullname})) { - $local_sources{$id} = $filepath; - } else { - $options{clean_other} && ! exists $protected_files{$filepath} and unlink $filepath; - } - } else { - $options{clean_other} && ! exists $protected_files{$filepath} and unlink $filepath; - } + my $filename = basename($filepath); + my @fullnames = keys(%{$file2fullnames{$filename} || {}}); + if (@fullnames > 1) { + $urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\"", $filename)); + } elsif (@fullnames == 1 && + defined(my $id = delete $fullname2id{$fullnames[0]})) { + $local_sources{$id} = $filepath; + } else { + $options{clean_other} && ! exists $protected_files{$filepath} and unlink $filepath; + } } } |