From b26fea9e305277b2874e2c7118be8da1bcc4a2a9 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 4 Aug 2003 17:51:15 +0000 Subject: 0.92-4mdk --- MANIFEST | 1 + URPM/Resolve.pm | 38 +++++++++++++++++++++++++++----------- perl-URPM.spec | 7 ++++++- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/MANIFEST b/MANIFEST index 89b6a42..96e694c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -8,3 +8,4 @@ URPM/Build.pm URPM/Resolve.pm t/rpmdb.t t/synthesis.t +META.yml Module meta-data (added by MakeMaker) diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index d1144dd..9d439a4 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -546,19 +546,14 @@ sub resolve_requested { #- they must first be unselected. $state->{rejected}{$p->fullname}{closure}{$pkg->fullname} ||= undef; } - #- examine rpm db too. - $db->traverse_tag('whatprovides', [ $n ], sub { + #- examine rpm db too (but only according to packages name as a fix in rpm itself) + $db->traverse_tag('name', [ $n ], sub { my ($p) = @_; - my %provides; - - #- a provide obsoleted in not concerned by this theory. - @provides{$p->provides_nosense} = (); - delete @provides{$p->obsoletes_nosense}; - exists $provides{$n} or return; + #- without an operator, anything (with the same name) is matched. + #- with an operator, check with package EVR with the obsoletes EVR. my $satisfied = !$o || eval($p->compare($v) . $o . 0); - $n eq $p->name && $p->name eq $pkg->name && $p->fullname ne $pkg->fullname || - $satisfied or return; + $p->name eq $pkg->name && $p->fullname eq $pkg->fullname || $satisfied or return; #- do not propagate now the broken dependencies as they are #- computed later. @@ -1115,7 +1110,28 @@ sub build_transaction_set { %set and push @{$state->{transaction}}, \%set; } } - } elsif (%{$state->{selected} || {}}) { + + #- check transaction set has been correctly created, + #- possible error are other package removed which should not be the case. + if (keys(%{$state->{selected}}) == keys(%{$state->{transaction_state}{selected}}) && + (grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} } keys %{$state->{rejected}}) == + (grep { $state->{transaction_state}{rejected}{$_}{removed} && !$state->{transaction_state}{rejected}{$_}{obsoleted} } + keys %{$state->{transaction_state}{rejected}}) + ) { + foreach (keys(%{$state->{selected}})) { + exists $state->{transaction_state}{selected}{$_} and next; + $state->{transaction} = []; last; + } + foreach (grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} } keys %{$state->{rejected}}) { + $state->{transaction_state}{rejected}{$_}{removed} && + !$state->{transaction_state}{rejected}{$_}{obsoleted} and next; + $state->{transaction} = []; last; + } + } + } + + #- fallback if something can be selected but nothing has been allowed in transaction list. + if (%{$state->{selected} || {}} && !@{$state->{transaction}}) { push @{$state->{transaction}}, { upgrade => [ keys %{$state->{selected}} ], remove => [ grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} } diff --git a/perl-URPM.spec b/perl-URPM.spec index 5cf550f..50a20d6 100644 --- a/perl-URPM.spec +++ b/perl-URPM.spec @@ -1,7 +1,7 @@ %define name perl-URPM %define real_name URPM %define version 0.92 -%define release 3mdk +%define release 4mdk %{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)} @@ -51,6 +51,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Aug 4 2003 François Pons 0.92-4mdk +- sanity check on transaction set (should be the same as + normal selection, else something wrong has occured). +- updated with newer rpm with obsoletes fixed among others. + * Fri Aug 1 2003 Pixel 0.92-3mdk - rebuild for new perl (it helps DrakX build script) - use DESTDIR -- cgit v1.2.1