X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fupdatexlrator.cgi;h=c94c34ec1e6e8f7b4e607513bf798b7d8d549967;hp=147be8e5eb1fdfe89447d0b2fccd50344b91bc43;hb=56947acb12176f397cbd5078c5544cdc4f19b27b;hpb=75842d01ba4f57aa4a67089fcaa218abad74c334 diff --git a/html/cgi-bin/updatexlrator.cgi b/html/cgi-bin/updatexlrator.cgi index 147be8e5eb..c94c34ec1e 100644 --- a/html/cgi-bin/updatexlrator.cgi +++ b/html/cgi-bin/updatexlrator.cgi @@ -27,6 +27,11 @@ # along with this program. If not, see . # # # ############################################################################### +# +# Changelog: +# 2012-10-27: nightshift - Bugfix regarding showing wrong vendor icon while Download of new Updates +# 2012-10-27: nightshift - Optimizing logic of check for vendor icons +# use strict; @@ -75,6 +80,7 @@ my @vendors=(); my %vendorstats=(); my $repository = "/var/updatecache/"; +my $webhome = "/srv/web/ipfire/html"; my $hintcolour = '#FFFFCC'; my $colourgray = '#808080'; @@ -94,10 +100,6 @@ my @downloadfiles=(); my @metadata=(); -my $chk_cron_dly = "${General::swroot}/updatexlrator/autocheck/cron.daily"; -my $chk_cron_wly = "${General::swroot}/updatexlrator/autocheck/cron.weekly"; -my $chk_cron_mly = "${General::swroot}/updatexlrator/autocheck/cron.monthly"; - &General::readhash("${General::swroot}/ethernet/settings", \%netsettings); &General::readhash("${General::swroot}/main/settings", \%mainsettings); &General::readhash("${General::swroot}/proxy/settings", \%proxysettings); @@ -395,7 +397,7 @@ print < $Lang::tr{'updxlrtr passive mode'}: - $Lang::tr{'updxlrtr max disk usage'}: + $Lang::tr{'updxlrtr max disk usage'}: * % @@ -407,7 +409,7 @@ print < $Lang::tr{'updxlrtr low download priority'}: - $Lang::tr{'updxlrtr max download rate'}: * + $Lang::tr{'updxlrtr max download rate'}: @@ -515,7 +517,7 @@ END $id = 0; foreach $updatefile (@downloadfiles) { - $updatefile =~ s/.*://; + $updatefile =~ s/.*:download/download/; my $size_updatefile = 0; my $mtime = 0; if(-e "$repository/$updatefile") { @@ -553,46 +555,23 @@ END print "$Lang::tr{ \n"; } - print "\t\t "; - if ($vendorid =~ /^Adobe$/i) - { - print "Adobe \n"; - } elsif ($vendorid =~ /^Microsoft$/i) - { - print "Microsoft \n"; - } elsif ($vendorid =~ /^Symantec$/i) - { - print "Symantec \n"; - } elsif ($vendorid =~ /^Linux$/i) - { - print "Linux \n"; - } elsif ($vendorid =~ /^TrendMicro$/i) - { - print "Trend Micro \n"; - } elsif ($vendorid =~ /^Apple$/i) - { - print "Apple \n"; - } elsif ($vendorid =~ /^Avast$/i) - { - print "Avast \n"; - } else - { - if (-e "/home/httpd/html/images/updbooster/updxl-src-" . $vendorid . ".gif") - { - print "" . ucfirst $vendorid . " \n"; - } else { - print "" . ucfirst $vendorid . " \n"; - } - } + print "\t\t "; - $shortname = substr($updatefile,rindex($updatefile,"/")+1); - $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i; + if (($vendorid ne '') && (-e "$webhome/images/updbooster/updxl-src-$vendorid.gif")) + { + print "" . ucfirst $vendorid . " \n"; + } else { + print "" . ucfirst $vendorid . " \n"; + } - $filesize = $dlinfo{'REMOTESIZE'}; - 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; - $dlinfo{'VENDORID'}=ucfirst $vendorid; + $shortname = substr($updatefile,rindex($updatefile,"/")+1); + $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i; - print < $dlinfo{'VENDORID'}  $shortname  $filesize  @@ -992,7 +971,8 @@ foreach (@sources) { next if(/\.info$/); $updatefile = substr($_,rindex($_,"/")+1); - $updatefile .= ":download/$vendorid/$updatefile"; + $_ = $updatefile; tr/[A-Z]/[a-z]/; + $updatefile = "$_:separator:download/$vendorid/$updatefile"; $updatefile = " ".$updatefile; push(@repositoryfiles,$updatefile); } @@ -1023,7 +1003,7 @@ foreach (@sources) chomp($sourceurl); $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl)); $_ = $updatefile; tr/[A-Z]/[a-z]/; - $updatefile = "$_:$vendorid/$uuid/$updatefile"; + $updatefile = "$_:separator:$vendorid/$uuid/$updatefile"; push(@repositoryfiles,$updatefile); } } @@ -1166,7 +1146,7 @@ END $id = 0; foreach $updatefile (@files) { - $updatefile =~ s/.*://; + $updatefile =~ s/.*:separator://; my $size_updatefile = 0; my $mtime = 0; if(-e "$repository/$updatefile") { @@ -1366,7 +1346,7 @@ sub printlegendicons $Lang::tr{ $Lang::tr{'updxlrtr last checkup'}   - $Lang::tr{ + $Lang::tr{ $Lang::tr{'updxlrtr remove file'}     @@ -1495,27 +1475,18 @@ END sub savesettings { - if (-e $chk_cron_dly) { unlink($chk_cron_dly); } - if (-e $chk_cron_wly) { unlink($chk_cron_wly); } - if (-e $chk_cron_mly) { unlink($chk_cron_mly); } if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily')) { - symlink("../bin/checkup",$chk_cron_dly) - } else { - symlink("/bin/false",$chk_cron_dly) + system('/usr/local/bin/updxlratorctrl cron daily >/dev/null 2>&1'); } - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly')) + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly')) { - symlink("../bin/checkup",$chk_cron_wly) - } else { - symlink("/bin/false",$chk_cron_wly) + system('/usr/local/bin/updxlratorctrl cron weekly >/dev/null 2>&1'); } - if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly')) + if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly')) { - symlink("../bin/checkup",$chk_cron_mly) - } else { - symlink("/bin/false",$chk_cron_mly) + system('/usr/local/bin/updxlratorctrl cron monthly >/dev/null 2>&1'); } # don't save those variable to the settings file,