changeset 41320:8f0e8b179842 stable

packaging: modify rc detection to work with X.Yrc instead of X.Y-rc rc detection on CentOS failed without this change, resulting in upgrades from 4.9rc to 4.9 not working (4.9rc was considered more recent than 4.9). Differential Revision: https://phab.mercurial-scm.org/D5876
author Mathias De Mare <mathias.de_mare@nokia.com>
date Thu, 07 Feb 2019 09:12:01 +0100
parents 87a6e3c953e0
children f2f538725d07
files contrib/packaging/packagelib.sh
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/packaging/packagelib.sh	Tue Feb 05 20:50:54 2019 -0500
+++ b/contrib/packaging/packagelib.sh	Thu Feb 07 09:12:01 2019 +0100
@@ -28,9 +28,9 @@
         distance=''
         node=''
     fi
-    if echo $hgversion | grep -- '-' > /dev/null 2>&1; then
-        version=`echo $hgversion | cut -d- -f1`
-        type=`echo $hgversion | cut -d- -f2`
+    if echo $hgversion | grep -E -- '[0-9]\.[0-9](\.[0-9])?rc' > /dev/null 2>&1; then
+        version=`echo $hgversion | cut -d'r' -f1`
+        type="rc`echo $hgversion | cut -d'c' -f2-`"
     else
         version=$hgversion
         type=''