#! /bin/sh
#
# $FreeBSD: tagcheck,v 1.16 2009/08/11 21:27:59 simon Exp $


# TAG  add/mov/del  repo  files...
# $1   $2           $3    $4   ...

case "$1" in
  RELENG*)
    ;;
  RELEASE*)
    ;;
  *)
    echo "Tags are disabled for the move to subversion." 1>&2
    exit 1
    ;;
esac

USER=`/usr/bin/id -un`
case "$USER" in
  peter | kensmith | simon)
    exit 0	# ok
    ;;
  *)
    echo "$USER does not have permission to perform this tag operation!" 1>&2
    echo "RELENG* tag operations are reserved for release engineering!" 1>&2
    echo "RELEASE* tag operations are reserved for portmgr and doceng!" 1>&2
    echo "Use 'cvs add' or 'cvs rm' to add/remove files from branches!" 1>&2
    echo "$*" | /usr/bin/mail -s "NCVS TAG" ncvs
    exit 1
    ;;
esac
