[ros-catkin] 01/04: New upstream version 0.7.2

Jochen Sprickerhof jspricke at moszumanska.debian.org
Sat Sep 17 12:25:15 UTC 2016


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

jspricke pushed a commit to annotated tag debian/0.7.2-1
in repository ros-catkin.

commit 5353e5c5a53dc55fbef3e6cccd446f5df04a8798
Author: Jochen Sprickerhof <git at jochen.sprickerhof.de>
Date:   Sat Sep 17 14:09:27 2016 +0200

    New upstream version 0.7.2
---
 CHANGELOG.rst                       | 12 +++++++++
 bin/catkin_make                     | 29 ++++++++++++--------
 bin/catkin_make_isolated            |  2 ++
 cmake/catkin_package.cmake          | 17 ++++++++----
 cmake/templates/_setup_util.py.in   | 46 +++++++++++++++----------------
 cmake/templates/relay.py.in         | 13 +++++++--
 cmake/templates/script.py.in        | 13 +++++++--
 cmake/templates/setup.bat.in        |  4 +--
 cmake/test/nosetests.cmake          |  4 +--
 doc/howto/format2/building_msgs.rst |  5 ++--
 package.xml                         |  2 +-
 python/catkin/builder.py            | 54 ++++++++++++++++++++++++-------------
 test/unit_tests/test_setup_util.py  | 22 +++++++--------
 13 files changed, 143 insertions(+), 80 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 792af14..936a67d 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -2,6 +2,18 @@
 Changelog for package catkin
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+0.7.2 (2016-09-02)
+------------------
+* change warning to status when nosetests was not found (`#823 <https://github.com/ros/catkin/issues/823>`_)
+* maintain file context when invoking Python scripts through relay (`#820 <https://github.com/ros/catkin/issues/820>`_)
+* fix rollback logic for more than one value per environment variable and workspace (`#819 <https://github.com/ros/catkin/issues/819>`_)
+* add option to use NMake instead of Make (`#816 <https://github.com/ros/catkin/pull/816>`_)
+* fix check if DEPENDS was found (`#813 <https://github.com/ros/catkin/issues/813>`_)
+* fix quoting of paths to handle spaces (`#808 <https://github.com/ros/catkin/issues/808>`_)
+* update doc of catkin_package to clarify importance of case for variable names
+* improve doc about catkin_package(CFG_EXTRAS) (`#805 <https://github.com/ros/catkin/issues/805>`_)
+* doc: fix format 2 howto to suggest to declare a build export dependency on "message_runtime"
+
 0.7.1 (2016-03-18)
 ------------------
 * expose format 2 style dependencies as CMake variables (`#787 <https://github.com/ros/catkin/issues/787>`_)
diff --git a/bin/catkin_make b/bin/catkin_make
index afcbe69..d02ced0 100755
--- a/bin/catkin_make
+++ b/bin/catkin_make
@@ -173,12 +173,14 @@ def main():
             args.pkg = [name for name in args.pkg if name in packages_by_name]
 
     if not [arg for arg in cmake_args if arg.startswith('-G')]:
-        if not args.use_ninja:
-            cmake_args += ['-G', 'Unix Makefiles']
-        else:
+        if args.use_ninja:
             cmake_args += ['-G', 'Ninja']
-    elif args.use_ninja:
-        return fmt("@{rf}Error: either specify a generator using '-G...' or '--use-ninja' but not both")
+        elif args.use_nmake:
+            cmake_args += ['-G', 'NMake Makefiles']
+        else:
+            cmake_args += ['-G', 'Unix Makefiles']
+    elif args.use_ninja or args.use_nmake:
+        return fmt("@{rf}Error: either specify a generator using '-G...' or '--use-[ninja|nmake]' but not both")
 
     # check if cmake must be run (either for a changed list of package paths or changed cmake arguments)
     force_cmake = cmake_input_changed(packages, build_path, cmake_args=cmake_args)
@@ -203,10 +205,12 @@ def main():
         except subprocess.CalledProcessError:
             return fmt('@{rf}Invoking @{boldon}"cmake"@{boldoff} failed')
     else:
-        if not args.use_ninja:
-            cmd = ['make', 'cmake_check_build_system']
-        else:
+        if args.use_ninja:
             cmd = ['ninja', 'build.ninja']
