diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-11-19 16:57:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-11-19 16:57:27 +0000 |
commit | c1f8de32e005e1fb103c57995e216f8593a68a1e (patch) | |
tree | 46885a511ce5a7d748885090e633c22c3f8d879a | |
parent | 5b22496d75ea1d65a97d65bac2a416473b665684 (diff) | |
download | mgaonline-c1f8de32e005e1fb103c57995e216f8593a68a1e.tar mgaonline-c1f8de32e005e1fb103c57995e216f8593a68a1e.tar.gz mgaonline-c1f8de32e005e1fb103c57995e216f8593a68a1e.tar.bz2 mgaonline-c1f8de32e005e1fb103c57995e216f8593a68a1e.tar.xz mgaonline-c1f8de32e005e1fb103c57995e216f8593a68a1e.zip |
(silentCheck) prevent checker process from crashing on 2008.1 and 2009.0
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | mdkapplet | 12 |
2 files changed, 11 insertions, 2 deletions
@@ -1,6 +1,7 @@ - mdkapplet o add mdkonline version to distribution list requests o log crashes of mdkapplet checker process + o prevent checker process from crashing on 2008.1 and 2009.0 Version 2.77.9 - 10 November 2009, Thierry Vignaud @@ -578,7 +578,9 @@ sub silentCheck() { } checker_exit('locked') if $will_not_update_media; - my $is_it_a_devel_distro = is_it_a_devel_distro(); + # prevent crashing on 2008.1 and 2009.0: + my $is_it_a_devel_distro = eval { is_it_a_devel_distro() }; + my $media = $is_it_a_devel_distro ? '-a' : '--update'; if (!run_program::run('urpmi.update', $media, if_($root, "--urpmi-root=$root"))) { checker_exit('error_updating') if $will_not_update_media; @@ -594,7 +596,13 @@ sub silentCheck() { # this eats 52Mb of RAM on 64bit: # (hence we do it in the forked helper so that the applet doesn't eat too much RAM) urpm::media::configure($urpm, if_(!$is_it_a_devel_distro, update => 1)); - my @update_medias = get_update_medias($urpm); + + # prevent crashing on 2008.1 and 2009.0: + my @update_medias = eval { get_update_medias($urpm) }; + if ($@) { + @update_medias = grep { $_->{update} } @{$urpm->{media}}; + } + if (!@update_medias) { get_product_id(); if ($product_id->{type} eq 'Enterprise' && $product_id->{product} eq 'Server') { |