diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-01-10 16:36:38 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-01-10 16:36:38 +0000 |
commit | 002651e9da33b6ded7cf38fe95ca6441fa5ac74d (patch) | |
tree | 7811918bbd9826fdeb97bc2dc54d0af41f5f861f | |
parent | c080ade47ddc823e72db3b7b9ecbaef76a87bd19 (diff) | |
download | urpmi-002651e9da33b6ded7cf38fe95ca6441fa5ac74d.tar urpmi-002651e9da33b6ded7cf38fe95ca6441fa5ac74d.tar.gz urpmi-002651e9da33b6ded7cf38fe95ca6441fa5ac74d.tar.bz2 urpmi-002651e9da33b6ded7cf38fe95ca6441fa5ac74d.tar.xz urpmi-002651e9da33b6ded7cf38fe95ca6441fa5ac74d.zip |
simplify
-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; + } } } |