+        elif args.use_nmake:
+            cmd = ['nmake', 'cmake_check_build_system']
+        else:
+            cmd = ['make', 'cmake_check_build_system']
         try:
             print_command_banner(cmd, build_path, color=not args.no_color)
             if args.no_color:
@@ -219,10 +223,12 @@ def main():
     ensure_workspace_marker(base_path)
 
     # invoke make
-    if not args.use_ninja:
-        cmd = ['make']
-    else:
+    if args.use_ninja:
         cmd = ['ninja']
+    elif args.use_nmake:
+        cmd = ['nmake']
+    else:
+        cmd = ['make']
     cmd.extend(handle_make_arguments(args.make_args))
     try:
         if not args.pkg:
@@ -259,6 +265,7 @@ def _parse_args(args=sys.argv[1:]):
     add('--source', help="The path to the source space (default 'workspace_base/src')")
     add('--build', help="The path to the build space (default 'workspace_base/build')")
     add('--use-ninja', action='store_true', help="Use 'ninja' instead of 'make'")
+    add('--use-nmake', action='store_true', help="Use 'nmake' instead of 'make'")
     add('--force-cmake', action='store_true', help="Invoke 'cmake' even if it has been executed before")
     add('--no-color', action='store_true', help='Disables colored output (only for catkin_make and CMake)')
     add('--pkg', nargs='+', help="Invoke 'make' on specific packages only")
diff --git a/bin/catkin_make_isolated b/bin/catkin_make_isolated
index ccef0fc..4b60b06 100755
--- a/bin/catkin_make_isolated
+++ b/bin/catkin_make_isolated
@@ -45,6 +45,7 @@ def parse_args(args=None):
     add('--install-space', default=None,
         help="Sets the target install space (default 'workspace_base/install_isolated')")
     add('--use-ninja', action='store_true', help="Use 'ninja' instead of 'make'")
+    add('--use-nmake', action='store_true', help="Use 'nmake' instead of 'make'")
     add('--install', action='store_true', default=False,
         help='Causes each catkin package to be installed.')
     add('--force-cmake', action='store_true', default=False,
@@ -151,6 +152,7 @@ def main():
         only_pkg_with_deps=opts.only_pkg_with_deps,
         destdir=destdir,
         use_ninja=opts.use_ninja,
+        use_nmake=opts.use_nmake,
         override_build_tool_check=opts.override_build_tool_check,
     )
 
diff --git a/cmake/catkin_package.cmake b/cmake/catkin_package.cmake
index 7d56edf..ee47981 100644
--- a/cmake/catkin_package.cmake
+++ b/cmake/catkin_package.cmake
@@ -31,13 +31,17 @@
 # :param DEPENDS: a list of CMake projects which this project depends
 #   on.  Since they might not be *find_packagable* or lack a pkg-config
 #   file their ``INCLUDE_DIRS`` and ``LIBRARIES`` are passed directly.
-#   This requires that it has been ``find_package``\ -ed before.
+#   This requires that it has been ``find_package``\ -ed before and all
+#   variables (``<name>_FOUND``, ``<name>_INCLUDE_DIRS``, etc.) have the
+#   same case as this argument.
 # :type DEPENDS: list of strings
 # :param CFG_EXTRAS: a CMake file containing extra stuff that should
 #   be accessible to users of this package after
 #   ``find_package``\ -ing it.  This file must live in the
-#   subdirectory ``cmake`` or be an absolute path.  Various additional
-#   file extension are possible:
+#   subdirectory ``cmake`` or be an absolute path.
+#   All passed extra files must have unique basenames since they are
+#   being installed into a single folder.
+#   Various additional file extension are possible:
 #   for a plain cmake file just ``.cmake``, for files expanded using
 #   CMake's ``configure_file()`` use ``.cmake.in`` or for files expanded
 #   by empy use ``.cmake.em``.  The templates can distinguish between
@@ -142,7 +146,7 @@ function(_catkin_package)
     endif()
     if("${second_item}" STREQUAL "COMPONENTS")
       list(GET depend_list 0 depend_name)
-      if(NOT ${${depend_name}_FOUND})
+      if(NOT ${depend_name}_FOUND)
         message(FATAL_ERROR "catkin_package() DEPENDS on '${depend}' which must be find_package()-ed before")
       endif()
       message(WARNING "catkin_package() DEPENDS on '${depend}' which is deprecated. find_package() it before and only DEPENDS on '${depend_name}' instead")
@@ -155,9 +159,12 @@ function(_catkin_package)
           #message(WARNING "catkin_package() DEPENDS on catkin package '${depend_name}' which is deprecated. Use CATKIN_DEPENDS for catkin packages instead.")
           list(APPEND _PROJECT_CATKIN_DEPENDS ${depend_name})
         else()
-          if(NOT ${${depend_name}_FOUND})
+          if(NOT ${depend_name}_FOUND)
             message(FATAL_ERROR "catkin_package() DEPENDS on '${depend_name}' which must be find_package()-ed before. If it is a catkin package it can be declared as CATKIN_DEPENDS instead without find_package()-ing it.")
           endif()
+          if(NOT DEFINED ${depend_name}_INCLUDE_DIRS AND NOT DEFINED ${depend_name}_LIBRARIES)
+            message(WARNING "catkin_package() DEPENDS on '${depend_name}' but neither '${depend_name}_INCLUDE_DIRS' nor '${depend_name}_LIBRARIES' is defined.")
+          endif()
           list(APPEND PROJECT_DEPENDENCIES_INCLUDE_DIRS ${${depend_name}_INCLUDE_DIRS})
           list(APPEND PROJECT_DEPENDENCIES_LIBRARIES ${${depend_name}_LIBRARIES})
         endif()
diff --git a/cmake/templates/_setup_util.py.in b/cmake/templates/_setup_util.py.in
index cace21c..106507a 100755
--- a/cmake/templates/_setup_util.py.in
+++ b/cmake/templates/_setup_util.py.in
@@ -71,42 +71,42 @@ def rollback_env_variables(environ, env_var_subfolders):
         subfolders = env_var_subfolders[key]
         if not isinstance(subfolders, list):
             subfolders = [subfolders]
-        for subfolder in subfolders:
-            value = _rollback_env_variable(unmodified_environ, key, subfolder)
-            if value is not None:
-                environ[key] = value
-                lines.append(assignment(key, value))
+        value = _rollback_env_variable(unmodified_environ, key, subfolders)
+        if value is not None:
+            environ[key] = value
+            lines.append(assignment(key, value))
     if lines:
         lines.insert(0, comment('reset environment variables by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH'))
     return lines
 
 
-def _rollback_env_variable(environ, name, subfolder):
+def _rollback_env_variable(environ, name, subfolders):
     '''
     For each catkin workspace in CMAKE_PREFIX_PATH remove the first entry from env[NAME] matching workspace + subfolder.
 
-    :param subfolder: str '' or subfoldername that may start with '/'
+    :param subfolders: list of str '' or subfoldername that may start with '/'
     :returns: the updated value of the environment variable.
     '''
     value = environ[name] if name in environ else ''
     env_paths = [path for path in value.split(os.pathsep) if path]
     value_modified = False
-    if subfolder:
-        if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)):
-            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, 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:
-            env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path
-            if env_path_clean == path_to_find:
-                path_to_remove = env_path
-                break
-        if path_to_remove:
-            env_paths.remove(path_to_remove)
-            value_modified = True
+    for subfolder in subfolders:
+        if subfolder:
+            if subfolder.startswith(os.path.sep) or (os.path.altsep and subfolder.startswith(os.path.altsep)):
+                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, 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:
+                env_path_clean = env_path[:-1] if env_path and env_path[-1] in [os.path.sep, os.path.altsep] else env_path
+                if env_path_clean == path_to_find:
+                    path_to_remove = env_path
+                    break
+            if path_to_remove:
+                env_paths.remove(path_to_remove)
+                value_modified = True
     new_value = os.pathsep.join(env_paths)
     return new_value if value_modified else None
 
diff --git a/cmake/templates/relay.py.in b/cmake/templates/relay.py.in
index 296fc3c..24fc873 100644
--- a/cmake/templates/relay.py.in
+++ b/cmake/templates/relay.py.in
@@ -1,5 +1,14 @@
 # -*- coding: utf-8 -*-
+# generated from catkin/cmake/template/relay.py.in
 # creates a relay to a python script source file, acting as that file.
 # The purpose is that of a symlink
