🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #72210

RCS 5.5, how can I tell if it's locked

#72210
From: Garry J. Garrett
Date: Fri, 13 Mar 1992 20:02
35 lines
2112 bytes
I am writing a makefile to install some files.  The makefile should checkin
what the user currently has (as a backup copy), and copy the new file over.
If the user already has his/her files backed up in RCS, then I want to
checkin his/her file if it has been checked out.  Normally I check to see
if $HOME/RCS/file,v exists.  If it does, then I check to see if the file
$HOME/file is writeable.  The problem is that many of the programs that use
this file need to write to it, and they will perform a chmod to make the
file writeable by user.  In other words, just because I have write permissions
that does no mean that the file was checked out with a lock.

I am trying to find some command (like test) that I could put in an expression
that would tell me if the file has been locked.  For instance:

if ! rcslock $HOME/file ; then \
	co -l $HOME/file \
fi;

Is there any way to use some of the RCS functions to perform this task?  I.E.
do any of the RCS funtions return true if a file is locked and false otherwise
(or vice versa)?

I am using RCS 5.5 (I have a copy of RCS 5.6, but haven't uudecoded it yet).

If anyone has the answer to this, let me know.  I would prefer e-mail as I
rarely get time to get onto usenet.

Thanks.

Garry Garrett
garry@ceco.ceco.com
-- 
# Garry Garrett, P&EIS		(Me?  Speak for CECo?  I get into enough
# Commonwealth Edison Co.         trouble speaking for myself!) 
# P.O. Box 767, Rm 1139G G.O.   UUCP: ...!uunet!ceco.ceco.com!garry
# Chicago, IL 60690-0767	Internet: garry@ceco.ceco.com
Technical Details
Message-ID: <722@ceco.ceco.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!ceco!garry

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1025b4,3dda1d1885c831f2,start
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1992-03-13 14:24:48 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!ceco!garry
From: garry@ceco.ceco.com (Garry J. Garrett)
Newsgroups: gnu.misc.discuss
Subject: RCS 5.5, how can I tell if it's locked
Summary: How do I tell (in a shell script) if a file has been locked?
Keywords: RCS locked
Message-ID: <722@ceco.ceco.com>
Date: 13 Mar 92 20:02:56 GMT
Organization: Commonwealth Edison Co., Chicago, IL
Lines: 35