#!/bin/sh
#
# This file should only be run automatically by make, not directly by
# the user.
#
# This script is part of the SUIF version control system.  It takes
# one argument, the name of an attribute.  It writes to standard
# output the version numbers of all versions with that attribute.

if (test ${1}"" = "") ; then
    echo "no attribute specified" 1>&2
    exit 1
fi

ver_cat_database > /dev/null
    if (test ${?} != 0) ; then
        exit 1
    fi

ver_cat_database | awk '/^[0-9]/ {for (i = 2; i <= NF; ++i)
                                      if ($i == "('${1}')")
                                          print $1}' | cut -f1 -d":"
exit ${?}
