#!/bin/bash
# taken from cvs.php.net/functable by Harmut

if [ $# -ne 2 ] 
then
  echo 1>&2 "usage: $0 repository release-tag";
  exit 3;
fi
cvs -d ":pserver:cvsread@cvs.php.net:/repository" get -d $2 -r $2 $1 >/dev/null 2>&1 | grep -v Updating
find $2 -type f -and -not -name "*.[chly]" -and -not -name "*.ec" -and -not -name "*.lex" | xargs rm -f 
while ( find $2 -depth -type d -and -empty | xargs rm -r 2>/dev/null ) ; do true ; done
