dev-python/vcstools: fix usage of yaml.load
authorAlexis Ballier <aballier@gentoo.org>
Thu, 12 Dec 2019 12:13:38 +0000 (13:13 +0100)
committerAlexis Ballier <aballier@gentoo.org>
Thu, 12 Dec 2019 12:30:58 +0000 (13:30 +0100)
Bug: https://bugs.gentoo.org/698668
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
dev-python/vcstools/files/yaml.patch [new file with mode: 0644]
dev-python/vcstools/vcstools-0.1.42.ebuild

diff --git a/dev-python/vcstools/files/yaml.patch b/dev-python/vcstools/files/yaml.patch
new file mode 100644 (file)
index 0000000..727131b
--- /dev/null
@@ -0,0 +1,25 @@
+https://github.com/vcstools/vcstools/issues/158
+https://bugs.gentoo.org/698668
+
+Index: vcstools-0.1.42/src/vcstools/tar.py
+===================================================================
+--- vcstools-0.1.42.orig/src/vcstools/tar.py
++++ vcstools-0.1.42/src/vcstools/tar.py
+@@ -77,7 +77,7 @@ class TarClient(VcsClientBase):
+         """
+         if self.detect_presence():
+             with open(self.metadata_path, 'r') as metadata_file:
+-                metadata = yaml.load(metadata_file.read())
++                metadata = yaml.full_load(metadata_file.read())
+                 if 'url' in metadata:
+                     return metadata['url']
+         return None
+@@ -165,7 +165,7 @@ class TarClient(VcsClientBase):
+         if self.detect_presence():
+             with open(self.metadata_path, 'r') as metadata_file:
+-                metadata = yaml.load(metadata_file.read())
++                metadata = yaml.full_load(metadata_file.read())
+                 if 'version' in metadata:
+                     return metadata['version']
+         return None
index 2526583e223aec77207d5552247c7150682eadbc..84a9cca031f2d9359c451a3fbbe9c28ded5946fe 100644 (file)
@@ -1,7 +1,7 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 PYTHON_COMPAT=( python{2_7,3_5,3_6} )
 
 SCM=""
@@ -33,8 +33,8 @@ RDEPEND="
        dev-python/pyyaml[${PYTHON_USEDEP}]
        dev-python/python-dateutil[${PYTHON_USEDEP}]
 "
-DEPEND="${RDEPEND}
-       test? (
+DEPEND="${RDEPEND}"
+BDEPEND="test? (
                dev-python/nose[${PYTHON_USEDEP}]
                dev-vcs/git
                dev-vcs/bzr
@@ -42,6 +42,7 @@ DEPEND="${RDEPEND}
                dev-vcs/subversion
        )
 "
+PATCHES=( "${FILESDIR}/yaml.patch" )
 
 python_test() {
        # From travis.yml