Once your ClearCase view is created you need to get its config spec as a file with cleartool edcs
cd /path/to/view
cleartool catcs > cs
You need to adds your selection rules before the default one: as mentioned in config spec
Because the rules in a config spec are processed in order, varying the order may affect version selection. For example, suppose this rule appears near the beginning of a config spec:
element * /main/LATEST
Any subsequent rules in the config spec will never be used, because the rule always provides a match; every element has a most recent version on its main branch.
Note:
The order in which the load rules for a snapshot view are specified is not important.
To script that, please see "Using sed
, Insert a line below (or above) the pattern?".
Another option: see "How to insert the content of a file into another file before a pattern (marker)?".
Put your additional lines into a file named othercs
.
#!/bin/bash
while IFS= read -r line
do
if [[ "$line" =~ .*CHECKEDOUT.*$ ]]
then
cat othercs
fi
echo "$line"
done < cs
Once that is done, you can append any additional load rules you want (if you are using a snapshot view, since a dynamic view has no load rules)
Finally, once the cs file has the right selection/load rules, you set it back to the current view with cleartool setcs
.
cleartool setcs -tag view-tag cs
^
|
name of the file you have modified