commit b2ca35ca7f78ba22f7c2a88743724eb2a12f0b2b parent 14b0535d3eeddf7c232b1cee093d5a83ac25624f Author: ccx <root@dorje.wpr.cz> Date: Mon, 21 Feb 2022 02:55:04 +0100 Pretty up the script, enable s6-rc-format-upgrade. Diffstat:
M | install | | | 19 | ++++++++++++------- |
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/install b/install @@ -243,28 +243,33 @@ ensure_symlink() { } postinstall() { - ensure_symlink /etc/loginexec ../current/bzr/logincaps/etc/loginexec - ensure_symlink /command current/command + # TODO: Ensure patched Toybox login is compiled and installed. + ensure_symlink /etc/loginexec ../current/bzr/logincaps/etc/loginexec || return $? + ensure_symlink /command current/command || return $? if [[ -d /run/s6-rc/ ]]; then if link_changed package; then if link_changed s6-rc-source; 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 - : s6-rc-compile $tmp_db "$preinstall_links[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 $? + s6-rc-compile $tmp_db "$preinstall_links[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 $? else + # Installed software changed but s6-rc DB source is the same. # s6-rc-format-upgrade to new source directly - : s6-rc-format-upgrade -v2 /current/s6-rc-db/ || return $? + s6-rc-format-upgrade -v2 /current/s6-rc-db/ || return $? fi elif link_changed s6-rc-source; then + # s6-rc DB source changed while keeping same version of software. # s6-rc-update to new source directly s6-rc-update -v2 /current/s6-rc-db/ || return $? fi + # Check if we need to regenerate containers or their service directories. if link_changed bzr/containers || link_changed bzr/confz; then zsh -lc "quiet=1 confz site_containers" </dev/null 2>&1 | cat -v ret=$((${(j.|.)pipestatus})) # Nonzero iff any of commands in pipeline returned nonzero.