2010-07-24 03:50:02 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
proj="iperf"
|
|
|
|
|
2013-03-28 21:09:34 +04:00
|
|
|
tag=`awk '/IPERF_VERSION / {
|
2010-07-24 03:50:02 +04:00
|
|
|
gsub(/"/, "", $3);
|
|
|
|
print $3 }' src/version.h`
|
|
|
|
|
2013-03-28 21:09:34 +04:00
|
|
|
dirname=`echo $tag $proj | awk '{
|
2010-07-24 03:50:02 +04:00
|
|
|
gsub(/-ALPHA/, "a", $1);
|
|
|
|
gsub(/-BETA/, "b", $1);
|
|
|
|
gsub(/-RELEASE/, "", $1);
|
|
|
|
print $2"-"$1 }'`
|
|
|
|
|
2013-03-28 21:09:34 +04:00
|
|
|
echo tag $tag
|
2010-07-24 03:50:02 +04:00
|
|
|
echo dirname $dirname
|
|
|
|
|
|
|
|
do_tag ()
|
|
|
|
{
|
2013-03-28 21:09:34 +04:00
|
|
|
hg tag -m "tagging $tag" $tag
|
2010-07-24 03:50:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
do_tar ()
|
|
|
|
{
|
2013-03-28 21:51:08 +04:00
|
|
|
tarball=${dirname}.tar.gz
|
|
|
|
hg archive -t tgz -p ${dirname} -X make_release -X .hgtags -r ${tag} ${tarball}
|
|
|
|
}
|
|
|
|
|
|
|
|
usage ()
|
|
|
|
{
|
|
|
|
cat <<EOF
|
|
|
|
$0: tag|tar
|
|
|
|
|
|
|
|
tag -- create a tag using the contents of src/version.h
|
|
|
|
tar -- create a tarball of the current tag
|
|
|
|
|
|
|
|
General use is to do:
|
|
|
|
|
|
|
|
./$0 tag
|
|
|
|
./$0 tar
|
|
|
|
EOF
|
2010-07-24 03:50:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
tag) do_tag ;;
|
|
|
|
tar) do_tar ;;
|
2013-03-28 21:51:08 +04:00
|
|
|
*) echo "unknown command: $1"; usage ;;
|
2010-07-24 03:50:02 +04:00
|
|
|
esac
|
|
|
|
|
|
|
|
exit
|