diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-03-20 15:20:30 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-03-20 15:20:30 +0000 |
commit | d29cf6995bbd5bddbf1334466f92f4f80c6bb2da (patch) | |
tree | 7f6f858e21e83e64b8f3c23ca50afe52dc99c955 /mdkapplet | |
parent | 076738e8ff706e9db94125a43bffb70f5074e054 (diff) | |
download | mgaonline-d29cf6995bbd5bddbf1334466f92f4f80c6bb2da.tar mgaonline-d29cf6995bbd5bddbf1334466f92f4f80c6bb2da.tar.gz mgaonline-d29cf6995bbd5bddbf1334466f92f4f80c6bb2da.tar.bz2 mgaonline-d29cf6995bbd5bddbf1334466f92f4f80c6bb2da.tar.xz mgaonline-d29cf6995bbd5bddbf1334466f92f4f80c6bb2da.zip |
(silentCheck) add two new states that enable mdkapplet to warn when
there's no media at all or when all update media are disabled"
Diffstat (limited to 'mdkapplet')
-rwxr-xr-x | mdkapplet | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -137,7 +137,24 @@ my %state = ( changes => [ 'okay', 'busy', 'critical', 'error' ], menu => [ 'weblink' ], tt => [ N_("Release not supported (too old release, or development release)") ] - } + }, + no_update_medium => { + colour => [ 'noconf' ], + changes => [ 'okay', 'busy', 'critical', 'disconnected' ], + menu => [ 'configureApplet', 'check', 'weblink' ], + tt => [ N_("No medium found. You must add some media through 'Software Media Manager'.") ], + }, + no_enabled_medium => { + colour => [ 'noconf' ], + changes => [ 'okay', 'busy', 'critical', 'disconnected' ], + menu => [ 'configureApplet', 'check', 'weblink' ], + tt => [ sprintf(N_("You already have at least one update medium configured, but +all of them are currently disabled. You should run the Software +Media Manager to enable at least one (check it in the Enabled? +column). + +Then, restart %s.", 'mdkapplet'), 'mdkapplet') ], + }, ); my %actions = ( @@ -348,6 +365,16 @@ sub silentCheck() { require urpm::media; $urpm = urpm->new; urpm::media::configure($urpm); + my @update_medias = grep { $_->{update} } @{$urpm->{media}}; + if (!@update_medias) { + logIt("no update media configured"); + go2State('no_update_medium'); + return; + } elsif (!grep { ! $_->{ignore} } @update_medias) { + logIt("all update media are disabled"); + go2State('no_enabled_medium'); + return; + } logIt(N("Computing new updates...\n")); |