diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-03-05 00:16:30 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-03-05 00:16:30 +0000 |
commit | 038160752b70234dacab8204f6546964bf2d826d (patch) | |
tree | 0abad2236a91e3d5c71b2ad377c46da6e754ab50 | |
parent | 3f32cd321a2e53629350c8bb3f88654c7d2054a9 (diff) | |
download | mgaonline-038160752b70234dacab8204f6546964bf2d826d.tar mgaonline-038160752b70234dacab8204f6546964bf2d826d.tar.gz mgaonline-038160752b70234dacab8204f6546964bf2d826d.tar.bz2 mgaonline-038160752b70234dacab8204f6546964bf2d826d.tar.xz mgaonline-038160752b70234dacab8204f6546964bf2d826d.zip |
(silentCheck) use more modern API to check for updates
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | mdkapplet | 15 |
2 files changed, 13 insertions, 3 deletions
@@ -1,2 +1,3 @@ - mdkapplet: o make sure notifications' text doesn't got truncated + o use more modern API to check for updates @@ -366,9 +366,18 @@ sub silentCheck() { if (my $db = urpm::db_open_or_die($urpm)) { my $requested = {}; my $state = {}; - $urpm->request_packages_to_upgrade($db, $state, $requested); - my @requested_strict = $urpm->resolve_requested($db, $state, $requested, callback_choices => sub { 0 }); - if (@requested_strict) { # FIXME: log first found pkgs? + my @requested_strict; + my $need_restart = urpm::select::resolve_dependencies( + $urpm, $state, $requested, + callback_choices => sub { 0 }, + priority_upgrade => $urpm->{options}{'priority-upgrade'}, + auto_select => 1, + resolve_req_callback => sub { + @requested_strict = sort map { scalar $_->fullname } @_; + }, + ); + + if ($need_restart || @requested_strict) { # FIXME: log first found pkgs? $exit->('updates'); } else { $exit->('uptodate'); |