]> git.proxmox.com Git - libgit2.git/commitdiff
travis: take the newer ssh-keygen format into account
authorCarlos Martín Nieto <cmn@dwim.me>
Wed, 5 Oct 2016 18:17:06 +0000 (20:17 +0200)
committerCarlos Martín Nieto <cmn@dwim.me>
Wed, 5 Oct 2016 18:23:58 +0000 (20:23 +0200)
The Mac machines have updated their SSH version and so the ssh-keygen
format has changed. Ask it for MD5, which is the one that is output as
hex.

script/cibuild.sh

index 0ec29519803ea0fbb7cb1ec93d61ff7999e9b9f6..b13ad88c4ebdb8272f28356848fc205e25af3408 100755 (executable)
@@ -51,8 +51,13 @@ ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
 cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
 ssh-keyscan -t rsa localhost >>~/.ssh/known_hosts
 
-# Get the fingerprint for localhost and remove the colons so we can parse it as a hex number
-export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F localhost -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':')
+# Get the fingerprint for localhost and remove the colons so we can parse it as
+# a hex number. The Mac version is newer so it has a different output format.
+if [ "$TRAVIS_OS_NAME" = "osx" ]; then
+    export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -E md5 -F localhost -l | tail -n 1 | cut -d ' ' -f 3 | cut -d : -f2- | tr -d :)
+else
+    export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F localhost -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':')
+fi
 
 export GITTEST_REMOTE_URL="ssh://localhost/$HOME/_temp/test.git"
 export GITTEST_REMOTE_USER=$USER