1999-06-22 06:41:39 +00:00
|
|
|
#!/bin/sh
|
2000-08-10 20:01:42 +00:00
|
|
|
nocopy=0
|
|
|
|
if [ "x$1" = "x-nocopy" ]; then
|
|
|
|
nocopy=1
|
|
|
|
shift
|
|
|
|
fi
|
1999-09-11 00:11:12 +00:00
|
|
|
if [ $# != 4 ]; then
|
2000-08-10 20:01:42 +00:00
|
|
|
echo "usage: $0 [-nocopy] master portbuilddir branch md5"
|
1999-06-22 06:41:39 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2000-03-21 18:30:40 +00:00
|
|
|
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}')
|
1999-06-22 06:41:39 +00:00
|
|
|
fi
|
1999-09-22 00:58:26 +00:00
|
|
|
|
|
|
|
if ! rm -rf $2/*/chroot/* >/dev/null 2>&1; then
|
|
|
|
chflags -R noschg $2/*/chroot/*
|
|
|
|
rm -rf $2/*/chroot/*
|
|
|
|
fi
|
|
|
|
|
2000-08-10 20:01:42 +00:00
|
|
|
killall make fetch >/dev/null 2>&1
|
|
|
|
|
2000-03-21 18:30:40 +00:00
|
|
|
mkdir -p $2/scripts $2/$3/tarballs $2/$3/chroot
|
|
|
|
|
|
|
|
scp -p $1:$2/scripts/portbuild $2/scripts
|
2000-08-10 20:01:42 +00:00
|
|
|
|
|
|
|
if [ "$nocopy" = 0 ]; then
|
|
|
|
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 $1:$2/$3/tarballs/bindist.tar $2/$3/tarballs
|
|
|
|
fi
|
1999-09-11 00:11:12 +00:00
|
|
|
fi
|