commit:     5973d84d8637eee5ce8492dc40c62b009d8d12f2
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 12 14:40:14 2019 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Thu Dec 12 14:47:00 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5973d84d

dev-ros/rosmsg: fix tests

Closes: https://bugs.gentoo.org/624804
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 dev-ros/rosmsg/files/norm.patch        | 31 +++++++++++++++++++++++++++++++
 dev-ros/rosmsg/files/tests.patch       | 15 +++++++++++++++
 dev-ros/rosmsg/rosmsg-1.14.3-r1.ebuild |  2 +-
 3 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/dev-ros/rosmsg/files/norm.patch b/dev-ros/rosmsg/files/norm.patch
new file mode 100644
index 00000000000..530da65fcd2
--- /dev/null
+++ b/dev-ros/rosmsg/files/norm.patch
@@ -0,0 +1,31 @@
+From 0648d3019dc2395f61a8a7a3d1bbf790eca98739 Mon Sep 17 00:00:00 2001
+From: James Xu <[email protected]>
+Date: Wed, 6 Feb 2019 09:47:54 -0800
+Subject: [PATCH] normalize paths before comparison in rosmsg (#1586)
+
+* normalize paths before comparison in rosmsg
+
+* remove use of normcase and remove path_in_workspaces temp variable
+
+* remove duplicated control
+
+* revert unrelated whitespace changes
+
+* keep order of operands
+---
+ tools/rosmsg/src/rosmsg/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/rosmsg/src/rosmsg/__init__.py 
b/tools/rosmsg/src/rosmsg/__init__.py
+index 83b629e7e..4ed7aa542 100644
+--- a/tools/rosmsg/src/rosmsg/__init__.py
++++ b/tools/rosmsg/src/rosmsg/__init__.py
+@@ -551,7 +551,7 @@ def _get_package_paths(pkgname, rospack):
+     path = rospack.get_path(pkgname)
+     paths.append(path)
+     results = find_in_workspaces(search_dirs=['share'], project=pkgname, 
first_match_only=True, 
workspace_to_source_spaces=_catkin_workspace_to_source_spaces, 
source_path_to_packages=_catkin_source_path_to_packages)
+-    if results and results[0] != path:
++    if results and results[0].replace(os.path.sep, '/') != 
path.replace(os.path.sep, '/'):
+         paths.append(results[0])
+     return paths
+     

diff --git a/dev-ros/rosmsg/files/tests.patch b/dev-ros/rosmsg/files/tests.patch
new file mode 100644
index 00000000000..f8b514b4e12
--- /dev/null
+++ b/dev-ros/rosmsg/files/tests.patch
@@ -0,0 +1,15 @@
+Index: rosmsg/test/test_rosmsg_command_line.py
+===================================================================
+--- rosmsg.orig/test/test_rosmsg_command_line.py
++++ rosmsg/test/test_rosmsg_command_line.py
+@@ -168,8 +168,8 @@ class TestRosmsg(unittest.TestCase):
+ 
+             # test as search
+             type_ = t
+-            text = "[test_rosmaster/%s]:\n%s"%(t, text)
+-            text_raw = "[test_rosmaster/%s]:\n%s"%(t, text_raw)
++            text = ("[test_rosmaster/%s]:\n%s"%(t, text))*2
++            text_raw = ("[test_rosmaster/%s]:\n%s"%(t, text_raw))*2
+             output = Popen(['rosmsg', 'show', type_], 
stdout=PIPE).communicate()[0].decode()
+             self.assertEquals(text, output)
+             output = Popen(['rosmsg', 'show', '-r',type_], stdout=PIPE, 
stderr=PIPE).communicate()

diff --git a/dev-ros/rosmsg/rosmsg-1.14.3-r1.ebuild 
b/dev-ros/rosmsg/rosmsg-1.14.3-r1.ebuild
index dc284ec75bc..116c190ae75 100644
--- a/dev-ros/rosmsg/rosmsg-1.14.3-r1.ebuild
+++ b/dev-ros/rosmsg/rosmsg-1.14.3-r1.ebuild
@@ -24,4 +24,4 @@ RDEPEND="
 DEPEND="${RDEPEND}
        test? ( dev-ros/test_rosmaster[${PYTHON_USEDEP}] )
 "
-PATCHES=( "${FILESDIR}/py3.patch" )
+PATCHES=( "${FILESDIR}/py3.patch" "${FILESDIR}/norm.patch" 
"${FILESDIR}/tests.patch" )

Reply via email to