From 1c4e12bb92fa51632d9f628cf357fade2f1175be Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Sat, 31 Mar 2007 00:18:53 +0000 Subject: [PATCH] Work around Solaris tar lameness. git-svn-id: svn://svn.equi4.com/kitgen/trunk@1347 9e558909-932a-0410-a563-af77432da1eb --- kbs.tcl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kbs.tcl b/kbs.tcl index 291d0b6..f4866e0 100644 --- a/kbs.tcl +++ b/kbs.tcl @@ -96,7 +96,7 @@ namespace eval config { } puts " untarring $file" file mkdir tmp - exec tar xfz $file -C tmp + Untar $file set untarred [glob tmp/*] if {[llength $untarred] == 1 && [file isdir [lindex $untarred 0]]} { file rename [lindex $untarred 0] [Srcdir] @@ -139,6 +139,14 @@ namespace eval config { if {[llength $paths] != 1} { error "not unique: $match" } lindex $paths 0 } + + proc Untar {file} { + set path [file normalize $file] + cd tmp + set r [catch {exec gzip -dc $path | tar xf -} err] + cd .. + if {$r} {return -code error $err} + } proc Sh {args} { lappend args >@stdout 2>@stderr -- 2.23.0