summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-01-16 14:11:22 +0000
committerFrancois Pons <fpons@mandriva.com>2002-01-16 14:11:22 +0000
commita9a81651654af34db20a0b4bab4488c7a50cab38 (patch)
treeee521065632fad19c781174f72fd9e27c9291b76
parent74d329c910b31a6d7a83616a9eb2271a262a2e5b (diff)
downloadurpmi-a9a81651654af34db20a0b4bab4488c7a50cab38.tar
urpmi-a9a81651654af34db20a0b4bab4488c7a50cab38.tar.gz
urpmi-a9a81651654af34db20a0b4bab4488c7a50cab38.tar.bz2
urpmi-a9a81651654af34db20a0b4bab4488c7a50cab38.tar.xz
urpmi-a9a81651654af34db20a0b4bab4488c7a50cab38.zip
3.1-8mdk
-rw-r--r--urpm.pm55
-rw-r--r--urpmi.spec7
2 files changed, 46 insertions, 16 deletions
diff --git a/urpm.pm b/urpm.pm
index f4e01fe9..073d51a0 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -147,7 +147,6 @@ sub sync_curl {
#- options for ftp files, -R (-O <file>)*
#- options for http files, -R (-z file -O <file>)*
if (my @all_files = ((map { ("-O", $_ ) } @ftp_files), (map { /\/([^\/]*)$/ ? ("-z", $1, "-O", $_) : () } @other_files))) {
- print STDERR join " ", "/usr/bin/curl", "-R", "-f", @all_files;
system "/usr/bin/curl", "-R", "-f", @all_files;
$? == 0 or die _("curl failed: exited with %d or signal %d\n", $? >> 8, $? & 127);
}
@@ -1485,18 +1484,40 @@ sub filter_packages_to_upgrade {
delete $diffprovides{""};
foreach (keys %diffprovides) {
- #- check for exact match on it.
- if (/^(\S*)\s*(\S*)\s*(\d+:)?([^\s-]*)-?(\S*)/) {
- rpmtools::db_traverse_tag($db,
- 'whatrequires', [ $1 ],
- [ qw(name version release sense requires) ], sub{
- my ($p) = @_;
- foreach (@{$p->{requires}}) {
- s/\[\*\]//;
- s/\[([^\]]*)\]/ $1/;
- exists $diffprovides{$_} and $provides{$p->{name}} = undef;
- }
+ #- analyse the difference in provide and select other package.
+ if (my ($n, $o, $e, $v, $r) = /^(\S*)\s*(\S*)\s*(\d+:)?([^\s-]*)-?(\S*)/) {
+ rpmtools::db_traverse_tag($db, 'whatprovides', [ $n ], [ qw(name version release) ], sub{
+ $_[0]{name} eq $pkg->{name} and return;
+ $o and $n eq $_[0]{name} || return;
+ $v and eval(rpmtools::version_compare($_[0]{version}, $v) . $o . 0) || return;
+ $r && rpmtools::version_compare($_[0]{version}, $v) == 0 and
+ eval(rpmtools::version_compare($_[0]{release}, $r) . $o . 0) || return;
+ $provides{$n} = "$_[0]{name}-$_[0]{version}-$_[0]{release}";
});
+ unless (exists $provides{$n}) {
+ foreach my $fullname (keys %{$urpm->{params}{provides}{$n} || {}}) {
+ exists $conflicts{$_}{$fullname} and next;
+ my $p = $urpm->{params}{info}{$fullname};
+ $o and $n eq $p->{name} || next;
+ $v and eval(rpmtools::version_compare($p->{version}, $v) . $o . 0) || next;
+ $r && rpmtools::version_compare($p->{version}, $v) == 0 and
+ eval(rpmtools::version_compare($p->{release}, $r) . $o . 0) || next;
+ #- this is incomplete, exact provides is not kept.
+ $provides{$n} = undef;
+ }
+ }
+ unless (exists $provides{$n}) {
+ rpmtools::db_traverse_tag($db,
+ 'whatrequires', [ $1 ],
+ [ qw(name version release sense requires) ], sub{
+ my ($p) = @_;
+ foreach (@{$p->{requires}}) {
+ s/\[\*\]//;
+ s/\[([^\]]*)\]/ $1/;
+ exists $diffprovides{$_} and $provides{$p->{name}} = undef;
+ }
+ });
+ }
}
}
@@ -1510,8 +1531,10 @@ sub filter_packages_to_upgrade {
$provides{$n} ||= undef;
my $check_pkg = sub {
$options{keep_alldeps} and return;
+ $o and $n eq $_[0]{name} || return;
$v and eval(rpmtools::version_compare($_[0]{version}, $v) . $o . 0) || return;
- $r and eval(rpmtools::version_compare($_[0]{release}, $r) . $o . 0) || return;
+ $r && rpmtools::version_compare($_[0]{version}, $v) == 0 and
+ eval(rpmtools::version_compare($_[0]{release}, $r) . $o . 0) || return;
$provides{$n} = "$_[0]{name}-$_[0]{version}-$_[0]{release}";
};
rpmtools::db_traverse_tag($db, $n =~ m|^/| ? 'path' : 'whatprovides', [ $n ],
@@ -1527,7 +1550,8 @@ sub filter_packages_to_upgrade {
my $check_pkg = sub {
$o and $n eq $_[0]{name} || return;
$v and eval(rpmtools::version_compare($_[0]{version}, $v) . $o . 0) || return;
- $r and eval(rpmtools::version_compare($_[0]{release}, $r) . $o . 0) || return;
+ $r && rpmtools::version_compare($_[0]{version}, $v) == 0 and
+ eval(rpmtools::version_compare($_[0]{release}, $r) . $o . 0) || return;
$conflicts{$n}{"$_[0]{name}-$_[0]{version}-$_[0]{release}"} = 1;
$provides{$n} ||= undef;
};
@@ -1537,7 +1561,8 @@ sub filter_packages_to_upgrade {
my $pkg = $urpm->{params}{info}{$fullname};
$o and $n eq $_[0]{name} || next;
$v and eval(rpmtools::version_compare($pkg->{version}, $v) . $o . 0) || next;
- $r and eval(rpmtools::version_compare($pkg->{release}, $r) . $o . 0) || next;
+ $r && rpmtools::version_compare($pkg->{version}, $v) == 0 and
+ eval(rpmtools::version_compare($pkg->{release}, $r) . $o . 0) || next;
$conflicts{$n}{"$pkg->{name}-$pkg->{version}-$pkg->{release}"} ||= 0;
}
}
diff --git a/urpmi.spec b/urpmi.spec
index 26ed5931..3b42732b 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 3.1
-Release: 7mdk
+Release: 8mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -142,6 +142,11 @@ fi
%changelog
+* Wed Jan 16 2002 François Pons <fpons@mandrakesoft.com> 3.1-8mdk
+- improved dependencies resolution (typically XFree86 newer
+ packages).
+- removed log on uploading with curl.
+
* Tue Jan 15 2002 François Pons <fpons@mandrakesoft.com> 3.1-7mdk
- manage conflicts for dependencies resolution.
- added conflicts tag and obsoletes tag in synthesis.