From 5cc56baf4116d877840ed027cf3e2ba3a83c6023 Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Wed, 5 Oct 2011 17:54:06 -0400
Subject: [PATCH] * #7046: fix launchpad script to get last git tags

---
 tools/build-system/launch-build-machine-2.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/build-system/launch-build-machine-2.sh b/tools/build-system/launch-build-machine-2.sh
index 7834cfc113..0d9a44088f 100755
--- a/tools/build-system/launch-build-machine-2.sh
+++ b/tools/build-system/launch-build-machine-2.sh
@@ -118,8 +118,8 @@ if [ ${IS_KDE_CLIENT} ]; then
 	TAG_NAME_PREFIX="kde."
 	LAUNCHPAD_PACKAGES=( "sflphone-client-kde" )
 fi
-CURRENT_RELEASE_TAG_NAME=`git tag -l "${TAG_NAME_PREFIX}[0-9]\.[0-9]\.[0-9]*\.*" | tail -n 1`
-PREVIOUS_RELEASE_TAG_NAME=`git tag -l "${TAG_NAME_PREFIX}[0-9]\.[0-9]\.[0-9]*\.*" | tail -n 2 | sed -n '1p;1q'`
+CURRENT_RELEASE_TAG_NAME=$(git for-each-ref refs/tags --sort=-authordate --format='%(refname)' --count=1 | cut -d'/' -f3)
+PREVIOUS_RELEASE_TAG_NAME=$(git for-each-ref refs/tags --sort=-authordate --format='%(refname)' --count=2 | cut -d'/' -f3 | tail -n1)
 CURRENT_RELEASE_COMMIT_HASH=`git show --pretty=format:"%H" -s ${CURRENT_RELEASE_TAG_NAME} | tail -n 1`
 PREVIOUS_RELEASE_COMMIT_HASH=`git show --pretty=format:"%H" -s ${PREVIOUS_RELEASE_TAG_NAME} | tail -n 1`
 CURRENT_COMMIT=`git show --pretty=format:"%H"  -s | tail -n 1`
-- 
GitLab