Revision: 55542
          http://sourceforge.net/p/brlcad/code/55542
Author:   brlcad
Date:     2013-05-23 02:50:01 +0000 (Thu, 23 May 2013)
Log Message:
-----------
fix the silent error that was causing mged to run without a slew of commands 
being available.  if we can't build a tclIndex, stop hard because something 
went terribly wrong.  sync ami.tcl and ampi.tcl too so they basically do the 
same thing (might want to merge at some point).  print the actual error if 
there was one.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/ami.tcl
    brlcad/trunk/src/tclscripts/ampi.tcl

Modified: brlcad/trunk/src/tclscripts/ami.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/ami.tcl 2013-05-22 21:08:03 UTC (rev 55541)
+++ brlcad/trunk/src/tclscripts/ami.tcl 2013-05-23 02:50:01 UTC (rev 55542)
@@ -24,49 +24,54 @@
 # This is a comment \
     exit
 
+set error 0
+
+if {![info exists argv]} {
+    puts "No directory argument provided for tclIndex."
+    return 0
+}
+
+
 # make the tclIndex
-proc make_tclIndex {argv} {
-    foreach arg $argv {
-       # generate a tclIndex file in the arg dir
-       puts "Generating a tclIndex in $arg"
-       catch {auto_mkindex $arg *.tcl *.itcl *.itk *.sh}
+foreach arg $argv {
+    # generate a tclIndex file in the arg dir
+    puts "Generating tclIndex in $arg"
+    catch {auto_mkindex $arg *.tcl *.itcl *.itk *.sh} errout
 
-       if {![file exists "$arg/tclIndex"]} {
-           puts "ERROR: tclIndex does not exist in $arg"
-           continue
-       }
+    if {![file exists "$arg/tclIndex"]} {
+       puts "$errout"
+       puts "ERROR: tclIndex does not exist in $arg"
+       incr error
+       continue
+    }
 
-       set tclIndex ""
-       set header ""
+    set tclIndex ""
+    set header ""
 
-       # sort the tclIndex
-       set fd [open "$arg/tclIndex"]
-       while {[gets $fd data] >= 0} {
-           if {[string compare -length 3 $data "set"] == 0} {
-               lappend tclIndex $data
-           } else {
-               lappend header $data
-           }
+    # sort the tclIndex
+    set fd [open "$arg/tclIndex"]
+    while {[gets $fd data] >= 0} {
+       if {[string compare -length 3 $data "set"] == 0} {
+           lappend tclIndex $data
+       } else {
+           lappend header $data
        }
-       close $fd
+    }
+    close $fd
 
-       # write out the sorted tclIndex
-       set fd [open "$arg/tclIndex" {WRONLY TRUNC CREAT}]
-       foreach line $header {
-           puts $fd $line
-       }
-       foreach line [lsort $tclIndex] {
-           puts $fd $line
-       }
-       close $fd
+    # write out the sorted tclIndex
+    set fd [open "$arg/tclIndex" {WRONLY TRUNC CREAT}]
+    foreach line $header {
+       puts $fd $line
     }
+    foreach line [lsort $tclIndex] {
+       puts $fd $line
+    }
+    close $fd
 }
 
-if {![info exists argv]} {
-    return 0
-}
 
-make_tclIndex $argv
+exit $error
 
 # Local Variables:
 # mode: Tcl

Modified: brlcad/trunk/src/tclscripts/ampi.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/ampi.tcl        2013-05-22 21:08:03 UTC (rev 
55541)
+++ brlcad/trunk/src/tclscripts/ampi.tcl        2013-05-23 02:50:01 UTC (rev 
55542)
@@ -24,19 +24,25 @@
 # This is a comment \
     exit
 
-# make the pkgIndex.tcl
+set error 0
+
 if {![info exists argv]} {
-    puts "No directory argument provided."
+    puts "No directory argument provided for pkgIndex.tcl."
     return 0
 }
 
+
+# make the pkgIndex.tcl
 foreach arg $argv {
+
     # generate a pkgIndex.tcl file in the arg dir
     puts "Generating pkgIndex.tcl in $arg"
-    catch {pkg_mkIndex -verbose $arg *.tcl *.itcl *.itk *.sh}
+    catch {pkg_mkIndex -verbose $arg *.tcl *.itcl *.itk *.sh} errout
 
     if {![file exists "$arg/pkgIndex.tcl"]} {
+       puts "$errout"
        puts "ERROR: pkgIndex.tcl does not exist in $arg"
+       incr error
        continue
     }
 
@@ -65,6 +71,9 @@
     close $fd
 }
 
+
+exit $error
+
 # Local Variables:
 # mode: Tcl
 # tab-width: 8

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to