interplane.Get Omega
Read in your language

pageunit

Project brought through Interplane

Brought by drakestapleton

branch main Branches Tags History

pageunit / omc.sh

31 lines · 1455 bytes Raw Blame History
1#!/bin/sh
2# tools/pageunit/omc.sh : print the path of the Omega compiler pinned for tools/pageunit (omega-mv
3# rad:z6do9WDBhuSnvopDkgFdFr1yWA62 commit b2ad967e, seed/out/omc, sha256 f4fa7951...). Since
4# 2026-11-11 this is the same pin as tools/omc.sh (the server moved to it from 91b3c932); enc.om
5# and the units it writes need this compiler, because omc 2c824805 refuses enc.om (error 8). Uses
6# $OMC when set; otherwise extracts the binary
7# once from an omega-mv repository ($OMEGA_REPO, default the local Radicle storage of omega-mv)
8# into build/pageunit-omc. Exit 1 on a pin mismatch or when no repository holds the pin.
9set -u
10PIN_REV=b2ad967e57146172c1bedf1eac98babb75baef65
11PIN_SHA=f4fa7951816bbd09c5eaaae6692852a70c3c305164b365027c5b683dec7d63e9
12R=$(cd "$(dirname "$0")/../.." && pwd)
13if [ -z "${OMC:-}" ]; then
14 OMC=$R/build/pageunit-omc
15 if [ ! -x "$OMC" ]; then
16 mkdir -p "$R/build"
17 REPO=${OMEGA_REPO:-${RAD_HOME:-$HOME/.radicle}/storage/z6do9WDBhuSnvopDkgFdFr1yWA62}
18 if ! git -C "$REPO" show "$PIN_REV:seed/out/omc" > "$OMC.tmp"; then
19 echo "omc.sh: cannot read $PIN_REV:seed/out/omc from $REPO (rad clone rad:z6do9WDBhuSnvopDkgFdFr1yWA62, or set OMEGA_REPO)" >&2
20 rm -f "$OMC.tmp"
21 exit 1
22 fi
23 chmod +x "$OMC.tmp" && mv "$OMC.tmp" "$OMC"
24 fi
25fi
26have=$(sha256sum "$OMC" | cut -d' ' -f1)
27if [ "$have" != "$PIN_SHA" ]; then
28 echo "omc.sh: $OMC sha256 $have != pinned $PIN_SHA" >&2
29 exit 1
30fi
31echo "$OMC"