#!/usr/bin/env bash # The reference at its pins, into external/: supergrafx-python v0.1.0, the base board it pins # (pcengine-python v0.1.0), its CPU core (huc6280-python v0.3.0) and that core's frame # (6502-python 2146eba). No package is installed: the gate runs PyPy with PYTHONPATH on the # four src/ directories (scripts/lockstep.py), so nothing is fetched but the four checkouts. # Usage: scripts/fetch_reference.sh [SOURCE] # SOURCE: where the four repositories are, by name (default https://github.com/alewman; # a directory of local clones works: scripts/fetch_reference.sh /data/emu) set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) SOURCE=${1:-https://github.com/alewman} fetch() { # name, pin, the commit the pin names local dest="$ROOT/external/$1" if [ ! -d "$dest/.git" ]; then git clone -q "$SOURCE/$1" "$dest" fi git -C "$dest" fetch -q --tags origin 2>/dev/null || true git -C "$dest" checkout -q "$2" [ "$(git -C "$dest" rev-parse HEAD)" = "$3" ] || { echo "$1: $2 is not $3" >&2; exit 1; } echo "$1 $2 ($3) in $dest" } mkdir -p "$ROOT/external" fetch supergrafx-python v0.1.0 eee789a63f806723ea936c70293e8a413bee9cab fetch pcengine-python v0.1.0 bc9b976f8b6ba29ff16fdcbd527978899d7e54b4 fetch huc6280-python v0.3.0 bf20330d4ce4e0e126331433bad03f4e4d0e9a2e fetch 6502-python 2146eba3b3da4d2cc6c8fa3994f100bcb5abf039 2146eba3b3da4d2cc6c8fa3994f100bcb5abf039