#!/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
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",
# 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
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"]
# 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 *
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."