Skip to content

Commit db35766

Browse files
committed
travis: take the newer ssh-keygen format into account
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.
1 parent 94d565b commit db35766

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

script/cibuild.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,13 @@ ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
5151
cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
5252
ssh-keyscan -t rsa localhost >>~/.ssh/known_hosts
5353

54-
# Get the fingerprint for localhost and remove the colons so we can parse it as a hex number
55-
export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F localhost -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':')
54+
# Get the fingerprint for localhost and remove the colons so we can parse it as
55+
# a hex number. The Mac version is newer so it has a different output format.
56+
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
57+
export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -E md5 -F localhost -l | tail -n 1 | cut -d ' ' -f 3 | cut -d : -f2- | tr -d :)
58+
else
59+
export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F localhost -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':')
60+
fi
5661

5762
export GITTEST_REMOTE_URL="ssh://localhost/$HOME/_temp/test.git"
5863
export GITTEST_REMOTE_USER=$USER

0 commit comments

Comments
 (0)