如何使用cleartool为每个组件找到root [文件夹]? [英] how to find root[folder] for each component using cleartool?

查看:62
本文介绍了如何使用cleartool为每个组件找到root [文件夹]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查找与组件关联的根文件夹?

How to find root folder in which a component is associated?

我可以通过Project Explorer-> Components-> properties手动找到它

I am able to find it manually through project explorer -> Components-> properties

如何使用cleartool命令执行此操作。我需要它,因为我需要创建可在基本Clearcase视图中应用的配置规范并查看UCM视图内容。

How to do it using cleartool command. I need it as i need to create config spec which can be applied in base clearcase view and view the UCM view contents.

推荐答案

看看设置命令输出的格式字符串选项(fmt_ccase)

 cleartool descr -fmt "%[root_dir]p" component:aComponent@\aPVob

您可以可以通过这种方式进入根目录(通常是 \aVob 用于 vob组件或 \aVob\aRootDir

You can get that way to root directory (usually \aVob for "vob component" or "\aVob\aRootDir" for components within a Vob).

从此处开始,用于管理对中UCM组件的特定基准的访问非UCM 视图,则可以采用类似于 在perl脚本中从项目合并到非UCM分支(已完成合并,但是您可以对其进行修改,以便为所述非UCM视图建立配置规范):

From there, for managing access to specific baselines of UCM components in non-UCM views, you can follow an approach similar to "Merging from a Project to a Non-UCM Branch" in a perl script (done to merge, but you can adapt it, in order to build a config spec for said non-UCM view):

下面的脚本适用于使用推荐基准的项目,并以使用 %[root_dir] p 。

如果不使用建议的基准,则只需列出给定流的所有组件:

cleartool descr -fmt%[组件] CXp stream:aStream @ \aPVob

This script below is for projects which uses recommended baselines, and is given as an example of using the "%[root_dir]p".
If you don't use recommended baselines, you would simply list all components for a given stream:
cleartool descr -fmt "%[components]CXp" stream:aStream@\aPVob

print("######## Getting recommended baselines for project 
'$project'\n");
my @recbls = split(' ', ‘cleartool lsproject -fmt "%[rec_bls]p" 
$project‘);

foreach $bl (@recbls) {

    my $comp = ‘cleartool lsbl -fmt "%[component]p" $bl‘;
    my $vob = ‘cleartool lscomp -fmt "%[root_dir]p" $comp‘;

    #... build your config spec there
}
# call cleartool setsc there

然后您将生成(并应用于配置规范)类似于您其他问题的文件 使用 setcs 命令时,公文包配置规范的行为很奇怪。

You would then generate (and apply to a config spec) a file similar to your other question "Clearcase config spec behaves odd when using setcs command".

OP报告使用Powershell使这种方法有效:

(他最初从IBM复制了我的示例问题网站,其中连字符减号<-'被非ASCII减号<'代替:,'-vs. –:-':请参阅 您找到并修复的最棘手的错误是什么?):

The OP reports getting this approach working, using Powershell:
(he had initally issues with my example copied form the IBM site, where hyphens-minus '-' are replaced by non-ASCII minus '': , '- vs. –: -–': see "What's the toughest bug you ever found and fixed?"):

$project="MyComponents@\My_PVOB" 
$pvob="@\My_PVOB" 
$Baselines=(cleartool lsproject -fmt "%[rec_bls]p" $project).split() 
foreach ($bl in $Baselines) { 
  $comp=cleartool lsbl -fmt "%[component]p" $bl"$pvob" 
  $vob = cleartool lscomp -fmt "%[root_dir]p" $comp"$pvob" 
}

这篇关于如何使用cleartool为每个组件找到root [文件夹]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