summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2004-03-15 21:58:21 +0000
committerDaouda Lo <daouda@mandriva.com>2004-03-15 21:58:21 +0000
commit13714d49e1d0a8e975e176bd66a7e3e8203a7432 (patch)
treed1411833c482a23030bc0679be6a835670cb464e
parent453f8f98fe4aea713cc7a02fa8faf4d0bf02983e (diff)
downloadmgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.tar
mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.tar.gz
mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.tar.bz2
mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.tar.xz
mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.zip
- new algo to circumvent check fail
-rwxr-xr-xmdkapplet25
1 files changed, 19 insertions, 6 deletions
diff --git a/mdkapplet b/mdkapplet
index af6ad2c3..6cbcdd4c 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -169,7 +169,7 @@ sub installUpdates {
system "/usr/sbin/mdkupdate", "--applet";
}
sub silentCheck {
- my $link = "https://www.mandrakeonline.net/online3_RemoteAction.php" . '?action=UpdateList';
+ my $link = "http://www.mandrakeonline.net/online3_RemoteAction.php" . '?action=UpdateList';
my %h = getVarsFromSh($conffile);
my $u;
require LWP::UserAgent;
@@ -192,13 +192,13 @@ sub silentCheck {
10 => sub { go2State('okay') },
11 => sub {
my @contents = sort ( split /\n/, $ct);
- my @r = sort( split /\n/, `rpm -qa` );
+ my @t = split /\n/, `rpm -qa`;
foreach my $cand (@contents) {
$cand =~ s/\.(i586|ppc|ia64).rpm//;
- $cand =~ /(.*)-(.*)$/; my ($namever, $release) = ($1, $2);
- if (member($namever, @r) && $cand ne chomp_(`rpm -q $namever`)) {
- go2State('error') and last
- }
+ $cand =~ /(.*)-(.*)-(.*)$/; my ($name, $ver, $rel) = ($1, $2, $3);
+ my $comp = compareWithInstalled($name, $ver, $rel, \@t);
+ $comp and go2State('error');
+ $comp and last;
}
},
97 => sub { go2State('disabled'); },
@@ -207,6 +207,19 @@ sub silentCheck {
};
$retcode->{$u}->();
}
+sub compareWithInstalled {
+ my ($name, $ver, $rel, $t) = @_;
+ my $isUpdate = 0;
+ foreach my $p (@{$t}) {
+ $p =~ /(.*)-(.*)-(.*)$/;
+ if ($name eq $1 ) {
+ if ($ver ne $2 || $rel ne $3) {
+ $isUpdate = 1 and last;
+ }
+ }
+ }
+ $isUpdate
+}
sub cronUpdate {
my ($to) = shift;
$timeout = Glib::Timeout->add(60*60*1000, sub {