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

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

     1      1   #! /usr/bin/env tclsh
     2      2   
     3      3   # This file has no license.  It is in the public domain.
     4      4   # -- Roy Keene <tcl@rkeene.org> [20081025T1400Q]
     5      5   
            6  +namespace eval ::teapotclient {}
            7  +
            8  +package require Tcl
     6      9   package require md5
     7     10   package require http
     8     11   package require fileutil
           12  +
           13  +set ::teapotclient::have_vfszip 0
           14  +catch {
           15  +	package require vfs::zip
           16  +	set ::teapotclient::have_vfszip 1
           17  +}
     9     18   
    10     19   namespace eval ::teapotclient {}
    11     20   namespace eval ::teapotclient {
    12     21   	proc __get_tmpdir {} {
    13     22   		foreach checkenv [list TMPDIR TEMP TMP TEMPDIR] {
    14     23   			if {[info exists ::env($checkenv)]} {
    15     24   				return $::env($checkenv)
................................................................................
    40     49   			file mkdir $::env(HOME)
    41     50   		}
    42     51   
    43     52   		return $::env(HOME)
    44     53   	}
    45     54   
    46     55   	proc __unzip {dir file} {
    47         -		exec unzip -d $dir -n -qq $urlcachefile
           56  +		file mkdir $dir
           57  +		if {$::teapotclient::have_vfszip} {
           58  +			set mntfd [vfs::zip::Mount $file $file]
           59  +
           60  +			foreach filetail [glob -nocomplain -tails -directory $file *] {
           61  +				set srcfile [file join $file $filetail]
           62  +				set destdir [file dirname [file join $dir $filetail]]
           63  +				file copy -force -- $srcfile $destdir
           64  +			}
           65  +
           66  +			vfs::zip::Unmount $mntfd $file
           67  +		} else {
           68  +			exec unzip -d $dir -n -qq $urlcachefile
           69  +		}
    48     70   	}
    49     71   
    50     72   	set pkgcachedir [file join [__get_homedir] ".teapot-client" "cachedir"]
    51     73   
    52     74           # Conversions from Teapot-style names to local ones
    53     75   	set osTeapotToLocal(tcl) *
    54     76   	set osTeapotToLocal(linux-*) linux