1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

When -norsync is set, don't bother to run md5 over the bindist.tar

and copy it to the client.  This has two benefits:

1) Avoids spamming the master with dozens of md5 processes when
   dosetupnode is spawned for all client machines at ocne

2) Avoids silly copy attempts on disconnected nodes for which the file
   is copied to itself
This commit is contained in:
Kris Kennaway 2005-10-11 03:55:27 +00:00
parent ac6980959a
commit 94cda32b84
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=144896

View File

@ -22,10 +22,16 @@ echo "setting up of $node started at $(date)"
disconnected=0
. ${pb}/${arch}/portbuild.${node}
md5=$(/sbin/md5 ${pb}/${arch}/${branch}/tarballs/bindist.tar | awk '{print $4}')
if [ "${norsync}" = 1 ]; then
md5=0
nocopy=-nocopy
else
md5=$(/sbin/md5 ${pb}/${arch}/${branch}/tarballs/bindist.tar | awk '{print $4}')
nocopy=
fi
scp -p ${pb}/scripts/setupnode ${client_user}@${node}:/tmp
ssh -n ${client_user}@${node} ${sudo_cmd} sh /tmp/setupnode $(hostname) ${pb} ${arch} ${branch} ${scratchdir} ${md5} ${disconnected}
ssh -n ${client_user}@${node} ${sudo_cmd} sh /tmp/setupnode ${nocopy} $(hostname) ${pb} ${arch} ${branch} ${scratchdir} ${md5} ${disconnected}
if [ ! -z "${sudo_cmd}" -a ${disconnected} = "1" ]; then
ssh -n ${client_user}@${node} ${sudo_cmd} "chown -R ${client_user} /var/portbuild/"
fi
@ -39,5 +45,5 @@ if [ "${disconnected}" = 1 -a "${norsync}" = 0 ]; then
rsync ${rsync_gzip} -r -L -p --delete ${pb}/${arch}/${branch}/tarballs/ ${client_user}@${node}:${pb}/${arch}/${branch}/tarballs/
fi
lockf ${pb}/${arch}/queue/.lock ${pb}/scripts/pollmachine ${arch} ${node} -queue
lockf -k ${pb}/${arch}/queue/.lock ${pb}/scripts/pollmachine ${arch} ${node} -queue
echo "setting up of $node ended at $(date)"