Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienos.com/blob/main/om/agora-page/check.sh # aienos.com Source of www.aienos.com, served from my own hardware Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienos.com / om / agora-page / check.sh` 61 lines ยท 2420 bytes Raw Blame History 1 #!/bin/sh 2 # Regenerate the /agora/ skeleton and browser script using the pinned arm64 omc. 3 # Exit 2: missing compiler; 3: wrong pin; 4: stale artifact rewritten; 4 # 5: nondeterministic output; 6: empty output. Compile/run failures propagate. 5 set -eu 6 cd "$(dirname "$0")" 7 omc=${OMEGA_OMC:-$PWD/../hive-page/omc} 8 pin=$(tr -d ' \n' < omc.sha256) 9 if [ ! -f "$omc" ]; then 10 printf 'No compiler at %s; set OMEGA_OMC to the pinned omc (%s)\n' "$omc" "$pin" >&2 11 exit 2 12 fi 13 have=$(sha256sum "$omc" | cut -d' ' -f1) 14 if [ "$have" != "$pin" ]; then 15 printf 'Compiler sha256 mismatch: recorded %s, found %s\n' "$pin" "$have" >&2 16 exit 3 17 fi 18 work=$(mktemp -d "${TMPDIR:-/tmp}/agora-page.XXXXXX") 19 trap 'rm -rf "$work"' EXIT HUP INT TERM 20 cat contract.om agora.om agora-js.om > "$work/agora.om" 21 "$omc" < "$work/agora.om" > "$work/agora" 22 chmod +x "$work/agora" 23 "$work/agora" > "$work/first.html" 3> "$work/first.agora.js" 24 "$work/agora" > "$work/second.html" 3> "$work/second.agora.js" 25 stale=0 26 publish() { 27 first=$1 28 second=$2 29 artifact=$3 30 sidecar=$4 31 if ! cmp -s "$first" "$second"; then 32 printf '%s: generator output differs between runs\n' "$artifact" >&2 33 exit 5 34 fi 35 if [ ! -s "$first" ]; then 36 printf '%s: generator wrote nothing\n' "$artifact" >&2 37 exit 6 38 fi 39 if [ ! -f "$artifact" ] || ! cmp -s "$artifact" "$first"; then 40 stale=1 41 fi 42 cp "$first" "$artifact" 43 hash=$(sha256sum "$artifact" | cut -d' ' -f1) 44 printf '%s %s\n' "$hash" "$artifact" > "$sidecar" 45 printf '%s %s bytes sha256 %s\n' "$artifact" "$(wc -c < "$artifact" | tr -d ' ')" "$hash" 46 } 47 publish "$work/first.html" "$work/second.html" main.html main.html.sha256 48 publish "$work/first.agora.js" "$work/second.agora.js" ../../public/js/agora.js agora.js.sha256 49 "$omc" < aienet.om > "$work/aienet" 50 chmod +x "$work/aienet" 51 "$work/aienet" > "$work/first.aienet.html" 3> "$work/first.aienet.js" 52 "$work/aienet" > "$work/second.aienet.html" 3> "$work/second.aienet.js" 53 publish "$work/first.aienet.html" "$work/second.aienet.html" aienet.html aienet.html.sha256 54 publish "$work/first.aienet.js" "$work/second.aienet.js" ../../public/js/aienet.js aienet.js.sha256 55 printf 'omc sha256 %s\n' "$have" 56 if [ "$stale" = 1 ]; then 57 printf 'Generated artifacts were rewritten; commit them with their Omega sources\n' >&2 58 if [ "${OMEGA_ACCEPT_CHANGE:-0}" != 1 ]; then 59 exit 4 60 fi 61 fi