aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-01-23 14:29:31 +0000
committerFrancois Pons <fpons@mandriva.com>2003-01-23 14:29:31 +0000
commit16d9930415ab46e0b9101962ffce66f44f5fd794 (patch)
tree6a36e1743576fe4e8e20a6b5693d7c3f6e44f53d
parent8a90fb13057dde4edaea7c368ed30bf58e282cd4 (diff)
downloadperl-URPM-16d9930415ab46e0b9101962ffce66f44f5fd794.tar
perl-URPM-16d9930415ab46e0b9101962ffce66f44f5fd794.tar.gz
perl-URPM-16d9930415ab46e0b9101962ffce66f44f5fd794.tar.bz2
perl-URPM-16d9930415ab46e0b9101962ffce66f44f5fd794.tar.xz
perl-URPM-16d9930415ab46e0b9101962ffce66f44f5fd794.zip
0.81-7mdk
-rw-r--r--URPM/Build.pm15
-rw-r--r--URPM/Resolve.pm33
-rw-r--r--perl-URPM.spec7
3 files changed, 38 insertions, 17 deletions
diff --git a/URPM/Build.pm b/URPM/Build.pm
index 6119381..f1116e2 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -114,6 +114,11 @@ sub parse_headers {
#- callback : callback to relocate reference to package id.
sub compute_deps {
my ($urpm, %options) = @_;
+ my %propagated_weight = ( basesystem => 10000,
+ msec => 20000,
+ filesystem => 50000,
+ );
+ my ($locales_weight, $step_weight, $fixed_weight) = (-5000, 10000, $propagated_weight{basesystem});
#- avoid recomputing already present infos, take care not to modify
#- existing entries, as the array here is used instead of values of infos.
@@ -187,24 +192,24 @@ sub compute_deps {
}
my $pkg = $urpm->{depslist}[$_];
- my $delta = 1 + ($pkg->name eq 'basesystem' ? 10000 : 0) + ($pkg->name eq 'msec' ? 20000 : 0);
+ my $delta = 1 + $propagated_weight{$pkg->name};
foreach (keys %requires) {
$ordered{$_} += $delta;
}
}
#- some package should be sorted at the beginning.
- my $fixed_weight = 10000;
- foreach (qw(basesystem msec * locales filesystem setup glibc sash bash libtermcap2 termcap readline ldconfig)) {
+ foreach (qw(basesystem msec rpm locales filesystem setup glibc sash bash libtermcap2 termcap readline ldconfig)) {
foreach (keys %{$urpm->{provides}{$_} || {}}) {
/^\d+$/ and $ordered{$_} = $fixed_weight;
}
- $fixed_weight += 10000;
+ /locales/ and $locales_weight += $fixed_weight;
+ $fixed_weight += $step_weight;
}
foreach ($start .. $end) {
my $pkg = $urpm->{depslist}[$_];
- $pkg->name =~ /locales-[a-zA-Z]/ and $ordered{$_} = 35000;
+ $pkg->name =~ /locales-[a-zA-Z]/ and $ordered{$_} = $locales_weight;
}
#- compute base flag, consists of packages which are required without
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 0717e5d..32a03f4 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -86,6 +86,7 @@ sub unsatisfied_requires {
sub resolve_closure_ask_remove {
my ($urpm, $db, $state, $pkg, $from, $why) = @_;
my $name = join '-', ($pkg->fullname)[0..2]; #- specila name (without arch) to allow selection.
+ my @unsatisfied;
#- allow default value for 'from' to be taken.
$from ||= $name;
@@ -105,9 +106,17 @@ sub resolve_closure_ask_remove {
%{$state->{installed}{$_} || {}} or delete $state->{installed}{$_};
}
- #- close what requires this property.
+ #- close what requires this property, but check with selected package requiring old properties.
foreach ($pkg->provides) {
if (my ($n) = /^([^\s\[]*)/) {
+ foreach (keys %{$state->{whatrequires}{$n} || {}}) {
+ my $pkg = $urpm->{depslist}[$_] or next;
+ if (my @l = $urpm->unsatisfied_requires($db, $state, $pkg, name => $n, keep_state => 1)) {
+ #- a selected package requires something that is no more available
+ #- and should be tried to be re-selected.
+ push @unsatisfied, @l;
+ }
+ }
$db->traverse_tag('whatrequires', [ $n ], sub {
my ($p) = @_;
if (my @l = $urpm->unsatisfied_requires($db, $state, $p, name => $n, keep_state => 1)) {
@@ -128,6 +137,8 @@ sub resolve_closure_ask_remove {
} else {
$state->{ask_remove}{$name}{closure}{$from} = $why;
}
+
+ @unsatisfied;
}
#- resolve requested, keep resolution state to speed process.
@@ -279,8 +290,8 @@ sub resolve_requested {
$allow or update_state_provides($state, $pkg);
$allow = ++$state->{oldpackage};
$options{keep_state} or
- $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
- { old_requested => 1 });
+ push @properties, $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
+ { old_requested => 1 });
}
});
#- if nothing has been removed, just ignore it.
@@ -371,8 +382,8 @@ sub resolve_requested {
push @properties, @best;
} else {
$options{keep_state} or
- $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
- { unsatisfied => \@l });
+ push @properties, $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
+ { unsatisfied => \@l });
}
}
}
@@ -396,8 +407,8 @@ sub resolve_requested {
my ($p) = @_;
#- all these packages should be removed.
$options{keep_state} or
- $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
- { conflicts => $file });
+ push @properties, $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
+ { conflicts => $file });
});
} elsif (my ($property, $name) = /^(([^\s\[]*).*)/) {
$db->traverse_tag('whatprovides', [ $name ], sub {
@@ -415,8 +426,8 @@ sub resolve_requested {
} else {
#- no package have been found, we need to remove the package examined.
$options{keep_state} or
- $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
- { conflicts => $property });
+ push @properties, $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
+ { conflicts => $property });
}
}
});
@@ -440,8 +451,8 @@ sub resolve_requested {
if (grep { ranges_overlap($_, $property) } $pkg->provides) {
#- all these packages should be removed.
$options{keep_state} or
- $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
- { conflicts => $property });
+ push @properties, $urpm->resolve_closure_ask_remove($db, $state, $p, $pkg->id,
+ { conflicts => $property });
}
}
});
diff --git a/perl-URPM.spec b/perl-URPM.spec
index 144b51f..c5ac6bf 100644
--- a/perl-URPM.spec
+++ b/perl-URPM.spec
@@ -1,7 +1,7 @@
%define name perl-URPM
%define real_name URPM
%define version 0.81
-%define release 6mdk
+%define release 7mdk
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -49,6 +49,11 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Thu Jan 23 2003 François Pons <fpons@mandrakesoft.com> 0.81-7mdk
+- fixed unsatisfied requires of already selected package to
+ an installed properties which is removed later.
+- simplified weight propagation when building depslist (ordering).
+
* Mon Jan 6 2003 François Pons <fpons@mandrakesoft.com> 0.81-6mdk
- fixed avoiding package with virtual provides obsoleted by
another package as this is not a true obsoletes (openssh).