2010-07-24 03:50:02 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
proj="iperf"
|
|
|
|
|
2014-01-10 01:26:32 +04:00
|
|
|
if [ "x$2" != "x" ]; then
|
|
|
|
tag=$2
|
|
|
|
else
|
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`
|
2014-01-10 01:26:32 +04:00
|
|
|
fi
|
2010-07-24 03:50:02 +04:00
|
|
|
|
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 }'`
|
|
|
|
|
2014-01-10 01:26:32 +04:00
|
|
|
# echo tag $tag
|
|
|
|
# echo dirname $dirname
|
2010-07-24 03:50:02 +04:00
|
|
|
|
|
|
|
do_tag ()
|
|
|
|
{
|
2014-03-26 22:05:40 +04:00
|
|
|
git tag -s -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
|
2014-01-10 01:26:32 +04:00
|
|
|
rm -f ${tarball}
|
2014-03-11 00:30:20 +04:00
|
|
|
git archive --format=tar --prefix ${dirname}/ ${tag} | gzip -9 > ${tarball}
|
2014-01-10 01:26:32 +04:00
|
|
|
|
|
|
|
# Compute SHA256 hash
|
|
|
|
case `uname -s` in
|
|
|
|
FreeBSD) sha=sha256 ;;
|
|
|
|
Linux) sha=sha256sum ;;
|
|
|
|
Darwin) sha="shasum -a 256" ;;
|
|
|
|
*) sha=echo ;;
|
|
|
|
esac
|
2015-01-09 21:53:03 +03:00
|
|
|
${sha} ${tarball} | tee ${tarball}.sha256
|
2013-03-28 21:51:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
usage ()
|
|
|
|
{
|
|
|
|
cat <<EOF
|
|
|
|
$0: tag|tar
|
|
|
|
|
2014-01-10 01:26:32 +04:00
|
|
|
tag -- create a tag
|
|
|
|
tar -- create a tarball from a tag
|
2013-03-28 21:51:08 +04:00
|
|
|
|
|
|
|
General use is to do:
|
|
|
|
|
|
|
|
./$0 tag
|
|
|
|
./$0 tar
|
2014-01-10 01:26:32 +04:00
|
|
|
|
|
|
|
An optional argument may be specified to both the tag and tar
|
|
|
|
subcommands to explicitly specify a tag string. If not specified, the
|
|
|
|
contents of src/version.h are used.
|
|
|
|
|
2013-03-28 21:51:08 +04:00
|
|
|
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
|