Diff

Differences From Artifact [a394650d8e]:

To Artifact [e7e131fd9c]:


   675    675   		array set retval [list]
   676    676   
   677    677   		catch {
   678    678   			::appfs::getindex $pathinfo(hostname)
   679    679   			::appfs::getpkgmanifest $pathinfo(hostname) $pathinfo(package_sha1)
   680    680   		}
   681    681   
          682  +		set retval(path_type) $pathinfo(_type)
          683  +
   682    684   		switch -- $pathinfo(_type) {
   683    685   			"toplevel" {
   684    686   				set retval(type) directory
   685    687   				set retval(childcount) [llength [getchildren $path]]
   686    688   			}
   687    689   			"sites" {
   688    690   				set check [::appfs::db onecolumn {SELECT 1 FROM packages WHERE hostname = $pathinfo(hostname);}]
................................................................................
   752    754   							file lstat $localpath localpathinfo
   753    755   						}
   754    756   					}
   755    757   				}
   756    758   
   757    759   				if {$localpath != "" && [info exists localpathinfo]} {
   758    760   					set retval(is_localfile) 1
          761  +					unset retval(packaged)
   759    762   					catch {
   760    763   						set retval(time) $localpathinfo(mtime)
   761    764   
   762    765   						switch -- $localpathinfo(type) {
   763    766   							"directory" {
   764    767   								set retval(type) "directory"
   765    768   								set retval(childcount) [llength [getchildren $path]]
................................................................................
   837    840   		return [array get retval]
   838    841   	}
   839    842   
   840    843   	proc openpath {path mode} {
   841    844   		array set pathinfo [_parsepath $path]
   842    845   
   843    846   		if {$pathinfo(_type) != "files"} {
   844         -			return -code error "invalid type"
          847  +			return -code error "invalid path type: Got \"$pathinfo(_type)\", need \"files\""
   845    848   		}
   846    849   
   847    850   		set localpath [_localpath $pathinfo(package) $pathinfo(hostname) $pathinfo(file)]
   848    851   
   849    852   		if {$mode == "create"} {
   850    853   			if {$localpath == ""} {
   851    854   				return -code error "Asked to create, but no home directory."
................................................................................
   901    904   		return $localcachefile
   902    905   	}
   903    906   
   904    907   	proc localpath {path} {
   905    908   		array set pathinfo [_parsepath $path]
   906    909   
   907    910   		if {$pathinfo(_type) != "files"} {
   908         -			return -code error "invalid type"
          911  +			return -code error "invalid path type: Got \"$pathinfo(_type)\", need \"files\""
   909    912   		}
   910    913   
   911    914   		set localpath [_localpath $pathinfo(package) $pathinfo(hostname) $pathinfo(file)]
   912    915   
   913    916   		return $localpath
   914    917   	}
   915    918   
................................................................................
   950    953   
   951    954   		return $filename
   952    955   	}
   953    956   
   954    957   	proc unlinkpath {path} {
   955    958   		array set pathattrs [exists $path]
   956    959   
   957         -		if {![info exists pathattrs(packaged)]} {
   958         -			return -code error "invalid type"
          960  +		if {$pathattrs(path_type) != "files"} {
          961  +			return -code error "invalid path type: can only delete type \"files\" this is type \"$pathattrs(path_type)\""
   959    962   		}
   960    963   
   961    964   		set localpath $pathattrs(localpath)
   962    965   
   963    966   		if {$localpath == ""} {
   964    967   			return -code error "Asked to delete, but no home directory."
   965    968   		}