-with open("@PYTHON_SCRIPT@", 'r') as fh:
-    exec(fh.read())
+python_script = '@PYTHON_SCRIPT@'
+with open(python_script, 'r') as fh:
+    context = {
+        '__builtins__': __builtins__,
+        '__doc__': None,
+        '__file__': python_script,
+        '__name__': __name__,
+        '__package__': None,
+    }
+    exec(compile(fh.read(), python_script, 'exec'), context)
diff --git a/cmake/templates/script.py.in b/cmake/templates/script.py.in
index c8f79be..0d64646 100755
--- a/cmake/templates/script.py.in
+++ b/cmake/templates/script.py.in
@@ -1,6 +1,15 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
+# generated from catkin/cmake/template/script.py.in
 # creates a relay to a python script source file, acting as that file.
 # The purpose is that of a symlink
-with open("@PYTHON_SCRIPT@", 'r') as fh:
-    exec(fh.read())
+python_script = '@PYTHON_SCRIPT@'
+with open(python_script, 'r') as fh:
+    context = {
+        '__builtins__': __builtins__,
+        '__doc__': None,
+        '__file__': python_script,
+        '__name__': __name__,
+        '__package__': None,
+    }
+    exec(compile(fh.read(), python_script, 'exec'), context)
diff --git a/cmake/templates/setup.bat.in b/cmake/templates/setup.bat.in
index 1549181..33b8546 100644
--- a/cmake/templates/setup.bat.in
+++ b/cmake/templates/setup.bat.in
@@ -6,7 +6,7 @@ REM It tries it's best to undo changes from a previously sourced setup file befo
 REM Supported command line options:
 REM --extend: skips the undoing of changes from a previously sourced setup file
 
