From: <ow...@us...> - 2009-12-12 19:26:35
|
Revision: 3982 http://ipcop.svn.sourceforge.net/ipcop/?rev=3982&view=rev Author: owes Date: 2009-12-12 19:26:27 +0000 (Sat, 12 Dec 2009) Log Message: ----------- Only zap the available patches list if we have Internet connection. Helps when trying to do offline upgrades. Modified Paths: -------------- ipcop/trunk/html/cgi-bin/updates.cgi Modified: ipcop/trunk/html/cgi-bin/updates.cgi =================================================================== --- ipcop/trunk/html/cgi-bin/updates.cgi 2009-12-12 19:24:14 UTC (rev 3981) +++ ipcop/trunk/html/cgi-bin/updates.cgi 2009-12-12 19:26:27 UTC (rev 3982) @@ -120,9 +120,12 @@ unlink("/var/patches/${filename}"); } elsif ($uploadsettings{'ACTION'} eq $Lang::tr{'refresh update list'}) { - # Start gathering the information from scratch - system('/bin/echo -e "<ipcop>\n</ipcop>" > /var/ipcop/patches/available.xml'); - my $return = &General::downloadpatchlist(); + my $return = 1; + if (-e '/var/ipcop/red/active') { + # Start gathering the information from scratch, do not zap the list if offline + system('/bin/echo -e "<ipcop>\n</ipcop>" > /var/ipcop/patches/available.xml'); + $return = &General::downloadpatchlist(); + } if ($return == 0) { &General::log("installpackage", $Lang::tr{'successfully refreshed updates list'}); } @@ -235,7 +238,7 @@ my $done = 0; my $version = $available->{"update-${General::version}"}->{nextversion}; - while (($number < 10) && ! $done) { + while (($version ne "") && ($number < 10) && ! $done) { my $filename = "ipcop-${version}-update.${General::machine}.tgz.gpg"; my @signature = (''); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |