#/bin/sh

PROGNAME=`basename $0`
THISDIR=`dirname $0`

SPACES=$*

if [ ! "$SPACES" ]; then
	echo "$PROGNAME <space directory>..."
	exit 1
fi

TMPFILE=`python -W ignore::RuntimeWarning -c 'import os; print os.tmpnam()'`

  cat `find $SPACES -name MOIN_PACKAGE` \
| grep AddRevision \
| cut -f 4 -d '|' \
| grep -v '^$' \
> "$TMPFILE"

  cat `find $SPACES -name MOIN_PACKAGE` \
| grep AddAttachment \
| cut -f 5 -d '|' \
| grep -v '^$' \
>> "$TMPFILE"

sort -u "$TMPFILE" && rm "$TMPFILE"
