From b16cdf48fc4bba0143ac30eea7fd6e8468ab171d Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 30 Mar 2005 09:29:45 +0000 Subject: Remove dead code --- urpm.pm | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/urpm.pm b/urpm.pm index 6f1d5884..7a2fda11 100644 --- a/urpm.pm +++ b/urpm.pm @@ -2634,7 +2634,7 @@ sub copy_packages_of_removable_media { #- removable media have to be examined to keep mounted the one that has #- more packages than others. my $examine_removable_medium = sub { - my ($id, $device, $copy) = @_; + my ($id, $device) = @_; my $medium = $urpm->{media}[$id]; if (my ($dir) = $medium->{url} =~ m!^(?:(?:removable[^:]*|file):/)?(/.*)!) { #- the directory given does not exist and may be accessible @@ -2652,21 +2652,17 @@ sub copy_packages_of_removable_media { chomp $url; my ($filepath, $filename) = $url =~ m!^(?:removable[^:]*:/|file:/)?(/.*/([^/]*))! or next; if (-r $filepath) { - if ($copy) { - #- we should assume a possibly buggy removable device... - #- First, copy in partial cache, and if the package is still good, - #- transfer it to the rpms cache. - unlink "$urpm->{cachedir}/partial/$filename"; - if (urpm::util::copy($filepath, "$urpm->{cachedir}/partial") && - URPM::verify_rpm("$urpm->{cachedir}/partial/$filename", nosignatures => 1) !~ /NOT OK/) - { - #- now we can consider the file to be fine. - unlink "$urpm->{cachedir}/rpms/$filename"; - urpm::util::move("$urpm->{cachedir}/partial/$filename", "$urpm->{cachedir}/rpms/$filename"); - -r "$urpm->{cachedir}/rpms/$filename" and $sources->{$i} = "$urpm->{cachedir}/rpms/$filename"; - } - } else { - $sources->{$i} = $filepath; + #- we should assume a possibly buggy removable device... + #- First, copy in partial cache, and if the package is still good, + #- transfer it to the rpms cache. + unlink "$urpm->{cachedir}/partial/$filename"; + if (urpm::util::copy($filepath, "$urpm->{cachedir}/partial") && + URPM::verify_rpm("$urpm->{cachedir}/partial/$filename", nosignatures => 1) !~ /NOT OK/) + { + #- now we can consider the file to be fine. + unlink "$urpm->{cachedir}/rpms/$filename"; + urpm::util::move("$urpm->{cachedir}/partial/$filename", "$urpm->{cachedir}/rpms/$filename"); + -r "$urpm->{cachedir}/rpms/$filename" and $sources->{$i} = "$urpm->{cachedir}/rpms/$filename"; } } unless ($sources->{$i}) { @@ -2710,13 +2706,13 @@ sub copy_packages_of_removable_media { #- mount all except the biggest one. foreach (@sorted_media[0 .. $#sorted_media-1]) { - $examine_removable_medium->($_, $device, 'copy'); + $examine_removable_medium->($_, $device); } #- now mount the last one... $removables{$device} = [ $sorted_media[-1] ]; } - $examine_removable_medium->($removables{$device}[0], $device, 'copy'); + $examine_removable_medium->($removables{$device}[0], $device); } 1; -- cgit v1.2.1