2007-11-20 15:09:24 +08:00
|
|
|
#!/bin/sh
|
2010-03-04 03:36:22 +08:00
|
|
|
|
2010-11-22 00:19:29 +08:00
|
|
|
version=""
|
2010-03-04 03:36:22 +08:00
|
|
|
repo=""
|
|
|
|
branch=""
|
2016-02-22 13:07:11 +08:00
|
|
|
push=0
|
2010-11-22 00:19:29 +08:00
|
|
|
|
2016-02-22 13:07:11 +08:00
|
|
|
for opt; do
|
2010-11-22 00:19:29 +08:00
|
|
|
case "$opt" in
|
|
|
|
--ver=*)
|
|
|
|
version=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
|
|
|
|
;;
|
|
|
|
--repo=*)
|
|
|
|
repo=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
|
|
|
|
;;
|
|
|
|
--branch=*)
|
|
|
|
branch=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
|
|
|
|
;;
|
2016-02-22 13:07:11 +08:00
|
|
|
--push)
|
|
|
|
push=1
|
|
|
|
;;
|
2010-11-22 00:19:29 +08:00
|
|
|
--no-push)
|
|
|
|
push=0
|
|
|
|
;;
|
2016-02-22 13:05:16 +08:00
|
|
|
-*)
|
|
|
|
echo "Invalid option: $opt" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
2010-11-22 00:19:29 +08:00
|
|
|
*)
|
|
|
|
version=$opt
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2010-03-04 03:36:22 +08:00
|
|
|
|
2007-11-20 15:09:24 +08:00
|
|
|
if [ -z "$version" ]; then
|
2010-11-22 00:19:29 +08:00
|
|
|
echo " Usage"
|
|
|
|
echo " $0 --ver=num [--repo=name --branch=name --push]" 1>&2
|
|
|
|
echo " Example"
|
|
|
|
echo " $0 --ver=2.10rc1 --repo=git+ssh://user@repo.or.cz/nasm.git --branch=master --no-push" 1>&2
|
|
|
|
echo " With --no-push the changes are not pushed out to remote repo"
|
|
|
|
exit 1
|
2007-11-20 15:09:24 +08:00
|
|
|
fi
|
|
|
|
|
2010-03-04 03:36:22 +08:00
|
|
|
tag="nasm-$version"
|
|
|
|
|
2007-11-20 15:09:24 +08:00
|
|
|
echo "$version" > version
|
|
|
|
git add version
|
|
|
|
git commit -m "NASM $version"
|
2010-03-04 03:36:22 +08:00
|
|
|
git tag -a -m "NASM $version" "$tag"
|
|
|
|
|
2010-11-22 00:19:29 +08:00
|
|
|
if [ $push = 1 ]; then
|
2012-02-26 14:02:08 +08:00
|
|
|
set -x
|
|
|
|
git push $repo $branch
|
|
|
|
git push $repo $tag
|
|
|
|
git push --tags $repo
|
|
|
|
set +x
|
2010-03-04 03:36:22 +08:00
|
|
|
fi
|
2010-11-22 00:19:29 +08:00
|
|
|
|