D5876: packaging: modify rc detection to work with X.Yrc instead of X.Y-rc

Mathiasdm (Mathias De Maré) phabricator at mercurial-scm.org
Thu Feb 7 10:50:46 UTC 2019


Mathiasdm created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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).

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5876

AFFECTED FILES
  contrib/packaging/packagelib.sh

CHANGE DETAILS

diff --git a/contrib/packaging/packagelib.sh b/contrib/packaging/packagelib.sh
--- a/contrib/packaging/packagelib.sh
+++ b/contrib/packaging/packagelib.sh
@@ -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=''



To: Mathiasdm, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list