- unless (@$files) { print "\t<tr>\n\t\t<th colspan='8'>$Lang::tr{'updxlrtr empty repository'}.</th>\n\t</tr>\n"; }
- else {
- $id = 0;
- foreach $updatefile (@$files) {
- $updatefile =~ s/.*://;
- my $size_updatefile = 0;
- my $mtime = 0;
- if(-e "$repository/$updatefile") {
- $size_updatefile = (-s "$repository/$updatefile");
- $mtime = &getmtime("$repository/$updatefile");
- }
- print "\t<tr>\n";
- $filesize = &format_size($size_updatefile);
- my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime);
- $DAYdt = sprintf ("%.02d",$DAYdt);
- $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
- $YEARdt = sprintf ("%.04d",$YEARdt+1900);
- $filedate = $DAYdt.".".$MONTHdt.".".$YEARdt;
- $lastaccess = "n/a";
- $lastcheck = "n/a";
- $status = $sfUnknown;
- unless ($updatefile =~ /^download\//) {
- ($vendorid,$uuid,$shortname) = split('/',$updatefile);
- if (-e "$repository/$vendorid/$uuid/access.log") {
- open (FILE,"$repository/$vendorid/$uuid/access.log");
- @metadata = <FILE>;
- close(FILE);
- chomp @metadata;
- ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]);
- $DAYdt = sprintf ("%.02d",$DAYdt);
- $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
- $YEARdt = sprintf ("%.04d",$YEARdt+1900);
- if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1))
- { $lastaccess = $DAYdt.".".$MONTHdt.".".$YEARdt; }
- }
- if (-e "$repository/$vendorid/$uuid/checkup.log") {
- open (FILE,"$repository/$vendorid/$uuid/checkup.log");
- @metadata = <FILE>;
- close(FILE);
- chomp @metadata;
- ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]);
- $DAYdt = sprintf ("%.02d",$DAYdt);
- $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
- $YEARdt = sprintf ("%.04d",$YEARdt+1900);
- if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1))
- { $lastcheck = $DAYdt.".".$MONTHdt.".".$YEARdt; }
- }
- if (-e "$repository/$vendorid/$uuid/status") {
- open (FILE,"$repository/$vendorid/$uuid/status");
- @metadata = <FILE>;
- close(FILE);
- chomp @metadata;
- $status = $metadata[-1];
- }
- }
- else {
- ($uuid,$vendorid,$shortname) = split('/',$updatefile);
- $status = $sfOutdated;
- }
-
- if ($status == $sfUnknown)
- { print "\t\t<th><span id='ledgy$id' class='symbols' title='$Lang::tr{'updxlrtr condition unknown'}'> </span></th>\n"; }
- elsif ($status == $sfOk)
- { print "\t\t<th><span id='ledgr$id' class='symbols' title='$Lang::tr{'updxlrtr condition ok'}'></span> </th>\n"; }
- elsif ($status == $sfNoSource)
- { print "\t\t<th><span id='ledye$id' class='symbols' title='$Lang::tr{'updxlrtr condition nosource'}'> </span></th>\n"; }
- elsif (($status == $sfOutdated) && (!($updatefile =~ /^download\//i)))
- { print "\t\t<th><span id='ledrd$id' class='symbols' title='$Lang::tr{'updxlrtr condition outdated'}'> </span></th>\n"; }
- elsif (($status == $sfOutdated) && ($updatefile =~ /^download\//i))
- { print "\t\t<th><span id='ledbl$id' class='symbols' title='$Lang::tr{'updxlrtr condition download'}'> </span></th>\n"; }
- if ($vendimg{$vendorid}) {
- print "\t\t<th><span class='vendimg' style='background-image: url($vendimg{$vendorid});' title='".ucfirst $vendorid."'> </span></th>\n"; }
- else {
- print "\t\t<th><span class='vendimg' style='background-image: url($vendimg{unknown});' title='".ucfirst $vendorid."'> </span></th>\n";
- }
- $shortname = substr($updatefile,rindex($updatefile,"/")+1);
- unless ($vendorid ne 'microsoft') { $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1\[...\] $2/i; }
- unless (length($shortname) <= 50) {
- my $fext = substr($shortname,rindex("$shortname",'.'));
- $shortname = substr($shortname,0,44-length($fext));
- $shortname .= "[...] $fext";
- }
- print <<END
- <td title='cache:/$updatefile'><a href="/updatecache/$updatefile">$shortname</a></td>
- <td>$filesize</td>
- <td>$filedate</td>
- <td>$lastaccess</td>
- <td>$lastcheck</td>
- <th><input id='frm$id' type='checkbox' name='TODELETE' value='$updatefile' title='$Lang::tr{'updxlrtr remove file'}' /></th>
- </tr>