#!/bin/bash function die() { exit ${1:-1} } function error() { echo "$@" >&2 die 1 } PORTAGEQ="/usr/bin/portageq" [ -z "$( type -p $PORTAGEQ )" ] && error "portageq missing - Please merge sys-apps/portage" SEARCHPATH="$( portageq vdb_path )" [ -d "$SEARCHPATH" ] || unset SEARCHPATH SEARCHPATH="${SEARCHPATH:-/var/db/pkg/}" # We'll assume that the only packages containing "~x86" are going to be testing ones... find "$SEARCHPATH" -name "*.ebuild" -type f | xargs grep "KEYWORDS=.*~x86" | \ sed "s|$SEARCHPATH|| ; s|^/||" | cut -d"/" -f1,2 | sort | uniq exit $?