Clearcase and java process : changing view does no

2019-02-20 04:30发布

问题:

i have a simple application, which receives input from a user for a CC stream name, and is suppose to return the content of a specific file from this stream repository.

I have tried doing this using a simple shell script: user enters stream name, java receives stream name, runs a process which runs a script "myccscript.sh" which contains "myinput=$1; cleartool setview $myinput" (or something like that).

then i try reading the file and printing it's content in the java side. BUT, after the process is finished - the view is not the view from the user input - that environment was probably only valid for the process Ive created.

how do i change the clearcase view to the main java process? Thanks!

回答1:

Don't use cleartool setview. It spawns a sub-shell which will make all your other command not working (since they are executed in the parent shell)

Always use the full path of a dynamic view:

/view/aView/vobs/aVob/....

You will find the very same issue (and the very same advice "don't use setview") in:

  • "Dynamic views of ClearCase not integrating in Jenkins"
  • "using SSH to run a cleartool command with agruments on remote a linux machine"
  • "script doesn't run while executing in clearcase"

You will find a concrete example of that issue in "Python and ClearCase setview".