diff options
author | Daouda Lo <daouda@mandriva.com> | 2004-03-15 21:58:21 +0000 |
---|---|---|
committer | Daouda Lo <daouda@mandriva.com> | 2004-03-15 21:58:21 +0000 |
commit | 13714d49e1d0a8e975e176bd66a7e3e8203a7432 (patch) | |
tree | d1411833c482a23030bc0679be6a835670cb464e /mdkapplet | |
parent | 453f8f98fe4aea713cc7a02fa8faf4d0bf02983e (diff) | |
download | mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.tar mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.tar.gz mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.tar.bz2 mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.tar.xz mgaonline-13714d49e1d0a8e975e176bd66a7e3e8203a7432.zip |
- new algo to circumvent check fail
Diffstat (limited to 'mdkapplet')
-rwxr-xr-x | mdkapplet | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -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 { |