aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2024-04-08 14:48:36 +0200
committerJakub Jirutka <jakub@jirutka.cz>2024-04-19 20:57:06 +0000
commit843f2d8b7ce594fe55101b74aab800bd05c67362 (patch)
treeb1f62957bdb1500f8b3aae988e798b10738d519b
parent94827c8b362b01aa1293c9af6043150537cb0f05 (diff)
testing/yq: new aportHEADmaster
Resolves #15591
-rw-r--r--testing/yq/APKBUILD50
-rw-r--r--testing/yq/yq.post-upgrade19
2 files changed, 69 insertions, 0 deletions
diff --git a/testing/yq/APKBUILD b/testing/yq/APKBUILD
new file mode 100644
index 00000000000..6cd28bad00a
--- /dev/null
+++ b/testing/yq/APKBUILD
@@ -0,0 +1,50 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+#
+# NOTE: yq and yq-go are NOT interchangeable, they have quite different CLI
+# and syntax. Most distros package this Python implementation as "yq".
+pkgname=yq
+pkgver=3.2.3
+pkgrel=0
+pkgdesc="jq wrapper for YAML/XML/TOML documents"
+url="https://github.com/kislyuk/yq"
+arch="noarch"
+license="Apache-2.0"
+depends="
+ !yq-go
+ jq
+ py3-pyaml
+ py3-xmltodict
+ py3-tomlkit
+ py3-argcomplete
+ "
+makedepends="
+ py3-gpep517
+ py3-setuptools
+ py3-wheel
+ "
+checkdepends="py3-pytest"
+subpackages="$pkgname-pyc"
+install="$pkgname.post-upgrade"
+source="https://github.com/kislyuk/yq/archive/v$pkgver/yq-$pkgver.tar.gz"
+builddir="$srcdir/yq-$pkgver"
+
+build() {
+ echo "version = '$pkgver'" > yq/version.py
+
+ gpep517 build-wheel \
+ --wheel-dir .dist \
+ --output-fd 3 3>&1 >&2
+}
+
+check() {
+ python3 ./test/test.py -v
+}
+
+package() {
+ python3 -m installer -d "$pkgdir" .dist/*.whl
+}
+
+sha512sums="
+6238746d59511577fb0368ab43e3593c60dfb40dfebd7a01e475abf7171d27f7e0d2de9b03a3d95a554d82e181ddaf3cd030020853e7c9efad2f77914ea9c0ad yq-3.2.3.tar.gz
+"
diff --git a/testing/yq/yq.post-upgrade b/testing/yq/yq.post-upgrade
new file mode 100644
index 00000000000..b1969dad445
--- /dev/null
+++ b/testing/yq/yq.post-upgrade
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+ver_new="$1"
+ver_old="$2"
+
+# NOTE: .pre-upgrade doesn't work here, that's why it's in .post-upgrade.
+if [ "${ver_new%%.*}" = 3 ] && [ "${ver_old%%.*}" = 4 ]; then
+ cat >&2 <<-EOF
+ *
+ * Until Alpine 3.20, the yq package was mikefarah's Go implementation. Now the
+ * yq package is kislyuk's Python implementation (as in most distros), and the
+ * Go implementation has been renamed to yq-go. They are incompatible.
+ *
+ * If you want to keep the Go implementation: apk del yq && apk add yq-go
+ *
+ EOF
+fi
+
+exit 0