通过 PowerShell 访问 ClearCase 中的文件
我正在尝试使用 PowerShell 从 ClearCase 复制一些文件。我不需要实际检查它们 - 这是构建过程的一部分,所以我只想能够获取它们的副本。
我的猜测是我需要使用cleartool,也许与“find”一起使用,但我在实际获取我想要的文件时遇到了困难。无论我使用什么“路径”,我总是收到错误消息。例如:
cleartool find My_VOB\A_Folder\A_Subfolder -print
给我错误消息“没有这样的文件或目录。”
我正在努力使我们开发组中的每个人都可以重用此脚本,因此我不希望将其与任何特定视图绑定。我是否需要动态创建视图才能使用 ClearCase?
I am trying to copy some files out of ClearCase using PowerShell. I don't need to actually check them out - it's part of a build process, so I just want to be able to grab copies of them.
My guess is that I need to use cleartool, perhaps with "find", but I'm having trouble actually getting to the files that I want. No matter what "paths" I use I always get an error message. For example:
cleartool find My_VOB\A_Folder\A_Subfolder -print
gives me the error message, "No such file or directory."
I'm trying to make this script reusable by everyone in our development group, so I'd prefer not to have it tied to any specific view. Do I need to create a view on the fly to work with ClearCase?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你想复制文件,你需要一个视图来访问它们。
(这就是 ClearCase 视图,动态或快照,用于:访问文件的特定版本)
该视图要么存在(并且其根路径作为参数传递),要么不存在(在这种情况下,我强烈建议使用此类的动态视图(如果阅读访问))
即使 cleartool find 可以列出当前视图中不可见的版本,它仍然需要一个视图作为起点。
这篇 IBM 文章“其他示例中提供了许多其他查找示例
cleartool find
命令”。此线程列出了“没有此类文件或目录”错误消息。
(就像在私有目录中一样,如“非版本化目录”中)
此案例显示了使用 CAL 的 Powershell 脚本示例(ClearCase 自动化库)
If you want to copy files, you need a view to access them.
(That is what a ClearCase view, either dynamic or snapshot, is for: accessing specific versions of files)
Either that view exists (and its root path is passed as a parameter) or it don't (in which case I strongly recommend a dynamic view for those kind if reading access)
Even though a cleartool find can list versions not visible in the current view, it still needs a view as a starting point.
A lot of other find examples are available in this IBM article "Additional examples of the
cleartool find
command".This thread lists some causes for the "no such file or directory" error message.
(like being in a private directory, as in "non-versionned directory")
This case shows an example of Powershell script using CAL (the ClearCase Automation Library)
您肯定需要一个视图,并确保 VOB 已安装。
You definitely need a view, and make sure the VOB is mounted.