summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--urpm.pm34
-rw-r--r--urpmi.spec10
2 files changed, 29 insertions, 15 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}));
diff --git a/urpmi.spec b/urpmi.spec
index 32a3db5c..db8a99a2 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 3.1
-Release: 5mdk
+Release: 6mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -142,6 +142,14 @@ fi
%changelog
+* Thu Jan 10 2002 François Pons <fpons@mandrakesoft.com> 3.1-6mdk
+- fixed distant list file support.
+- allow shadow approach of list file, the same list file (global)
+ can be used for each intermediate medium, urpmi choose the right
+ entry for each medium from the same source.
+- added /./ as string marker to probe url, this means the heading
+ ./ of find . -name "*.rpm" -print should be kept.
+
* Wed Jan 9 2002 François Pons <fpons@mandrakesoft.com> 3.1-5mdk
- added lock urpmi database features.
- added support for distant list file.