Diff

Differences From Artifact [d0837729e0]:

To Artifact [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
			}