From owner-svn-src-projects@FreeBSD.ORG Fri May 27 10:08:25 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F53106564A; Fri, 27 May 2011 10:08:25 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6906D8FC14; Fri, 27 May 2011 10:08:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RA8P2x017044; Fri, 27 May 2011 10:08:25 GMT (envelope-from flz@svn.freebsd.org) Received: (from flz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4RA8P2W017040; Fri, 27 May 2011 10:08:25 GMT (envelope-from flz@svn.freebsd.org) Message-Id: <201105271008.p4RA8P2W017040@svn.freebsd.org> From: Florent Thoumie Date: Fri, 27 May 2011 10:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222352 - projects/portbuild/scripts X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 10:08:25 -0000 Author: flz Date: Fri May 27 10:08:25 2011 New Revision: 222352 URL: http://svn.freebsd.org/changeset/base/222352 Log: portbuild: use ${ssh_cmd} rather than calling ssh directly. ssh_cmd is set to use publickey authentication only so this avoids issues when a host might be up and running but keys aren't in place. Modified: projects/portbuild/scripts/allgohans projects/portbuild/scripts/dosetupnode projects/portbuild/scripts/pdispatch Modified: projects/portbuild/scripts/allgohans ============================================================================== --- projects/portbuild/scripts/allgohans Fri May 27 09:56:23 2011 (r222351) +++ projects/portbuild/scripts/allgohans Fri May 27 10:08:25 2011 (r222352) @@ -31,16 +31,16 @@ doarch() { # If we need to scp first, the command given in the parameters is the local # path, which we need to upload first. The command will return the remote # temporary file, which we can subsequently execute. So this isn't really scp. - cmdpath=$(su ports-${arch} -c "cat ${cmd} | ssh ${client_user}@$i 't=\$(mktemp -t ${cmd##*/}); cat >\$t; echo \$t; chmod 755 \$t'") + cmdpath=$(su ports-${arch} -c "cat ${cmd} | ${ssh_cmd} ${client_user}@$i 't=\$(mktemp -t ${cmd##*/}); cat >\$t; echo \$t; chmod 755 \$t'") case ${cmdpath} in /tmp/*) ;; *) echo "Failed to scp ${cmd} to $i."; return 1;; esac fi - lockf -t 60 ${pbd}/${arch}/lockfiles/lock.$i su ports-${arch} -c "ssh ${client_user}@$i ${sudo_cmd} ${cmdpath} $@" + lockf -t 60 ${pbd}/${arch}/lockfiles/lock.$i su ports-${arch} -c "${ssh_cmd} ${client_user}@$i ${sudo_cmd} ${cmdpath} $@" result=$? if [ $result -ne 0 ]; then echo "could not execute command ${cmdpath} $@ on $i: $result" fi if [ ${scpfirst} -ne 0 ]; then - su ports-${arch} -c "ssh ${client_user}@$i 'rm -f ${cmdpath}'" + su ports-${arch} -c "${ssh_cmd} ${client_user}@$i 'rm -f ${cmdpath}'" fi done } Modified: projects/portbuild/scripts/dosetupnode ============================================================================== --- projects/portbuild/scripts/dosetupnode Fri May 27 09:56:23 2011 (r222351) +++ projects/portbuild/scripts/dosetupnode Fri May 27 10:08:25 2011 (r222352) @@ -72,7 +72,7 @@ setup() { checkerror $? || (echo "Copying scripts to ${node} failed"; return 1) fi - cmdpath=$(cat ${pbc}/scripts/setupnode | ssh -a ${client_user}@${node} 't=$(mktemp -t setupnode); cat >$t; echo $t; chmod 755 $t') + cmdpath=$(cat ${pbc}/scripts/setupnode | ${ssh_cmd} -a ${client_user}@${node} 't=$(mktemp -t setupnode); cat >$t; echo $t; chmod 755 $t') case ${cmdpath} in /tmp/*) ;; *) echo "Failed to upload or run setupnode on ${node}."; return 1;; esac client_setup="${ssh_cmd} -n ${client_user}@${node} ${cmdpath} ${pbd} ${arch} ${branch} ${buildid} ${scratchdir} \"${portsmd5}\" \"${srcmd5}\" \"${bindistmd5}\"" Modified: projects/portbuild/scripts/pdispatch ============================================================================== --- projects/portbuild/scripts/pdispatch Fri May 27 09:56:23 2011 (r222351) +++ projects/portbuild/scripts/pdispatch Fri May 27 10:08:25 2011 (r222352) @@ -85,7 +85,7 @@ chroot= test -f ${pbd}/${arch}/portbuild.${host} && . ${pbd}/${arch}/portbuild.${host} # Upload scripts/claim-chroot as per-build scripts aren't in place yet. -cmdpath=$(cat ${pbc}/scripts/claim-chroot | ssh -a ${client_user}@${host} 't=$(mktemp -t claim-chroot); cat >$t; echo $t; chmod 755 $t') +cmdpath=$(cat ${pbc}/scripts/claim-chroot | ${ssh_cmd} -a ${client_user}@${host} 't=$(mktemp -t claim-chroot); cat >$t; echo $t; chmod 755 $t') case ${cmdpath} in /tmp/*) ;; *) echo "Failed to scp claim-chroot to ${host}."; exit 254;; esac chrootdata=$(${ssh_cmd} -a -n ${client_user}@${host} ${sudo_cmd} ${cmdpath} ${arch} ${branch} ${buildid} ${pkgname} 2>&1) ${ssh_cmd} -a ${client_user}@${host} "rm -f ${cmdpath}"