From 64c16cae70da13de3c55d8555a2e4c5dcdf2fcad Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Wed, 6 Jul 2005 18:28:13 +0000 Subject: [PATCH] Fix None None bug and exception reporting git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@748 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 6 +++++- catalyst | 13 ++++++++++--- modules/catalyst_support.py | 13 +++++++++---- modules/generic_stage_target.py | 9 +++++---- 4 files changed, 29 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 117b551e..45381e68 100644 --- 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; catalyst, modules/catalyst_support.py, + modules/generic_stage_target.py: + Fix None None bug and exception reporting 06 Jul 2005; Eric Edgar targets/support/create-iso.sh: Fix iso creation script. Case statement out of place diff --git a/catalyst b/catalyst index 03097ac5..551b3065 100755 --- 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 # Chris Gianelloni import os,sys,imp,string,getopt - +import pdb __maintainer__="Chris Gianelloni " __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 diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index cde1a924..02a0ca5e 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.py @@ -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: diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 11e92d6d..e3b011b2 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -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): -- 2.26.2