-set _SETUP_UTIL="@SETUP_DIR@/_setup_util.py"
+set _SETUP_UTIL=@SETUP_DIR@/_setup_util.py
 
 if NOT EXIST "%_SETUP_UTIL%" (
   echo "Missing Python script: %_SETUP_UTIL%"
@@ -33,7 +33,7 @@ if NOT EXIST %_SETUP_TMP% (
 )
 
 REM invoke Python script to generate necessary exports of environment variables
-%_PYTHON% %_SETUP_UTIL% %* > %_SETUP_TMP%
+%_PYTHON% "%_SETUP_UTIL%" %* > %_SETUP_TMP%
 if NOT EXIST %_SETUP_TMP% (
   echo "Could not create temporary file: %_SETUP_TMP%"
   return 1
diff --git a/cmake/test/nosetests.cmake b/cmake/test/nosetests.cmake
index 326da59..d4af50d 100644
--- a/cmake/test/nosetests.cmake
+++ b/cmake/test/nosetests.cmake
@@ -93,9 +93,9 @@ if(NOSETESTS)
   message(STATUS "Using Python nosetests: ${NOSETESTS}")
 else()
   if("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
-    message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python3-nose')")
+    message(STATUS "nosetests not found, Python tests can not be run (try installing package 'python3-nose')")
   else()
-    message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python-nose')")
+    message(STATUS "nosetests not found, Python tests can not be run (try installing package 'python-nose')")
   endif()
 endif()
 
diff --git a/doc/howto/format2/building_msgs.rst b/doc/howto/format2/building_msgs.rst
index 0517c2e..9a73e34 100644
--- a/doc/howto/format2/building_msgs.rst
+++ b/doc/howto/format2/building_msgs.rst
@@ -8,10 +8,11 @@ package.xml
 :::::::::::
 
 Your ``package.xml`` must declare a ``<build_depend>`` on
-``message_generation``, and a ``<exec_depend>`` on
-``message_runtime``::
+``message_generation``, and a ``<build_export_depend>`` as well as
+``<exec_depend>`` on ``message_runtime``::
 
   <build_depend>message_generation</build_depend>
+  <build_export_depend>message_runtime</build_export_depend>
   <exec_depend>message_runtime</exec_depend>
 
 Your messages services, or actions will probably include fields
diff --git a/package.xml b/package.xml
index ba4619c..5dc531f 100644
--- a/package.xml
+++ b/package.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <package format="2">
   <name>catkin</name>
-  <version>0.7.1</version>
+  <version>0.7.2</version>
   <description>Low-level build system macros and infrastructure for ROS.</description>
   <maintainer email="dthomas at osrfoundation.org">Dirk Thomas</maintainer>
   <license>BSD</license>
diff --git a/python/catkin/builder.py b/python/catkin/builder.py
index 6127a8b..9c49c2a 100644
--- a/python/catkin/builder.py
+++ b/python/catkin/builder.py
@@ -341,7 +341,7 @@ def build_catkin_package(
     path, package,
     workspace, buildspace, develspace, installspace,
     install, force_cmake, quiet, last_env, cmake_args, make_args,
-    destdir=None, use_ninja=False
+    destdir=None, use_ninja=False, use_nmake=False
 ):
     cprint(
         "Processing @{cf}catkin@| package: '@!@{bf}" +
@@ -403,10 +403,13 @@ def build_catkin_package(
     else:
         print('%s exists, skipping explicit cmake invocation...' % makefile_name)
         # Check to see if cmake needs to be run via make
-        if not use_ninja:
-            make_check_cmake_cmd = ['make', 'cmake_check_build_system']
-        else:
+        if use_ninja:
             make_check_cmake_cmd = ['ninja', 'build.ninja']
+        elif use_nmake:
+            make_check_cmake_cmd = ['nmake', 'cmake_check_build_system']
+        else:
+            make_check_cmake_cmd = ['make', 'cmake_check_build_system']
+
         add_env = get_additional_environment(install, destdir, installspace)
         isolation_print_command(' '.join(make_check_cmake_cmd), build_dir, add_env=add_env)
         if last_env is not None:
@@ -416,10 +419,13 @@ def build_catkin_package(
         )
 
     # Run make
-    if not use_ninja:
-        make_executable = 'make'
-    else:
+    if use_ninja:
         make_executable = 'ninja'
+    elif use_nmake:
+        make_executable = 'nmake'
+    else:
+        make_executable = 'make'
+
     make_cmd = [make_executable]
     make_cmd.extend(handle_make_arguments(make_args))
     isolation_print_command(' '.join(make_cmd), build_dir)
@@ -428,7 +434,8 @@ def build_catkin_package(
     run_command(make_cmd, build_dir, quiet)
 
     # Make install
-    if install:
+    # NMake doesn't have an option to list target so try it anyway
+    if install or use_nmake:
         if has_make_target(build_dir, 'install', use_ninja=use_ninja):
             make_install_cmd = [make_executable, 'install']
             isolation_print_command(' '.join(make_install_cmd), build_dir)
@@ -465,7 +472,7 @@ def build_cmake_package(
     path, package,
     workspace, buildspace, develspace, installspace,
     install, force_cmake, quiet, last_env, cmake_args, make_args,
-    destdir=None, use_ninja=False
+    destdir=None, use_ninja=False, use_nmake=False
 ):
     # Notify the user that we are processing a plain cmake package
     cprint(
@@ -507,10 +514,13 @@ def build_cmake_package(
     else:
         print('%s exists, skipping explicit cmake invocation...' % makefile_name)
         # Check to see if cmake needs to be run via make
-        if not use_ninja:
-            make_check_cmake_cmd = ['make', 'cmake_check_build_system']
-        else:
+        if use_ninja:
             make_check_cmake_cmd = ['ninja', 'build.ninja']
+        elif use_nmake:
+            make_check_cmake_cmd = ['nmake', 'cmake_check_build_system']
+        else:
+            make_check_cmake_cmd = ['make', 'cmake_check_build_system']
+
         isolation_print_command(' '.join(make_check_cmake_cmd), build_dir)
         if last_env is not None:
             make_check_cmake_cmd = [last_env] + make_check_cmake_cmd
@@ -520,9 +530,11 @@ def build_cmake_package(
 
     # Run make
     if not use_ninja:
-        make_executable = 'make'
-    else:
         make_executable = 'ninja'
+    elif use_nmake:
+        make_executable = 'nmake'
+    else:
+        make_executable = 'make'
     make_cmd = [make_executable]
     make_cmd.extend(handle_make_arguments(make_args))
     isolation_print_command(' '.join(make_cmd), build_dir)
@@ -739,6 +751,7 @@ def build_workspace_isolated(
     only_pkg_with_deps=None,
     destdir=None,
     use_ninja=False,
+    use_nmake=False,
     override_build_tool_check=False
 ):
     '''
@@ -775,6 +788,7 @@ def build_workspace_isolated(
         ``[str]``
     :param destdir: define DESTDIR for cmake/invocation, ``string``
     :param use_ninja: if True, use ninja instead of make, ``bool``
+    :param use_nmake: if True, use nmake instead of make, ``bool``
     :param override_build_tool_check: if True, build even if a space was built
         by another tool previously.
     '''
@@ -847,12 +861,14 @@ def build_workspace_isolated(
         cmake_args = []
 
     if not [arg for arg in cmake_args if arg.startswith('-G')]:
-        if not use_ninja:
-            cmake_args += ['-G', 'Unix Makefiles']
-        else:
+        if use_ninja:
             cmake_args += ['-G', 'Ninja']
-    elif use_ninja:
-        print(colorize_line("Error: either specify a generator using '-G...' or '--use-ninja' but not both"))
+        elif use_nmake:
+            cmake_args += ['-G', 'NMake Makefiles']
+        else:
+            cmake_args += ['-G', 'Unix Makefiles']
+    elif use_ninja or use_nmake:
+        print(colorize_line("Error: either specify a generator using '-G...' or '--use-[ninja|nmake]' but not both"))
         sys.exit(1)
 
     if make_args:
diff --git a/test/unit_tests/test_setup_util.py b/test/unit_tests/test_setup_util.py
index 3e4d3e7..722cf6e 100644
--- a/test/unit_tests/test_setup_util.py
+++ b/test/unit_tests/test_setup_util.py
@@ -101,20 +101,20 @@ class SetupUtilTest(unittest.TestCase):
             mock_env = {varname: os.pathsep.join([foolib, barlib]),
                         'CMAKE_PREFIX_PATH': barws}
             # since workspace foo is not in CMAKE_PREFIX_PATH, it remains in varname
-            self.assertEqual(foolib, _rollback_env_variable(mock_env, varname, '/lib'))
+            self.assertEqual(foolib, _rollback_env_variable(mock_env, varname, ['/lib']))
 
             # mock_env with both ws in CPP
             mock_env = {varname: os.pathsep.join([foolib, barlib]),
                         wsvarname: os.pathsep.join([foows, barws]),
                         'CMAKE_PREFIX_PATH': os.pathsep.join([foows, barws])}
 
-            self.assertEqual(None, _rollback_env_variable(mock_env, varname, ''))
-            self.assertEqual(None, _rollback_env_variable(mock_env, varname, 'nolib'))
-            self.assertEqual(None, _rollback_env_variable(mock_env, varname, '/nolib'))
-            self.assertEqual('', _rollback_env_variable(mock_env, varname, 'lib'))
-            self.assertEqual('', _rollback_env_variable(mock_env, varname, '/lib'))
-            self.assertEqual(None, _rollback_env_variable(mock_env, varname, ''))
-            self.assertEqual('', _rollback_env_variable(mock_env, wsvarname, ''))
+            self.assertEqual(None, _rollback_env_variable(mock_env, varname, ['']))
+            self.assertEqual(None, _rollback_env_variable(mock_env, varname, ['nolib']))
+            self.assertEqual(None, _rollback_env_variable(mock_env, varname, ['/nolib']))
+            self.assertEqual('', _rollback_env_variable(mock_env, varname, ['lib']))
+            self.assertEqual('', _rollback_env_variable(mock_env, varname, ['/lib']))
+            self.assertEqual(None, _rollback_env_variable(mock_env, varname, ['']))
+            self.assertEqual('', _rollback_env_variable(mock_env, wsvarname, ['']))
 
             # nows: not a workspace
             nows = os.path.join(rootdir, 'nows')
@@ -125,12 +125,12 @@ class SetupUtilTest(unittest.TestCase):
             mock_env = {'varname': os.pathsep.join([foolib, nowslib, barlib, foolib]),
                         'CMAKE_PREFIX_PATH': os.pathsep.join([foows, barws])}
             # checks nows/lib remains, and second mention of foolib
-            self.assertEqual(os.pathsep.join([nowslib, foolib]), _rollback_env_variable(mock_env, 'varname', '/lib'))
-            self.assertEqual(os.pathsep.join([nowslib, foolib]), _rollback_env_variable(mock_env, 'varname', 'lib'))
+            self.assertEqual(os.pathsep.join([nowslib, foolib]), _rollback_env_variable(mock_env, 'varname', ['/lib']))
+            self.assertEqual(os.pathsep.join([nowslib, foolib]), _rollback_env_variable(mock_env, 'varname', ['lib']))
 
             # windows pathsep
             os.path.altsep = '\\'
-            self.assertEqual(os.pathsep.join([nowslib, foolib]), _rollback_env_variable(mock_env, 'varname', '\\lib'))
+            self.assertEqual(os.pathsep.join([nowslib, foolib]), _rollback_env_variable(mock_env, 'varname', ['\\lib']))
         finally:
             os.path.altsep = altsep
             shutil.rmtree(rootdir)

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



More information about the debian-science-commits mailing list