How to use clearfsimport to import files into an empty VOB
I created a VOB and a snapshot view that loads it. The VOB is empty and I wanted to add some files to initialize it, but I got errors for all files that I wanted to import. Here is the details.
The VOB is created by this command:
ct mkvob -tag /vobs/sqlite -comment "testing VOB for Sqlite" -public /var/clearcase/vobs/sqlite.vbs
The view is created by this command:
ct mkview -tag sqlite-dev -snapshot /home/clearcase/working/sqlite-dev
The config spec is:
element * CHECKEDOUT
element * /main/LATEST
load /vobs/sqlite
I checked out the "vobs/sqlite".
In the view directory /home/clearcase/working/sqlite-dev
, I run clearfsimport
to import some files:
clearfsimport -rec /home/clearcase/tmp/sqlite-3.6.23.1/* vobs/sqlite
But I got errors for all files and directories. Fore example, for the file "VERSIONS", I saw errors like:
Creating element "vobs/sqlite/VERSION".
clearfsimport: Error: Unable to lookup "VERSION" in "/vobs/sqlite@@/main/CHECKEDOUT": no version selected in configuration specification.
clearfsimport: Error: Unable to access "/vobs/sqlite/VERSION": no version selected in configuration specification.
clearfsimport: Warning: Trouble updating name "VERSION" in snapshot view: error detected by ClearCase subsystem.
A separate update may need to be performed in order to reflect the results of the operation in the snapshot view.
clearfsimport: Warning: Unable to check if new version of "vobs/sqlite/VERSION" is identical.
clearfsimport: Warning: Element "vobs/sqlite/VERSION" is no longer being loaded and will not be updated as part of this operation.
version "/main/1".
Can anybody please point out what I did wrong here? Should I change the config spec somehow?
Updates after I tried VonC's answer.
Thanks for the response. I tried to run clearfsimport
again and I saw some different errors:
Validating directory "/home/clearcase/working/sqlite-dev/vobs/sqlite/tool".
clearfsimport: Error: Cannot checkout a directory when directory doesn't exist in the snapshot view.
clearfsimport: Error: Could not checkout directory "/home/clearcase/working/sqlite-dev/vobs/sqlite/tool".
Validating element "/home/clearcase/working/sqlite-dev/vobs/sqlite/VERSION".
clearfsimport: Error: Could not access "/home/clearcase/working/sqlite-dev/vobs/sqlite/VERSION".
clearfsimport: Warning: Trouble importing element "/home/clearcase/working/sqlite-dev/vobs/sqlite/VERSION".
tool
is a directory and VERSION
is a file. The same error happens to all files/directories.
The CC is installed on Linux, so I cannot try the ClearCase explorer.
I tried the full path but I saw the same errors.
I am running these command as root, I guess "-nset" won't help. I tried adding it but still saw the same error.
Are there other开发者_开发技巧 ways to add files if I only want to add them once?
- Try the
clearfsimport
without checkouting the vob first. - Try adding a file to the vob through the ClearCase explorer (just to see if it works)
- Try specifying the full path of the vob when clearfsimporting:
/home/clearcase/working/sqlite-dev/vobs/sqlite
Note: you can also use a dynamic view for this kind of operation (that avoid any "update view" error regarding the workspace, since a dynamic view has no need to update its -- network managed -- workspace)
See also "How can I use ClearCase to “add to source control …” recursively?" for more on the clearfsimport
options: the '-nset
' option might also be needed here.
精彩评论