Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2008-10-21 15:07:03 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-10-21 15:07:03 (GMT)
commit611bd9ccda271f7d82eb4aa68856c0a12fd13771 (patch)
treee34542f9511ee77ca628ac728de51c910e7a248e /src/sugar
parent0b7def17884447dbb5e221a52d4f71aeeefe4e6d (diff)
Only absolutize the command when it doesnt contain already a slash
Diffstat (limited to 'src/sugar')
-rw-r--r--src/sugar/activity/activityfactory.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sugar/activity/activityfactory.py b/src/sugar/activity/activityfactory.py
index 75503fc..97583a0 100644
--- a/src/sugar/activity/activityfactory.py
+++ b/src/sugar/activity/activityfactory.py
@@ -131,10 +131,13 @@ def get_command(activity, activity_id=None, object_id=None, uri=None):
if uri is not None:
command.extend(['-u', uri])
- bin_path = os.path.join(activity.get_path(), 'bin')
- absolute_path = os.path.join(bin_path, command[0])
- if os.path.exists(absolute_path):
- command[0] = absolute_path
+ # if the command is in $BUNDLE_ROOT/bin, execute the absolute path so there
+ # is no need to mangle with the shell's PATH
+ if '/' not in command[0]:
+ bin_path = os.path.join(activity.get_path(), 'bin')
+ absolute_path = os.path.join(bin_path, command[0])
+ if os.path.exists(absolute_path):
+ command[0] = absolute_path
logging.debug('launching: %r' % command)