From a29253564ae8f756168fd1670be5a4857f2d02d5 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Wed, 27 Apr 2005 21:04:02 +0000 Subject: [PATCH] Fix exception handling to remove extraneous prints of None git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@630 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 6 +++++- catalyst | 8 ++++++-- modules/catalyst_support.py | 9 +++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae44b14d..600d262b 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.242 2005/04/27 17:59:35 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.243 2005/04/27 21:04:01 rocket Exp $ + + 27 Apr 2005; Eric Edgar catalyst, + modules/catalyst_support.py: + Fix exception handling to remove extraneous prints of None 27 Apr 2005; Eric Edgar modules/stage4_target.py: Remove iso creation code from stage4 diff --git a/catalyst b/catalyst index 33cfb06a..851502df 100755 --- a/catalyst +++ b/catalyst @@ -1,7 +1,7 @@ #!/usr/bin/python # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.76 2005/04/26 18:30:50 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.77 2005/04/27 21:04:02 rocket Exp $ # Maintained in full by: # Eric Edgar @@ -195,6 +195,7 @@ def build_target(addlargs, targetmap): mytarget.run() except CatalystError: + mytarget.mount_safety_check() sys.exit(1) if __name__ == "__main__": @@ -342,5 +343,8 @@ if __name__ == "__main__": raise CatalystError,"Could not complete build" sys.exit(2) except KeyboardInterrupt: - print "\nCatalyst build aborted due to user interrupt" + print "\nCatalyst build aborted due to user interrupt ( Ctrl-C )" + sys.exit(2) + except: + print "Catalyst aborting ...." sys.exit(2) diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index 47af6acc..a710ce76 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.py @@ -1,6 +1,6 @@ # Copyright 1999-2004 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.44 2005/04/27 17:44:58 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.45 2005/04/27 21:04:02 rocket Exp $ import sys,string,os,types,re,signal,traceback,md5,time # a function to turn a string of non-printable characters into a string of @@ -142,11 +142,12 @@ def spawn(mystring,debug=0,fd_pipes=None): else: return ((retval & 0xff) << 8) # interrupted by signal - except: + except: os.kill(mypid,signal.SIGTERM) if os.waitpid(mypid,os.WNOHANG)[1] == 0: # feisty bugger, still alive. os.kill(mypid,signal.SIGKILL) + raise def cmd(mycmd,myexc=""): @@ -154,8 +155,8 @@ def cmd(mycmd,myexc=""): retval=spawn(mycmd) if retval != 0: raise CatalystError,myexc - except KeyboardInterrupt: - raise CatalystError,"Caught SIGINT, aborting." + except: + raise def file_locate(settings,filelist,expand=1): -- 2.26.2