#!/bin/sh # SPDX-License-Identifier: 0BSD set -eu img=${1?"usage: $0 "} test -f git-annex/git-annex.cabal || { printf >&2 'initialize git-annex submodule first\n' exit 1 } test -z "$(git -C git-annex status --porcelain -unormal)" || { printf >&2 'git-annex repository is dirty\n' exit 1 } test -n "$(git -C git-annex for-each-ref --points-at=HEAD refs/tags)" || { printf >&2 'git-annex repository must be on a tagged commit\n' exit 1 } git -C git-annex clean -xfd podman run \ -v ./git-annex:/git-annex \ -v ./img-scripts:/mnt \ -w /git-annex \ --env RELEASE_BUILD=1 --rm \ "$img" /mnt/build