From 367bb37890ffcc624b6a29d2a52417de4de52eb9 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 19:28:10 -0400 Subject: [PATCH 1/3] build(source-os): make office shell verify installation-aware --- .../scripts/office_shell_verify.sh | 61 ++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/build/office-suite/scripts/office_shell_verify.sh b/build/office-suite/scripts/office_shell_verify.sh index 216cd73..3bb0440 100644 --- a/build/office-suite/scripts/office_shell_verify.sh +++ b/build/office-suite/scripts/office_shell_verify.sh @@ -1,7 +1,66 @@ #!/usr/bin/env bash set -euo pipefail -ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)" +APP_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/applications" +CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" +DESKTOP_FILE="$APP_DIR/sourceos-office.desktop" +MIME_FILE="$CONFIG_DIR/mimeapps.list" + +if [[ -x "$SCRIPT_DIR/sourceos-office-open" ]]; then + [[ -f "$DESKTOP_FILE" ]] || { + echo "office shell verification failed: missing desktop entry" >&2 + exit 1 + } + + [[ -x "$SCRIPT_DIR/sourceos-office" ]] || { + echo "office shell verification failed: missing sourceos-office command" >&2 + exit 1 + } + + [[ -x "$SCRIPT_DIR/sourceos-office-open" ]] || { + echo "office shell verification failed: missing sourceos-office-open helper" >&2 + exit 1 + } + + [[ -x "$SCRIPT_DIR/office_cloud_handoff.sh" ]] || { + echo "office shell verification failed: missing cloud handoff helper" >&2 + exit 1 + } + + [[ -x "$SCRIPT_DIR/office_search_handoff.sh" ]] || { + echo "office shell verification failed: missing search handoff helper" >&2 + exit 1 + } + + [[ -x "$SCRIPT_DIR/office_search_open.sh" ]] || { + echo "office shell verification failed: missing search open helper" >&2 + exit 1 + } + + [[ -f "$MIME_FILE" ]] || { + echo "office shell verification failed: missing MIME defaults" >&2 + exit 1 + } + + TMPDIR="$(mktemp -d)" + trap 'rm -rf "$TMPDIR"' EXIT + TEST_DOC="$TMPDIR/verify.txt" + echo "SourceOS office verify" > "$TEST_DOC" + + OUT="$(SOURCEOS_OFFICE_MODE=cloud "$SCRIPT_DIR/sourceos-office" open "$TEST_DOC")" + case "$OUT" in + http://*|https://*) ;; + *) + echo "office shell verification failed: installed open path did not return URL" >&2 + exit 1 + ;; + esac + + echo "office shell verification passed" + exit 0 +fi "$ROOT/build/office-suite/scripts/verify_office_desktop_entry.sh" From 07e961f09eeab6cff403e0495048443eb0f9bcce Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 19:29:23 -0400 Subject: [PATCH 2/3] build(source-os): stage office shell verify helper during install --- build/office-suite/scripts/install_sourceos_office_shell.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/office-suite/scripts/install_sourceos_office_shell.sh b/build/office-suite/scripts/install_sourceos_office_shell.sh index 4937b2a..65527af 100644 --- a/build/office-suite/scripts/install_sourceos_office_shell.sh +++ b/build/office-suite/scripts/install_sourceos_office_shell.sh @@ -9,11 +9,13 @@ BIN_DIR="$HOME/.local/bin" mkdir -p "$BIN_DIR" cp "$ROOT/build/office-suite/scripts/sourceos-office" "$BIN_DIR/sourceos-office" -chmod +x "$BIN_DIR/sourceos-office" +cp "$ROOT/build/office-suite/scripts/office_shell_verify.sh" "$BIN_DIR/office_shell_verify.sh" +chmod +x "$BIN_DIR/sourceos-office" "$BIN_DIR/office_shell_verify.sh" if [[ -x "$ROOT/build/office-suite/scripts/verify_office_suite_profile.sh" ]]; then "$ROOT/build/office-suite/scripts/verify_office_suite_profile.sh" fi echo "installed sourceos-office to $BIN_DIR/sourceos-office" +echo "installed office_shell_verify.sh to $BIN_DIR/office_shell_verify.sh" echo "SourceOS office shell install completed" From 3ae716389acaa158c3321d3cd06203ca78a3446e Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 19:30:25 -0400 Subject: [PATCH 3/3] build(source-os): exercise installed sourceos-office verify path in shell smoke --- .../scripts/install_sourceos_office_shell_smoke.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh b/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh index 3bc4b3e..cb0950a 100644 --- a/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh +++ b/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh @@ -15,6 +15,7 @@ mkdir -p "$HOME" DESKTOP_FILE="$XDG_DATA_HOME/applications/sourceos-office.desktop" OPEN_BIN="$HOME/.local/bin/sourceos-office-open" SOURCEOS_OFFICE_BIN="$HOME/.local/bin/sourceos-office" +VERIFY_BIN="$HOME/.local/bin/office_shell_verify.sh" CLOUD_BIN="$HOME/.local/bin/office_cloud_handoff.sh" MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list" TEST_DOC="$TMPDIR/demo.txt" @@ -35,6 +36,11 @@ echo "SourceOS office shell smoke" > "$TEST_DOC" exit 1 } +[[ -x "$VERIFY_BIN" ]] || { + echo "office shell installer smoke failed: missing office_shell_verify helper" >&2 + exit 1 +} + [[ -x "$CLOUD_BIN" ]] || { echo "office shell installer smoke failed: missing cloud handoff helper" >&2 exit 1 @@ -54,4 +60,10 @@ case "$OUT" in ;; esac +VERIFY_OUT="$($SOURCEOS_OFFICE_BIN verify)" +[[ "$VERIFY_OUT" == *"office shell verification passed"* ]] || { + echo "office shell installer smoke failed: installed verify path did not pass" >&2 + exit 1 +} + echo "office shell installer smoke passed"