Reputation: 3779
Because ClearCase updates directory version numbers when files inside are created, our config-spec generating script is failing (details omitted).
So, as an example, given a file such as "/proj/src/scripts/build.sh@@/main/branch42/3", how can we determine the latest version of the scripts directory that contains that version of the build.sh file.
Note: we're looking for a unix command-line solution that can be scripted.
Upvotes: 1
Views: 793
Reputation: 1323553
Another approach is to:
element * SCRIPT_LABEL element /proj/... .../branch42/LATEST
That way, you simply read the information you need from that second dynamic view.
Upvotes: 1
Reputation: 28180
If you do a ls /proj/src/scripts@@/main/branch42/*/build.sh/main/branch42/3
you should get a list of all versions of the scripts
directory that contain version .../3
of build.sh
. Then you should be able to pick out the latest of those.
The above is probably not a fool proof approach, so you might try something more like
cleartool find /proj/src/scripts --allversions --nonvisible -name build.sh -version 'brtype(branch42) && version(3)' -print
(I no longer have a clearcase environment to test in, so the above is from memory and is not an accurate command)
Upvotes: 1