#!/bin/sh usage () { echo "usage: makerestr 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 . ${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 builddir=${pbd}/${arch}/${branch}/builds/${buildid} buildenv ${pbd} ${arch} ${branch} ${builddir} unset DISPLAY export __MAKE_SHELL=/rescue/sh export LOCALBASE=/nonexistentlocal export LINUXBASE=/nonexistentlinux export PKG_DBDIR=/nonexistentpkg export PORT_DBDIR=/nonexistentport RESTR_PORTS=. if [ -n "$target" ]; then if [ -f "$target" ]; then RESTR_PORTS=$(grep -v "^#" $target | tr '\n' ' ') else echo "File $target doesn't exist. Exiting." exit 1 fi fi cd ${PORTSDIR} (for i in ${RESTR_PORTS}; do cd ${PORTSDIR}/$i make -j4 ECHO_MSG=true clean-restricted-list \ | sed -e "s!/usr/ports/packages/!${builddir}/packages/!g" \ -e "s!/usr/ports/!${builddir}/ports/!g" done) > ${builddir}/restricted.sh 2> /dev/null