clearcase ucm baseline

两盒软妹~` 提交于 2019-12-29 09:22:07

问题


Is there any way to get the composte baseline information from the current view in command line .

I am using the comand in my script. It's displaying the list of the commands which include composite and ovverride component baselines in my view .

cleartool lsstream -fmt "%[found_bls]NXp\n" -view $VIEW_NAME

I need only the composite baseline as output for my command.

Is there any command to findout the composite baseline in current view ? pls help .


回答1:


I guess your composite baselines are rootless components, so you can check the components and display only rootless. You can use cleartool describe for that.




回答2:


A composite baseline can list its immediate dependencies, so as described in this script, you can attempt to list those for each baselines.
the one that does return an output (without error) is your composite baseline.

cleartool describe -fmt "%[depends_on]Np\n" {baseline selector}

However, building on my previous answer about "search the output line and save in variable", what you can do is describe each baseline, asking for its dependencies, and grepping for the line which contains an arobase '@':
Only composite baselines will return fully qualified baseline names, with arobase in it, as opposed to a non-composite baseline, which will return... nothing)

cleartool lsstream -fmt "%[found_bls]CXp" -view $VIEW_NAME | tr -s " " "\012" | xargs cleartool descr -fmt "%n %[depends_on]Cp" | grep "@" | sed -e "s/ .*//"

For more visibility:

cleartool lsstream -fmt "%[found_bls]CXp" -view $VIEW_NAME \
| tr -s " " "\012" 
| xargs cleartool descr -fmt "%n %[depends_on]Cp" 
| grep "@" | sed -e "s/ .*//"


来源:https://stackoverflow.com/questions/9528091/clearcase-ucm-baseline

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