summaryrefslogtreecommitdiff
path: root/pkgtools/tinderbox-dragonfly/files/bulk_hook_1.sh.in
blob: d5881356b43620678e955bf82422f17e74597928 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#/bin/sh
#
# Bulk Build, PostPortBuild Hook
# When executed, this hook will remove the built port from the
# ${BULKTMP}/bulk_${BUILD}.queue.  If the built port matches
# the ${BULKTMP}/bulk_${BUILD}.active file, then the nextport
# on the bulk build will be added to the queue.
#

PB=@TINROOT@
BULKTMP=/tmp

if [ -z "{BUILD}" ]; then
   echo "BUILD envvar not defined."
   exit
fi

if [ -z "{PORTDIR}" ]; then
   echo "PORTDIR envvar not defined."
   exit
fi

echo "${PORTDIR} (${PACKAGE_NAME}: ${STATUS})" >> ${BULKTMP}/bulk_${BUILD}.processed
QLIST=`${PB}/scripts/tc listBuildPortsQueue -b ${BUILD} | grep " ${PORTDIR} "`
if [ -n "${QLIST}" ]; then
	${PB}/scripts/tc rmBuildPortsQueueEntry -b ${BUILD} -d ${PORTDIR}
fi

SPORTDIR=`echo ${PORTDIR} | sed "s|/|\\\\\\/|g"`
if [ -n "${SPORTDIR}" ]; then
	sed "/^${SPORTDIR}\$/d" ${BULKTMP}/bulk_${BUILD}.queue > ${BULKTMP}/bulk_${BUILD}.queue.tmp
	mv ${BULKTMP}/bulk_${BUILD}.queue.tmp ${BULKTMP}/bulk_${BUILD}.queue
fi

if [ -f ${BULKTMP}/bulk_${BUILD}.active ]; then
   ACTIVEPORT=`cat ${BULKTMP}/bulk_${BUILD}.active`
   if [ "${ACTIVEPORT}" = "${PORTDIR}" ]; then
      rm ${BULKTMP}/bulk_${BUILD}.active
      ${PB}/scripts/contrib/bulk/bulkbuild.sh nextport ${BUILD}
   fi
fi