#!/bin/sh # See LICENSE file for copyright and license details. set -e if test ! $# = 2 || test -t 0 || test -t 1; then printf 'usage: %s tarball git-dir < tarball-url-list > checksum-listing\n' "$0" >&2 fi tarball="$1" gitdir="$2" utildir="$(dirname -- "$0")" (cd -- "${utildir}" && (make >/dev/null 2>/dev/null || make)) "${utildir}"/tmpmount /var/empty "${utildir}"/validate-tarball "${tarball}" "${gitdir}" /var/empty get_checksums () { "${utildir}"/get-checksums "${tarball}" while read -r url; do "${utildir}"/tmpmount /var/empty "${utildir}"/get-and-check "${url}" "${gitdir}" /var/empty done } checksums="$(get_checksums)" printf '%s\n' "$checksums" | "${utildir}"/order-checksums