Artifact 39ba51f6e4e90d5a5e4a3dfdcac2170cb4c219fe:
0000: 49 2e 20 43 4c 49 45 4e 54 0a 3d 3d 3d 3d 3d 3d I. CLIENT.======
0010: 3d 3d 3d 0a 54 68 69 73 20 69 73 20 61 20 76 65 ===.This is a ve
0020: 72 79 20 62 61 73 69 63 20 69 6d 70 6c 65 6d 65 ry basic impleme
0030: 6e 74 61 74 69 6f 6e 20 6f 66 20 61 20 54 65 61 ntation of a Tea
0040: 70 6f 74 20 63 6c 69 65 6e 74 2e 20 20 49 74 20 pot client. It
0050: 77 69 6c 6c 20 66 65 74 63 68 20 61 6c 6c 0a 72 will fetch all.r
0060: 65 71 75 65 73 74 65 64 20 70 61 63 6b 61 67 65 equested package
0070: 73 20 61 6e 64 20 74 68 65 69 72 20 64 65 70 65 s and their depe
0080: 6e 64 65 6e 63 69 65 73 20 66 72 6f 6d 20 61 20 ndencies from a
0090: 72 65 6d 6f 74 65 20 54 45 41 50 4f 54 20 73 65 remote TEAPOT se
00a0: 72 76 65 72 2e 0a 0a 31 2e 20 49 6e 73 74 61 6c rver...1. Instal
00b0: 6c 69 6e 67 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ling.-----------
00c0: 2d 2d 0a 54 68 65 20 73 75 70 70 6c 69 65 64 20 --.The supplied
00d0: 4d 61 6b 65 66 69 6c 65 20 6f 6e 6c 79 20 69 6e Makefile only in
00e0: 73 74 61 6c 6c 73 20 74 68 65 20 63 6c 69 65 6e stalls the clien
00f0: 74 20 6c 69 62 72 61 72 79 2e 20 20 41 20 73 61 t library. A sa
0100: 6d 70 6c 65 20 63 6c 69 65 6e 74 20 74 68 61 74 mple client that
0110: 0a 6d 61 6b 65 73 20 75 73 65 20 6f 66 20 74 68 .makes use of th
0120: 69 73 20 6c 69 62 72 61 72 79 20 69 73 20 69 6e is library is in
0130: 63 6c 75 64 65 64 2e 20 20 54 68 65 20 73 61 6d cluded. The sam
0140: 70 6c 65 20 6c 69 62 72 61 72 79 20 69 73 20 63 ple library is c
0150: 61 6c 6c 65 64 0a 22 74 65 61 70 6f 74 2d 63 6c alled."teapot-cl
0160: 69 65 6e 74 2e 74 63 6c 22 2e 0a 0a 09 61 2e 20 ient.tcl"....a.
0170: 54 6f 20 69 6e 73 74 61 6c 6c 20 77 69 74 68 20 To install with
0180: 61 6c 6c 20 74 68 65 20 64 65 66 61 75 6c 74 20 all the default
0190: 6f 70 74 69 6f 6e 73 20 61 6e 64 20 61 75 74 6f options and auto
01a0: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 2c 0a configuration,.
01b0: 09 20 20 20 65 78 65 63 75 74 65 3a 0a 09 09 23 . execute:...#
01c0: 20 6d 61 6b 65 20 69 6e 73 74 61 6c 6c 0a 09 62 make install..b
01d0: 2e 20 49 66 20 79 6f 75 20 77 69 73 68 20 74 6f . If you wish to
01e0: 20 69 6e 73 74 61 6c 6c 20 74 68 65 20 70 61 63 install the pac
01f0: 6b 61 67 65 20 69 6e 74 6f 20 61 20 70 61 72 74 kage into a part
0200: 69 63 75 6c 61 72 20 64 69 72 65 63 74 6f 72 79 icular directory
0210: 2c 0a 09 20 20 20 65 78 65 63 75 74 65 3a 0a 09 ,.. execute:..
0220: 09 23 20 6d 61 6b 65 20 69 6e 73 74 61 6c 6c 20 .# make install
0230: 54 43 4c 44 49 52 3d 79 6f 75 72 5f 70 61 72 74 TCLDIR=your_part
0240: 69 63 75 6c 61 72 5f 64 69 72 65 63 74 6f 72 79 icular_directory
0250: 0a 09 20 20 20 28 6e 6f 74 65 20 74 68 61 74 20 .. (note that
0260: 69 74 20 77 69 6c 6c 20 63 72 65 61 74 65 20 61 it will create a
0270: 20 22 74 65 61 70 6f 74 63 6c 69 65 6e 74 30 2e "teapotclient0.
0280: 31 22 20 64 69 72 65 63 74 6f 72 79 20 61 6e 64 1" directory and
0290: 0a 09 20 20 20 20 62 75 74 20 6e 6f 20 22 6c 69 .. but no "li
02a0: 62 22 20 6f 72 20 73 69 6d 69 6c 61 72 20 64 69 b" or similar di
02b0: 72 65 63 74 6f 72 79 29 0a 09 63 2e 20 49 66 20 rectory)..c. If
02c0: 79 6f 75 20 77 69 73 68 20 74 6f 20 69 6e 73 74 you wish to inst
02d0: 61 6c 6c 20 69 6e 74 6f 20 61 6e 20 61 6c 74 65 all into an alte
02e0: 72 6e 61 74 65 20 72 6f 6f 74 20 64 69 72 65 63 rnate root direc
02f0: 74 6f 72 79 20 28 69 2e 65 2e 2c 20 66 6f 72 0a tory (i.e., for.
0300: 09 20 20 20 70 61 63 6b 61 67 69 6e 67 29 2c 20 . packaging),
0310: 65 78 65 63 75 74 65 3a 0a 09 09 23 20 6d 61 6b execute:...# mak
0320: 65 20 69 6e 73 74 61 6c 6c 20 44 45 53 54 44 49 e install DESTDI
0330: 52 3d 79 6f 75 72 5f 6e 65 77 5f 72 6f 6f 74 64 R=your_new_rootd
0340: 69 72 0a 09 20 20 20 54 68 69 73 20 77 69 6c 6c ir.. This will
0350: 20 73 65 61 72 63 68 20 66 6f 72 20 61 20 22 74 search for a "t
0360: 63 6c 43 6f 6e 66 69 67 2e 73 68 22 20 69 6e 20 clConfig.sh" in
0370: 74 68 65 20 64 65 73 74 69 6e 61 74 69 6f 6e 20 the destination
0380: 64 69 72 65 63 74 6f 72 79 2e 0a 0a 4e 6f 74 65 directory...Note
0390: 20 74 68 61 74 20 74 68 65 20 69 6e 73 74 61 6c that the instal
03a0: 6c 20 64 69 72 65 63 74 6f 72 79 20 69 73 20 6e l directory is n
03b0: 6f 74 20 65 6e 63 6f 64 65 64 20 69 6e 20 74 68 ot encoded in th
03c0: 65 20 73 63 72 69 70 74 20 69 6e 20 61 6e 79 20 e script in any
03d0: 77 61 79 20 73 6f 20 69 74 0a 63 61 6e 20 62 65 way so it.can be
03e0: 20 73 61 66 65 6c 79 20 6d 6f 76 65 64 20 61 66 safely moved af
03f0: 74 65 72 20 69 6e 73 74 61 6c 6c 61 74 69 6f 6e ter installation
0400: 2e 0a 0a 32 2e 20 55 73 69 6e 67 0a 2d 2d 2d 2d ...2. Using.----
0410: 2d 2d 2d 2d 0a 0a 61 2e 20 74 65 61 70 6f 74 63 ----..a. teapotc
0420: 6c 69 65 6e 74 3a 0a 0a 09 69 2e 20 67 65 74 5f lient:...i. get_
0430: 65 78 74 65 6e 73 69 6f 6e 73 0a 09 09 53 59 4e extensions...SYN
0440: 4f 50 53 49 53 0a 09 09 70 61 63 6b 61 67 65 20 OPSIS...package
0450: 72 65 71 75 69 72 65 20 74 65 61 70 6f 74 63 6c require teapotcl
0460: 69 65 6e 74 0a 0a 09 09 3a 3a 74 65 61 70 6f 74 ient....::teapot
0470: 63 6c 69 65 6e 74 3a 3a 67 65 74 5f 65 78 74 65 client::get_exte
0480: 6e 73 69 6f 6e 73 20 3c 6c 69 73 74 5f 6f 66 5f nsions <list_of_
0490: 74 65 61 70 6f 74 5f 73 65 72 76 65 72 73 3e 20 teapot_servers>
04a0: 5c 0a 09 09 20 20 3f 3c 6f 73 5f 67 6c 6f 62 5f \... ?<os_glob_
04b0: 70 61 74 74 65 72 6e 3e 3f 20 3f 3c 63 70 75 5f pattern>? ?<cpu_
04c0: 67 6c 6f 62 5f 70 61 74 74 65 72 6e 3e 3f 0a 0a glob_pattern>?..
04d0: 09 09 44 45 53 43 52 49 50 54 49 4f 4e 0a 09 09 ..DESCRIPTION...
04e0: 67 65 74 5f 65 78 74 65 6e 73 69 6f 6e 73 20 67 get_extensions g
04f0: 65 74 73 20 74 68 65 20 65 78 74 65 6e 73 69 6f ets the extensio
0500: 6e 73 20 74 68 61 74 20 61 72 65 20 61 76 61 69 ns that are avai
0510: 6c 61 62 6c 65 20 66 72 6f 6d 20 61 0a 09 09 6c lable from a...l
0520: 69 73 74 20 6f 66 20 54 45 41 50 4f 54 20 73 65 ist of TEAPOT se
0530: 72 76 65 72 73 2c 20 66 6f 72 20 61 20 70 61 72 rvers, for a par
0540: 74 69 63 75 6c 61 72 20 6f 70 65 72 61 74 69 6e ticular operatin
0550: 67 20 73 79 73 74 65 6d 0a 09 09 61 6e 64 20 43 g system...and C
0560: 50 55 20 74 75 70 6c 65 20 28 77 68 69 63 68 20 PU tuple (which
0570: 63 61 6e 20 62 65 20 67 6c 6f 62 20 70 61 74 74 can be glob patt
0580: 65 72 6e 73 29 2e 0a 0a 09 09 54 68 65 20 64 65 erns).....The de
0590: 66 61 75 6c 74 20 4f 53 20 61 6e 64 20 43 50 55 fault OS and CPU
05a0: 20 70 61 74 74 65 72 6e 73 20 61 72 65 20 62 6f patterns are bo
05b0: 74 68 20 22 2a 22 20 77 68 69 63 68 20 77 69 6c th "*" which wil
05c0: 6c 20 6d 61 74 63 68 0a 09 09 61 6c 6c 20 6f 70 l match...all op
05d0: 65 72 61 74 69 6e 67 20 73 79 73 74 65 6d 20 61 erating system a
05e0: 6e 64 20 63 70 75 73 2e 0a 0a 09 09 52 45 54 55 nd cpus.....RETU
05f0: 52 4e 20 56 41 4c 55 45 0a 09 09 54 68 65 20 72 RN VALUE...The r
0600: 65 74 75 72 6e 65 64 20 76 61 6c 75 65 20 69 73 eturned value is
0610: 20 61 20 6c 69 73 74 20 69 6e 20 74 68 65 20 66 a list in the f
0620: 6f 72 6d 61 74 20 6f 66 3a 0a 09 09 7b 45 78 74 ormat of:...{Ext
0630: 65 6e 73 69 6f 6e 5f 31 7d 20 7b 45 78 74 65 6e ension_1} {Exten
0640: 73 69 6f 6e 49 6e 66 6f 5f 31 7d 20 7b 45 78 74 sionInfo_1} {Ext
0650: 65 6e 73 69 6f 6e 5f 32 7d 20 7b 45 78 74 65 6e ension_2} {Exten
0660: 73 69 6f 6e 49 6e 66 6f 5f 32 7d 20 2e 2e 2e 0a sionInfo_2} ....
0670: 0a 09 09 57 68 65 72 65 20 45 78 74 65 6e 73 69 ...Where Extensi
0680: 6f 6e 49 6e 66 6f 5f 4e 20 69 73 20 61 20 6c 69 onInfo_N is a li
0690: 73 74 20 69 6e 20 74 68 65 20 66 6f 72 6d 61 74 st in the format
06a0: 20 6f 66 3a 0a 09 09 45 78 74 65 6e 73 69 6f 6e of:...Extension
06b0: 56 65 72 73 69 6f 6e 20 45 78 74 65 6e 73 69 6f Version Extensio
06c0: 6e 50 6c 61 74 66 6f 72 6d 49 6e 66 6f 0a 0a 09 nPlatformInfo...
06d0: 69 69 2e 20 64 6f 77 6e 6c 6f 61 64 5f 65 78 74 ii. download_ext
06e0: 65 6e 73 69 6f 6e 73 0a 09 09 53 59 4e 4f 50 53 ensions...SYNOPS
06f0: 49 53 0a 09 09 70 61 63 6b 61 67 65 20 72 65 71 IS...package req
0700: 75 69 72 65 20 74 65 61 70 6f 74 63 6c 69 65 6e uire teapotclien
0710: 74 0a 0a 09 09 3a 3a 74 65 61 70 6f 74 63 6c 69 t....::teapotcli
0720: 65 6e 74 3a 3a 64 6f 77 6e 6c 6f 61 64 5f 65 78 ent::download_ex
0730: 74 65 6e 73 69 6f 6e 73 20 3c 72 6f 6f 74 64 69 tensions <rootdi
0740: 72 3e 20 5c 0a 09 09 20 20 3c 6c 69 73 74 5f 6f r> \... <list_o
0750: 66 5f 74 65 61 70 6f 74 5f 73 65 72 76 65 72 73 f_teapot_servers
0760: 3e 20 3c 6c 69 73 74 5f 6f 66 5f 65 78 74 65 6e > <list_of_exten
0770: 73 69 6f 6e 73 3e 20 5c 0a 09 09 20 20 3c 6f 73 sions> \... <os
0780: 5f 67 6c 6f 62 5f 70 61 74 74 65 72 6e 3e 20 3c _glob_pattern> <
0790: 63 70 75 5f 67 6c 6f 62 5f 70 61 74 74 65 72 6e cpu_glob_pattern
07a0: 3e 20 5c 0a 09 09 20 20 3f 3c 6c 69 73 74 5f 6f > \... ?<list_o
07b0: 66 5f 65 78 74 65 6e 73 69 6f 6e 73 5f 74 6f 5f f_extensions_to_
07c0: 65 78 63 6c 75 64 65 3e 3f 0a 0a 09 09 44 45 53 exclude>?....DES
07d0: 43 52 49 50 54 49 4f 4e 0a 09 09 64 6f 77 6e 6c CRIPTION...downl
07e0: 6f 61 64 5f 65 78 74 65 6e 73 69 6f 6e 73 20 77 oad_extensions w
07f0: 69 6c 6c 20 64 6f 77 6e 6c 6f 61 64 20 74 68 65 ill download the
0800: 20 6c 69 73 74 20 6f 66 20 65 78 74 65 6e 73 69 list of extensi
0810: 6f 6e 73 20 66 6f 72 20 61 0a 09 09 67 69 76 65 ons for a...give
0820: 6e 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 n operating syst
0830: 65 6d 20 61 6e 64 20 43 50 55 20 74 75 70 6c 65 em and CPU tuple
0840: 2c 20 61 6e 64 20 64 6f 77 6e 6c 6f 61 64 20 74 , and download t
0850: 68 65 69 72 0a 09 09 64 65 70 65 6e 64 65 6e 63 heir...dependenc
0860: 69 65 73 20 72 65 63 75 72 73 69 76 65 6c 79 2e ies recursively.
0870: 20 20 49 74 20 77 69 6c 6c 20 70 6c 61 63 65 20 It will place
0880: 65 61 63 68 20 64 6f 77 6e 6c 6f 61 64 65 64 0a each downloaded.
0890: 09 09 65 78 74 65 6e 73 69 6f 6e 73 20 69 6e 20 ..extensions in
08a0: 69 74 73 20 6f 77 6e 20 73 75 62 64 69 72 65 63 its own subdirec
08b0: 74 6f 72 79 20 62 65 6e 65 61 74 68 20 74 68 65 tory beneath the
08c0: 20 73 70 65 63 69 66 69 65 64 0a 09 09 22 72 6f specified..."ro
08d0: 6f 74 64 69 72 22 2e 0a 0a 09 09 54 68 65 20 6c otdir".....The l
08e0: 61 74 65 73 74 20 76 65 72 73 69 6f 6e 20 61 76 atest version av
08f0: 61 69 6c 61 62 6c 65 20 66 6f 72 20 74 68 65 20 ailable for the
0900: 67 69 76 65 6e 20 4f 53 20 61 6e 64 20 43 50 55 given OS and CPU
0910: 20 74 75 70 6c 65 20 6f 66 0a 09 09 65 61 63 68 tuple of...each
0920: 20 65 78 74 65 6e 73 69 6f 6e 20 77 69 6c 6c 20 extension will
0930: 62 65 20 64 6f 77 6e 6c 6f 61 64 65 64 2e 0a 0a be downloaded...
0940: 09 09 59 6f 75 20 6d 61 79 20 6f 70 74 69 6f 6e ..You may option
0950: 61 6c 6c 79 20 73 70 65 63 69 66 79 20 61 20 6c ally specify a l
0960: 69 73 74 20 6f 66 20 65 78 74 65 6e 73 69 6f 6e ist of extension
0970: 73 20 74 68 61 74 20 79 6f 75 20 64 6f 20 6e 6f s that you do no
0980: 74 0a 09 09 77 69 73 68 20 74 6f 20 62 65 20 64 t...wish to be d
0990: 6f 77 6e 6c 6f 61 64 65 64 2e 0a 0a 09 09 52 45 ownloaded.....RE
09a0: 54 55 52 4e 20 56 41 4c 55 45 0a 09 09 54 68 65 TURN VALUE...The
09b0: 20 72 65 74 75 72 6e 20 76 61 6c 75 65 20 69 73 return value is
09c0: 20 61 20 6c 69 73 74 20 6f 66 20 65 78 74 65 6e a list of exten
09d0: 73 69 6f 6e 73 20 61 63 74 75 61 6c 6c 79 20 64 sions actually d
09e0: 6f 77 6e 6c 6f 61 64 65 64 2e 0a 09 09 54 68 69 ownloaded....Thi
09f0: 73 20 6d 61 79 20 63 6f 6e 74 61 69 6e 20 69 74 s may contain it
0a00: 65 6d 73 20 74 68 61 74 20 77 65 72 65 20 6e 6f ems that were no
0a10: 74 20 72 65 71 75 65 73 74 65 64 20 28 69 66 20 t requested (if
0a20: 74 68 65 79 20 77 65 72 65 0a 09 09 6e 65 65 64 they were...need
0a30: 65 64 20 74 6f 20 73 61 74 69 73 66 79 20 61 20 ed to satisfy a
0a40: 64 65 70 65 6e 64 65 6e 63 79 29 2c 20 61 6e 64 dependency), and
0a50: 20 6d 61 79 20 6e 6f 74 20 63 6f 6e 74 61 69 6e may not contain
0a60: 20 61 6c 6c 20 69 74 65 6d 73 0a 09 09 74 68 61 all items...tha
0a70: 74 20 77 65 72 65 20 72 65 71 75 65 73 74 65 64 t were requested
0a80: 20 28 69 66 20 74 68 65 79 20 77 65 72 65 20 75 (if they were u
0a90: 6e 61 76 61 69 6c 61 62 6c 65 29 2e 0a 0a 09 09 navailable).....
0aa0: 54 68 65 20 6c 69 73 74 20 69 73 20 69 6e 20 74 The list is in t
0ab0: 68 65 20 66 6f 72 6d 61 74 3a 0a 09 09 7b 45 78 he format:...{Ex
0ac0: 74 65 6e 73 69 6f 6e 5f 31 7d 20 7b 45 78 74 65 tension_1} {Exte
0ad0: 6e 73 69 6f 6e 49 6e 66 6f 5f 31 7d 20 7b 45 78 nsionInfo_1} {Ex
0ae0: 74 65 6e 73 69 6f 6e 5f 32 7d 20 7b 45 78 74 65 tension_2} {Exte
0af0: 6e 73 69 6f 6e 49 6e 66 6f 5f 32 7d 20 2e 2e 2e nsionInfo_2} ...
0b00: 0a 0a 09 09 57 68 65 72 65 20 45 78 74 65 6e 73 ....Where Extens
0b10: 69 6f 6e 49 6e 66 6f 5f 4e 20 69 73 20 61 20 6c ionInfo_N is a l
0b20: 69 73 74 20 69 6e 20 74 68 65 20 66 6f 72 6d 61 ist in the forma
0b30: 74 20 6f 66 3a 0a 09 09 45 78 74 65 6e 73 69 6f t of:...Extensio
0b40: 6e 56 65 72 73 69 6f 6e 20 45 78 74 65 6e 73 69 nVersion Extensi
0b50: 6f 6e 50 6c 61 74 66 6f 72 6d 49 6e 66 6f 20 45 onPlatformInfo E
0b60: 78 74 65 6e 73 69 6f 6e 53 65 72 76 65 72 0a 0a xtensionServer..
0b70: 09 69 69 69 2e 20 73 65 74 63 61 63 68 65 64 69 .iii. setcachedi
0b80: 72 0a 09 09 53 59 4e 4f 50 53 49 53 0a 09 09 70 r...SYNOPSIS...p
0b90: 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 74 ackage require t
0ba0: 65 61 70 6f 74 63 6c 69 65 6e 74 0a 0a 09 09 3a eapotclient....:
0bb0: 3a 74 65 61 70 6f 74 63 6c 69 65 6e 74 3a 3a 73 :teapotclient::s
0bc0: 65 74 63 61 63 68 65 64 69 72 20 3c 64 69 72 65 etcachedir <dire
0bd0: 63 74 6f 72 79 3e 0a 0a 09 09 44 45 53 43 52 49 ctory>....DESCRI
0be0: 50 54 49 4f 4e 0a 09 09 54 68 65 20 64 6f 77 6e PTION...The down
0bf0: 6c 6f 61 64 5f 65 78 74 65 6e 73 69 6f 6e 73 20 load_extensions
0c00: 61 6e 64 20 67 65 74 5f 65 78 74 65 6e 73 69 6f and get_extensio
0c10: 6e 73 20 63 6f 6d 6d 61 6e 64 73 20 75 73 65 20 ns commands use
0c20: 61 0a 09 09 6c 6f 63 61 6c 20 64 69 73 6b 20 63 a...local disk c
0c30: 61 63 68 65 20 74 6f 20 69 6d 70 72 6f 76 65 20 ache to improve
0c40: 70 65 72 66 6f 72 6d 61 6e 63 65 2e 20 20 54 68 performance. Th
0c50: 65 20 64 65 66 61 75 6c 74 0a 09 09 63 61 63 68 e default...cach
0c60: 65 20 64 69 72 65 63 74 6f 72 79 20 69 73 20 61 e directory is a
0c70: 20 64 69 72 65 63 74 6f 72 79 20 69 6e 20 74 68 directory in th
0c80: 65 20 75 73 65 72 27 73 20 68 6f 6d 65 20 64 69 e user's home di
0c90: 72 65 63 74 6f 72 79 2c 20 6f 72 0a 09 09 61 20 rectory, or...a
0ca0: 74 65 6d 70 6f 72 61 72 79 20 64 69 72 65 63 74 temporary direct
0cb0: 6f 72 79 20 69 66 20 61 20 68 6f 6d 65 20 64 69 ory if a home di
0cc0: 72 65 63 74 6f 72 79 20 69 73 20 6e 6f 74 20 66 rectory is not f
0cd0: 6f 75 6e 64 2e 0a 0a 09 09 73 65 74 63 61 63 68 ound.....setcach
0ce0: 65 64 69 72 20 73 70 65 63 69 66 69 65 73 20 61 edir specifies a
0cf0: 6e 20 61 6c 74 65 72 6e 61 74 65 20 6c 6f 63 61 n alternate loca
0d00: 74 69 6f 6e 20 74 6f 20 73 74 6f 72 65 20 74 68 tion to store th
0d10: 65 20 63 61 63 68 65 2e 0a 0a 09 09 73 65 74 63 e cache.....setc
0d20: 61 63 68 65 64 69 72 20 73 68 6f 75 6c 64 20 62 achedir should b
0d30: 65 20 63 61 6c 6c 65 64 20 62 65 66 6f 72 65 20 e called before
0d40: 61 6e 79 20 6f 74 68 65 72 20 63 6f 6d 6d 61 6e any other comman
0d50: 64 73 20 69 66 20 69 74 20 69 73 0a 09 09 69 6e ds if it is...in
0d60: 74 65 6e 64 65 64 20 74 6f 20 62 65 20 75 73 65 tended to be use
0d70: 64 2e 0a 09 0a 0a 09 09 52 45 54 55 52 4e 20 56 d.......RETURN V
0d80: 41 4c 55 45 0a 09 09 55 6e 73 70 65 63 69 66 69 ALUE...Unspecifi
0d90: 65 64 2e 0a 0a 09 69 76 2e 20 45 78 61 6d 70 6c ed....iv. Exampl
0da0: 65 20 31 3a 0a 09 09 70 61 63 6b 61 67 65 20 72 e 1:...package r
0db0: 65 71 75 69 72 65 20 74 65 61 70 6f 74 63 6c 69 equire teapotcli
0dc0: 65 6e 74 0a 0a 09 09 70 75 74 73 20 22 54 68 65 ent....puts "The
0dd0: 20 66 6f 6c 6c 6f 77 69 6e 67 20 65 78 74 65 6e following exten
0de0: 73 69 6f 6e 73 20 61 72 65 20 61 76 61 69 6c 61 sions are availa
0df0: 62 6c 65 3a 22 0a 09 09 66 6f 72 65 61 63 68 20 ble:"...foreach
0e00: 7b 65 78 74 65 6e 73 69 6f 6e 20 65 78 74 65 6e {extension exten
0e10: 73 69 6f 6e 69 6e 66 6f 7d 20 5b 3a 3a 74 65 61 sioninfo} [::tea
0e20: 70 6f 74 63 6c 69 65 6e 74 3a 3a 67 65 74 5f 65 potclient::get_e
0e30: 78 74 65 6e 73 69 6f 6e 73 20 5c 0a 09 09 20 20 xtensions \...
0e40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0e50: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0e60: 20 5b 6c 69 73 74 20 74 65 61 70 6f 74 2e 61 63 [list teapot.ac
0e70: 74 69 76 65 73 74 61 74 65 2e 63 6f 6d 5d 20 5c tivestate.com] \
0e80: 0a 09 09 20 20 20 20 20 20 20 20 20 20 20 20 20 ...
0e90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0ea0: 20 20 20 20 20 20 7b 2a 7d 20 7b 2a 7d 5d 20 7b {*} {*}] {
0eb0: 0a 09 09 09 70 75 74 73 20 22 20 20 24 65 78 74 ....puts " $ext
0ec0: 65 6e 73 69 6f 6e 20 5b 6a 6f 69 6e 20 24 65 78 ension [join $ex
0ed0: 74 65 6e 73 69 6f 6e 69 6e 66 6f 20 7b 2c 20 7d tensioninfo {, }
0ee0: 5d 22 0a 09 09 7d 0a 0a 09 20 76 2e 20 45 78 61 ]"...}... v. Exa
0ef0: 6d 70 6c 65 20 32 3a 0a 09 09 70 61 63 6b 61 67 mple 2:...packag
0f00: 65 20 72 65 71 75 69 72 65 20 74 65 61 70 6f 74 e require teapot
0f10: 63 6c 69 65 6e 74 0a 0a 09 09 73 65 74 20 6f 73 client....set os
0f20: 20 24 74 63 6c 5f 70 6c 61 74 66 6f 72 6d 28 6f $tcl_platform(o
0f30: 73 29 0a 09 09 69 66 20 7b 24 74 63 6c 5f 70 6c s)...if {$tcl_pl
0f40: 61 74 66 6f 72 6d 28 70 6c 61 74 66 6f 72 6d 29 atform(platform)
0f50: 20 3d 3d 20 22 77 69 6e 64 6f 77 73 22 7d 20 7b == "windows"} {
0f60: 0a 09 09 09 73 65 74 20 6f 73 20 24 74 63 6c 5f ....set os $tcl_
0f70: 70 6c 61 74 66 6f 72 6d 28 70 6c 61 74 66 6f 72 platform(platfor
0f80: 6d 29 0a 09 09 7d 0a 0a 09 09 70 75 74 73 20 22 m)...}....puts "
0f90: 44 6f 77 6e 6c 6f 61 64 69 6e 67 20 6d 64 35 20 Downloading md5
0fa0: 61 6e 64 20 73 68 61 31 20 70 61 63 6b 61 67 65 and sha1 package
0fb0: 73 20 66 6f 72 20 74 68 65 20 63 75 72 72 65 6e s for the curren
0fc0: 74 20 73 79 73 74 65 6d 22 0a 09 09 3a 3a 74 65 t system"...::te
0fd0: 61 70 6f 74 63 6c 69 65 6e 74 3a 3a 64 6f 77 6e apotclient::down
0fe0: 6c 6f 61 64 5f 65 78 74 65 6e 73 69 6f 6e 73 20 load_extensions
0ff0: 22 2e 22 20 5c 0a 09 09 20 20 5b 6c 69 73 74 20 "." \... [list
1000: 74 65 61 70 6f 74 2e 61 63 74 69 76 65 73 74 61 teapot.activesta
1010: 74 65 2e 63 6f 6d 5d 20 5b 6c 69 73 74 20 6d 64 te.com] [list md
1020: 35 20 73 68 61 31 5d 20 24 6f 73 20 5c 0a 09 09 5 sha1] $os \...
1030: 20 20 24 74 63 6c 5f 70 6c 61 74 66 6f 72 6d 28 $tcl_platform(
1040: 6d 61 63 68 69 6e 65 29 0a 0a 09 09 0a 62 2e 20 machine).....b.
1050: 74 65 61 70 6f 74 2d 63 6c 69 65 6e 74 20 2f 20 teapot-client /
1060: 74 65 61 70 6f 74 2d 63 6c 69 65 6e 74 2e 74 63 teapot-client.tc
1070: 6c 3a 0a 09 69 2e 20 74 65 61 70 6f 74 2d 63 6c l:..i. teapot-cl
1080: 69 65 6e 74 20 67 65 74 20 3c 64 69 72 3e 20 3c ient get <dir> <
1090: 6f 73 3e 20 3c 63 70 75 3e 20 3c 70 61 63 6b 61 os> <cpu> <packa
10a0: 67 65 73 2e 2e 2e 3e 0a 09 09 44 6f 77 6e 6c 6f ges...>...Downlo
10b0: 61 64 73 20 61 6c 6c 20 74 68 65 20 72 65 71 75 ads all the requ
10c0: 65 73 74 65 64 20 65 78 74 65 6e 73 69 6f 6e 73 ested extensions
10d0: 2f 70 61 63 6b 61 67 65 73 20 66 6f 72 20 74 68 /packages for th
10e0: 65 20 4f 53 2b 43 50 55 0a 09 09 70 61 69 72 20 e OS+CPU...pair
10f0: 69 6e 74 6f 20 74 68 65 20 22 6c 69 62 22 20 64 into the "lib" d
1100: 69 72 65 63 74 6f 72 79 20 6f 66 20 74 68 65 20 irectory of the
1110: 64 69 72 65 63 74 6f 72 79 20 73 70 65 63 69 66 directory specif
1120: 69 65 64 2e 0a 0a 09 69 69 2e 20 74 65 61 70 6f ied....ii. teapo
1130: 74 2d 63 6c 69 65 6e 74 20 6c 69 73 74 20 3f 3c t-client list ?<
1140: 6f 73 3e 3f 20 3f 3c 63 70 75 3e 3f 0a 09 09 4c os>? ?<cpu>?...L
1150: 69 73 74 73 20 61 6c 6c 20 61 76 61 69 6c 61 62 ists all availab
1160: 6c 65 20 65 78 74 65 6e 73 69 6f 6e 73 20 61 6e le extensions an
1170: 64 20 74 68 65 69 72 20 6d 6f 73 74 20 72 65 63 d their most rec
1180: 65 6e 74 20 76 65 72 73 69 6f 6e 73 2c 0a 09 09 ent versions,...
1190: 6f 70 74 69 6f 6e 61 6c 6c 79 20 72 65 73 74 72 optionally restr
11a0: 69 63 74 65 64 20 74 6f 20 61 6e 20 4f 53 2b 43 icted to an OS+C
11b0: 50 55 20 70 61 69 72 2e 0a 0a 49 49 2e 20 53 45 PU pair...II. SE
11c0: 52 56 45 52 0a 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a RVER.==========.
11d0: 54 68 69 73 20 69 73 20 6e 6f 74 20 79 65 74 20 This is not yet
11e0: 69 6d 70 6c 65 6d 65 6e 74 65 64 2e 0a implemented..