~vcs-imports-ii/dejagnu/master

« back to all changes in this revision

Viewing changes to lib/remote.exp

  • Committer: Ben Elliston
  • Date: 2018-12-09 07:41:26 UTC
  • Revision ID: git-v1:e2fb9266669c87021ce666f8dca81ab2d96635d1
        * baseboards/basic-sid.exp, baseboards/basic-sim.exp,
        baseboards/i386-sid.exp, baseboards/mt-sid.exp,
        baseboards/sh-sid.exp, config/adb.exp, config/gdb-comm.exp,
        config/gdb_stub.exp, config/sim.exp, config/unix.exp,
        config/vxworks.exp, lib/dejagnu.exp, lib/dg.exp,
        lib/framework.exp, lib/kermit.exp, lib/libgloss.exp,
        lib/remote.exp, lib/rsh.exp, lib/target.exp, lib/tip.exp,
        lib/utils.exp, testsuite/lib/libsup.exp,
        testsuite/runtest.all/options.exp,: Remove unnecessary braces
        around variable expansions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
        }
189
189
        # Why do we use tee? Because open can't redirect both input and output.
190
190
        if { $use_tee } {
191
 
            set result [catch {open "| ${commandline} $inp |& tee $outpf" RDONLY} id]
 
191
            set result [catch {open "| $commandline $inp |& tee $outpf" RDONLY} id]
192
192
        } else {
193
 
            set result [catch {open "| ${commandline} $inp $outp" $mode} id]
 
193
            set result [catch {open "| $commandline $inp $outp" $mode} id]
194
194
        }
195
195
 
196
196
        if { $result != 0 } {
362
362
proc standard_close { host } {
363
363
    global board_info
364
364
 
365
 
    if {[board_info ${host} exists fileid]} {
366
 
        set shell_id [board_info ${host} fileid]
 
365
    if {[board_info $host exists fileid]} {
 
366
        set shell_id [board_info $host fileid]
367
367
        set pid -1
368
368
 
369
369
        verbose "Closing the remote shell $shell_id" 2
370
 
        if {[board_info ${host} exists fileid_origid]} {
371
 
            set oid [board_info ${host} fileid_origid]
 
370
        if {[board_info $host exists fileid_origid]} {
 
371
            set oid [board_info $host fileid_origid]
372
372
            set pid [pid $oid]
373
 
            unset board_info(${host},fileid_origid)
 
373
            unset board_info($host,fileid_origid)
374
374
        } else {
375
375
            set result [catch "exp_pid -i $shell_id" pid]
376
376
            if { $result != 0 || $pid <= 0 } {
387
387
            catch "close $oid"
388
388
        }
389
389
 
390
 
        unset board_info(${host},fileid)
 
390
        unset board_info($host,fileid)
391
391
        verbose "Shell closed."
392
392
    }
393
393
    return 0
410
410
# success and 0 on failure.
411
411
#
412
412
proc remote_reboot { host } {
413
 
    clone_output "\nRebooting ${host}\n"
 
413
    clone_output "\nRebooting $host\n"
414
414
    # FIXME: don't close the host connection, or all the remote
415
415
    # procedures will fail.
416
416
    # remote_close $host
637
637
        }
638
638
        return $result
639
639
    }
640
 
    foreach try "${high_prot} [board_info $dest file_transfer] [board_info $dest connect] telnet standard" {
 
640
    foreach try "$high_prot [board_info $dest file_transfer] [board_info $dest connect] telnet standard" {
641
641
        verbose "looking for ${try}_${proc}" 4
642
642
        if { $try ne "" } {
643
643
            if { [info procs "${try}_${proc}"] ne "" } {
864
864
 
865
865
        if { [llength $args] > 0 } {
866
866
            if { [lindex $args 0] eq "readonly" } {
867
 
                set result [catch { open "| ${commandline} |& cat" "r" } id]
 
867
                set result [catch { open "| $commandline |& cat" "r" } id]
868
868
                if { $result != 0 } {
869
869
                    return -1
870
870
                }
871
871
            } else {
872
 
                set result [catch {open "| ${commandline}" "w"} id]
 
872
                set result [catch {open "| $commandline" "w"} id]
873
873
                if { $result != 0 } {
874
874
                    return -1
875
875
                }
982
982
            } else {
983
983
                set dprog $prog
984
984
            }
985
 
            set status [remote_exec host "[target_info objcopy]" "-O srec $dprog ${dprog}.sum"]
 
985
            set status [remote_exec host "[target_info objcopy]" "-O srec $dprog $dprog.sum"]
986
986
            if {[isremote host]} {
987
 
                remote_file upload ${dprog}.sum ${prog}.sum
 
987
                remote_file upload $dprog.sum $prog.sum
988
988
            }
989
989
            if { [lindex $status 0] == 0 } {
990
990
                set sumout [remote_exec build $sum_program $prog.sum]
991
991
                set sum [lindex $sumout 1]
992
992
                regsub "\[\r\n \t\]+$" $sum "" sum
993
993
            } else {
994
 
                set sumout [remote_exec build $sum_program ${prog}]
 
994
                set sumout [remote_exec build $sum_program $prog]
995
995
                set sum [lindex $sumout 1]
996
996
                regsub "\[\r\n \t\]+$" $sum "" sum
997
997
            }
998
 
            remote_file build delete ${prog}.sum
 
998
            remote_file build delete $prog.sum
999
999
        }
1000
1000
        if {[file exists $cache]} {
1001
1001
            set same 0
1288
1288
            append res "$x "
1289
1289
            set next [expr {$i + 1}]
1290
1290
            set y [lrange $args $next $next]
1291
 
            append res "${y} "
 
1291
            append res "$y "
1292
1292
            set got_re 1
1293
1293
            incr i
1294
1294
            continue