#!/bin/sh

for x in */ ; do
  NAME=${x%/}
  SHORTNAME=${NAME:0:4}
  SHORTNAME=${SHORTNAME//[-_0-9]/}
  mkdir -p $NAME/plugins
  sed -e 's/%NAME%/'$SHORTNAME'/g' bugzilla.py.tmpl > $NAME/plugins/bugzilla.py
  rm -f $NAME/plugins/bugzilla.pyc
  chown apache:svn $NAME/plugins
  echo $NAME ok
done

