aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/nginx/APKBUILD4
-rw-r--r--main/nginx/nginx.post-upgrade11
-rw-r--r--main/nginx/nginx.pre-upgrade9
3 files changed, 22 insertions, 2 deletions
diff --git a/main/nginx/APKBUILD b/main/nginx/APKBUILD
index 272650901d..b76bc2703c 100644
--- a/main/nginx/APKBUILD
+++ b/main/nginx/APKBUILD
@@ -23,7 +23,7 @@ pkgname=nginx
# NOTE: Upgrade only to even-numbered versions (e.g. 1.14.z, 1.16.z)!
# Odd-numbered versions are mainline (development) versions.
pkgver=1.18.0
-pkgrel=14
+pkgrel=15
# Revision of nginx-tests to use for check().
_tests_hgrev=4e0644119341
_njs_ver=0.5.0
@@ -61,7 +61,7 @@ pkgusers="nginx"
_grp_ngx="nginx"
_grp_www="www-data"
pkggroups="$_grp_ngx $_grp_www"
-install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
+install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-upgrade $pkgname.post-upgrade"
subpackages="$pkgname-debug $pkgname-doc $pkgname-openrc $pkgname-vim::noarch"
source="https://nginx.org/download/$pkgname-$pkgver.tar.gz
$pkgname-tests-$_tests_hgrev.tar.gz::https://hg.nginx.org/nginx-tests/archive/$_tests_hgrev.tar.gz
diff --git a/main/nginx/nginx.post-upgrade b/main/nginx/nginx.post-upgrade
index 8404e1ceb3..8b6cddf9de 100644
--- a/main/nginx/nginx.post-upgrade
+++ b/main/nginx/nginx.post-upgrade
@@ -62,4 +62,15 @@ if [ "$(apk version -t "$ver_old" '1.18.0-r13')" = '<' ]; then
EOF
fi
+# Handle trasition from /var/tmp/nginx to /var/lib/nginx/tmp
+# https://gitlab.alpinelinux.org/alpine/aports/-/issues/11204
+if [ -d /var/lib/nginx/tmp ]; then
+ for i in /var/tmp/nginx/*; do
+ if [ -e "$i" ]; then
+ mv $i /var/lib/nginx/tmp/
+ fi
+ done
+ rmdir /var/tmp/nginx 2>/dev/null
+fi
+
exit 0
diff --git a/main/nginx/nginx.pre-upgrade b/main/nginx/nginx.pre-upgrade
new file mode 100644
index 0000000000..67d540f185
--- /dev/null
+++ b/main/nginx/nginx.pre-upgrade
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# symlink to directory confuses apk. remove it before the upgrade
+# https://gitlab.alpinelinux.org/alpine/aports/-/issues/11204
+
+if [ "$(readlink /var/lib/nginx/tmp)" = "/var/tmp/nginx" ]; then
+ rm /var/lib/nginx/tmp
+fi
+