diff options
author | Francois Pons <fpons@mandriva.com> | 2003-12-05 20:01:15 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-12-05 20:01:15 +0000 |
commit | 5d034413d1804079456b89690c3dd9ef55b81b58 (patch) | |
tree | ad064421ef6dbaac3deae20fafde00d045c7c90b /urpm.pm | |
parent | 3ca9398a892c9aeab4cb8892bb3e8c3a8d74530a (diff) | |
download | urpmi-5d034413d1804079456b89690c3dd9ef55b81b58.tar urpmi-5d034413d1804079456b89690c3dd9ef55b81b58.tar.gz urpmi-5d034413d1804079456b89690c3dd9ef55b81b58.tar.bz2 urpmi-5d034413d1804079456b89690c3dd9ef55b81b58.tar.xz urpmi-5d034413d1804079456b89690c3dd9ef55b81b58.zip |
try to improve rpm based package being upgraded and causing urpmi to be restarted.
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -2383,6 +2383,7 @@ sub search_packages { #- do the resolution of dependencies. sub resolve_dependencies { my ($urpm, $state, $requested, %options) = @_; + my $need_restart = 0; if ($options{install_src}) { #- only src will be installed, so only update $state->{selected} according @@ -2421,27 +2422,32 @@ sub resolve_dependencies { #- auto select package for upgrading the distribution. $options{auto_select} and $urpm->request_packages_to_upgrade($db, $state, $requested, requested => undef); - $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 %{$state->{selected}}) { + foreach (keys %$requested) { 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... + #- clean state as we found priority packages, + #- no --auto-select should be done though here... %$state = (); - $urpm->resolve_requested($db, $state, \%priority_requested, %options); + %$requested = %priority_requested; + $need_restart = 1; } } + + $urpm->resolve_requested($db, $state, $requested, %options); } + + #- allow caller to know if it should try to restart. + $need_restart; } sub create_transaction { |