Diff

Differences From Artifact [a38541090a]:

To Artifact [ce9ff0669b]:


120
121
122
123
124
125
126


127

128
129
130
131
132
133
134
120
121
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136







+
+
-
+








			set pkginfo [lindex $pkgdata($extension) 0]

			set ver [lindex $pkginfo 0]
			set arch [lindex $pkginfo 1]
			set server [lindex $pkginfo 2]

			set safe_ext_name [string map [list ":" "_"] $extension]

			set pkgdir [file join $rootdir $extension$ver]
			set pkgdir [file join $rootdir ${safe_ext_name}$ver]
			file mkdir $pkgdir $::teapotclient::pkgcachedir

			set url "http://$server/package/name/$extension/ver/$ver/arch/$arch/file"
			set urlcachefile [file join $::teapotclient::pkgcachedir [::md5::md5 -hex $url]]

			if {![file exists $urlcachefile]} {
				set tmpfd [open $urlcachefile w]
161
162
163
164
165
166
167
168

169
170
171
172
173
174
175
163
164
165
166
167
168
169

170
171
172
173
174
175
176
177







-
+







						}
						close $fd
					}
				}
				"(^| )text($| )" {
					unset -nocomplain fd

					set extfile [file join $pkgdir ${extension}.tcl]
					set extfile [file join $pkgdir ${safe_ext_name}.tcl]
					set idxfile [file join $pkgdir pkgIndex.tcl]

					catch {
						file copy -force -- $urlcachefile $extfile

						set fd [open $idxfile w]
						puts $fd "package ifneeded $extension $ver \[list source \[file join \$dir [file tail $extfile]\]\]"