#!/bin/bash m4_include(lib/common.sh) m4_include(lib/valid-tags.sh) # parse command line options FORCE= while getopts ':f' flag; do case $flag in f) FORCE=1 ;; :) die "Option requires an argument -- '$OPTARG'" ;; \?) die "Invalid option -- '$OPTARG'" ;; esac done shift $(( OPTIND - 1 )) if ! (( $# )); then echo 'Usage: archrelease [-f] ...' exit 1 fi # validate repo is really repo-arch if [[ -z $FORCE ]]; then for tag in "$@"; do if ! in_array "$tag" "${_tags[@]}"; then die 'archrelease: Invalid tag: "'$tag'" (use -f to force release)' fi done fi if [[ ! -f PKGBUILD ]]; then die 'archrelease: PKGBUILD not found' fi trunk=${PWD##*/} if [[ $(git status -s | grep -v "^?? ") ]]; then die 'archrelease: You have not committed your changes yet!' fi # TODO: merge with code from commitpkg if [[ -z $server ]]; then case "$repo" in core|extra|testing|staging|kde-unstable|gnome-unstable) server='gerolde.archlinux.org' ;; community*|multilib*) server='aur.archlinux.org' ;; *) server='gerolde.archlinux.org' msg "Non-standard repository $repo in use, defaulting to server $server" ;; esac fi stat_busy "Releasing package" printf -v tag_list ", %s" "$@"; tag_list="${tag_list#, }" ssh $server commit -q -m "archrelease: copy ${trunk} to $tag_list" || abort stat_done popd >/dev/null