Diff

Differences From Artifact [ce277262eb]:

To Artifact [a96ad61fba]:


531
532
533
534
535
536
537



538
539
540
541
542
543
544
				}
			}
			"files" {

				set retval(packaged) 1

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



				if {[file exists $localpath]} {
					catch {
						file lstat $localpath localpathinfo
						set retval(time) $localpathinfo(mtime)

						switch -- $localpathinfo(type) {
							"directory" {







>
>
>







531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
				}
			}
			"files" {

				set retval(packaged) 1

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

				set retval(localpath) $localpath

				if {[file exists $localpath]} {
					catch {
						file lstat $localpath localpathinfo
						set retval(time) $localpathinfo(mtime)

						switch -- $localpathinfo(type) {
							"directory" {
631
632
633
634
635
636
637
638






























			}

			return $localpath
		}

		return $localcachefile
	}
}





































|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
			}

			return $localpath
		}

		return $localcachefile
	}

	proc exists {path} {
		catch {
			set info [getattr $path]
		} err

		if {![info exists info]} {
			if {$err == "No such file or directory"} {
				return [list]
			} else {
				return -code error $err
			}
		}

		return $info
	}

	proc prepare_to_create {path} {
		if {[exists $path] != ""} {
			return -code error "File already exists"
		}

		set filename [openpath $path "create"]

		set dirname [file dirname $filename]

		file mkdir $dirname

		return $filename
	}
}