aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2021-06-02 12:41:26 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2021-06-02 12:55:50 +0200
commit537d75886466e62dc688e319fa22b37e41dee107 (patch)
treed4e1eabcfcba6173e8847010822034d13407c848
parent4518bb23f19ad31a0e48b4d6c100117266ffa0ef (diff)
downloadaports-537d75886466e62dc688e319fa22b37e41dee107.tar.gz
aports-537d75886466e62dc688e319fa22b37e41dee107.tar.bz2
aports-537d75886466e62dc688e319fa22b37e41dee107.tar.xz
main/nginx: fix transition /var/tmp/nginx -> /var/lib/nginx/tmp
fixes #11204
-rw-r--r--main/nginx/APKBUILD2
-rw-r--r--main/nginx/nginx.post-upgrade11
-rw-r--r--main/nginx/nginx.pre-upgrade28
3 files changed, 17 insertions, 24 deletions
diff --git a/main/nginx/APKBUILD b/main/nginx/APKBUILD
index 24562a7181..7a104795da 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=2
+pkgrel=3
# Revision of nginx-tests to use for check().
_tests_hgrev=c1d167a13c24
_njs_ver=0.3.8
diff --git a/main/nginx/nginx.post-upgrade b/main/nginx/nginx.post-upgrade
index 6d9e698dc7..c2e905fd9d 100644
--- a/main/nginx/nginx.post-upgrade
+++ b/main/nginx/nginx.post-upgrade
@@ -20,4 +20,15 @@ if [ "$(apk version -t "$ver_old" "1.10.1-r3")" = "<" ]; 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
index 67f05dda1c..67d540f185 100644
--- a/main/nginx/nginx.pre-upgrade
+++ b/main/nginx/nginx.pre-upgrade
@@ -1,27 +1,9 @@
-#!/bin/ash
+#!/bin/sh
-ver_new="$1"
-ver_old="$2"
+# symlink to directory confuses apk. remove it before the upgrade
+# https://gitlab.alpinelinux.org/alpine/aports/-/issues/11204
-if [ "$(apk version -t "$ver_old" '1.12.0-r1')" = '<' ]; then
- tmp_new=/var/tmp/nginx
- tmp_old=/var/lib/nginx/tmp
-
- # Create a new temp directory, move data from the old one to the new
- # one and delete the old one.
- if [ -d "$tmp_old" ]; then
- echo "* Moving data from $tmp_old to $tmp_new..." >&2
-
- [ -d "$tmp_new" ] \
- || install -d -m 700 -o nginx -g nginx "$tmp_new"
- rmdir "$tmp_old" 2>/dev/null \
- && exit 0 \
- || mv "$tmp_old"/* "$tmp_new"/
- rmdir "$tmp_old" 2>/dev/null \
- && exit 0 \
- || mv "$tmp_old"/.[!.]* "$tmp_new"/ # move dot files
- rmdir "$tmp_old"
- fi
+if [ "$(readlink /var/lib/nginx/tmp)" = "/var/tmp/nginx" ]; then
+ rm /var/lib/nginx/tmp
fi
-exit 0