svn commit: r222352 - projects/portbuild/scripts
Florent Thoumie
flz at FreeBSD.org
Fri May 27 10:08:25 UTC 2011
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}"
More information about the svn-src-projects
mailing list