summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-01-10 13:31:38 +0000
committerFrancois Pons <fpons@mandriva.com>2002-01-10 13:31:38 +0000
commit45f8214f69c52e4cbc7bc61b055c8d0ec2308bec (patch)
tree75d6e19945332e7a7e0341058782634b21c1b53d /urpm.pm
parent013dc34291268abb76ed9a74f3211bda5085c546 (diff)
downloadurpmi-45f8214f69c52e4cbc7bc61b055c8d0ec2308bec.tar
urpmi-45f8214f69c52e4cbc7bc61b055c8d0ec2308bec.tar.gz
urpmi-45f8214f69c52e4cbc7bc61b055c8d0ec2308bec.tar.bz2
urpmi-45f8214f69c52e4cbc7bc61b055c8d0ec2308bec.tar.xz
urpmi-45f8214f69c52e4cbc7bc61b055c8d0ec2308bec.zip
fix distant list file support.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm34
1 files changed, 20 insertions, 14 deletions
diff --git a/urpm.pm b/urpm.pm
index 2ad606ae..981f895f 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -287,7 +287,11 @@ sub probe_medium {
local *L;
open L, "$urpm->{statedir}/$medium->{list}";
while (<L>) {
- /^(.*)\/[^\/]*/ and $probe{$1} = undef;
+ #- /./ is end of url marker in list file (typically generated by a
+ #- find . -name "*.rpm" > list
+ #- for exportable list file.
+ /^(.*)\/\.\// and $probe{$1} = undef;
+ /^(.*)\/[^\/]*$/ and $probe{$1} = undef;
}
close L;
foreach (sort { length($a) <=> length($b) } keys %probe) {
@@ -832,21 +836,23 @@ sub update_media {
/\/([^\/]*)-[^-\/]*-[^-\/]*\.[^\/]*\.rpm/;
$list{"$prefix:/$_\n"} = ($urpm->{params}{names}{$1} || { id => 1000000000 })->{id};
}
- } elsif (-s "$urpm->{cachedir}/partial/list") {
- local (*F, $_);
- while (<F>) {
- /\/([^\/]*)-[^-\/]*-[^-\/]*\.[^\/]*\.rpm/;
- $list{"$medium->{url}/$_\n"} = ($urpm->{params}{names}{$1} || { id => 1000000000 })->{id};
- }
- close F;
} else {
local (*F, $_);
+ my %filename2pathname;
+ if ($medium->{hdlist} ne 'list' && -s "$urpm->{cachedir}/partial/list") {
+ open F, "$urpm->{cachedir}/partial/list";
+ while (<F>) {
+ /\/([^\/]*)\.rpm$/ and $filename2pathname{$1} = "$medium->{url}/$_";
+ }
+ close F;
+ }
unless ($medium->{synthesis}) {
open F, "parsehdlist --name '$urpm->{cachedir}/partial/$medium->{hdlist}' |";
while (<F>) {
- /^([^\/]*):name:([^\/\s:]*)(?::(.*)\.rpm)?$/;
- $list{"$medium->{url}/". ($3 || $2) .".rpm\n"} = ($urpm->{params}{names}{$1} || { id => 1000000000 }
- )->{id};
+ /^([^\/]*):name:([^\/\s:]*)(?::(.*)\.rpm)?$/ or next;
+ $list{$filename2pathname{$3 || $2} ||
+ "$medium->{url}/". ($3 || $2) .".rpm\n"} = ($urpm->{params}{names}{$1} ||
+ { id => 1000000000 })->{id};
}
close F or $medium->{synthesis} = 1; #- try hdlist as a synthesis (for probe)
}
@@ -856,9 +862,9 @@ sub update_media {
#- parse_synthesis returns all full name of package read from it.
foreach (@founds) {
my $fullname = "$_->{name}-$_->{version}-$_->{release}.$_->{arch}";
- $list{"$medium->{url}/". ($_->{file} || $fullname) .".rpm\n"} = ($urpm->{params}{names}{$_->{name}} ||
- { id => 1000000000 }
- )->{id};
+ $list{$filename2pathname{$_->{file} || $fullname} ||
+ "$medium->{url}/". ($_->{file} || $fullname) .".rpm\n"} = ($urpm->{params}{names}{$_->{name}} ||
+ { id => 1000000000 })->{id};
}
} else {
$error = 1, $urpm->{error}(_("unable to parse hdlist file of \"%s\"", $medium->{name}));