livecd-stage2 error handling code
authorJohn P. Davis <zhen@gentoo.org>
Tue, 8 Jun 2004 04:07:34 +0000 (04:07 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Tue, 8 Jun 2004 04:07:34 +0000 (04:07 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@388 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/builder.py
modules/catalyst_support.py
modules/livecd_stage2_target.py

index 316901703abcfaa995aab3e6f0439bba3ab858b2..edc4d329bf14073a8f78c92d0e259576761378c1 100644 (file)
--- 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 <zhen@gentoo.org> 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 <zhen@gentoo.org>
   livecd/runscript-support/livecdfs-update.sh:
index 8aa4a3d80bd15fdea288de485c1056a9ff0d2e74..a45465c8203d3d575641edfacbace7ef8e5a16e2 100644 (file)
@@ -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):
index 6dd6fe9d02f4e5dc43e2648803bde96cfd9d5db0..6dd31a6a23eb7b380232eea0e1126beb9a81b28f 100644 (file)
@@ -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)
index 65a48b7cfeb16eea552bac9852167ac5e635603d..7f6ff805f4acaaed86f892968084bc85e6836c1e 100644 (file)
@@ -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"):