From a7698fedbd586495e833e5e61e67c3f64729dbc2 Mon Sep 17 00:00:00 2001 From: Daniel Robbins Date: Thu, 12 Feb 2004 19:51:37 +0000 Subject: [PATCH] missing "/" and new clst_conf support git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@222 d1e1f19c-881f-0410-ab34-b69fee027534 --- catalyst | 15 +++++++++++---- modules/catalyst_support.py | 4 +++- modules/targets.py | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/catalyst b/catalyst index 67bfc36b..0b1a7950 100755 --- 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", diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index 3b174734..829cb311 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.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"] diff --git a/modules/targets.py b/modules/targets.py index ddd918e5..9ec3104f 100644 --- a/modules/targets.py +++ b/modules/targets.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/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." -- 2.26.2