1 |
commit: 5b526a1d6b0fff6bf8834b27adc4b4e08e3e2ebb |
2 |
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com> |
3 |
AuthorDate: Sat Oct 31 01:36:31 2020 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 31 01:36:45 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b526a1d |
7 |
|
8 |
app-admin/salt-3002: Version bump (bug #750815) |
9 |
|
10 |
Closes: https://bugs.gentoo.org/750815 |
11 |
Copyright: Sony Interactive Entertainment Inc. |
12 |
Package-Manager: Portage-3.0.8, Repoman-3.0.2 |
13 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
14 |
|
15 |
app-admin/salt/Manifest | 1 + |
16 |
.../files/salt-3002-dont-realpath-on-tmpdir.patch | 38 +++++ |
17 |
app-admin/salt/files/salt-3002-tests.patch | 27 +++ |
18 |
app-admin/salt/salt-3002.ebuild | 183 +++++++++++++++++++++ |
19 |
4 files changed, 249 insertions(+) |
20 |
|
21 |
diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest |
22 |
index 4f594f7a094..e98dc8130cb 100644 |
23 |
--- a/app-admin/salt/Manifest |
24 |
+++ b/app-admin/salt/Manifest |
25 |
@@ -3,3 +3,4 @@ DIST salt-3000.2-py38-misc.patch.gz 6250 BLAKE2B 68fff80a042e6bf208ea2d9692da7a7 |
26 |
DIST salt-3000.2.tar.gz 15231513 BLAKE2B 2090d0f52f953a42f1685ad190750e9c76ad6e862a3272444fef063a7605f69a6c542f04165a41fb9cdaa126a878cc133d4857faa70edc5eac4bf49bdde937ab SHA512 88e8876ed8cd18e942c2194686cda68f40fa49e69e317ca488bf58e095bcf6cdf8771d93eba7960038941cc5863e13a4eea4dad5256c12da7cd8288a2c61f59d |
27 |
DIST salt-3000.3.tar.gz 15237557 BLAKE2B ab51e07f56f9e02c47da58fad95c9482ea70e0685996a78e34382eadb3a9a3dace63ef65d643a9de284ea00c34785eae631d033f32e00e59eb3639514459af33 SHA512 a4697da9a2f7d484b72145e8b83f6d9032369f87e2e7119a9d51f59b989488285406543f79142fc686c41c144f5878eefba37927137581c892c88f03fc3a8208 |
28 |
DIST salt-3001.1.tar.gz 14556156 BLAKE2B 3088955a07b6ff95588f5b6235e0bae9cea366e957e026bacd228af9f1ed500f88f7fb543833f2398d64fe7e4546f0f29d7c65362464097bf89424174e76c954 SHA512 d59b6c3580d3379192f36e462385c74b53b0b385e63b3db7734003d0a71df8f88593a59eeccd86b1dc15800e46d050094e7a88f2636673770ddc952d0110ca29 |
29 |
+DIST salt-3002.tar.gz 15741439 BLAKE2B 7463cfe558515697177fedb25fdf9f2e2819b62e3a96c8196b4243a4f2a59a202ac5a3869138b2df00fb47238329ba102396b464379f09d2a79c8c0a672638fb SHA512 7a3ed78b301e9c1ef65c8e6aeeaebc2376b3942e94e38b0591860fa1d9213c6c0f85db4d932b4c7c9d20717027a686690973d0dfd2aff17f44abae0ec0e97d31 |
30 |
|
31 |
diff --git a/app-admin/salt/files/salt-3002-dont-realpath-on-tmpdir.patch b/app-admin/salt/files/salt-3002-dont-realpath-on-tmpdir.patch |
32 |
new file mode 100644 |
33 |
index 00000000000..5ef68dcd180 |
34 |
--- /dev/null |
35 |
+++ b/app-admin/salt/files/salt-3002-dont-realpath-on-tmpdir.patch |
36 |
@@ -0,0 +1,38 @@ |
37 |
+diff --git a/tests/integration/files/file/base/_modules/runtests_helpers.py b/tests/integration/files/file/base/_modules/runtests_helpers.py |
38 |
+index 3ee0e2da5f..5b462f0a9e 100644 |
39 |
+--- a/tests/integration/files/file/base/_modules/runtests_helpers.py |
40 |
++++ b/tests/integration/files/file/base/_modules/runtests_helpers.py |
41 |
+@@ -18,7 +18,7 @@ try: |
42 |
+ from tests.support.runtests import RUNTIME_VARS |
43 |
+ except ImportError: |
44 |
+ # Salt SSH Tests |
45 |
+- SYS_TMP_DIR = os.path.realpath( |
46 |
++ SYS_TMP_DIR = os.path.abspath( |
47 |
+ # Avoid ${TMPDIR} and gettempdir() on MacOS as they yield a base path too long |
48 |
+ # for unix sockets: ``error: AF_UNIX path too long`` |
49 |
+ # Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR} |
50 |
+diff --git a/tests/support/paths.py b/tests/support/paths.py |
51 |
+index 5f28904858..26245fadf9 100644 |
52 |
+--- a/tests/support/paths.py |
53 |
++++ b/tests/support/paths.py |
54 |
+@@ -48,14 +48,12 @@ if TESTS_DIR not in sys.path: |
55 |
+ sys.path.insert(1, TESTS_DIR) |
56 |
+ |
57 |
+ SYS_TMP_DIR = os.path.abspath( |
58 |
+- os.path.realpath( |
59 |
+- # Avoid ${TMPDIR} and gettempdir() on MacOS as they yield a base path too long |
60 |
+- # for unix sockets: ``error: AF_UNIX path too long`` |
61 |
+- # Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR} |
62 |
+- os.environ.get("TMPDIR", tempfile.gettempdir()) |
63 |
+- if not sys.platform.startswith("darwin") |
64 |
+- else "/tmp" |
65 |
+- ) |
66 |
++ # Avoid ${TMPDIR} and gettempdir() on MacOS as they yield a base path too long |
67 |
++ # for unix sockets: ``error: AF_UNIX path too long`` |
68 |
++ # Gentoo Portage prefers ebuild tests are rooted in ${TMPDIR} |
69 |
++ os.environ.get("TMPDIR", tempfile.gettempdir()) |
70 |
++ if not sys.platform.startswith("darwin") |
71 |
++ else "/tmp" |
72 |
+ ) |
73 |
+ TMP = os.path.join(SYS_TMP_DIR, "salt-tests-tmpdir") |
74 |
+ TMP_ROOT_DIR = os.path.join(TMP, "rootdir") |
75 |
|
76 |
diff --git a/app-admin/salt/files/salt-3002-tests.patch b/app-admin/salt/files/salt-3002-tests.patch |
77 |
new file mode 100644 |
78 |
index 00000000000..88e1ce59056 |
79 |
--- /dev/null |
80 |
+++ b/app-admin/salt/files/salt-3002-tests.patch |
81 |
@@ -0,0 +1,27 @@ |
82 |
+diff --git a/tests/unit/utils/test_verify.py b/tests/unit/utils/test_verify.py |
83 |
+index 5662cf621b..16aa6d08da 100644 |
84 |
+--- a/tests/unit/utils/test_verify.py |
85 |
++++ b/tests/unit/utils/test_verify.py |
86 |
+@@ -329,6 +329,7 @@ class TestVerifyLog(TestCase): |
87 |
+ self.assertTrue(os.path.exists(path)) |
88 |
+ |
89 |
+ |
90 |
++@skipIf(True, "skipping since temp dir is a symlink") |
91 |
+ class TestCleanPath(TestCase): |
92 |
+ """ |
93 |
+ salt.utils.clean_path works as expected |
94 |
+@@ -394,12 +395,14 @@ class TestCleanPathLink(TestCase): |
95 |
+ def tearDown(self): |
96 |
+ shutil.rmtree(self.tmpdir) |
97 |
+ |
98 |
++ @skipIf(True, "skipping since temp dir is a symlink") |
99 |
+ def test_clean_path_symlinked_src(self): |
100 |
+ test_path = os.path.join(self.from_path, "test") |
101 |
+ expect_path = os.path.join(self.to_path, "test") |
102 |
+ ret = clean_path(self.from_path, test_path) |
103 |
+ assert ret == expect_path, "{} is not {}".format(ret, expect_path) |
104 |
+ |
105 |
++ @skipIf(True, "skipping since temp dir is a symlink") |
106 |
+ def test_clean_path_symlinked_tgt(self): |
107 |
+ test_path = os.path.join(self.to_path, "test") |
108 |
+ expect_path = os.path.join(self.to_path, "test") |
109 |
|
110 |
diff --git a/app-admin/salt/salt-3002.ebuild b/app-admin/salt/salt-3002.ebuild |
111 |
new file mode 100644 |
112 |
index 00000000000..59838e3e579 |
113 |
--- /dev/null |
114 |
+++ b/app-admin/salt/salt-3002.ebuild |
115 |
@@ -0,0 +1,183 @@ |
116 |
+# Copyright 1999-2020 Gentoo Authors |
117 |
+# Distributed under the terms of the GNU General Public License v2 |
118 |
+ |
119 |
+EAPI=7 |
120 |
+PYTHON_COMPAT=( python3_{7..8} ) |
121 |
+DISTUTILS_USE_SETUPTOOLS=rdepend |
122 |
+inherit systemd distutils-r1 |
123 |
+ |
124 |
+DESCRIPTION="Salt is a remote execution and configuration manager" |
125 |
+HOMEPAGE="https://www.saltstack.com/resources/community/ |
126 |
+ https://github.com/saltstack" |
127 |
+ |
128 |
+if [[ ${PV} == 9999* ]]; then |
129 |
+ inherit git-r3 |
130 |
+ EGIT_REPO_URI="git://github.com/${PN}stack/${PN}.git" |
131 |
+ EGIT_BRANCH="develop" |
132 |
+ SRC_URI="" |
133 |
+else |
134 |
+ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
135 |
+ KEYWORDS="~amd64 ~x86" |
136 |
+fi |
137 |
+ |
138 |
+LICENSE="Apache-2.0" |
139 |
+SLOT="0" |
140 |
+IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako |
141 |
+ mongodb neutron nova openssl portage profile redis selinux test raet |
142 |
+ +zeromq vim-syntax" |
143 |
+ |
144 |
+RDEPEND=" |
145 |
+ sys-apps/pciutils |
146 |
+ >=dev-python/distro-1.5[${PYTHON_USEDEP}] |
147 |
+ dev-python/jinja[${PYTHON_USEDEP}] |
148 |
+ dev-python/libnacl[${PYTHON_USEDEP}] |
149 |
+ >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}] |
150 |
+ >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}] |
151 |
+ dev-python/pycryptodomex[${PYTHON_USEDEP}] |
152 |
+ dev-python/pyyaml[${PYTHON_USEDEP}] |
153 |
+ dev-python/markupsafe[${PYTHON_USEDEP}] |
154 |
+ >=dev-python/requests-1.0.0[${PYTHON_USEDEP}] |
155 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
156 |
+ dev-python/toml[${PYTHON_USEDEP}] |
157 |
+ dev-python/watchdog[${PYTHON_USEDEP}] |
158 |
+ libcloud? ( >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}] ) |
159 |
+ mako? ( dev-python/mako[${PYTHON_USEDEP}] ) |
160 |
+ ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] ) |
161 |
+ libvirt? ( |
162 |
+ $(python_gen_cond_dep 'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_7) |
163 |
+ ) |
164 |
+ openssl? ( |
165 |
+ dev-libs/openssl:0=[-bindist] |
166 |
+ dev-python/pyopenssl[${PYTHON_USEDEP}] |
167 |
+ ) |
168 |
+ raet? ( |
169 |
+ >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}] |
170 |
+ >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}] |
171 |
+ >=dev-python/raet-0.6.0[${PYTHON_USEDEP}] |
172 |
+ ) |
173 |
+ cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] ) |
174 |
+ cheetah? ( dev-python/cheetah3[${PYTHON_USEDEP}] ) |
175 |
+ mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] ) |
176 |
+ portage? ( sys-apps/portage[${PYTHON_USEDEP}] ) |
177 |
+ keyring? ( dev-python/keyring[${PYTHON_USEDEP}] ) |
178 |
+ redis? ( dev-python/redis-py[${PYTHON_USEDEP}] ) |
179 |
+ selinux? ( sec-policy/selinux-salt ) |
180 |
+ nova? ( |
181 |
+ $(python_gen_cond_dep '>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_7) |
182 |
+ ) |
183 |
+ neutron? ( |
184 |
+ $(python_gen_cond_dep '>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_7) |
185 |
+ ) |
186 |
+ gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] ) |
187 |
+ profile? ( dev-python/yappi[${PYTHON_USEDEP}] ) |
188 |
+ vim-syntax? ( app-vim/salt-vim ) |
189 |
+ zeromq? ( >=dev-python/pyzmq-2.2.0[${PYTHON_USEDEP}] ) |
190 |
+" |
191 |
+BDEPEND=" |
192 |
+ test? ( |
193 |
+ ${RDEPEND} |
194 |
+ >=dev-python/boto-2.32.1[${PYTHON_USEDEP}] |
195 |
+ >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}] |
196 |
+ >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}] |
197 |
+ >=dev-python/mock-2.0.0[${PYTHON_USEDEP}] |
198 |
+ >=dev-python/moto-0.3.6[${PYTHON_USEDEP}] |
199 |
+ dev-python/pip[${PYTHON_USEDEP}] |
200 |
+ dev-python/psutil[${PYTHON_USEDEP}] |
201 |
+ dev-python/pytest[${PYTHON_USEDEP}] |
202 |
+ dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}] |
203 |
+ >=dev-python/pytest-salt-factories-0.93.0[${PYTHON_USEDEP}] |
204 |
+ dev-python/pytest-tempdir[${PYTHON_USEDEP}] |
205 |
+ >=dev-python/virtualenv-20.0.20[${PYTHON_USEDEP}] |
206 |
+ !x86? ( >=dev-python/boto3-1.3.15[${PYTHON_USEDEP}] ) |
207 |
+ )" |
208 |
+ |
209 |
+DOCS=( README.rst AUTHORS ) |
210 |
+ |
211 |
+REQUIRED_USE="|| ( raet zeromq ) |
212 |
+ test? ( cheetah genshi )" |
213 |
+RESTRICT="!test? ( test ) x86? ( test )" |
214 |
+ |
215 |
+PATCHES=( |
216 |
+ "${FILESDIR}/salt-2019.2.0-skip-tests-that-oom-machine.patch" |
217 |
+ "${FILESDIR}/salt-3002-dont-realpath-on-tmpdir.patch" |
218 |
+ "${FILESDIR}/salt-3002-tests.patch" |
219 |
+) |
220 |
+ |
221 |
+python_prepare_all() { |
222 |
+ # remove tests with external dependencies that may not be available |
223 |
+ rm tests/unit/{test_zypp_plugins.py,utils/test_extend.py} || die |
224 |
+ rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die |
225 |
+ rm tests/unit/states/test_boto_vpc.py || die |
226 |
+ rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die |
227 |
+ |
228 |
+ # tests that require network access |
229 |
+ rm tests/unit/{states,modules}/test_zcbuildout.py || die |
230 |
+ |
231 |
+ # make sure pkg_resources doesn't bomb because pycrypto isn't installed |
232 |
+ find . -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d' -i || die |
233 |
+ |
234 |
+ distutils-r1_python_prepare_all |
235 |
+} |
236 |
+ |
237 |
+python_prepare() { |
238 |
+ einfo "Fixing collections.abc warnings for ${EPYTHON}" |
239 |
+ local abc |
240 |
+ abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die |
241 |
+ find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die |
242 |
+} |
243 |
+ |
244 |
+python_install_all() { |
245 |
+ local svc |
246 |
+ USE_SETUPTOOLS=1 distutils-r1_python_install_all |
247 |
+ |
248 |
+ for svc in minion master syndic api; do |
249 |
+ newinitd "${FILESDIR}"/${svc}-initd-4 salt-${svc} |
250 |
+ newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc} |
251 |
+ systemd_dounit "${FILESDIR}"/salt-${svc}.service |
252 |
+ done |
253 |
+ |
254 |
+ insinto /etc/${PN} |
255 |
+ doins -r conf/* |
256 |
+} |
257 |
+ |
258 |
+python_test() { |
259 |
+ local tempdir |
260 |
+ # testsuite likes lots of files |
261 |
+ ulimit -n 3072 || die |
262 |
+ |
263 |
+ # ${T} is too long a path for the tests to work |
264 |
+ tempdir="$(mktemp -du --tmpdir=/tmp salt-XXX)" |
265 |
+ mkdir "${T}/$(basename "${tempdir}")" |
266 |
+ |
267 |
+ ( |
268 |
+ cleanup() { rm -f "${tempdir}" || die; } |
269 |
+ |
270 |
+ trap cleanup EXIT |
271 |
+ |
272 |
+ addwrite "${tempdir}" |
273 |
+ ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}" || die |
274 |
+ |
275 |
+ USE_SETUPTOOLS=1 SHELL="/bin/bash" \ |
276 |
+ TMPDIR="${tempdir}" \ |
277 |
+ ${EPYTHON} tests/runtests.py \ |
278 |
+ --unit-tests --no-report --verbose \ |
279 |
+ || die "testing failed with ${EPYTHON}" |
280 |
+ ) |
281 |
+} |
282 |
+ |
283 |
+pkg_postinst() { |
284 |
+ if use python_targets_python3_8; then |
285 |
+ if use nova; then |
286 |
+ ewarn "Salt's nova functionality will not work with python3.8 since" |
287 |
+ ewarn "dev-python/python-novaclient does not support it yet" |
288 |
+ fi |
289 |
+ if use neutron; then |
290 |
+ ewarn "Salt's neutron functionality will not work with python3.8 since" |
291 |
+ ewarn "dev-python/python-neutronclient does not support it yet" |
292 |
+ fi |
293 |
+ if use libvirt; then |
294 |
+ ewarn "Salt's libvirt functionality will not work with python3.8 since" |
295 |
+ ewarn "dev-python/libvirt-python does not support it yet" |
296 |
+ fi |
297 |
+ fi |
298 |
+} |