Diff

Differences From Artifact [2a6db15ed4]:

To Artifact [bfe8021807]:


   473    473   				return $retval
   474    474   			}
   475    475   			"versions" {
   476    476   				set retval [::appfs::db eval {
   477    477   					SELECT DISTINCT version FROM packages WHERE hostname = $pathinfo(hostname) AND package = $pathinfo(package) AND os = $pathinfo(os) AND cpuArch = $pathinfo(cpu);
   478    478   				}]
   479    479   
   480         -				lappend retval "latest"
          480  +				::appfs::db eval {SELECT version FROM packages WHERE isLatest = 1 AND hostname = $pathinfo(hostname) AND package = $pathinfo(package) AND os = $pathinfo(os) AND cpuArch = $pathinfo(cpu) LIMIT 1;} latest_info {}
          481  +
          482  +				if {[info exists latest_info(version)]} {
          483  +					lappend retval "latest"
          484  +				}
   481    485   
   482    486   				return $retval
   483    487   			}
   484    488   			"files" {
   485    489   				catch {
   486    490   					::appfs::getpkgmanifest $pathinfo(hostname) $pathinfo(package_sha1)
   487    491   				}
................................................................................
   570    574   						set retval(type) directory
   571    575   						set retval(childcount) [llength [getchildren $path]]
   572    576   					}
   573    577   				}
   574    578   			}
   575    579   			"versions" {
   576    580   				if {$pathinfo(version) == "latest"} {
   577         -					set retval(type) symlink
   578         -					set retval(source) "1.0"
          581  +					::appfs::db eval {SELECT version FROM packages WHERE isLatest = 1 AND hostname = $pathinfo(hostname) AND package = $pathinfo(package) AND os = $pathinfo(os) AND cpuArch = $pathinfo(cpu) LIMIT 1;} latest_info {}
          582  +
          583  +					if {[info exists latest_info(version)]} {
          584  +						set retval(type) symlink
          585  +						set retval(source) $latest_info(version)
          586  +					}
   579    587   				} else {
   580    588   					if {[info exists pathinfo(package_sha1)] && $pathinfo(package_sha1) != ""} {
   581    589   						set retval(type) directory
   582    590   						set retval(childcount) [llength [getchildren $path]]
   583    591   					}
   584    592   				}
   585    593   			}