[PATCH STABLE] docker: match more version of 'hg docker version' (issue4967)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Nov 25 02:16:04 UTC 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1448417605 28800
#      Tue Nov 24 18:13:25 2015 -0800
# Branch stable
# Node ID 05635441f955acbdab243156af39e79addda1c34
# Parent  6979fe2a6d75105affcacd9e298262a92641cb98
# Available At http://hg.netv6.net/marmoute-wip/mercurial/
#              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r 05635441f955
docker: match more version of 'hg docker version' (issue4967)

My version of docker (1.8.3) have a different formating for 'docker version'
that broke the build script. We make the version matching more generic in to
work with both version.

diff --git a/contrib/dockerlib.sh b/contrib/dockerlib.sh
--- a/contrib/dockerlib.sh
+++ b/contrib/dockerlib.sh
@@ -12,12 +12,12 @@ function checkdocker() {
     echo "Error: docker must be installed"
     exit 1
   fi
 
   $DOCKER -h 2> /dev/null | grep -q Jansens && { echo "Error: $DOCKER is the Docking System Tray - install docker.io instead"; exit 1; }
-  $DOCKER version | grep -q "^Client version:" || { echo "Error: unexpected output from \"$DOCKER version\""; exit 1; }
-  $DOCKER version | grep -q "^Server version:" || { echo "Error: could not get docker server version - check it is running and your permissions"; exit 1; }
+  $DOCKER version | grep -Eq "^(Client version|Client):" || { echo "Error: unexpected output from \"$DOCKER version\""; exit 1; }
+  $DOCKER version | grep -Eq "^(Server version|Server):" || { echo "Error: could not get docker server version - check it is running and your permissions"; exit 1; }
 }
 
 # Construct a container and leave its name in $CONTAINER for future use.
 function initcontainer() {
   [ "$1" ] || { echo "Error: platform name must be specified"; exit 1; }


More information about the Mercurial-devel mailing list