eval: Use nasm_error helpers
[nasm.git] / tools / tag-release
blob9e3a0bd081ec934ecfd5ce9a5dc47092fda715c8
1 #!/bin/sh
3 version=""
4 repo=""
5 branch=""
6 push=0
8 for opt; do
9 case "$opt" in
10 --ver=*)
11 version=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
13 --repo=*)
14 repo=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
16 --branch=*)
17 branch=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
19 --push)
20 push=1
22 --no-push)
23 push=0
25 -*)
26 echo "Invalid option: $opt" 1>&2
27 exit 1
30 version=$opt
32 esac
33 done
35 if [ -z "$version" ]; then
36 echo " Usage"
37 echo " $0 --ver=num [--repo=name --branch=name --push]" 1>&2
38 echo " Example"
39 echo " $0 --ver=2.10rc1 --repo=git+ssh://user@repo.or.cz/nasm.git --branch=master --no-push" 1>&2
40 echo " With --no-push the changes are not pushed out to remote repo"
41 exit 1
44 tag="nasm-$version"
46 echo "$version" > version
47 git add version
48 git commit -m "NASM $version"
49 git tag -a -m "NASM $version" "$tag"
51 if [ $push = 1 ]; then
52 set -x
53 git push $repo $branch
54 git push $repo $tag
55 git push --tags $repo
56 set +x