Index: appfsd.tcl ================================================================== --- appfsd.tcl +++ appfsd.tcl @@ -521,24 +521,24 @@ } switch -- $pathinfo(_type) { "toplevel" { set retval(type) directory - set retval(childcount) 2 + set retval(childcount) [llength [getchildren $path]] } "sites" { set check [::appfs::db onecolumn {SELECT 1 FROM packages WHERE hostname = $pathinfo(hostname);}] if {$check == "1"} { set retval(type) directory - set retval(childcount) 2; + set retval(childcount) [llength [getchildren $path]] } } "packages" { set check [::appfs::db onecolumn {SELECT 1 FROM packages WHERE hostname = $pathinfo(hostname) AND package = $pathinfo(package);}] if {$check == "1"} { set retval(type) directory - set retval(childcount) 2; + set retval(childcount) [llength [getchildren $path]] } } "os-cpu" { if {$pathinfo(os) == "platform" && $pathinfo(cpu) == ""} { set retval(type) symlink @@ -547,11 +547,11 @@ set check [::appfs::db onecolumn { SELECT 1 FROM packages WHERE hostname = $pathinfo(hostname) AND package = $pathinfo(package) AND os = $pathinfo(os) AND cpuArch = $pathinfo(cpu); }] if {$check == "1"} { set retval(type) directory - set retval(childcount) 2; + set retval(childcount) [llength [getchildren $path]] } } } "versions" { if {$pathinfo(version) == "latest"} { @@ -558,11 +558,11 @@ set retval(type) symlink set retval(source) "1.0" } else { if {[info exists pathinfo(package_sha1)] && $pathinfo(package_sha1) != ""} { set retval(type) directory - set retval(childcount) 2; + set retval(childcount) [llength [getchildren $path]] } } } "files" { set retval(packaged) 1 @@ -582,11 +582,11 @@ set retval(time) $localpathinfo(mtime) switch -- $localpathinfo(type) { "directory" { set retval(type) "directory" - set retval(childcount) 2 + set retval(childcount) [llength [getchildren $path]] } "file" { set retval(type) "file" set retval(size) $localpathinfo(size) _as_user { @@ -621,11 +621,11 @@ set work [split $pathinfo(file) "/"] set directory [join [lrange $work 0 end-1] "/"] set file [lindex $work end] if {$directory == "" && $file == ""} { - array set retval [list type directory childcount 2] + array set retval [list type directory childcount [llength [getchildren $path]]] } ::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 {} unset -nocomplain retval(*) }