This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch maint-0.14.x
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit 2ec397aa3a4dad996e307fe7129d53210cfc05a0
Author: Sutou Kouhei <[email protected]>
AuthorDate: Sun Jun 30 14:40:38 2019 +0900

    ARROW-5793: [Release] Avoid duplicated known host SSH error in 
dev/release/03-binary.sh
    
    Author: Sutou Kouhei <[email protected]>
    
    Closes #4753 from kou/release-upload-binary-avoid-known-host-duplication 
and squashes the following commits:
    
    7fc0018bc <Sutou Kouhei>  Avoid duplicated known host SSH error in 
dev/release/03-binary.sh
---
 dev/release/03-binary.sh | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/dev/release/03-binary.sh b/dev/release/03-binary.sh
index fa1119a..74602cd 100755
--- a/dev/release/03-binary.sh
+++ b/dev/release/03-binary.sh
@@ -88,13 +88,22 @@ docker_run() {
 docker_gpg_ssh() {
   local ssh_port=$1
   shift
-  ssh \
-    -o StrictHostKeyChecking=no \
-    -i "${docker_ssh_key}" \
-    -p ${ssh_port} \
-    -R "/home/arrow/.gnupg/S.gpg-agent:${gpg_agent_extra_socket}" \
-    [email protected] \
-    "$@"
+  local known_hosts_file=$(mktemp -t "arrow-binary-gpg-ssh-known-hosts.XXXXX")
+  local exit_code=
+  if ssh \
+      -o StrictHostKeyChecking=no \
+      -o UserKnownHostsFile=${known_hosts_file} \
+      -i "${docker_ssh_key}" \
+      -p ${ssh_port} \
+      -R "/home/arrow/.gnupg/S.gpg-agent:${gpg_agent_extra_socket}" \
+      [email protected] \
+      "$@"; then
+    exit_code=$?;
+  else
+    exit_code=$?;
+  fi
+  rm -f ${known_hosts_file}
+  return ${exit_code}
 }
 
 docker_run_gpg_ready() {

Reply via email to