#!/bin/sh usage () { echo "usage: makeduds arch branch buildid [target]" exit 1 } if [ $# -lt 3 ]; then usage fi # configurable variables pbc=${PORTBUILD_CHECKOUT:-/a/portbuild} pbd=${PORTBUILD_DATA:-/a/portbuild} arch=$1 branch=$2 buildid=$3 target=$4 builddir=${pbd}/${arch}/${branch}/builds/${buildid} . ${pbc}/conf/server.conf . ${pbc}/conf/common.conf . ${pbd}/${arch}/portbuild.conf if [ -f ${pbd}/${arch}/${branch}/builds/${buildid}/portbuild.conf ]; then . ${pbd}/${arch}/${branch}/builds/${buildid}/portbuild.conf fi . ${pbc}/scripts/buildenv # -j# to make duds DUDSJOBS=4 buildenv ${pbd} ${arch} ${branch} ${builddir} duds=${builddir}/duds index=${PORTSDIR}/${INDEXFILE} unset DISPLAY export __MAKE_SHELL=/rescue/sh export LOCALBASE=/nonexistentlocal export LINUXBASE=/nonexistentlinux export PKG_DBDIR=/nonexistentpkg export PORT_DBDIR=/nonexistentport DUDS_PORTS=. if [ -n "$target" ]; then if [ -f "$target" ]; then DUDS_PORTS=$(grep -v "^#" $target | tr '\n' ' ') else echo "File $target doesn't exist. Exiting." exit 1 fi fi cd ${PORTSDIR} (for i in ${DUDS_PORTS}; do cd ${PORTSDIR}/$i make -j${DUDSJOBS} ignorelist-verbose ECHO_MSG=true done) > ${duds}.verbose 2> /dev/null || exit 1 sort ${duds}.verbose > ${duds}.verbose.tmp mv -f ${duds}.verbose.tmp ${duds}.verbose cut -f 1 -d \| ${duds}.verbose > ${duds} cp ${duds} ${duds}.orig grep -Ff ${duds}.orig ${index} | cut -f 1 -d \| > ${duds}.full cat ${duds} ${duds}.full | sort | uniq -u | sed -e "s@\$@|IGNORE: dependent port@" > ${duds}.full.verbose.tmp cat ${duds}.verbose ${duds}.full.verbose.tmp | sort > ${duds}.full.verbose rm ${duds}.full.verbose.tmp