#!/bin/bash set -euo pipefail pkg=$1 targets=(~/arch/{community,extra}) found_pkg=0 for target in "${targets[@]}"; do if [[ -f "$target/$pkg/trunk/PKGBUILD" ]]; then found_pkg=1 cd "$target/$pkg" svn up cd trunk break fi done if ((!found_pkg)); then echo "Package not found. Creating not supported here" exit 1 fi case "${target##*/}" in extra) relcmd=(extrapkg);; community) relcmd=(communitypkg);; *) echo "Unable to determine release command for target '$target'"; exit 1; ;; esac gen-perl-pkg "$pkg" ch update 64 ch cbuild 64 checkpkg echo "About to release with command: ${relcmd[*]}" read -r -p "Hit enter to release or ^C to abort" "${relcmd[@]}" "upstream update"