Revision: 107492 https://trac.macports.org/changeset/107492 Author: marius@macports.org Date: 2013-07-01 08:07:52 -0700 (Mon, 01 Jul 2013) Log Message: ----------- Switched to regex search, fixed path, removed set_dir args. Modified Paths: -------------- branches/gsoc13-tests/tests/test/library.tcl Modified: branches/gsoc13-tests/tests/test/library.tcl =================================================================== --- branches/gsoc13-tests/tests/test/library.tcl 2013-07-01 15:00:40 UTC (rev 107491) +++ branches/gsoc13-tests/tests/test/library.tcl 2013-07-01 15:07:52 UTC (rev 107492) @@ -16,18 +16,20 @@ exit 1 } - set aux [expr [string length $pwd] - 20] - set cpwd [string range $pwd 0 [expr [string last "/" $pwd $aux] - 1]] + set aux [expr [string last "/" $pwd [string length $pwd]]] + set aux2 [expr [string last "/" $pwd $aux-1]] + set cpwd [string range $pwd 0 $aux2] - set line [get_line $autoconf "prefix"] + set line [get_line $autoconf "prefix*"] set prefix [lrange [split $line " "] 1 1] - set line [get_line $autoconf "bindir"] + set line [get_line $autoconf "bindir*"] set bin [lrange [split $line "/"] 1 1] set bindir $prefix/$bin/ set datadir $prefix/share set portsrc $cpwd/test-macports.conf + } proc cleanup {} { @@ -38,7 +40,7 @@ } # Sets initial directories -proc set_dir {pwd} { +proc set_dir {} { global datadir global cpwd @@ -119,7 +121,7 @@ while {[gets $fp line] != -1} { set line [string tolower $line] - if {[string first $lookup $line 0] != -1} { + if {[string match $lookup $line] != 0} { close $fp return $line }