summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2009-12-29 14:50:25 +0100
committerSebastian Pipping <sebastian@pipping.org>2009-12-29 15:21:38 +0100
commit08c83772f69aaa7edf6c4809365809e8144cce3b (patch)
treef827c15f6884be07472926f09c4367703df7038b
parent1fffa93607c68947ae4eea18bf22f95e0d514a66 (diff)
downloadlayman-08c83772f69aaa7edf6c4809365809e8144cce3b.tar.gz
layman-08c83772f69aaa7edf6c4809365809e8144cce3b.tar.bz2
layman-08c83772f69aaa7edf6c4809365809e8144cce3b.zip
Allow running VCS from PATH
-rw-r--r--CHANGES2
-rw-r--r--layman/overlays/overlay.py18
2 files changed, 17 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index eabc326..f84232d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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 + '?')