Check-in [68f9c46716]
Overview
Comment:Updated teapotclient to not require specifying "Tcl Tk" in the existing extensions parameter of download_extensions. Changed default download directory to not include "lib" of teapotclient, but left this behaviour in the "teapot-client.tcl" script Added examples
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 68f9c46716ac902d43577b5ffe5f9cac0e6339eb
User & Date: rkeene on 2009-04-18 22:14:02
Other Links: manifest | tags
Context
2009-04-18
22:15
Updated README with a mini-manual for the client. Updated build process cleanup. check-in: cce162f50e user: rkeene tags: trunk
22:14
Updated teapotclient to not require specifying "Tcl Tk" in the existing extensions parameter of download_extensions. Changed default download directory to not include "lib" of teapotclient, but left this behaviour in the "teapot-client.tcl" script Added examples check-in: 68f9c46716 user: rkeene tags: trunk
21:22
Added install target check-in: 3ae29b0fdc user: rkeene tags: trunk
Changes

Added client/examples/example-1.tcl version [4ace071797].













1
2
3
4
5
6
7
8
9
10
11
12
+
+
+
+
+
+
+
+
+
+
+
+
#! /usr/bin/env tclsh

lappend auto_path [file join [file dirname [info script]] .. lib]

		package require teapotclient

                puts "The following extensions are available:"
                foreach {extension extensioninfo} [::teapotclient::get_extensions \
                                                   [list teapot.activestate.com] \
                                                   {*} {*}] {
                        puts "  $extension [join $extensioninfo {, }]"
                }

Added client/examples/example-2.tcl version [ded7ead90f].

















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#! /usr/bin/env tclsh

lappend auto_path [file join [file dirname [info script]] .. lib]

                package require teapotclient

                set os $tcl_platform(os)
                if {$tcl_platform(platform) == "windows"} {
                        set os $tcl_platform(platform)
                }

                puts "Downloading md5 and sha1 packages for the current system"
                ::teapotclient::download_extensions "lib" \
                  [list teapot.activestate.com] [list md5 sha1] $os \
                  $tcl_platform(machine)

Modified client/lib/teapotclient0.1/teapotclient.tcl from [db3d2ea33e] to [a933729bfc].

49
50
51
52
53
54
55
56






57
58
59
60
61
62
63
49
50
51
52
53
54
55

56
57
58
59
60
61
62
63
64
65
66
67
68







-
+
+
+
+
+
+







	set osTeapotToLocal(irix) irix_*

	set cpuTeapotToLocal(ix86) x86
	set cpuTeapotToLocal(sparc) sun4*
	set cpuTeapotToLocal(universal) *
	set cpuTeapotToLocal(powerpc) ppc

	proc download_extensions {rootdir servers extensions os cpu {existingExts "Tcl Tk"}} {
	proc download_extensions {rootdir servers extensions os cpu {existingExts ""}} {
		foreach chkdefext [list Tcl Tk] {
			if {[lsearch -exact $existingExts $chkdefext] == -1} {
				lappend existingExts $chkdefext
			}
		}
		foreach server $servers {
			foreach {pkg pkginfo} [get_extensions $server $os $cpu] {
				foreach pkginstance $pkginfo {
					lappend pkginstance $server
					lappend pkgdata($pkg) $pkginstance
				}
			}
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
82
83
84
85
86
87
88

89
90
91
92
93
94
95
96







-
+








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

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

			set pkgdir [file join $rootdir lib $extension$ver]
			set pkgdir [file join $rootdir $extension$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]

Modified client/teapot-client.tcl from [99bcefeb9e] to [b79ca22208].

21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35







-
+







			exit 1
		}

		set dir [lindex $argv 0]
		set os [lindex $argv 1]
		set cpu [lindex $argv 2]
		set packages [lrange $argv 3 end]
		set extsinfo [::teapotclient::download_extensions $dir $teapotservers $packages $os $cpu]
		set extsinfo [::teapotclient::download_extensions [file join $dir lib] $teapotservers $packages $os $cpu]
		set exts [list]
		puts "Fetched Extensions:"
		foreach {ext extinfo} $extsinfo {
			lappend exts $ext
			puts "  $ext v[lindex $extinfo 0]"
		}