forked from Lainports/freebsd-ports
47 lines
984 B
Bash
Executable file
47 lines
984 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# buildsuccess <arch> <branch> <buildid> <pkgname>
|
|
|
|
# configurable variables
|
|
pb=/var/portbuild
|
|
|
|
usage () {
|
|
echo "usage: buildsuccess arch branch buildid pkgname"
|
|
exit 1
|
|
}
|
|
|
|
if [ $# -ne 4 ]; then
|
|
usage
|
|
fi
|
|
|
|
arch=$1
|
|
branch=$2
|
|
buildid=$3
|
|
pkgname=$4
|
|
shift 4
|
|
|
|
builddir=${pb}/${arch}/${branch}/builds/${buildid}
|
|
|
|
. ${pb}/${arch}/portbuild.conf
|
|
. ${pb}/scripts/buildenv
|
|
|
|
buildenv ${pb} ${arch} ${branch} ${builddir}
|
|
|
|
# Don't pick up installed packages from the host
|
|
export LOCALBASE=/nonexistentlocal
|
|
export X11BASE=/nonexistentx
|
|
|
|
index=${PORTSDIR}/${INDEXFILE}
|
|
|
|
portloc=$(grep "^$pkgname|" ${index} | cut -f 2 -d \| | sed s,/usr/ports/,,)
|
|
|
|
cd ${pb}/${arch}/${branch}
|
|
if grep -q "^${portloc}|" failure; then
|
|
echo | mail -s "${pkgname} now builds on ${arch} ${branch}" ${mailto}
|
|
grep -v "^${portloc}|" failure > failure.new
|
|
mv failure.new failure
|
|
fi
|
|
|
|
if [ -L ${pb}/${arch}/${branch}/latest/${portloc} ]; then
|
|
rm -f ${pb}/${arch}/${branch}/latest/${portloc}
|
|
fi
|