[cig-commits] commit: Adding an error msg to point a user in the right direction. This involves adding a custom function to the scons env, called UWExit.

Mercurial hg at geodynamics.org
Tue Mar 23 10:33:09 PDT 2010


changeset:   265:2a853f89027a
branch:      1.4.x
parent:      248:f155cc3a20ad
user:        JulianGiordani
date:        Wed Jan 27 12:54:59 2010 +1100
files:       SConfigure
description:
Adding an error msg to point a user in the right direction. This involves adding a custom function to the scons env, called UWExit.
The error msg is
************************************
If you require help, send the files:
config.log
config.cfg
to: underworld-users at vpac.org
************************************


diff -r f155cc3a20ad -r 2a853f89027a SConfigure
--- a/SConfigure	Wed Jan 20 13:12:53 2010 +1100
+++ b/SConfigure	Wed Jan 27 12:54:59 2010 +1100
@@ -33,6 +33,22 @@ options = [
 
 env = Environment(ENV=os.environ)
 env.Tool('config', toolpath=['config'], options=options)
+
+#
+# Definition of our error function
+#
+
+def UWExit( self ):
+   print '\n'
+   print '************************************'
+   print 'If you require help, send the files:'
+   print '\tconfig.log'
+   print '\tconfig.cfg'
+   print 'to: underworld-users at vpac.org'
+   print '************************************'
+   env.Exit()
+
+env.AddMethod( UWExit )
 
 #
 # Declare which packages we're going to use.
@@ -103,8 +119,10 @@ if not (GetOption('help') or GetOption('
 	#env.AppendUnique(LINKFLAGS=['-static'])
 	Package.static = True
     else:
+        print 
+        print '****  ERROR ****'
         print 'Invalid option \'--lib-type\''
-        sys.exit()
+        env.UWExit()
 
     env.ConfigurePackage(packages.libXML2)
     env.ConfigurePackage(packages.MPI)
@@ -124,11 +142,12 @@ if not (GetOption('help') or GetOption('
             res = env.ConfigurePackage(packages.OpenGL).result
             if not res:
                 print
+                print '****  ERROR ****'
                 print 'Need either OSMesa or OpenGL in order to use gLucifer'
                 print 'but neither could be found.'
-                print 'Details in \'config/config2/config.log\''
+                print 'Details in \'config.log\''
                 print
-                env.Exit()
+                env.UWExit()
 
         # Need an extra CPPDEFINE for gLucifer.
         env.AppendUnique(CPPDEFINES=['HAVE_GL'])
@@ -149,11 +168,12 @@ if not (GetOption('help') or GetOption('
 
         if not (res or sdl):
             print
+            print '****  ERROR ****'
             print 'Need a windowing system for gLucifer, one of either SDL,'
             print 'X11, Carbon or OSMesa. None of these could be found.'
-            print 'Details in \'config/config2/config.log\''
+            print 'Details in \'config.log\''
             print
-            env.Exit()
+            env.UWExit()
 
         # Add auxilliary gLucifer packages.
         if env.get('with_png'):



More information about the CIG-COMMITS mailing list