diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2004-06-03 05:03:58 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2004-06-03 05:03:58 +0000 |
commit | fdbc9fa2c2868c49003a89744822978eccadd97d (patch) | |
tree | 1a9868b0f0a8b6ac71810328a640a25119645700 /Tools/portbuild | |
parent | 5daae0650cff0b81a0e01fd1225a04ef0649900b (diff) | |
download | ports-fdbc9fa2c2868c49003a89744822978eccadd97d.tar.gz ports-fdbc9fa2c2868c49003a89744822978eccadd97d.zip |
Notes
Diffstat (limited to 'Tools/portbuild')
-rwxr-xr-x | Tools/portbuild/scripts/dopackages.wrapper | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Tools/portbuild/scripts/dopackages.wrapper b/Tools/portbuild/scripts/dopackages.wrapper new file mode 100755 index 000000000000..fe19ad4452a9 --- /dev/null +++ b/Tools/portbuild/scripts/dopackages.wrapper @@ -0,0 +1,53 @@ +#!/bin/sh + +cleanup() { + lock=$1 + error=$2 + + rm -f ${lock} + + exit ${error} +} + +# configurable variables +pb=/var/portbuild +arch=$1 +branch=$(echo $(basename $0) | cut -d'.' -f2) +shift + +. ${pb}/${arch}/portbuild.conf + +lock=${pb}/${arch}/lock +status=${pb}/${arch}/status +date=$(date '+%Y%m%d%H') +shortdate=$(date '+%Y%m%d') + +if [ -e ${lock} ]; then + exit 1 +fi + +touch ${lock} +rm -f ${status} +mkdir -p ${pb}/${arch}/archive/buildlogs + +trap "cleanup ${lock} 1" 1 2 3 9 10 11 15 + +dorun() { + branch=$1 + shift 1 + + ln -sf ${pb}/${arch}/archive/buildlogs/log.${branch}.${date} ${pb}/${arch}/${branch}/build.log + ln -sf log.${branch}.${date} ${pb}/${arch}/archive/buildlogs/log.${branch}.${shortdate} + ${pb}/scripts/dopackages ${arch} $@ ${branch} ${date} 2>&1 \ + > ${pb}/${arch}/archive/buildlogs/log.${branch}.${date} + if [ -f ${status} ]; then + error=$(cat ${status}) + cleanup ${lock} ${error} + fi + +} + +dorun ${branch} $@ & +wait + +cleanup ${lock} 0 |