File: 0004-Use-profile.d-in-usr-in-_setup_util.py.patch

package info (click to toggle)
ros-catkin 0.8.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,212 kB
  • sloc: python: 4,117; sh: 508; xml: 256; cpp: 136; makefile: 125
file content (29 lines) | stat: -rw-r--r-- 1,526 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Sat, 6 Jun 2015 15:29:55 +0200
Subject: Use profile.d in /usr in _setup_util.py

---
 cmake/templates/_setup_util.py.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmake/templates/_setup_util.py.in b/cmake/templates/_setup_util.py.in
index e73934b..8a80aa3 100755
--- a/cmake/templates/_setup_util.py.in
+++ b/cmake/templates/_setup_util.py.in
@@ -217,6 +217,7 @@ def find_env_hooks(environ, cmake_prefix_path):
     specific_env_hook_ext = environ['CATKIN_SHELL'] if not IS_WINDOWS and 'CATKIN_SHELL' in environ and environ['CATKIN_SHELL'] else None
     # remove non-workspace paths
     workspaces = [path for path in cmake_prefix_path.split(os.pathsep) if path and os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
+    workspaces.append('/')
     for workspace in reversed(workspaces):
         env_hook_dir = os.path.join(workspace, 'etc', 'catkin', 'profile.d')
         if os.path.isdir(env_hook_dir):
@@ -247,7 +248,7 @@ def find_env_hooks(environ, cmake_prefix_path):
     lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_COUNT', count))
     for i in range(count):
         lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d' % i, env_hooks[i]))
-        lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d_WORKSPACE' % i, env_hooks_workspace[i]))
+        lines.append(assignment('_CATKIN_ENVIRONMENT_HOOKS_%d_WORKSPACE' % i, (env_hooks_workspace[i] if env_hooks_workspace[i] != '/' else '')))
     return lines