#!/bin/sh
#
# Copyright 2008-2009 OpenCSW
#
# Redistribution and/or use, with or without modification, is
# permitted. This software is without warranty of any kind. The
# author(s) shall not be liable in the event that use of the
# software causes damage.
#
# gar.svn.mk - Targets for working with svn

# Read the comma separated ignores from stdin and merges it with any existing 
# ignores set on the directory.

ignores=`mktemp`-ignores
existing_ignores=`mktemp`-existing
new_ignores=`mktemp`-new

while [ "$1" != "" ]; do
  echo $1 >> $ignores
  shift
done

svn pg svn:ignore . > $existing_ignores
cat $ignores $existing_ignores | sort | uniq > $new_ignores
svn ps svn:ignore . -F $new_ignores

rm -rf $ignores $existing_ignores $new_ignores
