index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-02-09 00:50:15 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-02-12 12:35:14 +0100 |
commit | 9ab0d94578af8e79b64809b07346db89a07b7f61 (patch) | |
tree | 0b0e787929e103432b1739711d4004fb8f07b8aa /archrelease.in | |
parent | 5e8cb67603a10a00ddc6f3d124a120513094d7f6 (diff) |
-rw-r--r-- | archrelease.in | 25 |
diff --git a/archrelease.in b/archrelease.in index 40b6c09..5bc2c90 100644 --- a/archrelease.in +++ b/archrelease.in @@ -1,13 +1,32 @@ #!/bin/bash m4_include(lib/common.sh) +m4_include(lib/valid-tags.sh) -if [[ -z $1 ]]; then - echo 'Usage: archrelease <repo>...' +# 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] <repo>...' exit 1 fi -# TODO: validate repo is really repo-arch +# 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' |