diff --git a/aur.sh b/aur.sh new file mode 100644 index 0000000..6236db1 --- /dev/null +++ b/aur.sh @@ -0,0 +1,41 @@ +# shellcheck shell=bash + +aur_build() { + local args=() + + while [[ $# -gt 0 ]]; do + case $1 in + --debug) args+=("-e" "DEBUG_SHELL=y") ;; + --skip-native) args+=("-e" "SKIP_NATIVE=y") ;; + *) + echo "Unknown option: $1" + return 1 + ;; + esac + shift + done + + podman run --pull newer --rm -it "${args[@]}" -v "$PWD:/w" gitea.balki.me/balki/aur_builder:latest +} + +_aur_build() { + local -a flags + flags=( + '--debug:pause in a debug bash shell' + '--skip-native:do not force native architecture' + ) + _describe 'flags' flags +} + +compdef _aur_build aur_build + +aur_upload() { + curl --user "balki:${ARCH_REPO_TOKEN?token missing}" \ + --upload-file "${1?package file missing}" \ + https://gitea.balki.me/api/packages/balki-aur/arch/balki-aur +} + +compdef '_files -g "*.pkg.tar.zst"' aur_upload +zstyle ':completion:*:*:aur_upload:*' file-sort modification + +# vim: set filetype=zsh: