summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-12-14 10:57:22 +0000
committerFrancois Pons <fpons@mandriva.com>2003-12-14 10:57:22 +0000
commitb3de50154ae08824a1f96ada67d49f0f81b8cbc9 (patch)
tree0c066436a0badd6fe2aa59731f3359f3159e4394 /urpm.pm
parent0fd2423d5586fcf17d1908b4bd943cdbab31b073 (diff)
downloadurpmi-b3de50154ae08824a1f96ada67d49f0f81b8cbc9.tar
urpmi-b3de50154ae08824a1f96ada67d49f0f81b8cbc9.tar.gz
urpmi-b3de50154ae08824a1f96ada67d49f0f81b8cbc9.tar.bz2
urpmi-b3de50154ae08824a1f96ada67d49f0f81b8cbc9.tar.xz
urpmi-b3de50154ae08824a1f96ada67d49f0f81b8cbc9.zip
consolidated restart status to detect problems related as loop, improper fetching.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm28
1 files changed, 18 insertions, 10 deletions
diff --git a/urpm.pm b/urpm.pm
index d515e167..11bc9fee 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1084,7 +1084,7 @@ sub select_media {
sub remove_selected_media {
my ($urpm) = @_;
my @result;
-
+
foreach (@{$urpm->{media}}) {
if ($_->{modified}) {
$urpm->{log}(N("removing medium \"%s\"", $_->{name}));
@@ -2382,7 +2382,7 @@ sub search_packages {
#- do the resolution of dependencies.
sub resolve_dependencies {
my ($urpm, $state, $requested, %options) = @_;
- my $need_restart = 0;
+ my $need_restart;
if ($options{install_src}) {
#- only src will be installed, so only update $state->{selected} according
@@ -2421,28 +2421,36 @@ sub resolve_dependencies {
#- auto select package for upgrading the distribution.
$options{auto_select} and $urpm->request_packages_to_upgrade($db, $state, $requested, requested => undef);
+ #- resolve dependencies which will be examined for packages needed to
+ #- updated with a restart needed.
+ $urpm->resolve_requested($db, $state, $requested, %options);
+
if ($options{priority_upgrade} && !$options{rpmdb}) {
my (%priority_upgrade, %priority_requested);
@priority_upgrade{split ',', $options{priority_upgrade}} = ();
#- try to find if a priority upgrade should be tried, this is erwan feature he waited for months :)
#- this can be also considered as a special gift...
- foreach (keys %$requested) {
+ foreach (keys %{$state->{selected}}) {
my $pkg = $urpm->{depslist}[$_] or next;
exists $priority_upgrade{$pkg->name} or next;
$priority_requested{$pkg->id} = undef;
}
if (%priority_requested) {
- #- clean state as we found priority packages,
- #- no --auto-select should be done though here...
- %$state = ();
- %$requested = %priority_requested;
- $need_restart = 1;
+ my %priority_state;
+
+ $urpm->resolve_requested($db, \%priority_state, \%priority_requested, %options);
+ if (grep { ! exists $priority_state{$_} } keys %priority_requested) {
+ #- some packages which were selected previously have not been selected, strange!
+ $need_restart = 0;
+ } elsif (grep {! exists $priority_state{$_} } keys %{$state->{selected}}) {
+ #- there are other packages to install after this priority transaction.
+ %$state = %priority_state;
+ $need_restart = 1;
+ }
}
}
-
- $urpm->resolve_requested($db, $state, $requested, %options);
}
#- allow caller to know if it should try to restart.