summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Booij (tulcod) <auke@tulcod.com>2010-07-31 13:21:11 +0200
committerAuke Booij (tulcod) <auke@tulcod.com>2010-07-31 15:10:11 +0200
commiteb8c73c4bef036a3eea61d530c5ab6550d4cee40 (patch)
tree70bc410b4f59739c2c1c1318c6c6c645510c528a /g_common
parentChange config file format (diff)
downloadg-cran-eb8c73c4bef036a3eea61d530c5ab6550d4cee40.tar.gz
g-cran-eb8c73c4bef036a3eea61d530c5ab6550d4cee40.tar.bz2
g-cran-eb8c73c4bef036a3eea61d530c5ab6550d4cee40.zip
Move g-cran config file
Diffstat (limited to 'g_common')
-rw-r--r--g_common/g_common.py6
-rw-r--r--g_common/settings.py4
2 files changed, 6 insertions, 4 deletions
diff --git a/g_common/g_common.py b/g_common/g_common.py
index 73f3e86..c671b5c 100644
--- a/g_common/g_common.py
+++ b/g_common/g_common.py
@@ -23,7 +23,7 @@ def read_config(conf_file,defaults={}):
#returns dict of key=value config file
def read_driver_config(driver_name):
- conffile=os.path.join('/etc/g-common',driver_name+'.cfg')
+ conffile=os.path.join(settings.GLOBAL_CONF_DIR,settings.DRIVER_DIR,driver_name+'.cfg')
return read_config(conffile,{
#'name':None,
#'executable':None,
@@ -46,7 +46,7 @@ def action_sync(repo_location,driver,remote_uri):
remote_uri=repo_conf['uri']
#todo write repo.cfg
- cfg_file=open(os.path.join(repo_location,MYDIR,"repo.cfg"),"w")
+ cfg_file=open(os.path.join(repo_location,settings.MYDIR,"repo.cfg"),"w")
cfg_file.write('driver='+driver)
cfg_file.write('uri='+remote_uri)
cfg_file.close()
@@ -80,7 +80,7 @@ def generate_tree(repo_location):
repo_conf=read_repo_config(repo_location)
driver_conf=read_driver_config(repo_conf['driver'])
- ebuild_file=COMMON_EBUILD_FILE #get from settings
+ ebuild_file=settings.COMMON_EBUILD_FILE #get from settings
packages_list_pipe=subprocess.Popen(fixme,shell=True,stdout=subprocess.PIPE)
os.waitpid(process.pid,0)
diff --git a/g_common/settings.py b/g_common/settings.py
index 4ce4f6a..5163c2f 100644
--- a/g_common/settings.py
+++ b/g_common/settings.py
@@ -1,3 +1,5 @@
-GLOBAL_CONF_DIR='/etc/g-common/'
+GLOBAL_CONF_DIR='/usr/share/g-common/'
+DRIVER_DIR='drivers/'
+COMMON_EBUILD_FILE=GLOBAL_CONF_DIR+'common.ebuild'
MYDIR='.g-common'