info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: (bug?) cvs returning wrong exit status, depending on # of TA Gs?


From: Alleman, Lowell
Subject: RE: (bug?) cvs returning wrong exit status, depending on # of TA Gs?
Date: Tue, 3 Jul 2001 19:50:12 -0400

Ok, After some more playing around I'm beginning to think that this is not a
bug at all but rather a "feature"  (figures, I never get to find really cool
bugs..)..  but a feature that I really need to disable!


apparently, cvs will check all tags again the CVSROOT/val-tags file, and if
I request a tag with is in val-tags but not in the file that I'm requesting,
then cvs will send back nothing, and exit with a status of 0.  (This is when
running in pipe "-p" mode.)

Is there a way around this "feature"?  What is the easiest way of checking
if a flag exists for a particular file?  Or do I have to do something like
this:

        # (Searching for a tag named $TAG)
        if [ $$(`cvs log CVS-Dir/file | grep "$TAG" | wc -l`)) -gt 0 ] ;
then
                echo "$TAG exists"
        else
                echo "No $TAG! in CVS"
        fi

Isn't there some built-in way of checking for a tag within a file?




> -----Original Message-----
> From: Alleman, Lowell [SMTP:address@hidden
> Sent: Tuesday, July 03, 2001 5:44 PM
> To:   address@hidden
> Subject:      (bug?)  cvs returning wrong exit status, depending on # of
> TAGs?
> 
> 
> Hey,
> 
> 
> I wrote a bash script that will retrieve a specified version/tag of a CVS
> file without using a sandbox.  I added the option of falling back to the
> "HEAD" tag when the requested version was not available  (by checking to
> see
> if  "cvs checkout " was successful (0) or not.) 
> 
> The problem is that CVS appears to always return 0 when there are no user
> tags defined in a CVS file.  (This is probably depended on other options
> as
> well ("-p" p" piping file to STDOUT  and/or  "-kb"  using binary
> mode......
> Of course, that's assuming that I'm not just missing some something really
> obvious.)
> 
> 
> 
> Here is essentially what I tried:  (I renamed the tags/files)
> 
>       cvs checkout -p -kb -r MY_TAG CVS-DIR/my-file >  output.file    ||
>       cvs checkout -p -kb -r HEAD CVS-DIR/my-file >  output.file
> 
> The   "CVS-DIR/my-file" did not contain the MY_TAG tag, so the first
> command
> should fail, causing the second command to get the "HEAD" version. But,
> what
> I found is that the first command would exit successfully (without as much
> as a warning message, or any of the normal CVS file header information on
> STDERR as you would normally get using the "-p" option.), meaning that the
> second command would never execute (leaving me with an empty file.  And
> many
> hours of confusion...)
> 
> Then I added a tag to the CVS file:   (from  "CVS-DIR/"  in my local
> sandbox)
> 
>       cvs tag JUST_A_TAG my-file
> 
> At this point I re-ran the "cvs checkout" that I had originally tried.  It
> worked fine now.
> 
> 
> Is this correct behavior, or a bug on in CVS?  I just want to make sure
> this
> is NOT how CVS is supposed to work, before I bother the CVS bug/devel
> mailing list.
> 
> 
> 
> 
> 
> Thanks in advance,
> 
> Lowell C. Alleman
> address@hidden
> Martin's Famous Pastry Shoppe
> 
> 
> _______________________________________________
> Info-cvs mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/info-cvs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]