aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordol-sen <brian.dolbec@gmail.com>2011-08-08 18:14:18 -0700
committerdol-sen <brian.dolbec@gmail.com>2011-08-08 18:14:18 -0700
commit0a03f32c1257af352bf9ffa2be324c53f2656aa3 (patch)
tree1220e206777a06a2568ca3daee5ce0afb4b60121 /layman/config.py
parentfix bug 378097. unofficial installed overlays not printing (due to nocheck=no... (diff)
downloadlayman-0a03f32c1257af352bf9ffa2be324c53f2656aa3.tar.gz
layman-0a03f32c1257af352bf9ffa2be324c53f2656aa3.tar.bz2
layman-0a03f32c1257af352bf9ffa2be324c53f2656aa3.zip
make it EPREFIX ready
Diffstat (limited to 'layman/config.py')
-rw-r--r--layman/config.py31
1 files changed, 20 insertions, 11 deletions
diff --git a/layman/config.py b/layman/config.py
index 3873eef..1187f78 100644
--- a/layman/config.py
+++ b/layman/config.py
@@ -25,6 +25,7 @@
__version__ = "0.2"
+
import sys
import os
import ConfigParser
@@ -55,6 +56,14 @@ def read_layman_config(config=None, defaults=None):
config.set('MAIN', 'overlays', '\n'.join(overlays))
+# establish the eprefix, initially set so eprefixify can
+# set it on install
+EPREFIX = "@GENTOO_PORTAGE_EPREFIX@"
+
+# check and set it if it wasn't
+if EPREFIX == "@GENTOO_PORTAGE_EPREFIX@":
+ EPREFIX = ''
+
class BareConfig(object):
'''Handles the configuration only.'''
@@ -76,9 +85,9 @@ class BareConfig(object):
'''
self._defaults = {
- 'configdir': '/etc/layman',
+ 'configdir': EPREFIX + '/etc/layman',
'config' : '%(configdir)s/layman.cfg',
- 'storage' : '/var/lib/layman',
+ 'storage' : EPREFIX + '/var/lib/layman',
'cache' : '%(storage)s/cache',
'local_list': '%(storage)s/overlays.xml',
'make_conf' : '%(storage)s/make.conf',
@@ -88,15 +97,15 @@ class BareConfig(object):
'overlays' :
'http://www.gentoo.org/proj/en/overlays/repositories.xml',
'overlay_defs': '%(configdir)s/overlays',
- 'bzr_command': '/usr/bin/bzr',
- 'cvs_command': '/usr/bin/cvs',
- 'darcs_command': '/usr/bin/darcs',
- 'git_command': '/usr/bin/git',
- 'g-common_command': '/usr/bin/g-common',
- 'mercurial_command': '/usr/bin/hg',
- 'rsync_command': '/usr/bin/rsync',
- 'svn_command': '/usr/bin/svn',
- 'tar_command': '/bin/tar',
+ 'bzr_command': EPREFIX +'/usr/bin/bzr',
+ 'cvs_command': EPREFIX +'/usr/bin/cvs',
+ 'darcs_command': EPREFIX +'/usr/bin/darcs',
+ 'git_command': EPREFIX +'/usr/bin/git',
+ 'g-common_command': EPREFIX +'/usr/bin/g-common',
+ 'mercurial_command': EPREFIX +'/usr/bin/hg',
+ 'rsync_command': EPREFIX +'/usr/bin/rsync',
+ 'svn_command': EPREFIX +'/usr/bin/svn',
+ 'tar_command': EPREFIX +'/bin/tar',
't/f_options': ['nocheck'],
'bzr_addopts' : '',
'bzr_syncopts' : '',