@@ -677,10 +677,12 @@ catch { ::appfs::getindex $pathinfo(hostname) ::appfs::getpkgmanifest $pathinfo(hostname) $pathinfo(package_sha1) } + set retval(path_type) $pathinfo(_type) + switch -- $pathinfo(_type) { "toplevel" { set retval(type) directory set retval(childcount) [llength [getchildren $path]] } @@ -754,10 +756,11 @@ } } if {$localpath != "" && [info exists localpathinfo]} { set retval(is_localfile) 1 + unset retval(packaged) catch { set retval(time) $localpathinfo(mtime) switch -- $localpathinfo(type) { "directory" { @@ -839,11 +842,11 @@ proc openpath {path mode} { array set pathinfo [_parsepath $path] if {$pathinfo(_type) != "files"} { - return -code error "invalid type" + return -code error "invalid path type: Got \"$pathinfo(_type)\", need \"files\"" } set localpath [_localpath $pathinfo(package) $pathinfo(hostname) $pathinfo(file)] if {$mode == "create"} { @@ -903,11 +906,11 @@ proc localpath {path} { array set pathinfo [_parsepath $path] if {$pathinfo(_type) != "files"} { - return -code error "invalid type" + return -code error "invalid path type: Got \"$pathinfo(_type)\", need \"files\"" } set localpath [_localpath $pathinfo(package) $pathinfo(hostname) $pathinfo(file)] return $localpath @@ -952,12 +955,12 @@ } proc unlinkpath {path} { array set pathattrs [exists $path] - if {![info exists pathattrs(packaged)]} { - return -code error "invalid type" + if {$pathattrs(path_type) != "files"} { + return -code error "invalid path type: can only delete type \"files\" this is type \"$pathattrs(path_type)\"" } set localpath $pathattrs(localpath) if {$localpath == ""} {