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
--- 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=''