#!/bin/bash

for i in `sudo repoquery --repoid=fedora --queryformat "%{GROUP}: %{NAME}\n" -qa | \
         grep Amusements/Games | \
         cut -d ' ' -f 2`; do
    grep -q $i ~/projects/fedora/comps/comps-f13.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|lsnipes|npush|ninvaders|inksmoto|eboard|bam)
                 ;;
             poker2d-kde|torcs-robots|geoqo|geekcode|FlightGear-Atlas|cfdg-fe)
                 ;;
             dopewars-sdl|gnurobots|mnemosyne|moon-buggy|springlobby)
                 ;;
             robotfindskitten|mmapper)
                 ;;
             childsplay-alphabet_sounds_*|drascula-??)
                 ;;
             *)
                 # if its required by something assume we don't need it in
                 # comps
                 if [ -z "`sudo repoquery -q --whatrequires $i`" ]; then
                     echo $i
                 fi
                 ;;
         esac
    fi
done
