This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[patch] package handling in main.tcl
- From: "Martin M. Hunt" <hunt at redhat dot com>
- To: "insight at sources dot redhat dot com" <insight at sources dot redhat dot com>
- Date: 03 Dec 2002 14:27:42 -0800
- Subject: [patch] package handling in main.tcl
2002-12-03 Martin M. Hunt <hunt@redhat.com>
* library/main.tcl: Require package "debug". Make
package loading a bit more robust.
Index: main.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/main.tcl,v
retrieving revision 1.10
diff -p -r1.10 main.tcl
*** main.tcl 14 Aug 2002 18:10:49 -0000 1.10
--- main.tcl 3 Dec 2002 22:23:57 -0000
*************** if {[info exists auto_path]} {
*** 53,86 ****
}
}
# Require the packages we need. Most are loaded already, but this will catch
# any odd errors... :
- package require Tcl 8.0
- package require Tk 8.0
- package require Itcl 3.0
- package require Itk 3.0
- package require Gdbtk 1.0
- package require combobox 1.0
! namespace import itcl::*
namespace import debug::*
! # Setup iwidgets path, if needed
if {[info exists IWIDGETS_LIBRARY]} {
lappend auto_path $IWIDGETS_LIBRARY
}
!
! if {[catch {package require Iwidgets 3.0} errMsg]} {
! set msg "Could not find the Iwidgets libraries.\n\nGot nameofexec: [info nameofexecutable]\nError(s) were: \n$errMsg"
!
if {![info exists ::env(GDBTK_TEST_RUNNING)] || $::env(GDBTK_TEST_RUNNING) == 0} {
! puts stderr $msg
! } else {
! tk_messageBox -title Error -message $msg -icon error -type ok
}
! exit
}
# Environment variables controlling debugging:
# GDBTK_TRACE
--- 53,89 ----
}
}
+
# Require the packages we need. Most are loaded already, but this will catch
# any odd errors... :
! foreach p {{Tcl 8.0} {Tk 8.0} {Itcl 3.0} {Itk 3.0} {Gdbtk 1.0} {combobox 1.0} {debug 1.0}} {
! if {[catch {package require [lindex $p 0] [lindex $p 1]} msg]} {
! if {![info exists ::env(GDBTK_TEST_RUNNING)] || $::env(GDBTK_TEST_RUNNING) == 0} {
! puts stderr "Error: $msg"
! catch {tk_messageBox -title Error -message $msg -icon error -type ok}
! }
! exit -1
! } else {
! #puts "Loaded [lindex $p 0] $msg"
! }
! }
+ namespace import itcl::*
namespace import debug::*
! # Finally, load Iwidgets
if {[info exists IWIDGETS_LIBRARY]} {
lappend auto_path $IWIDGETS_LIBRARY
}
! if {[catch {package require Iwidgets 3.0} msg]} {
if {![info exists ::env(GDBTK_TEST_RUNNING)] || $::env(GDBTK_TEST_RUNNING) == 0} {
! puts stderr "Error: $msg"
! catch {tk_messageBox -title Error -message $msg -icon error -type ok}
}
! exit -1
}
+
# Environment variables controlling debugging:
# GDBTK_TRACE