diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2009-12-29 14:50:25 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2009-12-29 15:21:38 +0100 |
commit | 08c83772f69aaa7edf6c4809365809e8144cce3b (patch) | |
tree | f827c15f6884be07472926f09c4367703df7038b /layman/overlays/overlay.py | |
parent | 1fffa93607c68947ae4eea18bf22f95e0d514a66 (diff) | |
download | layman-08c83772f69aaa7edf6c4809365809e8144cce3b.tar.gz layman-08c83772f69aaa7edf6c4809365809e8144cce3b.tar.bz2 layman-08c83772f69aaa7edf6c4809365809e8144cce3b.zip |
Allow running VCS from PATH
Diffstat (limited to 'layman/overlays/overlay.py')
-rw-r--r-- | layman/overlays/overlay.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py index 4f245ec..3198bec 100644 --- a/layman/overlays/overlay.py +++ b/layman/overlays/overlay.py @@ -327,9 +327,21 @@ class Overlay: '''Is the overlay type supported?''' if binaries: - for mpath, mtype, package in binaries: - if not os.path.exists(mpath): - raise Exception('Binary ' + mpath + ' seems to be missing!' + for command, mtype, package in binaries: + found = False + if os.path.isabs(command): + kind = 'Binary' + found = os.path.exists(command) + else: + kind = 'Command' + for d in os.environ['PATH'].split(os.pathsep): + f = os.path.join(d, command) + if os.path.exists(f): + found = True + break + + if not found: + raise Exception(kind + ' ' + command + ' seems to be missing!' ' Overlay type "' + mtype + '" not support' 'ed. Did you emerge ' + package + '?') |