1
1
iperf3/make_release

70 строки
1.1 KiB
Plaintext
Исходник Обычный вид История

2010-07-24 03:50:02 +04:00
#!/bin/sh
proj="iperf"
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`
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 }'`
# echo tag $tag
# echo dirname $dirname
2010-07-24 03:50:02 +04:00
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
rm -f ${tarball}
hg archive -t tgz -p ${dirname} -X .hg\* -r ${tag} ${tarball}
# Compute SHA256 hash
case `uname -s` in
FreeBSD) sha=sha256 ;;
Linux) sha=sha256sum ;;
Darwin) sha="shasum -a 256" ;;
*) sha=echo ;;
esac
${sha} ${tarball}
2013-03-28 21:51:08 +04:00
}
usage ()
{
cat <<EOF
$0: tag|tar
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
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