summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-20 15:20:30 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-20 15:20:30 +0000
commitd29cf6995bbd5bddbf1334466f92f4f80c6bb2da (patch)
tree7f6f858e21e83e64b8f3c23ca50afe52dc99c955
parent076738e8ff706e9db94125a43bffb70f5074e054 (diff)
downloadmgaonline-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"
-rwxr-xr-xmdkapplet29
1 files changed, 28 insertions, 1 deletions
diff --git a/mdkapplet b/mdkapplet
index 1649fb2c..de2b7fc8 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -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"));