carbon-config

config submodule of carbon-core-system
git clone https://ccx.te2000.cz/git/carbon-config
Log | Files | Refs

commit 2e8d92782400e8ea6c70fea9774c2ac4925b392d
parent 66041c8e7c8be10ff8a0f0f680601f905e6e9f49
Author: ccx <ccx@te2000.cz>
Date:   Sun, 17 Jul 2022 16:19:57 +0000

Diff s6-rc-source directories instead of relying on symlink change

Diffstat:
Mpostinstall | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/postinstall b/postinstall @@ -35,12 +35,16 @@ link_changed() { } postinstall() { + local diff_ret cd $ALL_DIR || exit $? ensure_symlink /command current/command || return $? if [[ -d /run/s6-rc/ ]]; then + diff -Ru $preinstall_current/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 - if link_changed s6-rc-source; then + if (( $diff_ret == 1 )); then # Both s6-rc DB source and installed software changed. # s6-rc-format-upgrade to tmpdir, then s6-rc-update local tmp_db=/run/old-s6-rc-db-migration.$EPOCHREALTIME @@ -54,7 +58,7 @@ postinstall() { # s6-rc-format-upgrade to new compiled DB directly s6-rc-format-upgrade -v2 /current/s6-rc-db/ || return $? fi - elif link_changed s6-rc-source; then + elif (( $diff_ret == 1 )); then # s6-rc DB source changed while keeping same version of software. # s6-rc-update to new compiled DB directly s6-rc-update -v2 /current/s6-rc-db/ || return $?