aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM/Resolve.pm23
-rw-r--r--perl-URPM.spec9
2 files changed, 21 insertions, 11 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index b1f66d3..8370249 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -219,7 +219,8 @@ sub backtrack_selected {
dep => $dep, alternatives => $packages, %options) <= 0) {
#- keep in mind a backtrack has happening here...
$state->{rejected}{$_->fullname}{backtrack} ||=
- { exists $dep->{promote} ? (promote => $dep->{promote}) : @{[]} };
+ { exists $dep->{promote} ? (promote => $dep->{promote}) : @{[]},
+ exists $dep->{psel} ? (psel => $dep->{psel}) : @{[]} };
#- backtrack callback should return a strictly positive value if the selection of the new
#- package is prefered over the currently selected package.
next;
@@ -518,7 +519,7 @@ sub resolve_requested {
@{$packages->{$p->name}};
if (length $best) {
- push @properties, { required => $best, promote => $n };
+ push @properties, { required => $best, promote => $n, psel => $pkg };
} else {
#- no package have been found, we may need to remove the package examined unless
#- there exists a package that provided the unsatisfied requires.
@@ -535,7 +536,7 @@ sub resolve_requested {
}
if (@best == @l) {
- push @properties, map { +{ required => $_, promote => $n } } @best;
+ push @properties, map { +{ required => $_, promote => $n, psel => $pkg } } @best;
} else {
$urpm->resolve_rejected($db, $state, $p,
removed => 1, unsatisfied => \@properties,
@@ -968,6 +969,9 @@ sub has_dependence {
sub build_transaction_set {
my ($urpm, $db, $state, %options) = @_;
+ #- clean transaction set.
+ $state->{transaction} = [];
+
if ($options{split_length}) {
#- first step consists of sorting packages according to dependencies.
my @sorted = sort { ($a <=> $b, -1, +1, 0)[($urpm->has_dependence($state, $a, $b) && 1) +
@@ -1005,13 +1009,12 @@ sub build_transaction_set {
%set and push @{$state->{transaction}}, \%set;
}
}
- } else {
- #- no split is necessary, simply extract from current selection.
- $state->{transaction} = [ {
- upgrade => [ keys %{$state->{selected}} ],
- remove => [ grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} }
- keys %{$state->{rejected}} ],
- } ];
+ } elsif (%{$state->{selected} || {}} || %{$state->{rejected} || {}}) {
+ push @{$state->{transaction}}, {
+ upgrade => [ keys %{$state->{selected}} ],
+ remove => [ grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} }
+ keys %{$state->{rejected}} ],
+ };
}
$state->{transaction};
diff --git a/perl-URPM.spec b/perl-URPM.spec
index 468a69a..31f79de 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 5mdk
+%define release 6mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -51,6 +51,13 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Thu Jun 19 2003 François Pons <fpons@mandrakesoft.com> 0.91-6mdk
+- make sure callback options are taken into account only if a
+ reference is given.
+- make sure URPM::build_transaction_set do not create empty
+ transaction.
+- added source of promotion selection.
+
* Thu Jun 19 2003 François Pons <fpons@mandrakesoft.com> 0.91-5mdk
- added promote to backtrack data for more info.
- fixed visual glitches when a package has its selection backtracked