Check-in [738556ed56]
Overview
Comment:Added support for using "vfs::zip" if it is available.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:738556ed56047a0315bf54325e35376a5fca4b52
User & Date: rkeene on 2009-04-19 08:19:53
Other Links: manifest | tags
Context
2009-04-19
09:42
Updated teapotclient to understand "intel" means "x86" check-in: eb06aeb256 user: rkeene tags: trunk
08:19
Added support for using "vfs::zip" if it is available. check-in: 738556ed56 user: rkeene tags: trunk
2009-04-18
22:30
Added extra sanity checks to home directory searching. check-in: de2b9ae717 user: rkeene tags: trunk
Changes

Modified client/Makefile from [d966da7815] to [f94f975092].

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
teapot-client.kit: teapot-client.tcl lib/teapotclient0.1/pkgIndex.tcl lib/teapotclient0.1/teapotclient.tcl
	rm -rf teapot-client-tmp.vfs
	mkdir teapot-client-tmp.vfs
	cp -r lib teapot-client.tcl teapot-client-tmp.vfs/
	echo 'package require starkit' > teapot-client-tmp.vfs/main.tcl
	echo 'starkit::startup' >> teapot-client-tmp.vfs/main.tcl
	echo 'source $$starkit::topdir/teapot-client.tcl' >> teapot-client-tmp.vfs/main.tcl
	./teapot-client.tcl get teapot-client-tmp.vfs/ tcl tcl md5 fileutil
	$(TCLKIT) support/sdx.kit wrap teapot-client-tmp.kit
	rm -rf teapot-client-tmp.vfs
	mv teapot-client-tmp.kit teapot-client.kit

clean:
	rm -f teapot-client.kit
	rm -rf teapot-client-tmp.vfs

distclean: clean

.PHONY: all install clean distclean







|











31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
teapot-client.kit: teapot-client.tcl lib/teapotclient0.1/pkgIndex.tcl lib/teapotclient0.1/teapotclient.tcl
	rm -rf teapot-client-tmp.vfs
	mkdir teapot-client-tmp.vfs
	cp -r lib teapot-client.tcl teapot-client-tmp.vfs/
	echo 'package require starkit' > teapot-client-tmp.vfs/main.tcl
	echo 'starkit::startup' >> teapot-client-tmp.vfs/main.tcl
	echo 'source $$starkit::topdir/teapot-client.tcl' >> teapot-client-tmp.vfs/main.tcl
	./teapot-client.tcl get teapot-client-tmp.vfs/ tcl tcl md5 fileutil vfs::zip
	$(TCLKIT) support/sdx.kit wrap teapot-client-tmp.kit
	rm -rf teapot-client-tmp.vfs
	mv teapot-client-tmp.kit teapot-client.kit

clean:
	rm -f teapot-client.kit
	rm -rf teapot-client-tmp.vfs

distclean: clean

.PHONY: all install clean distclean

Modified client/lib/teapotclient0.1/teapotclient.tcl from [e17f36fccf] to [eeda69a9b1].

1
2
3
4
5



6
7
8






9
10
11
12
13
14
15
..
40
41
42
43
44
45
46












47
48

49
50
51
52
53
54
55
#! /usr/bin/env tclsh

# This file has no license.  It is in the public domain.
# -- Roy Keene <tcl@rkeene.org> [20081025T1400Q]




package require md5
package require http
package require fileutil







namespace eval ::teapotclient {}
namespace eval ::teapotclient {
	proc __get_tmpdir {} {
		foreach checkenv [list TMPDIR TEMP TMP TEMPDIR] {
			if {[info exists ::env($checkenv)]} {
				return $::env($checkenv)
................................................................................
			file mkdir $::env(HOME)
		}

		return $::env(HOME)
	}

	proc __unzip {dir file} {












		exec unzip -d $dir -n -qq $urlcachefile
	}


	set pkgcachedir [file join [__get_homedir] ".teapot-client" "cachedir"]

        # Conversions from Teapot-style names to local ones
	set osTeapotToLocal(tcl) *
	set osTeapotToLocal(linux-*) linux
	set osTeapotToLocal(win32) windows





>
>
>



>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
|
|
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /usr/bin/env tclsh

# This file has no license.  It is in the public domain.
# -- Roy Keene <tcl@rkeene.org> [20081025T1400Q]

namespace eval ::teapotclient {}

package require Tcl
package require md5
package require http
package require fileutil

set ::teapotclient::have_vfszip 0
catch {
	package require vfs::zip
	set ::teapotclient::have_vfszip 1
}

namespace eval ::teapotclient {}
namespace eval ::teapotclient {
	proc __get_tmpdir {} {
		foreach checkenv [list TMPDIR TEMP TMP TEMPDIR] {
			if {[info exists ::env($checkenv)]} {
				return $::env($checkenv)
................................................................................
			file mkdir $::env(HOME)
		}

		return $::env(HOME)
	}

	proc __unzip {dir file} {
		file mkdir $dir
		if {$::teapotclient::have_vfszip} {
			set mntfd [vfs::zip::Mount $file $file]

			foreach filetail [glob -nocomplain -tails -directory $file *] {
				set srcfile [file join $file $filetail]
				set destdir [file dirname [file join $dir $filetail]]
				file copy -force -- $srcfile $destdir
			}

			vfs::zip::Unmount $mntfd $file
		} else {
			exec unzip -d $dir -n -qq $urlcachefile
		}
	}

	set pkgcachedir [file join [__get_homedir] ".teapot-client" "cachedir"]

        # Conversions from Teapot-style names to local ones
	set osTeapotToLocal(tcl) *
	set osTeapotToLocal(linux-*) linux
	set osTeapotToLocal(win32) windows