From 8fdbb210f51b2f33711ec901618aa091c96ef285 Mon Sep 17 00:00:00 2001 From: asami Date: Fri, 22 Jan 1999 10:00:08 +0000 Subject: By defining NOCLEAN in the environment, you can have the chroot dir left behind. Useful for debugging. Touch package on master after copying it back. This will avoid synchronization problems when the machines' clocks are wildly skewed. Remove log from master when build is successful. No need to keep around transient error logs. --- Tools/portbuild/scripts/pdispatch | 9 +++++++-- Tools/portbuild/scripts/portbuild | 19 +++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'Tools/portbuild') diff --git a/Tools/portbuild/scripts/pdispatch b/Tools/portbuild/scripts/pdispatch index 1156d2d..5c31b7e 100755 --- a/Tools/portbuild/scripts/pdispatch +++ b/Tools/portbuild/scripts/pdispatch @@ -24,5 +24,10 @@ mach=$(cat ${buildroot}/ulist) num=$(echo $(echo $mach | wc -w)) set $mach shift $(echo "$$ $num" | awk '{srand($1); print(int(rand()*$2))}') -echo "dispatching: ssh -a $1 ${command} ${branch} $args" -ssh -a $1 ${command} ${branch} $args +if [ "x$NOCLEAN" != "x" ]; then + echo "dispatching: ssh -a $1 ${command} ${branch} -noclean $args" + ssh -a $1 ${command} ${branch} -noclean $args +else + echo "dispatching: ssh -a $1 ${command} ${branch} $args" + ssh -a $1 ${command} ${branch} $args +fi diff --git a/Tools/portbuild/scripts/portbuild b/Tools/portbuild/scripts/portbuild index 34f21f3..2f70e29 100755 --- a/Tools/portbuild/scripts/portbuild +++ b/Tools/portbuild/scripts/portbuild @@ -1,6 +1,6 @@ #!/bin/sh -# usage: $0 BRANCH PKGNAME.tar DIRNAME [DEPENDENCY.tar ...] +# usage: $0 BRANCH [-noclean] PKGNAME.tgz DIRNAME [DEPENDENCY.tgz ...] master=bento @@ -17,6 +17,7 @@ export WRKDIRPREFIX=/tmp export DEPENDS_TARGET=/usr/bin/true # don't pass -j, -k etc. to sub-makes unset MAKEFLAGS +unset PORTSDIR # 15 minutes export FTP_TIMEOUT=900 @@ -32,6 +33,12 @@ buildroot=/a/asami/portbuild branch=$1 shift +noclean=0 +if [ "x$1" = "x-noclean" ]; then + noclean=1 + shift +fi + if [ ${branch} = "3.0" ]; then export OSREL=3.0 export OSVERSION=300006 @@ -98,6 +105,8 @@ if [ "${error}" = 0 ]; then ssh -a $master tar --unlink -C ${buildroot} -xvf - tar -C ${chroot}/tmp -cf - packages | \ ssh -a $master tar --unlink -C ${buildroot}/${branch} -xvf - + ssh -a $master touch ${buildroot}/${branch}/packages/All/${pkgname}.tgz + ssh $master rm -f ${buildroot}/${branch}/logs/${pkgname}.log else scp ${chroot}/tmp/${pkgname}.log ${master}:${buildroot}/${branch}/logs/${pkgname}.log fi @@ -108,9 +117,11 @@ umount -f ${chroot}/usr/ports umount -f ${chroot}/usr/opt/doc umount -f ${chroot}/usr/src -if ! rm -rf ${chroot} >/dev/null 2>&1; then - chflags -R noschg ${chroot} - rm -rf ${chroot} >/dev/null 2>&1 +if [ $noclean != 1 ]; then + if ! rm -rf ${chroot} >/dev/null 2>&1; then + chflags -R noschg ${chroot} + rm -rf ${chroot} >/dev/null 2>&1 + fi fi echo -n "$pkgname done on $(hostname -s) at " -- cgit v1.1