From 780c1923b64081834ef38f5b21b436c6bb0cfde1 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 20:23:43 -0400 Subject: [PATCH 1/4] build(source-os): add writer-first office new helper --- build/office-suite/scripts/office_new.sh | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 build/office-suite/scripts/office_new.sh diff --git a/build/office-suite/scripts/office_new.sh b/build/office-suite/scripts/office_new.sh new file mode 100644 index 0000000..fa534cd --- /dev/null +++ b/build/office-suite/scripts/office_new.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ $# -lt 2 ]]; then + echo "usage: $0 " >&2 + exit 1 +fi + +KIND="$1" +OUTPUT="$2" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)" + +case "$KIND" in + writer) + if [[ -f "$SCRIPT_DIR/sourceos-default-writer.fodt" ]]; then + TEMPLATE="$SCRIPT_DIR/sourceos-default-writer.fodt" + else + TEMPLATE="$ROOT/build/office-suite/templates/sovereign/sourceos-default-writer.fodt" + fi + ;; + *) + echo "unsupported office kind: $KIND" >&2 + exit 2 + ;; +esac + +mkdir -p "$(dirname "$OUTPUT")" +cp "$TEMPLATE" "$OUTPUT" +echo "$OUTPUT" From 14024d249a3bee15c51a7a72e3a777f683109274 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 20:24:52 -0400 Subject: [PATCH 2/4] build(source-os): add writer-first sourceos-office new command --- build/office-suite/scripts/sourceos-office | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/office-suite/scripts/sourceos-office b/build/office-suite/scripts/sourceos-office index a53a154..a457c89 100644 --- a/build/office-suite/scripts/sourceos-office +++ b/build/office-suite/scripts/sourceos-office @@ -33,9 +33,12 @@ case "$CMD" in search) "$(resolve_helper office_search_open.sh build/office-suite/scripts/office_search_open.sh)" "$@" ;; + new) + "$(resolve_helper office_new.sh build/office-suite/scripts/office_new.sh)" "$@" + ;; help|*) cat <<'EOF' -usage: sourceos-office [args] +usage: sourceos-office [args] EOF ;; esac From bc8c67b8330ef590cf708a300192c8efa0ab4a96 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 20:26:08 -0400 Subject: [PATCH 3/4] build(source-os): stage office_new helper in shell installer --- build/office-suite/scripts/install_sourceos_office_shell.sh | 6 +++++- 1 file changed, 5 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 1a4a5d9..3e11835 100644 --- a/build/office-suite/scripts/install_sourceos_office_shell.sh +++ b/build/office-suite/scripts/install_sourceos_office_shell.sh @@ -11,7 +11,9 @@ mkdir -p "$BIN_DIR" cp "$ROOT/build/office-suite/scripts/sourceos-office" "$BIN_DIR/sourceos-office" cp "$ROOT/build/office-suite/scripts/install_sourceos_office_shell.sh" "$BIN_DIR/install_sourceos_office_shell.sh" cp "$ROOT/build/office-suite/scripts/office_shell_verify.sh" "$BIN_DIR/office_shell_verify.sh" -chmod +x "$BIN_DIR/sourceos-office" "$BIN_DIR/install_sourceos_office_shell.sh" "$BIN_DIR/office_shell_verify.sh" +cp "$ROOT/build/office-suite/scripts/office_new.sh" "$BIN_DIR/office_new.sh" +cp "$ROOT/build/office-suite/templates/sovereign/sourceos-default-writer.fodt" "$BIN_DIR/sourceos-default-writer.fodt" +chmod +x "$BIN_DIR/sourceos-office" "$BIN_DIR/install_sourceos_office_shell.sh" "$BIN_DIR/office_shell_verify.sh" "$BIN_DIR/office_new.sh" if [[ -x "$ROOT/build/office-suite/scripts/verify_office_suite_profile.sh" ]]; then "$ROOT/build/office-suite/scripts/verify_office_suite_profile.sh" @@ -20,4 +22,6 @@ fi echo "installed sourceos-office to $BIN_DIR/sourceos-office" echo "installed install_sourceos_office_shell.sh to $BIN_DIR/install_sourceos_office_shell.sh" echo "installed office_shell_verify.sh to $BIN_DIR/office_shell_verify.sh" +echo "installed office_new.sh to $BIN_DIR/office_new.sh" +echo "installed sourceos-default-writer.fodt to $BIN_DIR/sourceos-default-writer.fodt" echo "SourceOS office shell install completed" From 0f8ace2637db8f7d7e3c9bcba8e8a010926eeb29 Mon Sep 17 00:00:00 2001 From: mdheller <21163552+mdheller@users.noreply.github.com> Date: Sat, 2 May 2026 20:27:41 -0400 Subject: [PATCH 4/4] build(source-os): exercise installed sourceos-office new path in shell smoke --- .../install_sourceos_office_shell_smoke.sh | 22 +++++++++++++++++++ 1 file changed, 22 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 dfc2adf..2521263 100644 --- a/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh +++ b/build/office-suite/scripts/install_sourceos_office_shell_smoke.sh @@ -17,9 +17,11 @@ OPEN_BIN="$HOME/.local/bin/sourceos-office-open" SOURCEOS_OFFICE_BIN="$HOME/.local/bin/sourceos-office" INSTALL_BIN="$HOME/.local/bin/install_sourceos_office_shell.sh" VERIFY_BIN="$HOME/.local/bin/office_shell_verify.sh" +NEW_BIN="$HOME/.local/bin/office_new.sh" CLOUD_BIN="$HOME/.local/bin/office_cloud_handoff.sh" MIME_FILE="$XDG_CONFIG_HOME/mimeapps.list" TEST_DOC="$TMPDIR/demo.txt" +NEW_DOC="$TMPDIR/new-writer.fodt" echo "SourceOS office shell smoke" > "$TEST_DOC" [[ -f "$DESKTOP_FILE" ]] || { @@ -47,6 +49,11 @@ echo "SourceOS office shell smoke" > "$TEST_DOC" exit 1 } +[[ -x "$NEW_BIN" ]] || { + echo "office shell installer smoke failed: missing office_new helper" >&2 + exit 1 +} + [[ -x "$CLOUD_BIN" ]] || { echo "office shell installer smoke failed: missing cloud handoff helper" >&2 exit 1 @@ -90,6 +97,21 @@ case "$SEARCH_OUT" in ;; esac +NEW_OUT="$($SOURCEOS_OFFICE_BIN new writer "$NEW_DOC")" +[[ "$NEW_OUT" == "$NEW_DOC" ]] || { + echo "office shell installer smoke failed: installed sourceos-office new path did not return created file" >&2 + exit 1 +} +[[ -f "$NEW_DOC" ]] || { + echo "office shell installer smoke failed: installed sourceos-office new path did not create file" >&2 + exit 1 +} + +grep -q "SourceOS sovereign writer template placeholder" "$NEW_DOC" || { + echo "office shell installer smoke failed: created writer file does not contain template payload" >&2 + exit 1 +} + "$SOURCEOS_OFFICE_BIN" install >/dev/null echo "office shell installer smoke passed"