From 162ce0ba307cec47f4c1ab0eb8f0c807839b9bcf Mon Sep 17 00:00:00 2001 From: numa Date: Fri, 4 Sep 2009 15:51:03 +0200 Subject: [PATCH] Revert "Revert "vratili original FreeBSD host.tcl i exec.tcl, a dodali Linux verzije u linux/; dodali OS detection i pomaknuli platform detection iznad source'inga tako da to ide kondicionalno"" This reverts commit eba4cd9fa4c4a05bc251f2dc2bbb40393eac7600. --- imunes.tcl | 78 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/imunes.tcl b/imunes.tcl index 52cb6e3..4fd9dd8 100755 --- a/imunes.tcl +++ b/imunes.tcl @@ -102,6 +102,33 @@ if { $ROOTDIR == "." } { set BINDIR "bin" } +#****v* imunes.tcl/gui_unix +# NAME +# gui_unix +# FUNCTION +# false: IMUNES GUI is on MS Windows, +# true: GUI is on FreeBSD / Linux / ... +# Used in spawnShell to start xterm or command.com with NetCat +# Used below in order to source the right OS-specific files +#***** + +if { $tcl_platform(platform) == "unix" } { + set gui_unix true + if { $tcl_platform(os) == "FreeBSD" } { + set gui_freebsd true + set gui_linux false + } elseif { $tcl_platform(os) == "Linux" } { + set gui_linux true + set gui_freebsd false + } else { + puts "a bit lost here... apparently I am $tcl_platform(os)" + exit 1 + } +} else { + set gui_unix false +} +#puts "we have gui_unix=$gui_unix gui_linux=$gui_linux"; + source "$ROOTDIR/$LIBDIR/canvas.tcl" source "$ROOTDIR/$LIBDIR/linkcfg.tcl" source "$ROOTDIR/$LIBDIR/nodecfg.tcl" @@ -109,18 +136,34 @@ source "$ROOTDIR/$LIBDIR/ipv4.tcl" source "$ROOTDIR/$LIBDIR/ipv6.tcl" source "$ROOTDIR/$LIBDIR/ipsec.tcl" source "$ROOTDIR/$LIBDIR/cfgparse.tcl" -# TODO: odrediti je li FreeBSD ili Linux i ovisno o tome ucitati pravi exec.tcl -source "$ROOTDIR/$LIBDIR/exec.tcl" + +if { $gui_unix && $gui_linux } { + source "$ROOTDIR/$LIBDIR/linux/exec.tcl" +} else { + source "$ROOTDIR/$LIBDIR/exec.tcl" +} + source "$ROOTDIR/$LIBDIR/eventsched.tcl" -source "$ROOTDIR/$LIBDIR/quagga.tcl" -source "$ROOTDIR/$LIBDIR/xorp.tcl" -source "$ROOTDIR/$LIBDIR/static.tcl" -source "$ROOTDIR/$LIBDIR/pc.tcl" -source "$ROOTDIR/$LIBDIR/host.tcl" -source "$ROOTDIR/$LIBDIR/hub.tcl" -source "$ROOTDIR/$LIBDIR/lanswitch.tcl" -source "$ROOTDIR/$LIBDIR/rj45.tcl" +if { $gui_unix && $gui_linux } { +# source "$ROOTDIR/$LIBDIR/quagga.tcl" +# source "$ROOTDIR/$LIBDIR/xorp.tcl" +# source "$ROOTDIR/$LIBDIR/static.tcl" +# source "$ROOTDIR/$LIBDIR/pc.tcl" + source "$ROOTDIR/$LIBDIR/linux/host.tcl" +# source "$ROOTDIR/$LIBDIR/hub.tcl" +# source "$ROOTDIR/$LIBDIR/lanswitch.tcl" +# source "$ROOTDIR/$LIBDIR/rj45.tcl" +} else { + source "$ROOTDIR/$LIBDIR/quagga.tcl" + source "$ROOTDIR/$LIBDIR/xorp.tcl" + source "$ROOTDIR/$LIBDIR/static.tcl" + source "$ROOTDIR/$LIBDIR/pc.tcl" + source "$ROOTDIR/$LIBDIR/host.tcl" + source "$ROOTDIR/$LIBDIR/hub.tcl" + source "$ROOTDIR/$LIBDIR/lanswitch.tcl" + source "$ROOTDIR/$LIBDIR/rj45.tcl" +} source "$ROOTDIR/$LIBDIR/editor.tcl" source "$ROOTDIR/$LIBDIR/copypaste.tcl" @@ -201,21 +244,6 @@ set editor_only false set exec_sockets_opened false -#****v* imunes.tcl/gui_unix -# NAME -# gui_unix -# FUNCTION -# false: IMUNES GUI is on MS Windows, -# true: GUI is on FreeBSD / Linux / ... -# Used in spawnShell to start xterm or command.com with NetCat -#***** - -if { $tcl_platform(platform) == "unix" } { - set gui_unix true -} else { - set gui_unix false -} - #****v* imunes.tcl/remote_exec # NAME -- 2.39.5