summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2019-12-11 16:52:22 +0100
committerAlexis Ballier <aballier@gentoo.org>2019-12-11 17:12:27 +0100
commit4d975fc426f37698604a2a2b26309838417bb060 (patch)
tree5c343bb1ae164897e7ddb5ce74c1cf8141df6a02
parentdev-ros/roslaunch: Remove old (diff)
downloadgentoo-4d975fc426f.tar.gz
gentoo-4d975fc426f.tar.bz2
gentoo-4d975fc426f.zip
dev-ros/roslaunch: remove yaml.load() usages
Package-Manager: Portage-2.3.81, Repoman-2.3.20 Signed-off-by: Alexis Ballier <aballier@gentoo.org>
-rw-r--r--dev-ros/roslaunch/files/yaml.patch44
-rw-r--r--dev-ros/roslaunch/roslaunch-1.14.3-r1.ebuild (renamed from dev-ros/roslaunch/roslaunch-1.14.3.ebuild)2
-rw-r--r--dev-ros/roslaunch/roslaunch-9999.ebuild2
3 files changed, 46 insertions, 2 deletions
diff --git a/dev-ros/roslaunch/files/yaml.patch b/dev-ros/roslaunch/files/yaml.patch
new file mode 100644
index 000000000000..135e9927c408
--- /dev/null
+++ b/dev-ros/roslaunch/files/yaml.patch
@@ -0,0 +1,44 @@
+Index: roslaunch/src/roslaunch/loader.py
+===================================================================
+--- roslaunch.orig/src/roslaunch/loader.py
++++ roslaunch/src/roslaunch/loader.py
+@@ -98,7 +98,7 @@ def convert_value(value, type_):
+ raise ValueError("%s is not a '%s' type"%(value, type_))
+ elif type_ == 'yaml':
+ try:
+- return yaml.load(value)
++ return yaml.safe_load(value)
+ except yaml.parser.ParserError as e:
+ raise ValueError(e)
+ else:
+@@ -409,7 +409,7 @@ class Loader(object):
+ if rosparam is None:
+ import rosparam
+ try:
+- data = yaml.load(text)
++ data = yaml.safe_load(text)
+ # #3162: if there is no YAML, load() will return an
+ # empty string. We want an empty dictionary instead
+ # for our representation of empty.
+Index: roslaunch/test/unit/test_roslaunch_dump_params.py
+===================================================================
+--- roslaunch.orig/test/unit/test_roslaunch_dump_params.py
++++ roslaunch/test/unit/test_roslaunch_dump_params.py
+@@ -53,7 +53,7 @@ class TestDumpParams(unittest.TestCase):
+ o, e = p.communicate()
+ self.assert_(p.returncode == 0, "Return code nonzero for param dump! Code: %d" % (p.returncode))
+
+- self.assertEquals({'/noop': 'noop'}, yaml.load(o))
++ self.assertEquals({'/noop': 'noop'}, yaml.safe_load(o))
+
+ p = Popen([cmd, '--dump-params', 'roslaunch', 'test-dump-rosparam.launch'], stdout = PIPE)
+ o, e = p.communicate()
+@@ -95,7 +95,7 @@ class TestDumpParams(unittest.TestCase):
+ '/noparam1': 'value1',
+ '/noparam2': 'value2',
+ }
+- output_val = yaml.load(o)
++ output_val = yaml.safe_load(o)
+ if not val == output_val:
+ for k, v in val.items():
+ if k not in output_val:
diff --git a/dev-ros/roslaunch/roslaunch-1.14.3.ebuild b/dev-ros/roslaunch/roslaunch-1.14.3-r1.ebuild
index be129d151484..cc74b7791b52 100644
--- a/dev-ros/roslaunch/roslaunch-1.14.3.ebuild
+++ b/dev-ros/roslaunch/roslaunch-1.14.3-r1.ebuild
@@ -31,7 +31,7 @@ DEPEND="${RDEPEND}
dev-python/nose[${PYTHON_USEDEP}]
dev-ros/test_rosmaster
)"
-PATCHES=( "${FILESDIR}/timeout.patch" )
+PATCHES=( "${FILESDIR}/timeout.patch" "${FILESDIR}/yaml.patch" )
src_test() {
rosdep update
diff --git a/dev-ros/roslaunch/roslaunch-9999.ebuild b/dev-ros/roslaunch/roslaunch-9999.ebuild
index be129d151484..cc74b7791b52 100644
--- a/dev-ros/roslaunch/roslaunch-9999.ebuild
+++ b/dev-ros/roslaunch/roslaunch-9999.ebuild
@@ -31,7 +31,7 @@ DEPEND="${RDEPEND}
dev-python/nose[${PYTHON_USEDEP}]
dev-ros/test_rosmaster
)"
-PATCHES=( "${FILESDIR}/timeout.patch" )
+PATCHES=( "${FILESDIR}/timeout.patch" "${FILESDIR}/yaml.patch" )
src_test() {
rosdep update