From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23874 invoked by alias); 3 Dec 2002 22:26:16 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 23867 invoked from network); 3 Dec 2002 22:26:13 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 3 Dec 2002 22:26:13 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id gB3M1EP02397 for ; Tue, 3 Dec 2002 17:01:14 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gB3MQDD14675 for ; Tue, 3 Dec 2002 17:26:13 -0500 Received: from dragon (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gB3MQC925848 for ; Tue, 3 Dec 2002 17:26:12 -0500 Subject: [patch] package handling in main.tcl From: "Martin M. Hunt" To: "insight@sources.redhat.com" Content-Type: multipart/mixed; boundary="=-fufnGSjJckwzJreqFVxe" Date: Tue, 03 Dec 2002 14:26:00 -0000 Message-Id: <1038954463.1168.59.camel@Dragon> Mime-Version: 1.0 X-SW-Source: 2002-q4/txt/msg00149.txt.bz2 --=-fufnGSjJckwzJreqFVxe Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 137 2002-12-03 Martin M. Hunt * library/main.tcl: Require package "debug". Make package loading a bit more robust. --=-fufnGSjJckwzJreqFVxe Content-Disposition: attachment; filename=p Content-Transfer-Encoding: quoted-printable Content-Type: text/x-patch; name=p; charset=UTF-8 Content-length: 2575 Index: main.tcl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 **** } } =20=20 # Require the packages we need. Most are loaded already, but this will c= atch=20 # 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 =20=20 ! namespace import itcl::* =20=20 namespace import debug::* =20=20 ! # Setup iwidgets path, if needed if {[info exists IWIDGETS_LIBRARY]} { lappend auto_path $IWIDGETS_LIBRARY } !=20 ! if {[catch {package require Iwidgets 3.0} errMsg]} { ! set msg "Could not find the Iwidgets libraries.\n\nGot nameofexec: [inf= o nameofexecutable]\nError(s) were: \n$errMsg" !=20 if {![info exists ::env(GDBTK_TEST_RUNNING)] || $::env(GDBTK_TEST_RUNNI= NG) =3D=3D 0} { ! puts stderr $msg ! } else { ! tk_messageBox -title Error -message $msg -icon error -type ok } ! exit } =20=20 # Environment variables controlling debugging: # GDBTK_TRACE --- 53,89 ---- } } =20=20 +=20 # Require the packages we need. Most are loaded already, but this will c= atch=20 # any odd errors... : =20=20 ! 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_RUN= NING) =3D=3D 0} { ! puts stderr "Error: $msg" ! catch {tk_messageBox -title Error -message $msg -icon error -type o= k} ! } ! exit -1 ! } else { ! #puts "Loaded [lindex $p 0] $msg" ! } ! } =20=20 + namespace import itcl::* namespace import debug::* =20=20 ! # 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_RUNNI= NG) =3D=3D 0} { ! puts stderr "Error: $msg" ! catch {tk_messageBox -title Error -message $msg -icon error -type ok} } ! exit -1 } +=20 =20=20 # Environment variables controlling debugging: # GDBTK_TRACE --=-fufnGSjJckwzJreqFVxe--