#!/bin/csh -f
# unlocklog -- unlock RCS directory locked by changelog.
# Use standard argument/env scheme for directory and lock name
# this script just checks in the rcs lock file that prevents two people
# from using the log scheme simultaneously.

    set usage = ($0 -d rcsdir -l lockfile)

    # uses same argument/environment/default scheme as changelog

    if ($?RCSDIR) then
	set RCSdir = $RCSDIR
    else
	set RCSdir = ./RCS
    endif

    if ($?RCSLOCK) then
	set rcslock = $RCSLOCK
    else
	set rcslock = RCSLock
    endif

    while ($#argv > 0)
	switch ($argv[1])
	case -d:
	    if ($#argv == 1) then
		echo RCS directory specifier missing
		echo usage: $usage
		exit (1)
	    endif
	    set RCSdir = $argv[2]
	    if ($dbug) echo RCSdir = $RCSdir
	    shift
	    breaksw
	case -l:
	    if ($#argv == 1) then
		echo lock file name missing
		echo usage: $usage
		exit (1)
	    endif
	    set rcslock = $argv[2]
	    if ($dbug) echo rcslock = $rcslock
	    shift
	    breaksw
	default:
	    echo usage: $usage
	endsw
	shift
    end

    echo Unlocking RCS directory: $RCSdir with lock: $rcslock

    # lock directory
    echo lock directory
    ci -f -m"checked in by unlockrcs"  $RCSdir/$rcslock $RCSdir/$rcslock,v

    # get rid of copy of lock, if any around
    'rm' -f $rcslock
