#!/bin/sh ONLY_INSTALLED=1 check_single_port() { local PORT PORT=${1} if grep "^ONLY_FOR_ARCHS=" ${PORT}/Makefile >/dev/null; then echo "${PORT}: `grep \"^ONLY_FOR_ARCHS=\" ${PORT}/Makefile`" | \ sed 's/ONLY_FOR_ARCHS=//' fi } while getopts "a" CARG do case ${CARG} in a) ONLY_INSTALLED=0 ;; esac done cd /usr/ports if [ ${ONLY_INSTALLED} -eq 1 ] ; then echo "checking installed ports for ARCHS..." pkg_info -qo '*' | \ while read PORT ; do check_single_port ${PORT} done else echo "checking all ports for ARCHS..." CMD="echo */*" for DIR in * ; do [ -d ${DIR} ] && for PORT in ${DIR}/* ; do [ -d ${PORT} -a -f ${PORT}/Makefile ] && \ check_single_port ${PORT} done done fi