missing "/" and new clst_conf support
authorDaniel Robbins <drobbins@gentoo.org>
Thu, 12 Feb 2004 19:51:37 +0000 (19:51 +0000)
committerDaniel Robbins <drobbins@gentoo.org>
Thu, 12 Feb 2004 19:51:37 +0000 (19:51 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@222 d1e1f19c-881f-0410-ab34-b69fee027534

catalyst
modules/catalyst_support.py
modules/targets.py

index 67bfc36bd63f2de6665cdb93528e43575a3dc6e1..0b1a795045137fbf393b1d5618831833d149f140 100755 (executable)
--- a/catalyst
+++ b/catalyst
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # Copyright 1999-2004 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.28 2004/02/11 03:31:55 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/catalyst,v 1.29 2004/02/12 19:51:37 drobbins Exp $
 
 import os,sys,imp,string
 
@@ -32,11 +32,18 @@ if os.getuid()!=0:
 
 myspec={}
 myconf={}
-if os.path.exists("/etc/catalyst.conf"):
+myconffile="/etc/catalyst.conf"
+if os.environ.has_key("clst_conf"):
+       if not os.path.exists(os.environ["clst_conf"]):
+               print "catalyst: Unable to find config file specified in env var 'clst_conf'"
+               sys.exit(1)
+       myconffile=os.environ["clst_conf"]
+       
+if os.path.exists(myconffile):
        try:
-               execfile("/etc/catalyst.conf",myconf,myconf)
+               execfile(myconffile,myconf,myconf)
        except:
-               print "catalyst: Unable to parse /etc/catalyst.conf config file (syntax error)"
+               print "catalyst: Unable to parse "+myconffile+" config file (syntax error)"
                sys.exit(1)
 
 confdefaults={ "storedir":"/var/tmp/catalyst","sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",
index 3b174734bf48683b46f0d22d8d16a74687394d24..829cb311e7cb72adcb98f1cbce1b5a3fbdcecc5f 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.15 2004/02/11 03:31:55 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.16 2004/02/12 19:51:37 drobbins Exp $
 
 import sys,string,os,types
 
@@ -165,11 +165,13 @@ def ismount(path):
 def arg_parse(mydict,remaining,argv):
        "grab settings from argv, storing 'target' in mydict, and everything in remaining for later parsing"
        global required_config_file_values
+       print "ARGV",argv
        for x in argv:
                foo=string.split(x,"=")
                if len(foo)!=2:
                        raise CatalystError, "Invalid arg syntax: "+x
                remaining[foo[0]]=foo[1]
+               print "X",x
        if not remaining.has_key("target"):
                raise CatalystError, "Required value \"target\" not specified."
        mydict["target"]=remaining["target"]
index ddd918e5b3f49a6b7428ca360923dca2951a465f..9ec3104f9ffe8dab7c575cf31f7afd122d496faa 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/Attic/targets.py,v 1.85 2004/02/12 06:20:45 beejay Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/Attic/targets.py,v 1.86 2004/02/12 19:51:37 drobbins Exp $
 
 import os,string,imp,types,shutil
 from catalyst_support import *
@@ -545,7 +545,7 @@ class livecd_stage2_target(generic_stage_target):
                                        if type(myex)==types.ListType:
                                                myex=string.join(myex)
                                        try:
-                                               myf=open(self.settings["chroot_path"]+"/var/tmp"+kname+"."+extra,"w")
+                                               myf=open(self.settings["chroot_path"]+"/var/tmp/"+kname+"."+extra,"w")
                                        except:
                                                self.unbind()
                                                raise CatalystError,"Couldn't create file /var/tmp/"+kname+"."+extra+" in chroot."