diff options
author | Francois Pons <fpons@mandriva.com> | 2003-07-07 17:28:48 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-07-07 17:28:48 +0000 |
commit | 64797c37406f2dcf3b5ae5dd4c77a40bba97cc06 (patch) | |
tree | 764b37aa307754278fccc297e02aa39268cd539c | |
parent | 9aec64a16c4ea5e8e40ca5f1b0d078bd69a8c0e0 (diff) | |
download | perl-URPM-64797c37406f2dcf3b5ae5dd4c77a40bba97cc06.tar perl-URPM-64797c37406f2dcf3b5ae5dd4c77a40bba97cc06.tar.gz perl-URPM-64797c37406f2dcf3b5ae5dd4c77a40bba97cc06.tar.bz2 perl-URPM-64797c37406f2dcf3b5ae5dd4c77a40bba97cc06.tar.xz perl-URPM-64797c37406f2dcf3b5ae5dd4c77a40bba97cc06.zip |
0.91-10mdk
-rw-r--r-- | URPM/Resolve.pm | 38 | ||||
-rw-r--r-- | perl-URPM.spec | 7 |
2 files changed, 37 insertions, 8 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 612e69c..c9eba62 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -208,6 +208,7 @@ sub unsatisfied_requires { sub backtrack_selected { my ($urpm, $db, $state, $dep, %options) = @_; + my @properties; if (defined $dep->{required}) { #- search for all possible packages, first is to try the selection, then if it is @@ -274,9 +275,24 @@ sub backtrack_selected { } } + if (defined $dep->{promote} && defined $dep->{psel}) { + #- the backtrack need to examine diff_provides promotion on $n. + $db->traverse_tag('whatrequires', [ $dep->{promote} ], sub { + my ($p) = @_; + if (my @l = $urpm->unsatisfied_requires($db, $state, $p, nopromoteepoch => 1, name => $dep->{promote})) { + #- typically a redo of the diff_provides code should be applied... + $urpm->resolve_rejected($db, $state, $p, + removed => 1, + unsatisfied => \@properties, + from => scalar $dep->{psel}->fullname, + why => { unsatisfied => \@l }); + } + }); + } + #- some packages may have been removed because of selection of this one. #- the rejected flags should have been cleaned by disable_selected above. - (); + @properties; } #- close rejected (as urpme previously) for package to be removable without error. @@ -442,6 +458,8 @@ sub resolve_requested { push @selected, $pkg; $state->{selected}{$pkg->id} = { exists $dep->{requested} ? (requested => $dep->{requested}) : @{[]}, exists $dep->{from} ? (from => $dep->{from}) : @{[]}, + exists $dep->{promote} ? (promote => $dep->{promote}) : @{[]}, + exists $dep->{psel} ? (psel => $dep->{psel}) : @{[]}, $pkg->flag_disable_obsolete ? (install => 1) : @{[]}, }; @@ -516,7 +534,7 @@ sub resolve_requested { } foreach my $n (keys %diff_provides) { - $db->traverse_tag('whatrequires', [ $n ], sub { + $db->traverse_tag('whatrequires', [ $n ], sub { my ($p) = @_; if (my @l = $urpm->unsatisfied_requires($db, $state, $p, nopromoteepoch => 1, name => $n)) { #- try if upgrading the package will be satisfying all the requires... @@ -549,8 +567,10 @@ sub resolve_requested { push @properties, map { +{ required => $_, promote => $n, psel => $pkg } } @best; } else { $urpm->resolve_rejected($db, $state, $p, - removed => 1, unsatisfied => \@properties, - from => scalar $pkg->fullname, why => { unsatisfied => \@l }); + removed => 1, + unsatisfied => \@properties, + from => scalar $pkg->fullname, + why => { unsatisfied => \@l }); } } } @@ -559,7 +579,10 @@ sub resolve_requested { } #- all requires should be satisfied according to selected package, or installed packages. - push @properties, map { +{ required => $_, from => $pkg } } $urpm->unsatisfied_requires($db, $state, $pkg); + push @properties, map { +{ required => $_, from => $pkg, + exists $dep->{promote} ? (promote => $dep->{promote}) : @{[]}, + exists $dep->{psel} ? (psel => $dep->{psel}) : @{[]}, + } } $urpm->unsatisfied_requires($db, $state, $pkg); #- keep in mind what is requiring each item (for unselect to work). foreach ($pkg->requires_nosense) { @@ -706,7 +729,8 @@ sub disable_selected_unrequested_dependencies { foreach ($_->requires_nosense) { foreach (keys %{$urpm->{provides}{$_} || {}}) { my $pkg = $urpm->{depslist}[$_] or next; - exists $state->{selected}{$pkg->id} or next; + $state->{selected}{$pkg->id} or next; + $state->{selected}{$pkg->id}{psel} && $state->{selected}{$state->{selected}{$pkg->id}{psel}->id} and next; $pkg->flag_requested and next; $required{$pkg->id} = undef; } @@ -720,7 +744,7 @@ sub disable_selected_unrequested_dependencies { foreach (keys %{$state->{whatrequires}{$_} || {}}) { my $p = $urpm->{depslist}[$_] or next; exists $required{$p->id} and next; - exists $state->{selected}{$p->id} and $required{$pkg->id} = 1; + $state->{selected}{$p->id} and $required{$pkg->id} = 1; } } } diff --git a/perl-URPM.spec b/perl-URPM.spec index 1948515..5c91790 100644 --- a/perl-URPM.spec +++ b/perl-URPM.spec @@ -1,7 +1,7 @@ %define name perl-URPM %define real_name URPM %define version 0.91 -%define release 9mdk +%define release 10mdk %{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)} @@ -51,6 +51,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jul 7 2003 François Pons <fpons@mandrakesoft.com> 0.91-10mdk +- fixed backtracking not applied on promotion which now ends + up in removing the initial packages. +- promote and psel are propagated into selected hash. + * Mon Jul 7 2003 François Pons <fpons@mandrakesoft.com> 0.91-9mdk - fixed provides from package not examined for looking into unsatisfied requires. |