[Top][All Lists]

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

RE: loginfo parameters

From: CORUM, M E [AG/1000]
Subject: RE: loginfo parameters
Date: Wed, 15 Aug 2001 18:34:23 -0500


loginfo is not a shell script itself.  It calls shell scripts with
parameters that are created internally by CVS and over which I appear
to have no control.  The problem is not that it doesn't handle the
spaces correctly.  The problem is that the parameter generated internally
by CVS for the file name has the directory (with the last slash missing
which is the critical point) followed by a single space followed by
the file name (which has spaces).  If the last directory level before
the (missing) slash just before the file name has spaces and the file
name has spaces, there is no way I know of in simple parsing to figure
out what constitutes directory path and what is file name.  Another 
example may help:

I do a commit on:  
/project/docs/use cases/my use case.doc

CVS internally generates (through the %s parm): 
/project/docs/use cases my use case.doc
(Note the missing slash between "use cases" and "my use case.doc")

Now, my script (a simple Bourne shell script) that is called by
loginfo doesn't know what to make of this.  Should the last directory
level be:
/project/docs/use cases my use
/project/docs/use cases my
/project/docs/use cases

Should the file name be:
cases my use case.doc
my use case.doc
use case.doc

The loginfo doc says that my script should expect something on 
standard input.  If I do a read in my Bourne shell script, I get an
error about a broken pipe (meaning standard input had nothing) and
nothing is read into the variable.  It would be great if the commit
output I see on the screen would be sent into my shell script somehow
because the file name has the critical last slash in the directory
hierarchy before the file name itself.  Should I not be using the
read statement?  I don't know.  Thanks for replying.


-----Original Message-----
From: Jennifer Hamilton
To: CORUM, M E [AG/1000]; address@hidden
Sent: 8/15/01 6:17 PM
Subject: RE: loginfo parameters

If loginfo is a shell script, perhaps you use the escape character "\"
to show that the space should be used literally.

/project/docs/use\ cases/my\ use\ case.doc


-----Original Message-----
From: CORUM, M E [AG/1000] [mailto:address@hidden
Sent: Wednesday, August 15, 2001 3:46 PM
To: 'address@hidden'
Subject: loginfo parameters

I'm trying to use loginfo to run a script that exports a file out and
then copies it somewhere.  The problem is that the project team must
use spaces in its directories and file names.  When the parameter for
the file name (%s) comes into the script, the last slash is removed and
only a single space separates the directory from the file name.  If
both the directory and file name have spaces, there is no way to tell
where the directory ends and the file name begins:

/project/docs/use cases/my use case.doc

gets handed into the loginfo script as:

/project/docs/use cases my use case.doc

Can anybody help here?  Is there some secret way to have it just hand
in the directory in a parm?  I can't hard-code the directories into
the loginfo file because they will be adding new directories hourly
and I wouldn't be able to keep up with their requirements for adding
new lines into the loginfo script.  The online version of the Fogel
book implies that there are two spaces between the directory and the
list of files but that is not the case in 1.10.

Any help would be appreciated.


Info-cvs mailing list

reply via email to

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