summaryrefslogtreecommitdiffstats
path: root/update
diff options
context:
space:
mode:
authorRudolf Polzer <divVerent@xonotic.org>2013-12-30 10:32:18 +0100
committerRudolf Polzer <divVerent@xonotic.org>2013-12-30 10:32:18 +0100
commit40ec5ac037d118fa9b5a82c00a7b92d2d3bddb81 (patch)
tree5f2bc94028fc173290afa6ab1a9d397f8ba651e4 /update
parentba60c400ae5c69bd8b7f6c1368e6e8c6bfb42f24 (diff)
downloadmpv-build-40ec5ac037d118fa9b5a82c00a7b92d2d3bddb81.tar.bz2
mpv-build-40ec5ac037d118fa9b5a82c00a7b92d2d3bddb81.tar.xz
Implement version sorting using POSIX.1-2008 only.
Diffstat (limited to 'update')
-rwxr-xr-xupdate12
1 files changed, 11 insertions, 1 deletions
diff --git a/update b/update
index 839890e..6e37635 100755
--- a/update
+++ b/update
@@ -36,11 +36,21 @@ do_gitmaster_all()
do_gitmaster mpv
}
+versort_with_prefix()
+{
+ # Emulate sort -V using a known prefix. Filter out anything else.
+ sed -n -e "s/^$1\([0-9]\)/\\1/p" |\
+ sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 |\
+ sed -e "s/^/$1/"
+ # GNU version of the same:
+ # grep "^$2[0-9]" | sort -V
+}
+
do_releasetag()
{
(
cd "$1"
- version=`git tag | grep "^$2[0-9]" | sort -V | tail -n 1`
+ version=`git tag | versort_with_prefix "$2" | tail -n 1`
git checkout --detach refs/tags/"$version"
)
}