#!/usr/bin/env bash # Builds the test package "demo" as unsigned .apk files (several versions) into the directory given as $1. # Runs inside the apk image (build/Dockerfile.apk): tests/run_test.sh starts it. set -Eeuo pipefail out="${1:?usage: make_apk_fixtures.sh }" versions="${VERSIONS:-1.0.0 1.0.1 1.0.2 1.0.3}" work=$(mktemp -d) trap 'rm -rf "$work"' EXIT for ver in $versions; do root="${work}/root-${ver}" install -Dm755 /dev/stdin "${root}/usr/bin/demo" << EOF #!/bin/sh echo demo ${ver} EOF apk mkpkg --info "name:demo" --info "version:${ver}-r0" --info "arch:noarch" \ --info "description:Demo package" --info "url:https://example.com/demo" \ --files "$root" --output "${out}/demo-${ver}-r0.apk" > /dev/null done