Skip to content

Commit e8ab13b

Browse files
authored
Merge pull request libgit2#3954 from libgit2/cmn/osx-ssh-key
Travis Mac SSH key issues
2 parents 9fbbb0e + db35766 commit e8ab13b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

script/cibuild.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
set -x
4+
35
if [ -n "$COVERITY" ];
46
then
57
./script/coverity.sh;
@@ -49,8 +51,13 @@ ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q
4951
cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
5052
ssh-keyscan -t rsa localhost >>~/.ssh/known_hosts
5153

52-
# Get the fingerprint for localhost and remove the colons so we can parse it as a hex number
53-
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
5461

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

0 commit comments

Comments
 (0)