#!/bin/bash

for i in `repoquery --repoid=fedora --queryformat "%{GROUP}: %{NAME}\n" -qa | \
         grep Amusements/Games | \
         cut -d ' ' -f 2`; do
    grep -q $i ~/projects/fedora-extras/comps/comps-f8.xml.in
    if [ "$?" != "0" ]; then
         # filter false positives
         case $i in
             *-editor)
                 ;;
             *-server)
                 ;;
             *-selinux)
                 ;;
             *-logwatch)
                 ;;
             fgfs-Atlas|xblast-x11|kanatest|rott-registered|fortune-firefly)
                 ;;
             cowsay|ifm|shippy-allegro|wesnoth-tools|armacycles-ad-dedicated)
                 ;;
             frotz|tetrinetx)
                 ;;
             *)
                 # if its required by something assume we don't need it in
                 # comps
                 if [ -z "`repoquery -q --whatrequires $i`" ]; then
                     echo $i
                 fi
                 ;;
         esac
    fi
done
