1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-31 21:57:12 +00:00
freebsd-ports/Tools/portbuild/scripts/setupnode
1999-09-22 00:58:26 +00:00

23 lines
699 B
Bash
Executable File

#!/bin/sh
if [ $# != 4 ]; then
echo "usage: $0 master portbuilddir branch md5"
exit 1
fi
if [ $(echo $(/sbin/mount | grep "$2/.*(read-only)" | awk '{print $3}' | wc -c)) != 0 ]; then
/sbin/umount -f $(/sbin/mount | grep "$2/.*(read-only)" | awk '{print $3}')
fi
if ! rm -rf $2/*/chroot/* >/dev/null 2>&1; then
chflags -R noschg $2/*/chroot/*
rm -rf $2/*/chroot/*
fi
scp -p -a $1:$2/scripts/portbuild $2/scripts
md5=$(/sbin/md5 $2/$3/tarballs/bindist.tar | awk '{print $4}')
if [ "$md5" = "$4" ]; then
echo "not copying bindist to $(hostname -s) since it is already up to date"
else
echo "copying bindist to $(hostname -s)"
scp -p -a $1:$2/$3/tarballs/bindist.tar $2/$3/tarballs
fi