diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-03-30 09:29:45 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-03-30 09:29:45 +0000 |
commit | b16cdf48fc4bba0143ac30eea7fd6e8468ab171d (patch) | |
tree | d5f452e03726319285d4586a5f75b9aecab14aa0 /urpm.pm | |
parent | 28bc3db3d13b3d8a417bf9a8a930fe20b43d146c (diff) | |
download | urpmi-b16cdf48fc4bba0143ac30eea7fd6e8468ab171d.tar urpmi-b16cdf48fc4bba0143ac30eea7fd6e8468ab171d.tar.gz urpmi-b16cdf48fc4bba0143ac30eea7fd6e8468ab171d.tar.bz2 urpmi-b16cdf48fc4bba0143ac30eea7fd6e8468ab171d.tar.xz urpmi-b16cdf48fc4bba0143ac30eea7fd6e8468ab171d.zip |
Remove dead code
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 32 |
1 files changed, 14 insertions, 18 deletions
@@ -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; |