#!/bin/sh set -eu # req: distribution/001, distribution/002, distribution/003, distribution/005, distribution/006, distribution/008 test root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) ink=$root/channels/main/ink set=$root/channels/main/toolset manifest=$set/ink-toolset-main-x86_64-linux-musl.manifest.tsv (cd "$ink" && sha256sum -c ink-SHA256SUMS >/dev/null) (cd "$set" && sha256sum -c ink-toolset-SHA256SUMS >/dev/null) file "$ink/ink-x86_64-linux-musl" | grep -q 'statically linked' awk -F '\t' ' NR == 1 { if ($0 != "source_repository\tsource_commit\texecutable\tset\ttarget\tbytes\tsha256\tasset") exit 1 next } $1 != "tmk241/ink-toolset" || $2 !~ /^[0-9a-f]{40}$/ || $5 != "x86_64-linux-musl" || $6 !~ /^[0-9]+$/ || $7 !~ /^[0-9a-f]{64}$/ || $8 == "" { exit 1 } END { if (NR < 2) exit 1 } ' "$manifest" while IFS="$(printf '\t')" read -r source commit name group target bytes digest asset; do [ "$source" = source_repository ] && continue [ -f "$set/$asset" ] [ "$(wc -c < "$set/$asset" | tr -d ' ')" = "$bytes" ] [ "$(sha256sum "$set/$asset" | cut -d ' ' -f 1)" = "$digest" ] file "$set/$asset" | grep -q 'statically linked' done < "$manifest" podman run --rm -v "$root/channels/main:/release:ro" ghcr.io/void-linux/void-musl:latest /bin/sh -c ' set -eu /release/ink/ink-x86_64-linux-musl --help >/dev/null count=0 for asset in /release/toolset/*-x86_64-linux-musl; do "$asset" --help >/dev/null count=$((count+1)) done [ "$count" -gt 0 ] '