aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2020-02-04 15:16:16 +0100
committerJakub Jirutka <jakub@jirutka.cz>2020-02-04 15:46:17 +0100
commitbdaf9315081cb77b81c9c94c7621197954925fd1 (patch)
tree0c1e952b0661dfdfb549a40640278e104f317167 /main
parentf6a72510bd8f7a891e719aaf1f8f37bda413b757 (diff)
downloadaports-bdaf9315081cb77b81c9c94c7621197954925fd1.tar.bz2
aports-bdaf9315081cb77b81c9c94c7621197954925fd1.tar.xz
main/uwsgi: mitigate backward compat. breakage in -python3 and -gevent3
Packages uwsgi-python and uwsgi-gevent were removed and packages uwsgi-python3 and uwsgi-gevent3 renamed to uwsgi-python and uwsgi-gevent, respectively; without setting $provides and adding a warning message. This breakes backward compatibility with previous versions of the packages and thus introduces problems with upgrade to Alpine v3.11. The worst is that the names overlap, so when users with uwsgi-python or uwsgi-gevent (Python 2) installed upgrade to Alpine v3.11, they will suddenly end-up with Python 3 versions without noticing. This may lead to hard times trying to figure out why the app doesn't work correctly! Users with uwsgi-python3 or uwsgi-gevent3 installed will not be able to upgrade because of missing packages. After they find what happend and install uwsgi-python or uwsgi-gevent instead, they would have to also fix their uWSGI configuration to load correct plugin. Also all the major distros (except Arch Linux) name uWSGI Python 3 plugin as python3(_plugin.so) or python38(_plugin.so) and keep this name even after purging Python 2. That's consistent with naming Python 3 binary as python3 and not python. Unfortunately, there's no way how to fix this mess now without introducing another breaking change in v3.11 branch. This patch just fixes the upgrade path for uwsgi-python3 and uwsgi-gevent3 users and adds post-upgrade warning message. This problem was introduced in commit 3ee2dbe9737e86f9432a72e9cf49f41de7e5804b authored by @Leo and committed by @ncopa.
Diffstat (limited to 'main')
-rw-r--r--main/uwsgi/APKBUILD19
-rw-r--r--main/uwsgi/uwsgi.post-upgrade15
2 files changed, 32 insertions, 2 deletions
diff --git a/main/uwsgi/APKBUILD b/main/uwsgi/APKBUILD
index 2e53487b77..20a215127a 100644
--- a/main/uwsgi/APKBUILD
+++ b/main/uwsgi/APKBUILD
@@ -64,7 +64,7 @@ _plugins="
fastrouter
forkptyrouter
geoip
- gevent
+ gevent:gevent3
graylog2
http
legion_cache_fetch
@@ -80,7 +80,7 @@ _plugins="
pam
ping
pty
- python
+ python:python3
rawrouter
redislog
router_basicauth
@@ -194,6 +194,21 @@ _plugin() {
install -m 755 -D ${name}_plugin.so \
"$subpkgdir"/usr/lib/uwsgi/${name}_plugin.so
+
+ case "$name" in
+ # Mitigate breakages caused by injudicious rename in v3.11.
+ python3)
+ provides="uwsgi-python=$pkgver-r$pkgrel"
+ replaces="uwsgi-python"
+ ln -s python3_plugin.so "$subpkgdir"/usr/lib/uwsgi/python_plugin.so
+ ;;
+ # Mitigate breakages caused by injudicious rename in v3.11.
+ gevent3)
+ provides="uwsgi-gevent=$pkgver-r$pkgrel"
+ replaces="uwsgi-gevent"
+ ln -s gevent3_plugin.so "$subpkgdir"/usr/lib/uwsgi/gevent_plugin.so
+ ;;
+ esac
}
sha512sums="6561703279bcc4a81311d033810ac066d0f113bab13b0942f3eef86cac29c584a6641b52476840d6895151aee5ed064ae2d03b18932cf7f47e62f4eeed76da61 uwsgi-2.0.18.tar.gz
diff --git a/main/uwsgi/uwsgi.post-upgrade b/main/uwsgi/uwsgi.post-upgrade
new file mode 100644
index 0000000000..793d0d442e
--- /dev/null
+++ b/main/uwsgi/uwsgi.post-upgrade
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+ver_new="$1"
+ver_old="$2"
+
+if [ "$(apk version -t "$ver_old" "2.0.18-r2")" = "<" ]; then
+ cat 1>&2 <<-EOF
+ *
+ * uWSGI plugins for Python 2 were removed. uwsgi-python and uwsgi-gevent
+ * are aliases for uwsgi-python3 and uwsgi-gevent3, respectively!
+ *
+ EOF
+fi
+
+exit 0