Check-in [d64ee24bd0]
Overview
Comment:Renamed teapot.tcl to teapot-client.tcl
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d64ee24bd06d9556508500e46c9198aedc6eb3bd
User & Date: rkeene on 2009-04-18 02:48:01
Other Links: manifest | tags
Context
2009-04-18
03:04
Added Makefile to build Starkit Fixed bug in teapot client package Updated teapot client package to use various temporary directory possibilities Updated help on teapot client check-in: aca04fd88d user: rkeene tags: trunk
02:48
Renamed teapot.tcl to teapot-client.tcl check-in: d64ee24bd0 user: rkeene tags: trunk
02:43
Added teapot project (client-only so far), derivative of starkit2exe check-in: 1bf8a9efe1 user: rkeene tags: trunk
Changes

Added client/teapot-client.tcl version [74f5cdd85f].

































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
78
79
80
#! /usr/bin/env tclsh

set teapotservers [list teapot.activestate.com]

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

package require teapotclient

proc print_help {} {
	puts stderr "Usage: teapot-client.tcl get <dir> <os> <cpu> <packages...>"
	puts stderr "Usage: teapot-client.tcl list ?<os> ?<cpu>??"
}

set cmd [lindex $argv 0]
set argv [lrange $argv 1 end]

switch -- $cmd {
	"get" {
		if {[llength $argv] < 4} {
			print_help
			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 exts [list]
		puts "Fetched Extensions:"
		foreach {ext extinfo} $extsinfo {
			lappend exts $ext
			puts "  $ext v[lindex $extinfo 0]"
		}

		set failedexts [list]
		foreach pkg $packages {
			if {[lsearch -exact $exts $pkg] == -1} {
				lappend failedexts $pkg
			}
		}
		if {[llength $failedexts] != 0} {
			puts "Failed to fetch:"
			foreach ext $failedexts {
				puts "  $ext"
			}
			exit 1
		}
	}
	"list" {
		set os "*"
		set cpu "*"
		if {[llength $argv] > 0} {
			set os [lindex $argv 0]
		}
		if {[llength $argv] > 1} {
			set cpu [lindex $argv 1]
		}

		puts "Extensions available for OS=$os, CPU=$cpu:"

		set extsinfo [::teapotclient::get_extensions $teapotservers $os $cpu]
		foreach {ext extinfo} $extsinfo {
			set extvers [list]
			foreach extinfoitem $extinfo {
				set extinfoitemvers [lindex $extinfoitem 0]
				if {[lsearch -exact $extvers $extinfoitemvers] == -1} {
					lappend extvers $extinfoitemvers
				}
			}
			set extvers [lsort -decreasing -dictionary $extvers]

			puts "  $ext [lindex $extvers 0]"
		}
	}
	default {
		print_help
		exit 1
	}
}

Deleted client/teapot.tcl version [384fceb21a].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
78
79
80
#! /usr/bin/env tclsh

set teapotservers [list teapot.activestate.com]

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

package require teapotclient

proc print_help {} {
	puts stderr "Usage: teapot.tcl get <dir> <os> <cpu> <packages...>"
	puts stderr "Usage: teapot.tcl list ?<os> ?<cpu>??"
}

set cmd [lindex $argv 0]
set argv [lrange $argv 1 end]

switch -- $cmd {
	"get" {
		if {[llength $argv] < 4} {
			print_help
			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 exts [list]
		puts "Fetched Extensions:"
		foreach {ext extinfo} $extsinfo {
			lappend exts $ext
			puts "  $ext v[lindex $extinfo 0]"
		}

		set failedexts [list]
		foreach pkg $packages {
			if {[lsearch -exact $exts $pkg] == -1} {
				lappend failedexts $pkg
			}
		}
		if {[llength $failedexts] != 0} {
			puts "Failed to fetch:"
			foreach ext $failedexts {
				puts "  $ext"
			}
			exit 1
		}
	}
	"list" {
		set os "*"
		set cpu "*"
		if {[llength $argv] > 0} {
			set os [lindex $argv 0]
		}
		if {[llength $argv] > 1} {
			set cpu [lindex $argv 1]
		}

		puts "Extensions available for OS=$os, CPU=$cpu:"

		set extsinfo [::teapotclient::get_extensions $teapotservers $os $cpu]
		foreach {ext extinfo} $extsinfo {
			set extvers [list]
			foreach extinfoitem $extinfo {
				set extinfoitemvers [lindex $extinfoitem 0]
				if {[lsearch -exact $extvers $extinfoitemvers] == -1} {
					lappend extvers $extinfoitemvers
				}
			}
			set extvers [lsort -decreasing -dictionary $extvers]

			puts "  $ext [lindex $extvers 0]"
		}
	}
	default {
		print_help
		exit 1
	}
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<