Commit a5dc317e authored by Christopher Alfeld's avatar Christopher Alfeld

Fixed to deal with symbolic links.

parent 92614a39
...@@ -14,11 +14,18 @@ proc outs {args} { ...@@ -14,11 +14,18 @@ proc outs {args} {
puts $logFp $s puts $logFp $s
} }
if {[file dirname [info script]] == "."} { ### Bootstrapping code. The whole purpose of this is to find the
set updir ".." # directory containing the script.
} else { set file [info script]
set updir [file dirname [file dirname [info script]]] while {![catch "file readlink $file" newfile]} {
set file $newfile
} }
set scriptdir [file dirname $file]
if {$scriptdir == "."} {set scriptdir [pwd]}
###
set updir [file dirname $scriptdir]
set nfree "$updir/db/nfree" set nfree "$updir/db/nfree"
set libir "$updir/ir/libir.tcl" set libir "$updir/ir/libir.tcl"
......
...@@ -14,11 +14,18 @@ proc outs {args} { ...@@ -14,11 +14,18 @@ proc outs {args} {
puts $logFp $s puts $logFp $s
} }
if {[file dirname [info script]] == "."} { ### Bootstrapping code. The whole purpose of this is to find the
set updir ".." # directory containing the script.
} else { set file [info script]
set updir [file dirname [file dirname [info script]]] while {![catch "file readlink $file" newfile]} {
set file $newfile
} }
set scriptdir [file dirname $file]
if {$scriptdir == "."} {set scriptdir [pwd]}
###
set updir [file dirname $scriptdir]
set ns2ir "$updir/ir/ns2ir/parse.tcl" set ns2ir "$updir/ir/ns2ir/parse.tcl"
set assign "$updir/ir/assign.tcl" set assign "$updir/ir/assign.tcl"
set handle_ip "$updir/ir/handle_ip.tcl" set handle_ip "$updir/ir/handle_ip.tcl"
......
...@@ -14,12 +14,18 @@ proc outs {args} { ...@@ -14,12 +14,18 @@ proc outs {args} {
puts $logFp $s puts $logFp $s
} }
set scriptdir [file dirname [info script]] ### Bootstrapping code. The whole purpose of this is to find the
if {$scriptdir == "."} { # directory containing the script.
set updir ".." set file [info script]
} else { while {![catch "file readlink $file" newfile]} {
set updir [file dirname $scriptdir] set file $newfile
} }
set scriptdir [file dirname $file]
if {$scriptdir == "."} {set scriptdir [pwd]}
###
set updir [file dirname $scriptdir]
set snmpit "$updir/switch_tools/intel510/snmpit" set snmpit "$updir/switch_tools/intel510/snmpit"
set resetvlans "$updir/switch_tools/intel510/resetvlans.tcl" set resetvlans "$updir/switch_tools/intel510/resetvlans.tcl"
set libir "$updir/ir/libir.tcl" set libir "$updir/ir/libir.tcl"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment