Fix None None bug and exception reporting
authorEric Edgar <rocket@gentoo.org>
Wed, 6 Jul 2005 18:28:13 +0000 (18:28 +0000)
committerEric Edgar <rocket@gentoo.org>
Wed, 6 Jul 2005 18:28:13 +0000 (18:28 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@748 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
catalyst
modules/catalyst_support.py
modules/generic_stage_target.py

index 117b551ee47cbf82504ac782f7e5c2261e9cfd37..45381e681c8cf2b4499c4317e7e516b193b2f213 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.290 2005/07/06 14:10:03 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.291 2005/07/06 18:28:12 rocket Exp $
+
+  06 Jul 2005; <eje001@gentoo.org> catalyst, modules/catalyst_support.py,
+  modules/generic_stage_target.py:
+  Fix None None bug and exception reporting
 
   06 Jul 2005; Eric Edgar <rocket@gentoo.org> targets/support/create-iso.sh:
   Fix iso creation script.  Case statement out of place
index 03097ac585716ce77be6d17c7d7b7dd73c0c7f91..551b3065472798d554d8a6db79176184585159f9 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -1,14 +1,14 @@
 #!/usr/bin/python
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.85 2005/07/05 21:53:41 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.86 2005/07/06 18:28:12 rocket Exp $
 
 # Maintained in full by:
 # Eric Edgar <rocket@gentoo.org>
 # Chris Gianelloni <wolf31o2@gentoo.org>
 
 import os,sys,imp,string,getopt
-
+import pdb
 __maintainer__="Chris Gianelloni <wolf31o2@gentoo.org>"
 __version__="2.0.0_pre2"
 
@@ -344,13 +344,20 @@ if __name__ == "__main__":
        
        except CatalystError:
                raise CatalystError,"Could not complete build"
+               print
+               print "Catalyst aborting...."
                sys.exit(2)
        except KeyboardInterrupt:
                print "\nCatalyst build aborted due to user interrupt ( Ctrl-C )"
-               sys.exit(2)
+               print
+               print "Catalyst aborting...."
        except KeyError:
                print "\nproblem with command line or spec file ( Key Error )"
+               print
+               print "Catalyst aborting...."
                sys.exit(2)
+       except UnboundLocalError:
+               pass
        except:
                print "Catalyst aborting...."
                raise
index cde1a9240715b8ea4d3a92204007a19c11f5bc14..02a0ca5e3e91b19ef80fba720f988f2fa80df81a 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.49 2005/07/05 21:53:41 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.50 2005/07/06 18:28:13 rocket Exp $
 
 import sys,string,os,types,re,signal,traceback,md5,time
 selinux_capable = False
@@ -20,6 +20,10 @@ except:
 # pids this process knows of.
 spawned_pids = []
 
+try:
+        import urllib
+except SystemExit, e:
+        raise
 
 def cleanup(pids,block_exceptions=True):
         """function to go through and reap the list of pids passed to it"""
@@ -137,8 +141,10 @@ def list_to_string(mylist):
 class CatalystError(Exception):
        def __init__(self, message):
                if message:
-                       print
-                       print traceback.print_exc(file=sys.stdout)
+                       (type,value)=sys.exc_info()[:2]
+                       if value!=None:
+                           print
+                           print traceback.print_exc(file=sys.stdout)
                        print
                        print "!!! catalyst: "+message
                        print
@@ -500,7 +506,6 @@ def file_locate(settings,filelist,expand=1):
                        settings[myfile]=os.getcwd()+"/"+settings[myfile]
                else:
                        raise CatalystError, "Cannot locate specified "+myfile+": "+settings[myfile]+" (2nd try)"
-
 """
 Spec file format:
 
index 11e92d6d7e6e66bd301a11951466477d008c6fce..e3b011b207b6ef09292f48c3c0c568c311057736 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.49 2005/07/05 21:53:41 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.50 2005/07/06 18:28:13 rocket Exp $
 
 """
 This class does all of the chroot setup, copying of files, etc. It is
@@ -11,7 +11,7 @@ import os,string,imp,types,shutil
 from catalyst_support import *
 from generic_target import *
 from stat import *
-
+import pdb
 class generic_stage_target(generic_target):
 
        def __init__(self,myspec,addlargs):
@@ -131,10 +131,10 @@ class generic_stage_target(generic_target):
                self.set_iso()
                self.set_packages()
                
-
                # this next line checks to make sure that the specified variables exist on disk.
+               #pdb.set_trace()
                file_locate(self.settings,["source_path","snapshot_path","distdir"],expand=0)
-               
+
                # if we are using portage_confdir, check that as well
                if self.settings.has_key("portage_confdir"):
                        file_locate(self.settings,["portage_confdir"],expand=0)
@@ -849,6 +849,7 @@ class generic_stage_target(generic_target):
                    except CatalystError:
                        self.unbind()
                        raise
+
                touch(self.settings["autoresume_path"]+"unmerge")
 
        def target_setup(self):