From 37b4a419c6cad149f59960ee9837217fcf684935 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Tue, 27 May 2014 09:32:39 -0700 Subject: [PATCH] fix rollback of environment when workspace has been deleted --- cmake/templates/_setup_util.py.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/templates/_setup_util.py.in b/cmake/templates/_setup_util.py.in index 0cfab97c3..1f92d75aa 100755 --- a/cmake/templates/_setup_util.py.in +++ b/cmake/templates/_setup_util.py.in @@ -96,7 +96,7 @@ def _rollback_env_variable(environ, name, subfolder): subfolder = subfolder[1:] if subfolder.endswith(os.path.sep) or (os.path.altsep and subfolder.endswith(os.path.altsep)): subfolder = subfolder[:-1] - for ws_path in _get_workspaces(environ, include_fuerte=True): + for ws_path in _get_workspaces(environ, include_fuerte=True, include_non_existing=True): path_to_find = os.path.join(ws_path, subfolder) if subfolder else ws_path path_to_remove = None for env_path in env_paths: @@ -111,7 +111,7 @@ def _rollback_env_variable(environ, name, subfolder): return new_value if value_modified else None -def _get_workspaces(environ, include_fuerte=False): +def _get_workspaces(environ, include_fuerte=False, include_non_existing=False): ''' Based on CMAKE_PREFIX_PATH return all catkin workspaces. @@ -122,7 +122,7 @@ def _get_workspaces(environ, include_fuerte=False): value = environ[env_name] if env_name in environ else '' paths = [path for path in value.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)) or (include_fuerte and path.startswith('/opt/ros/fuerte'))] + workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE)) or (include_fuerte and path.startswith('/opt/ros/fuerte')) or (include_non_existing and not os.path.exists(path))] return workspaces