couldn't you write a 'lock' file into the cvsroot of the repository and then
delete it when the script ends...  That way when the script runs it checks
for the lock file first... if it's there it means the script is already
running (unless it dies last time before it deleted the lock)...

GaRy....

Gilles-Eric Descamps wrote:
> 
> Hi,
> 
> We're using CVS in pserver mode.
> We're using tags for our release mechanism.
> 
> Before tagging a file, I have written a script
> that checks that there is not a more recent version
> of that file already with that tag in the repository.
> 
> However, my script is not atomic.
> If two person try to run it together, the check
> for a more recent version will take too much time,
> specially as the users tag a whole directory.
> 
> How can I acquire a named lock in the CVS repository ?
> 
> I'd like to have only one user at a time able to run
> this script for release "Rel_3".
> So, I could border my script by:
> getlock ("Rel_3");
> verify ();
> tag ();
> leavelock ("Rel_3");
> 
> Thanks,
> 
> 
> --
> Gilles-Eric DESCAMPS,      Voice: (408) 545-1130
> SILICON ACCESS                Fax: (419) 844-7467
> <     Enabling the Next Generation Internet    >
> 2801A Orchard Parkway - San Jose, CA, 95134-2013
> mailto:[EMAIL PROTECTED]
> "Sed quis custodiet ipsos custodes ?"
> 
> 

-- 
Gary Pinkham                          
Reasoning, Inc.                         
One New England Executive Park          
Burlington, MA 01803                    Email: [EMAIL PROTECTED]

Reply via email to