summaryrefslogtreecommitdiffstats
path: root/urpm/get_pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-18 16:11:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-18 16:11:34 +0000
commit389048ecdd1ab3434a445d56e4c13f7221739c8b (patch)
tree93396a270ff5d927cab56f96800c63b3d6be54ed /urpm/get_pkgs.pm
parent23b35b838587cf83ff70afb0564576837d621a9a (diff)
downloadurpmi-389048ecdd1ab3434a445d56e4c13f7221739c8b.tar
urpmi-389048ecdd1ab3434a445d56e4c13f7221739c8b.tar.gz
urpmi-389048ecdd1ab3434a445d56e4c13f7221739c8b.tar.bz2
urpmi-389048ecdd1ab3434a445d56e4c13f7221739c8b.tar.xz
urpmi-389048ecdd1ab3434a445d56e4c13f7221739c8b.zip
use var (for future commit)
Diffstat (limited to 'urpm/get_pkgs.pm')
-rw-r--r--urpm/get_pkgs.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index e688bc74..0906ee54 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -135,7 +135,9 @@ sub download_packages_of_distant_media {
}
}
- if (%distant_sources && ! -w "$urpm->{cachedir}/partial") {
+ my $partial_dir = "$urpm->{cachedir}/partial";
+ my $rpms_dir = "$urpm->{cachedir}/rpms";
+ if (%distant_sources && ! -w $partial_dir) {
$urpm->{error}(N("sorry, you can't use --install-src to install remote .src.rpm files"));
exit 1;
}
@@ -155,13 +157,13 @@ sub download_packages_of_distant_media {
#- present the error to the user.
foreach my $i (keys %distant_sources) {
my ($filename) = $distant_sources{$i} =~ m|/([^/]*\.rpm)$|;
- if ($filename && -s "$urpm->{cachedir}/partial/$filename" &&
- URPM::verify_rpm("$urpm->{cachedir}/partial/$filename", nosignatures => 1))
+ if ($filename && -s "$partial_dir/$filename" &&
+ URPM::verify_rpm("$partial_dir/$filename", nosignatures => 1))
{
#- it seems the the file has been downloaded correctly and has been checked to be valid.
- 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";
+ unlink "$rpms_dir/$filename";
+ urpm::util::move("$partial_dir/$filename", "$rpms_dir/$filename");
+ -r "$rpms_dir/$filename" and $sources->{$i} = "$rpms_dir/$filename";
}
unless ($sources->{$i}) {
$error_sources->{$i} = $distant_sources{$i};