diff options
author | Ben Elliston <bje@gnu.org> | 2018-12-09 17:00:21 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2018-12-09 17:00:21 +1100 |
commit | 1ebfbcd81f3e1918cc96e3654f9120ea7458b1f6 (patch) | |
tree | 3d8b6ed82c08e11af0cdadc1429d37232de66aaf | |
parent | ea3d6ba5abc895eb968b5990c4ff8aa604d6a8e1 (diff) | |
download | dejagnu-1ebfbcd81f3e1918cc96e3654f9120ea7458b1f6.zip dejagnu-1ebfbcd81f3e1918cc96e3654f9120ea7458b1f6.tar.gz dejagnu-1ebfbcd81f3e1918cc96e3654f9120ea7458b1f6.tar.bz2 |
* lib/debugger.exp, lib/dg.exp, lib/framework.exp, lib/ftp.exp,
lib/kermit.exp, lib/libgloss.exp, lib/remote.exp, lib/rlogin.exp,
lib/target.exp, lib/tip.exp, lib/utils.exp, runtest.exp: Remove
unnecessary quotes and braces around variable expansions.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/debugger.exp | 2 | ||||
-rw-r--r-- | lib/dg.exp | 18 | ||||
-rw-r--r-- | lib/framework.exp | 34 | ||||
-rw-r--r-- | lib/ftp.exp | 2 | ||||
-rw-r--r-- | lib/kermit.exp | 6 | ||||
-rw-r--r-- | lib/libgloss.exp | 52 | ||||
-rw-r--r-- | lib/remote.exp | 92 | ||||
-rw-r--r-- | lib/rlogin.exp | 2 | ||||
-rw-r--r-- | lib/target.exp | 12 | ||||
-rw-r--r-- | lib/tip.exp | 2 | ||||
-rw-r--r-- | lib/utils.exp | 4 |
12 files changed, 120 insertions, 113 deletions
@@ -1,5 +1,12 @@ 2018-12-09 Ben Elliston <bje@gnu.org> + * lib/debugger.exp, lib/dg.exp, lib/framework.exp, lib/ftp.exp, + lib/kermit.exp, lib/libgloss.exp, lib/remote.exp, lib/rlogin.exp, + lib/target.exp, lib/tip.exp, lib/utils.exp, runtest.exp: Remove + unnecessary quotes and braces around variable expansions. + +2018-12-09 Ben Elliston <bje@gnu.org> + * config/gdb-comm.exp: Remove unnecessary quotes. * config/gdb_stub.exp: Likewise. * config/vxworks.exp: Likewise. diff --git a/lib/debugger.exp b/lib/debugger.exp index abcbb2d..8873a13 100644 --- a/lib/debugger.exp +++ b/lib/debugger.exp @@ -179,7 +179,7 @@ proc watchdel { args } { # This file creates GDB style commands for the Tcl debugger # proc print { var } { - puts "$var" + puts $var } proc quit { } { @@ -374,7 +374,7 @@ proc dg-error { args } { set line [dg-format-linenum [lindex $args 0]] } - lappend messages [list $line "${xfail}ERROR" [lindex $args 1] [lindex $args 2]] + lappend messages [list $line ${xfail}ERROR [lindex $args 1] [lindex $args 2]] } proc dg-warning { args } { @@ -406,7 +406,7 @@ proc dg-warning { args } { set line [dg-format-linenum [lindex $args 0]] } - lappend messages [list $line "${xfail}WARNING" [lindex $args 1] [lindex $args 2]] + lappend messages [list $line ${xfail}WARNING [lindex $args 1] [lindex $args 2]] } proc dg-bogus { args } { @@ -438,7 +438,7 @@ proc dg-bogus { args } { set line [dg-format-linenum [lindex $args 0]] } - lappend messages [list $line "${xfail}BOGUS" [lindex $args 1] [lindex $args 2]] + lappend messages [list $line ${xfail}BOGUS [lindex $args 1] [lindex $args 2]] } proc dg-build { args } { @@ -460,7 +460,7 @@ proc dg-build { args } { } } - lappend messages [list [lindex $args 0] "${xfail}BUILD" [lindex $args 1] [lindex $args 2]] + lappend messages [list [lindex $args 0] ${xfail}BUILD [lindex $args 1] [lindex $args 2]] } proc dg-excess-errors { args } { @@ -629,7 +629,7 @@ proc dg-test { args } { # We append the compilation flags, if any, to ensure that the test case # names are unique. - if { "$tool_flags" ne "" } { + if { $tool_flags ne "" } { set name "$name $tool_flags" } @@ -659,7 +659,7 @@ proc dg-test { args } { set tmp [dg-get-options $prog] foreach op $tmp { verbose "Processing option: $op" 3 - set status [catch "$op" errmsg] + set status [catch $op errmsg] if { $status != 0 } { if { 0 && [info exists errorInfo] } { # This also prints a backtrace which will just confuse @@ -681,7 +681,7 @@ proc dg-test { args } { # If we're not supposed to try this test on this target, we're done. if { [lindex ${dg-do-what} 1] eq "N" } { - unsupported "$name" + unsupported $name verbose "$name not supported on this target, skipping it" 3 return } @@ -805,7 +805,7 @@ proc dg-test { args } { if { [lindex ${dg-do-what} 2] eq "F" } { setup_xfail "*-*-*" } - if { "$status" eq "pass" } { + if { $status eq "pass" } { pass "$name execution test" verbose "Exec succeeded." 3 if { [llength ${dg-output-text}] > 1 } { @@ -823,7 +823,7 @@ proc dg-test { args } { } unset texttmp } - } elseif { "$status" eq "fail" } { + } elseif { $status eq "fail" } { # It would be nice to get some info out of errorCode. if {[info exists errorCode]} { verbose "Exec failed, errorCode: $errorCode" 3 diff --git a/lib/framework.exp b/lib/framework.exp index 9581513..57f65d3 100644 --- a/lib/framework.exp +++ b/lib/framework.exp @@ -70,7 +70,7 @@ proc open_logs { } { xml_output "<testsuite>" } catch "file delete -force -- $outdir/$tool.log" - log_file -a "$outdir/$tool.log" + log_file -a $outdir/$tool.log verbose "Opening log files in $outdir" if { ${tool} == "testrun" } { set tool "" @@ -108,7 +108,7 @@ proc isbuild { { pattern "" } } { } verbose "Checking pattern \"$pattern\" with $build_triplet" 2 - if {[string match "$pattern" $build_triplet]} { + if {[string match $pattern $build_triplet]} { return 1 } else { return 0 @@ -186,7 +186,7 @@ proc is3way {} { set build_triplet ${host_triplet} } verbose "Checking $host_triplet against $build_triplet" 2 - if { "$build_triplet" eq "$host_triplet" } { + if { $build_triplet eq $host_triplet } { return 0 } return 1 @@ -203,7 +203,7 @@ proc ishost { { pattern "" } } { } verbose "Checking pattern \"$pattern\" with $host_triplet" 2 - if {[string match "$pattern" $host_triplet]} { + if {[string match $pattern $host_triplet]} { return 1 } else { return 0 @@ -289,11 +289,11 @@ proc clone_output { message } { global all_flag if { $sum_file ne "" } { - puts $sum_file "$message" + puts $sum_file $message } - regsub "^\[ \t\]*(\[^ \t\]+).*$" "$message" "\\1" firstword - switch -glob -- "$firstword" { + regsub "^\[ \t\]*(\[^ \t\]+).*$" $message "\\1" firstword + switch -glob -- $firstword { "PASS:" - "XFAIL:" - "KFAIL:" - @@ -302,18 +302,18 @@ proc clone_output { message } { "UNTESTED:" { if {$all_flag} { send_user -- "$message\n" - return "$message" + return $message } else { send_log -- "$message\n" } } {"ERROR:" "WARNING:" "NOTE:"} { send_error -- "$message\n" - return "$message" + return $message } default { send_user -- "$message\n" - return "$message" + return $message } } } @@ -350,7 +350,7 @@ proc log_and_exit {} { log_summary total # extract version number if {[info procs ${tool}_version] ne ""} { - if {[catch "${tool}_version" output]} { + if {[catch ${tool}_version output]} { warning "${tool}_version failed:\n$output" } } @@ -575,7 +575,7 @@ proc check_conditional_xfail { args } { set incl_hit 0 set opt [lindex $includes $i] verbose "Looking for $opt to include in the compiler flags" 2 - foreach j "$opt" { + foreach j $opt { if {[string match "* $j *" $compiler_flags]} { verbose "Found $j to include in the compiler flags" 2 incr incl_hit @@ -595,7 +595,7 @@ proc check_conditional_xfail { args } { set excl_hit 0 set opt [lindex $excludes $i] verbose "Looking for $opt to exclude in the compiler flags" 2 - foreach j "$opt" { + foreach j $opt { if {[string match "* $j *" $compiler_flags]} { verbose "Found $j to exclude in the compiler flags" 2 incr excl_hit @@ -804,11 +804,11 @@ proc record_test { type message args } { global multipass_name if { $multipass_name ne "" } { - set message [format "%s: %s: %s" "$type" "$multipass_name" "$message"] + set message [format "%s: %s: %s" $type $multipass_name $message] } else { set message "$type: $message" } - clone_output "$message" + clone_output $message # If a command name exists in the $local_record_procs associative # array for this type of result, then invoke it. @@ -816,7 +816,7 @@ proc record_test { type message args } { set lowcase_type [string tolower $type] global local_record_procs if {[info exists local_record_procs($lowcase_type)]} { - $local_record_procs($lowcase_type) "$message" + $local_record_procs($lowcase_type) $message } # Reset these so they're ready for the next test case. We don't reset @@ -1014,7 +1014,7 @@ proc init_testcounts { } { set j "" foreach i [lsort [array names test_counts]] { - regsub ",.*$" "$i" "" i + regsub ",.*$" $i "" i if { $i == $j } { continue } diff --git a/lib/ftp.exp b/lib/ftp.exp index b1feaf0..e1cc1a9 100644 --- a/lib/ftp.exp +++ b/lib/ftp.exp @@ -67,7 +67,7 @@ proc ftp_open {host} { } else { set command "user [board_info $host ftp_username]\n" } - send "$command" + send $command expect { -i $spawn_id -re ".*230.*$prompt" { } -i $spawn_id default { diff --git a/lib/kermit.exp b/lib/kermit.exp index 221b059..db604a2 100644 --- a/lib/kermit.exp +++ b/lib/kermit.exp @@ -127,7 +127,7 @@ proc kermit_command {dest args} { } foreach command $args { set timeout 120 - send -i $shell_id "${command}\r" + send -i $shell_id "$command\r" expect { -i $shell_id -re ".*ermit.*>.*$" { } -i $shell_id timeout { @@ -152,11 +152,11 @@ proc kermit_command {dest args} { proc kermit_send {dest string args} { if {[board_info $dest exists transmit_pause]} { set f [open "/tmp/fff" "w"] - puts -nonewline $f "$string" + puts -nonewline $f $string close $f set result [remote_transmit $dest /tmp/fff] remote_file build delete "/tmp/fff" - return "$result" + return $result } else { return [standard_send $dest $string] } diff --git a/lib/libgloss.exp b/lib/libgloss.exp index 0e033df..ac971c6 100644 --- a/lib/libgloss.exp +++ b/lib/libgloss.exp @@ -134,7 +134,7 @@ proc newlib_link_flags { args } { return "$result -B$gccpath/newlib/ -L$gccpath/newlib" } else { verbose "No newlib support for this target" - return "$result" + return $result } } @@ -181,7 +181,7 @@ proc libio_include_flags { args } { set gccpath "[get_multilibs]" if { $gccpath eq "" } { - set gccpath "$tool_root_dir" + set gccpath $tool_root_dir } set libio_bin_dir [lookfor_file ${gccpath} libio/_G_config.h] @@ -255,7 +255,7 @@ proc g++_include_flags { args } { append flags " -I${dir} -I${dir}/stl" } - return "$flags" + return $flags } proc g++_link_flags { args } { @@ -311,7 +311,7 @@ proc g++_link_flags { args } { append flags "-L${librx} " } } - return "$flags" + return $flags } proc libstdc++_include_flags { args } { @@ -344,7 +344,7 @@ proc libstdc++_include_flags { args } { append flags " -I${dir} -I${dir}/stl" } - return "$flags" + return $flags } proc libstdc++_link_flags { args } { @@ -383,7 +383,7 @@ proc libstdc++_link_flags { args } { append flags "-L${librx} " } } - return "$flags" + return $flags } # Get the list of directories and -m options for gcc. This is kinda bogus that @@ -425,9 +425,9 @@ proc get_multilibs { args } { return "" } - foreach x "$compiler" { - if {[regexp "^-B" "$x"]} { - regsub "^-B" "$x" "" comp_base_dir + foreach x $compiler { + if {[regexp "^-B" $x]} { + regsub "^-B" $x "" comp_base_dir set comp_base_dir [file dirname $comp_base_dir] break } @@ -497,9 +497,9 @@ proc get_multilibs { args } { } # search for the top level multilib directory - set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"] + set multitop [lookfor_file $comp_base_dir $target_alias] if { $multitop eq "" } { - set multitop [lookfor_file "${comp_base_dir}" "libraries"] + set multitop [lookfor_file $comp_base_dir "libraries"] if { $multitop eq "" } { set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]" if { $multitop ne "" } { @@ -510,14 +510,14 @@ proc get_multilibs { args } { } } - set gccpath [eval exec "$compiler" --print-multi-directory $mopts] + set gccpath [eval exec $compiler --print-multi-directory $mopts] set gccpath [lindex $gccpath 0] if { $gccpath ne "" } { verbose "GCC path is $gccpath" if { [llength $args] == 0 } { - set board_info($target_board,multitop) "$multitop/$gccpath" + set board_info($target_board,multitop) $multitop/$gccpath } - return "$multitop/$gccpath" + return $multitop/$gccpath } # extract the MULTILIB_MATCHES from dumpspecs @@ -562,11 +562,11 @@ proc get_multilibs { args } { # compare the lists of gcc options with the list of support multilibs verbose "Supported multilibs are: $multilibs" 3 set best 0 - foreach i "$multilibs" { + foreach i $multilibs { set hits 0 set opts [lindex $i 1] if { [llength $opts] <= [llength $moptions] } { - foreach j "$moptions" { + foreach j $moptions { # see if all the -m<foo> options match any of the multilibs verbose "Looking in $i for $j" 3 if { [lsearch -exact $opts $j] >= 0 } { @@ -590,15 +590,15 @@ proc get_multilibs { args } { if {[file exists [file join $multitop $gccpath]]} { verbose "GCC path is $multitop/$gccpath" 3 if { [llength $args] == 0 } { - set board_info($target_board,multitop) "$multitop/$gccpath" + set board_info($target_board,multitop) $multitop/$gccpath } - return "$multitop/$gccpath" + return $multitop/$gccpath } else { verbose "GCC path is $multitop" 3 if { [llength $args] == 0 } { - set board_info($target_board,multitop) "$multitop" + set board_info($target_board,multitop) $multitop } - return "$multitop" + return $multitop } } @@ -618,7 +618,7 @@ proc find_binutils_prog { name } { set file [lookfor_file $tool_root_dir binutils/${name}-new] } if { $file ne "" } { - set NAME "$file" + set NAME $file } else { set NAME [transform $name] } @@ -796,8 +796,8 @@ proc process_multilib_options { args } { set multilib_flags "" foreach x $board_variant_list { - regsub -all "^\[ \t\]*" "$x" "" x - regsub -all "\[ \t\]*$" "$x" "" x + regsub -all "^\[ \t\]*" $x "" x + regsub -all "\[ \t\]*$" $x "" x if { $x eq "" } { continue @@ -822,9 +822,9 @@ proc process_multilib_options { args } { set_board_info debug_flags "-gdwarf2" } "gdb:*=*" { - regsub "^gdb:\[^=\]*=(.*)$" "$x" "\\1" value - regsub "^gdb:(\[^=\]*)=.*$" "$x" "\\1" variable - set_board_info $variable "$value" + regsub "^gdb:\[^=\]*=(.*)$" $x "\\1" value + regsub "^gdb:(\[^=\]*)=.*$" $x "\\1" variable + set_board_info $variable $value } "gdb*remote" { set is_gdb_remote 1 diff --git a/lib/remote.exp b/lib/remote.exp index 08b1753..9185c29 100644 --- a/lib/remote.exp +++ b/lib/remote.exp @@ -98,7 +98,7 @@ proc close_wait_program { program_id pid {wres_varname ""} } { append sh_cmd "(kill -9 -$spid || kill -9 $spid);" } append sh_cmd ") && sleep $secs" - set exec_pid [exec sh -c "$sh_cmd" &] + set exec_pid [exec sh -c $sh_cmd &] } verbose "pid is $pid" @@ -156,7 +156,7 @@ proc local_exec { commandline inp outp timeout } { # cause it to exit before it can exit normally. The child should # ignore SIGHUP. global errorInfo - if { "$inp" eq "" && "$outp" eq "" } { + if { $inp eq "" && $outp eq "" } { set id -1 set result [catch "eval spawn -ignore SIGHUP \{${commandline}\}" pid] if { $result == 0 } { @@ -180,7 +180,7 @@ proc local_exec { commandline inp outp timeout } { if { $outp eq "" } { set outp "|& cat" } else { - set outpf "$outp" + set outpf $outp set outp "> $outp" if { $inp ne "" } { set use_tee 1 @@ -250,7 +250,7 @@ proc local_exec { commandline inp outp timeout } { } } if { $r2 != 0 } { - set res "$wres" + set res $wres } else { set res "" } @@ -347,7 +347,7 @@ proc standard_exec { hostname args } { # proc remote_close { host } { while { 1 } { - set result [call_remote "" close "$host"] + set result [call_remote "" close $host] if { [remote_pop_conn $host] ne "pass" } { break } @@ -356,7 +356,7 @@ proc remote_close { host } { } proc remote_raw_close { host } { - return [call_remote raw close "$host"] + return [call_remote raw close $host] } proc standard_close { host } { @@ -397,11 +397,11 @@ proc standard_close { host } { # characters. # proc remote_binary { host } { - return [call_remote "" binary "$host"] + return [call_remote "" binary $host] } proc remote_raw_binary { host } { - return [call_remote raw binary "$host"] + return [call_remote raw binary $host] } @@ -414,7 +414,7 @@ proc remote_reboot { host } { # FIXME: don't close the host connection, or all the remote # procedures will fail. # remote_close $host - set status [call_remote "" reboot "$host"] + set status [call_remote "" reboot $host] if {[board_info $host exists name]} { set host [board_info $host name] } @@ -474,7 +474,7 @@ proc remote_download { dest file args } { perror "Couldn't create remote directory $remotedir on $dest" return "" } - set destfile "$remotedir/$destfile" + set destfile $remotedir/$destfile } return [call_remote "" download $dest $file $destfile] @@ -492,10 +492,10 @@ proc standard_download {dest file destfile} { } else { set dest "" } - set destfile "$destdir/$destfile" + set destfile $destdir/$destfile } - if { "$dest" ne "" } { + if { $dest ne "" } { set result [rsh_download $dest $file $destfile] if { $result == $destfile } { return $orig_destfile @@ -549,10 +549,10 @@ proc standard_upload { dest srcfile destfile } { } else { set dest "" } - set srcfile "$destdir/$srcfile" + set srcfile $destdir/$srcfile } - if { "$dest" ne "" } { + if { $dest ne "" } { return [rsh_upload $dest $srcfile $destfile] } @@ -583,7 +583,7 @@ proc call_remote { type proc dest args } { } if { $proc eq "reboot" } { - regsub {/.*} "$dest" "" dest + regsub {/.*} $dest "" dest verbose "Changed dest to $dest" } @@ -596,7 +596,7 @@ proc call_remote { type proc dest args } { } load_board_description $dest if { $proc eq "reboot" } { - regsub {/.*} "$dest" "" dest + regsub {/.*} $dest "" dest verbose "Changed dest to $dest" } } @@ -605,9 +605,9 @@ proc call_remote { type proc dest args } { set high_prot "" if { $type ne "raw" } { if {[board_info $dest exists protocol]} { - set high_prot "${dest} [board_info $dest protocol]" + set high_prot "$dest [board_info $dest protocol]" } else { - set high_prot "${dest} [board_info $dest generic_name]" + set high_prot "$dest [board_info $dest generic_name]" } } @@ -655,26 +655,26 @@ proc call_remote { type proc dest args } { # Send FILE through the existing session established to DEST. # proc remote_transmit { dest file } { - return [call_remote "" transmit "$dest" "$file"] + return [call_remote "" transmit $dest $file] } proc remote_raw_transmit { dest file } { - return [call_remote raw transmit "$dest" "$file"] + return [call_remote raw transmit $dest $file] } # The default transmit procedure if no other exists. This feeds the # supplied file directly into the connection. # proc standard_transmit {dest file} { - if {[board_info ${dest} exists name]} { - set dest [board_info ${dest} name] + if {[board_info $dest exists name]} { + set dest [board_info $dest name] } - if {[board_info ${dest} exists baud]} { - set baud [board_info ${dest} baud] + if {[board_info $dest exists baud]} { + set baud [board_info $dest baud] } else { set baud 9600 } - set shell_id [board_info ${dest} fileid] + set shell_id [board_info $dest fileid] set lines 0 set chars 0 @@ -702,11 +702,11 @@ proc standard_transmit {dest file} { } proc remote_send { dest string } { - return [call_remote "" send "$dest" "$string"] + return [call_remote "" send $dest $string] } proc remote_raw_send { dest string } { - return [call_remote raw send "$dest" "$string"] + return [call_remote raw send $dest $string] } proc standard_send { dest string } { @@ -718,7 +718,7 @@ proc standard_send { dest string } { verbose "shell_id in standard_send is $shell_id" 3 verbose "send -i [board_info $dest fileid] -- $string" 3 if {[catch "send -i [board_info $dest fileid] -- \$string" errorInfo]} { - return "$errorInfo" + return $errorInfo } else { return "" } @@ -907,14 +907,14 @@ proc remote_spawn { dest commandline args } { # Seems to me there should be a cleaner way to do this. if { $args eq "" } { - return [call_remote "" spawn "$dest" "$commandline"] + return [call_remote "" spawn $dest $commandline] } else { - return [call_remote "" spawn "$dest" "$commandline" $args] + return [call_remote "" spawn $dest $commandline $args] } } proc remote_raw_spawn { dest commandline } { - return [call_remote raw spawn "$dest" "$commandline"] + return [call_remote raw spawn $dest $commandline] } # The default spawn procedure. Uses rsh to connect to $dest. @@ -987,13 +987,13 @@ proc remote_load { dest prog args } { remote_file upload ${dprog}.sum ${prog}.sum } if { [lindex $status 0] == 0 } { - set sumout [remote_exec build "$sum_program" "${prog}.sum"] + set sumout [remote_exec build $sum_program $prog.sum] set sum [lindex $sumout 1] - regsub "\[\r\n \t\]+$" "$sum" "" sum + regsub "\[\r\n \t\]+$" $sum "" sum } else { - set sumout [remote_exec build "$sum_program" "${prog}"] + set sumout [remote_exec build $sum_program ${prog}] set sum [lindex $sumout 1] - regsub "\[\r\n \t\]+$" "$sum" "" sum + regsub "\[\r\n \t\]+$" $sum "" sum } remote_file build delete ${prog}.sum } @@ -1012,7 +1012,7 @@ proc remote_load { dest prog args } { } } if { $same } { - set fd [open "${cache}.res" "r"] + set fd [open $cache.res "r"] gets $fd l1 set result [list $l1 [read $fd]] close $fd @@ -1032,12 +1032,12 @@ proc remote_load { dest prog args } { if {[file exists $dir]} { if {[info exists sum_program]} { set id [open $cache "w"] - puts -nonewline $id "$sum" + puts -nonewline $id $sum close $id } else { remote_exec build cp "$prog $cache" } - set id [open "${cache}.res" "w"] + set id [open $cache.res "w"] puts $id [lindex $result 0] puts -nonewline $id [lindex $result 1] close $id @@ -1108,7 +1108,7 @@ proc standard_load { dest prog args } { verbose -log "Executed $prog, status $status" 2 if { $output ne "" } { - verbose -log -- "$output" 2 + verbose -log -- $output 2 } if { $status == 0 } { return [list "pass" $output] @@ -1254,7 +1254,7 @@ proc remote_expect { board timeout args } { set got_re 0 set need_append 1 - set orig "$args" + set orig $args set error_sect "" set save_next 0 @@ -1271,7 +1271,7 @@ proc remote_expect { board timeout args } { } set x "[lrange $args $i $i]" - regsub "^\n*\[ \t\]*" "$x" "" x + regsub "^\n*\[ \t\]*" $x "" x if { $x eq "-i" || $x eq "-timeout" || $x eq "-ex" } { append res "$x " @@ -1281,11 +1281,11 @@ proc remote_expect { board timeout args } { continue } if { $x eq "-n" || $x eq "-notransfer" || $x eq "-nocase" || $x eq "-indices" } { - append res "${x} " + append res "$x " continue } if { $x eq "-re" } { - append res "${x} " + append res "$x " set next [expr {$i + 1}] set y [lrange $args $next $next] append res "${y} " @@ -1302,14 +1302,14 @@ proc remote_expect { board timeout args } { set error_sect [lindex $args $i] } } else { - if { ${x} eq "eof" } { + if { $x eq "eof" } { set save_next 1 - } elseif { ${x} eq "default" || ${x} eq "timeout" } { + } elseif { $x eq "default" || $x eq "timeout" } { if { $error_sect eq "" } { set save_next 1 } } - append res "${x} " + append res "$x " set got_re 1 } } diff --git a/lib/rlogin.exp b/lib/rlogin.exp index cd1a583..30d2d1e 100644 --- a/lib/rlogin.exp +++ b/lib/rlogin.exp @@ -163,7 +163,7 @@ proc rlogin_spawn { dest cmdline } { if { ! $ok } { return "unable to start command" } else { - remote_send $dest "${prefix}${cmdline}\n" + remote_send $dest "$prefix$cmdline\n" return [board_info $dest fileid] } } diff --git a/lib/target.exp b/lib/target.exp index dbb50f6..b818d92 100644 --- a/lib/target.exp +++ b/lib/target.exp @@ -639,7 +639,7 @@ proc default_target_compile {source destfile type options} { if {[isremote host]} { if {[host_info exists use_at]} { set fid [open "atfile" "w"] - puts $fid "$opts" + puts $fid $opts close $fid set opts "@[remote_download host atfile]" remote_file build delete atfile @@ -673,7 +673,7 @@ proc default_target_compile {source destfile type options} { if { [lindex $status 1] ne "" } { verbose "output is:\n[lindex $status 1]" 2 } - if { [lindex $status 0] != 0 && "${comp_output}" eq "" } { + if { [lindex $status 0] != 0 && $comp_output eq "" } { set comp_output "exit status is [lindex $status 0]" } return ${comp_output} @@ -698,7 +698,7 @@ proc default_target_assemble { source destfile flags } { global ASFLAGS_FOR_TARGET if {[info exists AS_FOR_TARGET]} { - set AS "$AS_FOR_TARGET" + set AS $AS_FOR_TARGET } else { if {![board_info target exists assembler]} { set AS [find_gas] @@ -737,7 +737,7 @@ proc default_target_assemble { source destfile flags } { # linker. # proc target_link { objects destfile flags } { - return [default_link target "$objects" "$destfile" $flags] + return [default_link target $objects $destfile $flags] } proc default_link { board objects destfile flags } { @@ -770,7 +770,7 @@ proc default_link { board objects destfile flags } { } if {[info exists LD_FOR_TARGET]} { - set LD "$LD_FOR_TARGET" + set LD $LD_FOR_TARGET } else { if {![board_info target exists linker]} { set LD [find_ld] @@ -804,7 +804,7 @@ proc default_link { board objects destfile flags } { foreach x $objects { set nobjects "$nobjects [remote_download host $x]" } - set objects "$nobjects" + set objects $nobjects set dest "a.out" } else { set dest $destfile diff --git a/lib/tip.exp b/lib/tip.exp index 9fb94dd..d3b6ecd 100644 --- a/lib/tip.exp +++ b/lib/tip.exp @@ -163,7 +163,7 @@ proc tip_download { dest file args } { } -i $shell_id -re ".*$decimal\r" { if {[info exists expect_out(buffer)]} { - verbose "$expect_out(buffer)" + verbose $expect_out(buffer) exp_continue } } diff --git a/lib/utils.exp b/lib/utils.exp index e859e4d..30cf0b0 100644 --- a/lib/utils.exp +++ b/lib/utils.exp @@ -73,7 +73,7 @@ proc getdirs { args } { } } } else { - perror "$tmp" + perror $tmp return "" } @@ -230,7 +230,7 @@ proc grep { args } { set fd [open $file r] while { [gets $fd cur_line]>=0 } { incr i - if {[regexp -- "$pattern" $cur_line match]} { + if {[regexp -- $pattern $cur_line match]} { if {$options ne ""} { foreach opt $options { switch -- $opt { |