clearcase ucm baseline

2019-01-29 03:54发布

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 .

2条回答
\"骚年 ilove
2楼-- · 2019-01-29 04:39

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/ .*//"
查看更多
贼婆χ
3楼-- · 2019-01-29 04:57

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.

查看更多
登录 后发表回答