From 92a545dc6b64bbebfa9bc4c3788f1ae3db058788 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sun, 14 Oct 2012 18:03:27 -0700 Subject: Add checking for ROOT in the environment on statup, and setting it in the appropriate paths. Add warnings for not finding the config file and installed db. Fix updaters config file path --- bin/layman | 10 +++++++++- bin/layman-updater | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/layman b/bin/layman index 6299d34..ba91c20 100755 --- a/bin/layman +++ b/bin/layman @@ -18,6 +18,8 @@ __version__ = "0.2" +import os + #=============================================================================== # # Dependencies @@ -33,5 +35,11 @@ from layman.cli import Main # #------------------------------------------------------------------------------- -main = Main(ArgsParser()) +root = None +try: + root = os.environ['ROOT'] +except KeyError: + pass + +main = Main(ArgsParser(root=root)) main() diff --git a/bin/layman-updater b/bin/layman-updater index ac9e841..51cf825 100755 --- a/bin/layman-updater +++ b/bin/layman-updater @@ -16,9 +16,15 @@ __version__ = "0.1" +import os from layman.updater import Main +root = None +try: + root = os.environ['ROOT'] +except KeyError: + pass -main = Main() +main = Main(root=root) main() -- cgit v1.2.3-1-g7c22