Debian Codegraph @

tools/tag-release

raw
1 #!/bin/sh
2
3 version=""
4 repo=""
5 branch=""
6 push=0
7
8 for opt; do
9 case "$opt" in
10 --ver=*)
11 version=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
12 ;;
13 --repo=*)
14 repo=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
15 ;;
16 --branch=*)
17 branch=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
18 ;;
19 --push)
20 push=1
21 ;;
22 --no-push)
23 push=0
24 ;;
25 -*)
26 echo "Invalid option: $opt" 1>&2
27 exit 1
28 ;;
29 *)
30 version=$opt
31 ;;
32 esac
33 done
34
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://[email protected]/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
42 fi
43
44 tag="nasm-$version"
45
46 echo "$version" > version
47 git add version
48 git commit -m "NASM $version"
49 git tag -a -m "NASM $version" "$tag"
50
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
57 fi
58