aboutsummaryrefslogtreecommitdiff
path: root/tests/checks
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-28 12:21:20 -0300
committerEuAndreh <eu@euandre.org>2023-03-28 19:51:09 -0300
commit8ff13c6ba6cc3eb35ca92682634425e2229486a6 (patch)
tree5ab70b5c0a4d1e45ec195f37d9ff70c207410862 /tests/checks
parentsrc/bin/paku.in, Makefile: Use "debian.out.txt" to communicate output files (diff)
downloadpackage-repository-8ff13c6ba6cc3eb35ca92682634425e2229486a6.tar.gz
package-repository-8ff13c6ba6cc3eb35ca92682634425e2229486a6.tar.xz
src/bin/paku.in: Add WIP version of Alpine support, based off of Debian
Diffstat (limited to 'tests/checks')
-rwxr-xr-xtests/checks/apk.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/checks/apk.sh b/tests/checks/apk.sh
new file mode 100755
index 0000000..5acb479
--- /dev/null
+++ b/tests/checks/apk.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+set -eu
+
+
+while getopts 'k:' flag; do
+ case "$flag" in
+ k)
+ KEY="$OPTARG"
+ ;;
+ *)
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+if [ -z "${KEY:-}" ]; then
+ echo 'Missing "-k KEY" argument.' >&2
+ exit 2
+fi
+
+set -x
+
+REPO="$1/alpine"
+
+if command -v remembering; then
+ echo 'remembering(1) is already installed.' >&2
+ exit 1
+fi
+
+if apk info remembering; then
+ echo 'remembering(1) is already in apk(8) list.' >&2
+ exit 1
+fi
+
+wget -qO- "$REPO"/"$KEY".rsa.pub | doas tee /etc/apk/keys/"$KEY".rsa.pub
+printf '%s\n' "$REPO" | doas tee -a /etc/apk/repositories
+doas apk add remembering
+
+remembering --help
+remembering -V