Fix installer state and launcher freshness checks

This commit is contained in:
Gabriel Brown
2026-08-27 17:31:46 -04:00
parent 99156442b5
commit b5832fc94a
6 changed files with 156 additions and 19 deletions
+9 -2
View File
@@ -8,6 +8,7 @@ declare -gA INSTALLER_PROVENANCE=()
_primary_key_fingerprints() (
local home
set -o pipefail
home="$(mktemp -d)" || exit 1
chmod 700 "$home"
trap 'rm -rf -- "$home"' EXIT
@@ -19,14 +20,20 @@ _primary_key_fingerprints() (
key_fingerprint_matches() {
local file="$1" expected="$2"
local output
local -a primary_fingerprints=()
mapfile -t primary_fingerprints < <(_primary_key_fingerprints "$file")
output="$(_primary_key_fingerprints "$file")" || return 1
[[ -n "$output" ]] || return 1
mapfile -t primary_fingerprints <<<"$output"
[[ ${#primary_fingerprints[@]} -eq 1 && "${primary_fingerprints[0]}" == "$expected" ]]
}
_key_has_one_primary() {
local output
local -a primary_fingerprints=()
mapfile -t primary_fingerprints < <(_primary_key_fingerprints "$1")
output="$(_primary_key_fingerprints "$1")" || return 1
[[ -n "$output" ]] || return 1
mapfile -t primary_fingerprints <<<"$output"
[[ ${#primary_fingerprints[@]} -eq 1 ]]
}