From 08c83772f69aaa7edf6c4809365809e8144cce3b Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Tue, 29 Dec 2009 14:50:25 +0100 Subject: Allow running VCS from PATH --- CHANGES | 2 ++ layman/overlays/overlay.py | 18 +++++++++++++++--- 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 + '?') -- cgit v1.2.3-1-g7c22