From e978b829cd5701d7b0d3d0d1a73b6920830952d2 Mon Sep 17 00:00:00 2001 From: Daniel Robbins Date: Thu, 6 Nov 2003 02:38:33 +0000 Subject: [PATCH] fix for module import path git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@50 d1e1f19c-881f-0410-ab34-b69fee027534 --- catalyst | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/catalyst b/catalyst index a2221aa9..f533d824 100755 --- a/catalyst +++ b/catalyst @@ -2,11 +2,6 @@ import os,sys,imp,string -#This allows plugins (and this code) to import modules in the /modules dir -sys.path.append(os.getcwd()+"/modules") - -from catalyst_support import * - def usage(): print "usage: meep!" @@ -28,7 +23,8 @@ if os.path.exists("/etc/catalyst.conf"): try: execfile("/etc/catalyst.conf",myconf,myconf) except: - raise CatalystError, "Unable to read config file (syntax error)" + print "catalyst: Unable to /etc/catalyst.conf config file (syntax error)" + sys.exit(1) confdefaults={ "storedir":"/var/tmp/catalyst","sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles", "portdir":"/usr/portage","options":"ccache"} @@ -41,6 +37,14 @@ for x in confdefaults.keys(): print "Setting",x,"to default value \""+confdefaults[x]+"\"" myspec[x]=confdefaults[x] +#This allows plugins (and this code) to import modules in the /modules dir +sys.path.append(myspec["sharedir"]+"/modules") +try: + from catalyst_support import * +except ImportError: + print "catalyst: catalyst_support module not found in "+myspec["sharedir"]+"/modules; exiting." + sys.exit(1) + if "ccache" in string.split(myspec["options"]): print "Compiler cache support enabled." myspec["CCACHE"]="1" -- 2.26.2