Check-in [7d728e1078]
Overview
Comment:Removed spurious deletes and fixed permissions on version directory
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tcl-ops
Files: files | file ages | folders
SHA1: 7d728e10783938364b9ccf91f42b644d91b17193
User & Date: rkeene on 2014-11-09 09:10:33
Other Links: branch diff | manifest | tags
Context
2014-11-10
03:11
Nearly completely working write support check-in: 2160c4189b user: rkeene tags: tcl-ops
2014-11-09
09:10
Removed spurious deletes and fixed permissions on version directory check-in: 7d728e1078 user: rkeene tags: tcl-ops
09:04
More work towards a writable solution check-in: 1adf504f9a user: rkeene tags: tcl-ops
Changes

Modified appfsd.tcl from [d0837729e0] to [251a7402cc].

403
404
405
406
407
408
409

410
411
412
413
414
415
416
								return [array get retval]
							}

							if {$pathlen > 4} {
								set retval(_type) files
								set retval(file) [join [lrange $path 4 end] "/"]
							} else {

								set retval(file) ""
							}
						}
					}
				}
			}
		}







>







403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
								return [array get retval]
							}

							if {$pathlen > 4} {
								set retval(_type) files
								set retval(file) [join [lrange $path 4 end] "/"]
							} else {
								set retval(_type) files
								set retval(file) ""
							}
						}
					}
				}
			}
		}
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
		}

		set localpath [_localpath $pathinfo(package) $pathinfo(hostname) $pathinfo(file)]

		return $localpath
	}

	proc _delete_files_except_whiteout {path} {
		foreach file [glob -nocomplain -directory $path {{.,}*}] {
			if {[string match "*/.." $file] || [string match "*/." $file]} {
				continue
			}

			if {[file isdirectory $file]} {
				_delete_files_except_whiteout $file
			}

			if {[string match "*.APPFS.WHITEOUT" $file]} {
				continue
			}

			catch {
				file delete -- $file
			}
		}
	}

	proc unlinkpath {path} {
		array set pathattrs [exists $path]

		if {![info exists pathattrs(packaged)]} {
			return -code error "invalid type"
		}

		set localpath $pathattrs(localpath)

		set whiteout 0
		set isdirectory 0
		if {[info exists pathattrs(is_localfile)]} {
			if {[file isdirectory $localpath]} {
				set isdirectory 1
				set whiteout 1
				_delete_files_except_whiteout $localpath
			} else {
				file delete -force -- $localpath
			}
		} elseif {[info exists pathattrs(is_remotefile)]} {
			if {$pathattrs(type) == "directory"} {
				set isdirectory 1
			}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<















<







693
694
695
696
697
698
699




















700
701
702
703
704
705
706
707
708
709
710
711
712
713
714

715
716
717
718
719
720
721
		}

		set localpath [_localpath $pathinfo(package) $pathinfo(hostname) $pathinfo(file)]

		return $localpath
	}





















	proc unlinkpath {path} {
		array set pathattrs [exists $path]

		if {![info exists pathattrs(packaged)]} {
			return -code error "invalid type"
		}

		set localpath $pathattrs(localpath)

		set whiteout 0
		set isdirectory 0
		if {[info exists pathattrs(is_localfile)]} {
			if {[file isdirectory $localpath]} {
				set isdirectory 1
				set whiteout 1

			} else {
				file delete -force -- $localpath
			}
		} elseif {[info exists pathattrs(is_remotefile)]} {
			if {$pathattrs(type) == "directory"} {
				set isdirectory 1
			}