Skip to content

Commit 5ef4dba

Browse files
committed
packaging: discover Arch artifact after build
1 parent d863ad9 commit 5ef4dba

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

packaging/scripts/verify-arch-package.sh

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ EOF
1414
chmod 0755 "$repo_root/target/release/$binary"
1515
done
1616

17-
pkg="$(TURTLE_TERM_OUT_DIR="$tmp" TURTLE_TERM_VERSION="0.1.0" TURTLE_TERM_ARCH_ARCH="$(uname -m)" \
18-
bash "$repo_root/packaging/scripts/build-arch-package.sh")"
17+
TURTLE_TERM_OUT_DIR="$tmp" TURTLE_TERM_VERSION="0.1.0" TURTLE_TERM_ARCH_ARCH="$(uname -m)" bash "$repo_root/packaging/scripts/build-arch-package.sh" >/dev/null
18+
pkg="$(find "$tmp" -maxdepth 1 -type f -name '*.pkg.tar.zst' | sort | head -n 1)"
1919
extract="$tmp/extract"
2020

21+
test -n "$pkg"
2122
test -f "$pkg"
2223
test -f "$pkg.sha256"
2324
test -f "$pkg.manifest.json"
@@ -34,14 +35,17 @@ assert manifest['package'].endswith('.pkg.tar.zst')
3435
assert manifest['profile'] == '/etc/turtle-term/turtleterm.lua'
3536
PY
3637

37-
tar --zstd -tf "$pkg" | grep -q '^./.PKGINFO$'
38-
tar --zstd -tf "$pkg" | grep -q '^./usr/bin/turtleterm$'
39-
tar --zstd -tf "$pkg" | grep -q '^./usr/bin/turtle-agentctl$'
40-
tar --zstd -tf "$pkg" | grep -q '^./etc/turtle-term/turtleterm.lua$'
41-
tar --zstd -tf "$pkg" | grep -q '^./usr/share/applications/ai.sourceos.TurtleTerm.desktop$'
42-
tar --zstd -tf "$pkg" | grep -q '^./usr/share/metainfo/ai.sourceos.TurtleTerm.metainfo.xml$'
43-
tar --zstd -tf "$pkg" | grep -q '^./usr/share/icons/hicolor/scalable/apps/ai.sourceos.TurtleTerm.svg$'
44-
tar --zstd -tf "$pkg" | grep -q '^./usr/libexec/turtle-term/wezterm-gui$'
38+
for path in \
39+
'^./.PKGINFO$' \
40+
'^./usr/bin/turtleterm$' \
41+
'^./usr/bin/turtle-agentctl$' \
42+
'^./etc/turtle-term/turtleterm.lua$' \
43+
'^./usr/share/applications/ai.sourceos.TurtleTerm.desktop$' \
44+
'^./usr/share/metainfo/ai.sourceos.TurtleTerm.metainfo.xml$' \
45+
'^./usr/share/icons/hicolor/scalable/apps/ai.sourceos.TurtleTerm.svg$' \
46+
'^./usr/libexec/turtle-term/wezterm-gui$'; do
47+
tar --zstd -tf "$pkg" | grep -q "$path"
48+
done
4549

4650
if tar --zstd -tf "$pkg" | grep -q '^./usr/bin/wezterm-gui$'; then
4751
echo 'private runtime leaked onto product PATH: wezterm-gui' >&2
@@ -52,9 +56,7 @@ mkdir -p "$extract"
5256
tar --zstd -C "$extract" -xf "$pkg"
5357
grep -q 'TURTLE_TERM_RUNTIME_DIR="/usr/libexec/turtle-term"' "$extract/usr/bin/turtleterm"
5458
grep -q 'TURTLETERM_CONFIG="/etc/turtle-term/turtleterm.lua"' "$extract/usr/bin/turtleterm"
55-
grep -q 'exec "/usr/libexec/turtle-term/turtleterm"' "$extract/usr/bin/turtleterm"
5659
grep -q 'TURTLE_TERM_RUNTIME_DIR="/usr/libexec/turtle-term"' "$extract/usr/bin/turtleterm-mux-server"
57-
grep -q 'exec "/usr/libexec/turtle-term/turtleterm-mux-server"' "$extract/usr/bin/turtleterm-mux-server"
5860
if grep -R "$tmp\|BUILDROOT\|rpm-root\|arch-root\|deb-root" "$extract/usr/bin/turtleterm" "$extract/usr/bin/turtleterm-mux-server"; then
5961
echo 'buildroot path leaked into Arch launch wrappers' >&2
6062
exit 1

0 commit comments

Comments
 (0)