#! /bin/sh

###
### $Header: /home/gene/src/lisp-script/RCS/apply-release-label,v 1.1 2004/03/24 06:26:31 gene Exp $
###
### Copyright (c) 2004  Gene Michael Stover.  All rights reserved.
###
### This file is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.
### 
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
### 
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
### Apply a label to all elements of RCS.  The label has the
### release number in it.  The release number is automagically
### determined from the contents of the './version' file.
###

VER=`cat ./version`
TIME=`date "+%A, %d %B %Y"`
P=`pwd`

for D in `find . -name RCS -print`; do
    echo \(directory \"$D\"\)
    cd $D/..

    ## Make sure all the RCS files for this directory are
    ## checked-in.  Any file not checked-in will get checked-in,
    ## & any file already checked-in will get a warning message
    ## that we can ignore.
    ci -q "-mClean up before pushing a new branch & label." RCS/*

    ## Checkout all RCS files in this directory.
    co -q -l RCS/*

    ## Force a checkin, creating a new branch & label.
    ci -q -f -r$VER -nRelease_$VER "-mRelease $VER.  $TIME." -u RCS/*

    cd $P
done

### --- end of file ---
