如何:移动符号链接并保持目标
我需要在动态视图中移动 VOB 内的多个符号链接。
正如我的上一个问题中所述,这并不是那么简单正如它听起来(对我来说),因为目标路径是相对于链接本身保存的,而不是相对于 VOB 根或类似的东西保存的。如果 ClearCase 会调整这些链接中的路径信息,这不会是一个大问题,但从表面上看,它不会。
详细信息:假设以下文件夹结构:
/myVOB
/Originals
/LinksA
/SubDir
/LinksB
然后将位于 myVOB/LinksB
中的文件 myVOB/Originals/readme.txt
的链接移动到 myVOB/LinksA /SubDir
将阻止链接找到其目标,因为它正在寻找 myVOB/LinksA/SubDir/../Originals/readme.txt
。
有谁知道是否可以告诉 ClearCase 在移动符号链接时调整路径?通常我认为这应该是开箱即用的,但人们永远不会知道 ClearCase...尽管如此,也许有人可以尝试重现这一点并告诉我它是否成功,也许这只是我系统上的一个错误?
编辑:好的,看起来不支持开箱即用的移动相对符号链接。我是否需要移动大量符号链接,我现在正在编写一个脚本,该脚本需要许多文件/目录并将它们移动到新位置。如果它遇到符号链接(其目标可能是文件或目录),它不会只调用cleartool mv 或其他命令,而是遵循 VonC 发布的过程。
但我不这样做,所以我可能会手动完成此操作。也许有人已经写了这样的脚本,那么这将是推广它的正确地方;)
I need to move multiple symlinks within a VOB in a dynamic view.
As described in my previous question, this is not as trivial as it sounds (to me), as the target path is saved relative to the link itself and not to the VOB root or anything like that. This wouldn't be a big issue, if ClearCase would adjust the path information in those links, but appearantly, it does not.
Details: Let's assume following folder structure:
/myVOB
/Originals
/LinksA
/SubDir
/LinksB
Then moving a link to the file myVOB/Originals/readme.txt
that is located in myVOB/LinksB
to myVOB/LinksA/SubDir
will prevent the link to find its target, as it is looking for myVOB/LinksA/SubDir/../Originals/readme.txt
.
Does anyone know if it is possible to tell ClearCase to adjust the paths when moving symlinks? Usually I would think this should be done out of the box, but one never knows with ClearCase... Nevertheless, perhaps someone could try to reproduce this and tell me if it succeeded or not, perhaps it's just a bug on my system?
Edit: OK, so it looks like moving relative symlinks is not supported out-of-the-box. Would I need to move a great number of symlinks, I'd be writing a script right now that took a number of files/directories and moved them to a new location. If it encountered a symlink (whose target may be a file or directory) it would not just call cleartool mv
or whatever, but follow the procedure as posted by VonC.
But I don't, so I'll probably do this by hand. Perhaps someone already wrote such a script, then this would be the right place to promote it ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您考虑有关“如何在 ClearCase 互操作中管理符号链接”的技术说明,看来:
(即使您不在互操作环境中,即即使您的 Windows 视图和 Vob 服务器都在 Windows 上)
If you consider this technote on "How to Manage symbolic links in ClearCase interop, it seems that:
(even if you aren't in an interop environment, ie even if your Windows views and Vob server are both on Windows)