[catkin] 01/01: Add patch for default workspace path

Jochen Sprickerhof jspricke-guest at moszumanska.debian.org
Fri Dec 12 08:41:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

jspricke-guest pushed a commit to branch master
in repository catkin.

commit 251f4e74db7350699d3d02672168d0b3036f36ca
Author: Jochen Sprickerhof <git at jochen.sprickerhof.de>
Date:   Fri Dec 12 09:33:59 2014 +0100

    Add patch for default workspace path
---
 .../0002-Add-usr-as-default-workspace-path.patch   | 55 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 56 insertions(+)

diff --git a/debian/patches/0002-Add-usr-as-default-workspace-path.patch b/debian/patches/0002-Add-usr-as-default-workspace-path.patch
new file mode 100644
index 0000000..c7ee3ed
--- /dev/null
+++ b/debian/patches/0002-Add-usr-as-default-workspace-path.patch
@@ -0,0 +1,55 @@
+From: Jochen Sprickerhof <git at jochen.sprickerhof.de>
+Date: Fri, 12 Dec 2014 09:31:17 +0100
+Subject: Add /usr as default workspace path
+
+---
+ python/catkin/workspace.py        |  3 +++
+ test/unit_tests/test_workspace.py | 10 +++++-----
+ 2 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/python/catkin/workspace.py b/python/catkin/workspace.py
+index 0b7583e..294c0fe 100644
+--- a/python/catkin/workspace.py
++++ b/python/catkin/workspace.py
+@@ -47,6 +47,7 @@ def get_workspaces():
+     paths = [path for path in os.environ.get(env_name, '').split(os.pathsep) if path]
+     # remove non-workspace paths
+     workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))]
++    workspaces.append('/usr')
+     return workspaces
+ 
+ 
+@@ -59,6 +60,8 @@ def get_source_paths(workspace):
+     """
+     # determine source spaces
+     filename = os.path.join(workspace, CATKIN_MARKER_FILE)
++    if workspace == '/usr':
++        return []
+     if not os.path.isfile(filename):
+         raise ValueError('Not a catkin workspace: "%s", missing file %s' % (workspace, filename))
+     with open(filename) as f:
+diff --git a/test/unit_tests/test_workspace.py b/test/unit_tests/test_workspace.py
+index 209d7a4..fca947d 100644
+--- a/test/unit_tests/test_workspace.py
++++ b/test/unit_tests/test_workspace.py
+@@ -27,15 +27,15 @@ class WorkspaceTest(unittest.TestCase):
+             with open(os.path.join(ws2, CATKIN_MARKER_FILE), 'w') as fhand:
+                 fhand.write('loc3;loc4')
+             catkin.workspace.os.environ = {}
+-            self.assertEqual([], get_workspaces())
++            self.assertEqual(['/usr'], get_workspaces())
+             catkin.workspace.os.environ = {'CMAKE_PREFIX_PATH': ''}
+-            self.assertEqual([], get_workspaces())
++            self.assertEqual(['/usr'], get_workspaces())
+             catkin.workspace.os.environ = {'CMAKE_PREFIX_PATH': ws1}
+-            self.assertEqual([ws1], get_workspaces())
++            self.assertEqual([ws1, '/usr'], get_workspaces())
+             catkin.workspace.os.environ = {'CMAKE_PREFIX_PATH': 'nowhere'}
+-            self.assertEqual([], get_workspaces())
++            self.assertEqual(['/usr'], get_workspaces())
+             catkin.workspace.os.environ = {'CMAKE_PREFIX_PATH': ws2 + os.pathsep + ws1}
+-            self.assertEqual([ws2, ws1], get_workspaces())
++            self.assertEqual([ws2, ws1, '/usr'], get_workspaces())
+         finally:
+             shutil.rmtree(root_dir)
+             catkin.workspace.os.environ = os.environ
diff --git a/debian/patches/series b/debian/patches/series
index c88de52..a9f8c48 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-Remove-NO_DEFAULT_PATH-and-NO_CMAKE_FIND_ROOT_PATH-f.patch
+0002-Add-usr-as-default-workspace-path.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/ros/catkin.git



More information about the debian-science-commits mailing list