Skip to content

Commit 9aefea1

Browse files
committed
Avoid broken pipe in Arch package verifier
1 parent 5d61467 commit 9aefea1

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

packaging/scripts/verify-arch-package.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ done
1616

1717
pkg="$(TURTLE_TERM_OUT_DIR="$tmp" TURTLE_TERM_VERSION="0.1.0" TURTLE_TERM_ARCH_ARCH="$(uname -m)" \
1818
"$repo_root/packaging/scripts/build-arch-package.sh")"
19+
contents="$tmp/arch-contents.txt"
1920
extract="$tmp/extract"
2021

2122
test -f "$pkg"
@@ -32,22 +33,23 @@ assert manifest['kind'] == 'arch'
3233
assert manifest['version'] == '0.1.0'
3334
assert manifest['package'].endswith('.pkg.tar.zst')
3435
assert manifest['profile'] == '/etc/turtle-term/turtleterm.lua'
35-
for command in ['turtle-cloudfog', 'turtle-superconscious', 'turtle-agent-machine', 'turtle-language', 'turtle-session']:
36+
for command in ['turtle-agent-status', 'turtle-cloudfog', 'turtle-superconscious', 'turtle-agent-machine', 'turtle-language', 'turtle-session']:
3637
assert command in manifest['public_commands'], command
3738
PY
3839

39-
tar --zstd -tf "$pkg" | grep -q '^./.PKGINFO$'
40-
for command in turtleterm turtle-agentctl turtle-cloudfog turtle-superconscious turtle-agent-machine turtle-language turtle-session; do
41-
tar --zstd -tf "$pkg" | grep -q "^./usr/bin/$command$"
40+
tar --zstd -tf "$pkg" > "$contents"
41+
grep -q '^./.PKGINFO$' "$contents"
42+
for command in turtleterm turtle-agentctl turtle-agent-status turtle-cloudfog turtle-superconscious turtle-agent-machine turtle-language turtle-session; do
43+
grep -q "^./usr/bin/$command$" "$contents"
4244
done
4345

44-
tar --zstd -tf "$pkg" | grep -q '^./etc/turtle-term/turtleterm.lua$'
45-
tar --zstd -tf "$pkg" | grep -q '^./usr/share/applications/ai.sourceos.TurtleTerm.desktop$'
46-
tar --zstd -tf "$pkg" | grep -q '^./usr/share/metainfo/ai.sourceos.TurtleTerm.metainfo.xml$'
47-
tar --zstd -tf "$pkg" | grep -q '^./usr/share/icons/hicolor/scalable/apps/ai.sourceos.TurtleTerm.svg$'
48-
tar --zstd -tf "$pkg" | grep -q '^./usr/libexec/turtle-term/wezterm-gui$'
46+
grep -q '^./etc/turtle-term/turtleterm.lua$' "$contents"
47+
grep -q '^./usr/share/applications/ai.sourceos.TurtleTerm.desktop$' "$contents"
48+
grep -q '^./usr/share/metainfo/ai.sourceos.TurtleTerm.metainfo.xml$' "$contents"
49+
grep -q '^./usr/share/icons/hicolor/scalable/apps/ai.sourceos.TurtleTerm.svg$' "$contents"
50+
grep -q '^./usr/libexec/turtle-term/wezterm-gui$' "$contents"
4951

50-
if tar --zstd -tf "$pkg" | grep -q '^./usr/bin/wezterm-gui$'; then
52+
if grep -q '^./usr/bin/wezterm-gui$' "$contents"; then
5153
echo 'private runtime leaked onto product PATH in Arch package' >&2
5254
exit 1
5355
fi
@@ -67,6 +69,7 @@ fi
6769
probe="$tmp/probe.py"
6870
printf 'def hello():\n return "world"\n' > "$probe"
6971
PATH="$extract/usr/bin:$PATH" "$extract/usr/bin/turtle-agentctl" --stdio surfaces >/dev/null
72+
PATH="$extract/usr/bin:$PATH" "$extract/usr/bin/turtle-agent-status" --json >/dev/null
7073
PATH="$extract/usr/bin:$PATH" "$extract/usr/bin/turtle-cloudfog" surfaces >/dev/null
7174
PATH="$extract/usr/bin:$PATH" "$extract/usr/bin/turtle-superconscious" observe arch-package >/dev/null
7275
PATH="$extract/usr/bin:$PATH" "$extract/usr/bin/turtle-agent-machine" surfaces >/dev/null

0 commit comments

Comments
 (0)