121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
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]
set token [::http::geturl $url -channel $tmpfd]
::http::cleanup $token
close $tmpfd
}
set retarr($extension) [list $ver $arch $server]
switch -regexp -- [::fileutil::fileType $urlcachefile] {
|
>
>
|
|
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
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]
fconfigure $tmpfd -encoding binary -translation binary -buffering none
set token [::http::geturl $url -binary true -channel $tmpfd]
::http::cleanup $token
close $tmpfd
}
set retarr($extension) [list $ver $arch $server]
switch -regexp -- [::fileutil::fileType $urlcachefile] {
|