commit fb296d77fdc90f6ac084c177eaef93fd95d7fae5
parent 305c4a85031a246d017a68318ac79662e34d6624
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Thu, 28 Jul 2022 10:29:45 +0200
Use preinstall_current_p for full path to previous current directory.
Also do simple symlink comparison instead of relying on environment.
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/postinstall b/postinstall
@@ -64,9 +64,13 @@ symlink_static_file() {
link_changed() {
local pre post
- pre=preinstall_link_$1
- post=postinstall_link_$1
- [[ "${(P)preinstall_links:-}" != "${(P)postinstall_links:-}" ]]
+ if (($+preinstall_current)); then
+ pre=${${:-$preinstall_current_p/$1}:P}
+ else
+ pre=
+ fi
+ post=${${:-/current/$1}:P}
+ [[ "$pre" != "$post" ]]
}
setup_static_symlinks() {
@@ -95,7 +99,7 @@ setup_storage() {
setup_rc() {
local diff_ret
if [[ -d /run/s6-rc/ ]]; then
- diff --recursive --unified $preinstall_current/s6-rc-source ./s6-rc-source; diff_ret=$?
+ diff --recursive --unified $preinstall_current_p/s6-rc-source ./s6-rc-source; diff_ret=$?
(( $diff_ret == 0 || $diff_ret == 1 )) || \
die111 "Could not diff s6-rc-source directories; exitcode $diff_ret"
if link_changed package; then
@@ -104,7 +108,7 @@ setup_rc() {
# s6-rc-format-upgrade to tmpdir, then s6-rc-update
local tmp_db=/run/old-s6-rc-db-migration.$EPOCHREALTIME
- s6-rc-compile $tmp_db $preinstall_current/s6-rc-source || return $?
+ s6-rc-compile $tmp_db $preinstall_current_p/s6-rc-source || return $?
s6-rc-format-upgrade -v2 $tmp_db || return $?
s6-rc-update -v2 /current/s6-rc-db/ || return $?
rm -r $tmp_db || return $?