summaryrefslogtreecommitdiffstats
path: root/git-interface
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-08-03 20:25:29 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-08-05 12:05:22 +0200
commitecbf32f0cc4673c56380a97a0097187924d47624 (patch)
tree7b1c7db08f17a9bdbb4c773d934fcb6735f566a4 /git-interface
parent2f5f5583bec2a0a04424d6bedd763855f308bce6 (diff)
downloadaur-ecbf32f0cc4673c56380a97a0097187924d47624.tar.gz
aur-ecbf32f0cc4673c56380a97a0097187924d47624.tar.xz
git-interface: Add AUR_CONFIG environment variable
Introduce a new environment variable that can be used to specify the path to an aurweb configuration file. If the environment variable is unset, the default search path is used. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface')
-rw-r--r--git-interface/config.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-interface/config.py b/git-interface/config.py
index cd6495b3..aac188b1 100644
--- a/git-interface/config.py
+++ b/git-interface/config.py
@@ -9,7 +9,11 @@ def _get_parser():
if not _parser:
_parser = configparser.RawConfigParser()
- path = os.path.dirname(os.path.realpath(__file__)) + "/../conf/config"
+ if 'AUR_CONFIG' in os.environ:
+ path = os.environ.get('AUR_CONFIG')
+ else:
+ relpath = "/../conf/config"
+ path = os.path.dirname(os.path.realpath(__file__)) + relpath
_parser.read(path)
return _parser