Add line to ClearCase config

三世轮回 提交于 2019-12-07 12:35:31

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!