From: John P. Davis Date: Tue, 8 Jun 2004 04:07:34 +0000 (+0000) Subject: livecd-stage2 error handling code X-Git-Tag: CATALYST_2_0_6_916~985 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8fcedfb8d19836d05f55ee76225537c45332ece1;p=catalyst.git livecd-stage2 error handling code git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@388 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index 31690170..edc4d329 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.59 2004/06/04 14:24:53 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.60 2004/06/08 04:07:34 zhen Exp $ + + 08 Jun 2004; John Davis modules/builder.py, + modules/catalyst_support.py, modules/livecd_stage2_target.py: + livecd-stage2 traced back when boot/kernel/x/config was an empty string, fixed + the code to give a nice error msg instead of a cryptic traceback 04 Jun 2004; John Davis livecd/runscript-support/livecdfs-update.sh: diff --git a/modules/builder.py b/modules/builder.py index 8aa4a3d8..a45465c8 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/builder.py,v 1.5 2004/02/11 03:31:55 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/builder.py,v 1.6 2004/06/08 04:07:34 zhen Exp $ class generic: def __init__(self,myspec): diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index 6dd6fe9d..6dd31a6a 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.21 2004/05/17 02:00:25 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.22 2004/06/08 04:07:34 zhen Exp $ import sys,string,os,types @@ -38,7 +38,7 @@ class CatalystError(Exception): def __init__(self, message): if message: print - print "catalyst: "+message + print "!!! catalyst: "+message def die(msg=None): warn(msg) diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index 65a48b7c..7f6ff805 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_stage2_target.py @@ -1,6 +1,6 @@ # Distributed under the GNU General Public License version 2 # Copyright 2003-2004 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.7 2004/05/22 05:51:06 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.8 2004/06/08 04:07:34 zhen Exp $ """ Builder class for a LiveCD stage2 build. @@ -67,7 +67,7 @@ class livecd_stage2_target(generic_stage_target): myunmerge=string.join(myunmerge) #before cleaning, unmerge stuff: try: - cmd("/bin/bash "+self.settings["sharedir"]+"/targets/"+self.settings["target"]+"/unmerge.sh "+myunmerge,"unmerge script failed.") + cmd("/bin/bash "+self.settings["sharedir"]+"/targets/"+self.settings["target"]+"/unmerge.sh "+myunmerge,"Unmerge script failed.") except CatalystError: self.unbind() raise @@ -75,25 +75,25 @@ class livecd_stage2_target(generic_stage_target): def clean(self): generic_stage_target.clean(self) try: - cmd("/bin/bash "+self.settings["livecd/runscript"]+" clean","clean runscript failed.") + cmd("/bin/bash "+self.settings["livecd/runscript"]+" clean","Clean runscript failed.") except: self.unbind() raise def preclean(self): try: - cmd("/bin/bash "+self.settings["livecd/runscript"]+" preclean","preclean runscript failed.") + cmd("/bin/bash "+self.settings["livecd/runscript"]+" preclean","Preclean runscript failed.") except: self.unbind() raise def cdroot_setup(self): - cmd("/bin/bash "+self.settings["livecd/runscript"]+" cdfs","cdfs runscript failed.") + cmd("/bin/bash "+self.settings["livecd/runscript"]+" cdfs","CDFS runscript failed.") if self.settings.has_key("livecd/overlay"): cmd("/bin/cp -a "+self.settings["livecd/overlay"]+"/* "+self.settings["cdroot_path"], "LiveCD overlay copy failed.") if self.settings.has_key("livecd/iso"): - cmd("/bin/bash "+self.settings["livecd/runscript"]+" iso "+self.settings["livecd/iso"],"iso runscript failed.") + cmd("/bin/bash "+self.settings["livecd/runscript"]+" iso "+self.settings["livecd/iso"],"ISO creation runscript failed.") print "livecd-stage2: complete!" def run_local(self): @@ -111,9 +111,12 @@ class livecd_stage2_target(generic_stage_target): for kname in mynames: args.append(kname) args.append(self.settings["boot/kernel/"+kname+"/sources"]) - if not os.path.exists(self.settings["boot/kernel/"+kname+"/config"]): - self.unbind() - raise CatalystError, "Can't find kernel config: "+self.settings["boot/kernel/"+kname+"/config"] + try: + if not os.path.exists(self.settings["boot/kernel/"+kname+"/config"]): + self.unbind() + raise CatalystError, "Can't find kernel config: "+self.settings["boot/kernel/"+kname+"/config"] + except TypeError: + raise CatalystError, "Required value boot/kernel/config not specified" # We must support multiple configs for the same kernel, # so we must manually edit the EXTRAVERSION on the kernel to allow them to coexist. @@ -167,11 +170,11 @@ class livecd_stage2_target(generic_stage_target): os.putenv(kname+"_kernelopts", "") try: - cmd("/bin/bash "+self.settings["livecd/runscript"]+" kernel "+list_bashify(args),"runscript kernel build failed") - cmd("/bin/bash "+self.settings["livecd/runscript"]+" bootloader","bootloader runscript failed.") + cmd("/bin/bash "+self.settings["livecd/runscript"]+"kernel "+list_bashify(args)," Runscript kernel build failed") + cmd("/bin/bash "+self.settings["livecd/runscript"]+"bootloader"," Bootloader runscript failed.") except CatalystError: self.unbind() - raise CatalystError,"runscript aborting due to error." + raise CatalystError,"Runscript aborting due to error." # what modules do we want to blacklist? if self.settings.has_key("livecd/modblacklist"):