Minor improvements to make_release script.
Allow optional specification of a version string (the intended use of this to be able to roll a tarball from a source tree / repo that's not the exact version being released). Compute and display SHA256 hash of the tarball on Linux, FreeBSD, and MacOS. Don't exclude make_release from the tarball (no point in hiding it) but do try a little harder to get rid of .hg\* files. Comment out some debugging code.
Этот коммит содержится в:
родитель
5f693411d2
Коммит
a844d3ba95
29
make_release
29
make_release
@ -2,9 +2,13 @@
|
|||||||
|
|
||||||
proj="iperf"
|
proj="iperf"
|
||||||
|
|
||||||
|
if [ "x$2" != "x" ]; then
|
||||||
|
tag=$2
|
||||||
|
else
|
||||||
tag=`awk '/IPERF_VERSION / {
|
tag=`awk '/IPERF_VERSION / {
|
||||||
gsub(/"/, "", $3);
|
gsub(/"/, "", $3);
|
||||||
print $3 }' src/version.h`
|
print $3 }' src/version.h`
|
||||||
|
fi
|
||||||
|
|
||||||
dirname=`echo $tag $proj | awk '{
|
dirname=`echo $tag $proj | awk '{
|
||||||
gsub(/-ALPHA/, "a", $1);
|
gsub(/-ALPHA/, "a", $1);
|
||||||
@ -12,8 +16,8 @@ dirname=`echo $tag $proj | awk '{
|
|||||||
gsub(/-RELEASE/, "", $1);
|
gsub(/-RELEASE/, "", $1);
|
||||||
print $2"-"$1 }'`
|
print $2"-"$1 }'`
|
||||||
|
|
||||||
echo tag $tag
|
# echo tag $tag
|
||||||
echo dirname $dirname
|
# echo dirname $dirname
|
||||||
|
|
||||||
do_tag ()
|
do_tag ()
|
||||||
{
|
{
|
||||||
@ -23,7 +27,17 @@ do_tag ()
|
|||||||
do_tar ()
|
do_tar ()
|
||||||
{
|
{
|
||||||
tarball=${dirname}.tar.gz
|
tarball=${dirname}.tar.gz
|
||||||
hg archive -t tgz -p ${dirname} -X make_release -X .hgtags -r ${tag} ${tarball}
|
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}
|
||||||
}
|
}
|
||||||
|
|
||||||
usage ()
|
usage ()
|
||||||
@ -31,13 +45,18 @@ usage ()
|
|||||||
cat <<EOF
|
cat <<EOF
|
||||||
$0: tag|tar
|
$0: tag|tar
|
||||||
|
|
||||||
tag -- create a tag using the contents of src/version.h
|
tag -- create a tag
|
||||||
tar -- create a tarball of the current tag
|
tar -- create a tarball from a tag
|
||||||
|
|
||||||
General use is to do:
|
General use is to do:
|
||||||
|
|
||||||
./$0 tag
|
./$0 tag
|
||||||
./$0 tar
|
./$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.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user