Diff

Differences From Artifact [969f157ddb]:

To Artifact [01f5038438]:


   519    519   			::appfs::getindex $pathinfo(hostname)
   520    520   			::appfs::getpkgmanifest $pathinfo(hostname) $pathinfo(package_sha1)
   521    521   		}
   522    522   
   523    523   		switch -- $pathinfo(_type) {
   524    524   			"toplevel" {
   525    525   				set retval(type) directory
   526         -				set retval(childcount) 2
          526  +				set retval(childcount) [llength [getchildren $path]]
   527    527   			}
   528    528   			"sites" {
   529    529   				set check [::appfs::db onecolumn {SELECT 1 FROM packages WHERE hostname = $pathinfo(hostname);}]
   530    530   				if {$check == "1"} {
   531    531   					set retval(type) directory
   532         -					set retval(childcount) 2;
          532  +					set retval(childcount) [llength [getchildren $path]]
   533    533   				}
   534    534   			}
   535    535   			"packages" {
   536    536   				set check [::appfs::db onecolumn {SELECT 1 FROM packages WHERE hostname = $pathinfo(hostname) AND package = $pathinfo(package);}]
   537    537   				if {$check == "1"} {
   538    538   					set retval(type) directory
   539         -					set retval(childcount) 2;
          539  +					set retval(childcount) [llength [getchildren $path]]
   540    540   				}
   541    541   			}
   542    542   			"os-cpu" {
   543    543   				if {$pathinfo(os) == "platform" && $pathinfo(cpu) == ""} {
   544    544   					set retval(type) symlink
   545    545   					set retval(source) [platform::generic]
   546    546   				} else {
   547    547   					set check [::appfs::db onecolumn {
   548    548   						SELECT 1 FROM packages WHERE hostname = $pathinfo(hostname) AND package = $pathinfo(package) AND os = $pathinfo(os) AND cpuArch = $pathinfo(cpu);
   549    549   					}]
   550    550   					if {$check == "1"} {
   551    551   						set retval(type) directory
   552         -						set retval(childcount) 2;
          552  +						set retval(childcount) [llength [getchildren $path]]
   553    553   					}
   554    554   				}
   555    555   			}
   556    556   			"versions" {
   557    557   				if {$pathinfo(version) == "latest"} {
   558    558   					set retval(type) symlink
   559    559   					set retval(source) "1.0"
   560    560   				} else {
   561    561   					if {[info exists pathinfo(package_sha1)] && $pathinfo(package_sha1) != ""} {
   562    562   						set retval(type) directory
   563         -						set retval(childcount) 2;
          563  +						set retval(childcount) [llength [getchildren $path]]
   564    564   					}
   565    565   				}
   566    566   			}
   567    567   			"files" {
   568    568   				set retval(packaged) 1
   569    569   
   570    570   				set localpath [_localpath $pathinfo(package) $pathinfo(hostname) $pathinfo(file)]
................................................................................
   580    580   							file lstat $localpath localpathinfo
   581    581   						}
   582    582   						set retval(time) $localpathinfo(mtime)
   583    583   
   584    584   						switch -- $localpathinfo(type) {
   585    585   							"directory" {
   586    586   								set retval(type) "directory"
   587         -								set retval(childcount) 2
          587  +								set retval(childcount) [llength [getchildren $path]]
   588    588   							}
   589    589   							"file" {
   590    590   								set retval(type) "file"
   591    591   								set retval(size) $localpathinfo(size)
   592    592   								_as_user {
   593    593   									if {[file executable $localpath]} {
   594    594   										set retval(perms) "x"
................................................................................
   619    619   						set retval(is_remotefile) 1
   620    620   
   621    621   						set work [split $pathinfo(file) "/"]
   622    622   						set directory [join [lrange $work 0 end-1] "/"]
   623    623   						set file [lindex $work end]
   624    624   
   625    625   						if {$directory == "" && $file == ""} {
   626         -							array set retval [list type directory childcount 2]
          626  +							array set retval [list type directory childcount [llength [getchildren $path]]]
   627    627   						}
   628    628   
   629    629   						::appfs::db eval {SELECT type, time, source, size, perms FROM files WHERE package_sha1 = $pathinfo(package_sha1) AND file_directory = $directory AND file_name = $file;} retval {}
   630    630   						unset -nocomplain retval(*)
   631    631   					}
   632    632   				}
   633    633