From 645ed6fd4b6f9038c7e1d85d74c3872b3cb9a507 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Tue, 16 Aug 2011 19:58:03 +1000 Subject: Update autosetup Allows options and settings in any order Doesn't try to create temp files in /tmp on mingw which may fail. Signed-off-by: Steve Bennett --- autosetup/autosetup | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/autosetup/autosetup b/autosetup/autosetup index 9d490c8..fae164e 100755 --- a/autosetup/autosetup +++ b/autosetup/autosetup @@ -1001,8 +1001,10 @@ set modsource(getopt) { # Parse everything out of the argv list which looks like an option # Knows about --enable-thing and --disable-thing as alternatives for --thing=0 or --thing=1 +# Everything which doesn't look like an option, or is after --, is left unchanged proc getopt {argvname} { upvar $argvname argv + set nargv {} for {set i 0} {$i < [llength $argv]} {incr i} { set arg [lindex $argv $i] @@ -1012,6 +1014,7 @@ proc getopt {argvname} { if {$arg eq "--"} { # End of options incr i + lappend nargv {*}[lrange $argv $i end] break } @@ -1025,14 +1028,14 @@ proc getopt {argvname} { } lappend opts($name) $value } else { - break + lappend nargv $arg } } - #puts "getopt: argv=[join $argv] => [join [lrange $argv $i end]]" + #puts "getopt: argv=[join $argv] => [join $nargv]" #parray opts - set argv [lrange $argv $i end] + set argv $nargv return [array get opts] } @@ -1513,7 +1516,7 @@ if {$autosetup(istcl)} { # Jim uses system() for exec under mingw, so # we need to fetch the output ourselves proc exec-with-stderr {args} { - set tmpfile /tmp/autosetup.[format %05x [rand 10000]].tmp + set tmpfile auto[format %04x [rand 10000]].tmp set rc [catch [list exec {*}$args >$tmpfile 2>&1] result] set result [readfile $tmpfile] file delete $tmpfile -- cgit v1.1