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 | |
parent | Allow overriding VCS commands (diff) | |
download | layman-08c83772f69aaa7edf6c4809365809e8144cce3b.tar.gz layman-08c83772f69aaa7edf6c4809365809e8144cce3b.tar.bz2 layman-08c83772f69aaa7edf6c4809365809e8144cce3b.zip |
Allow running VCS from PATH
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | layman/overlays/overlay.py | 18 |
2 files changed, 17 insertions, 3 deletions
@@ -8,6 +8,8 @@ TODO - Allow overriding of VCS commands + - Allow running VCS from PATH (fixes #280539) + Version 1.2.4 - Released 2009/12/05 =================================== 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 + '?') |