r2 - 10 Jun 2008 - 10:28:35 - MarcGirodCmWiki  >  CM Web  >  ConfigurationManagement > SoftwareConfigurationManagement > MarcGirod  >  ClearFsImport

clearfsimport

clearfsimport is a relatively recent tool in the ClearCase toolset, to import and update a vob copy of a directory tree. It is mentioned in a couple of FAQ entries, such as 1.2.7 and 1.2.16.

clearfsimport has one alternative: ClearCase::SyncTree by David Boyce, from CPAN. It even looks like IBM/Rational keeps taking ideas from there to implement missing functionality into the former (e.g. the recent –upd/ates_only option).

By default, clearfsimport is meant to be used by the vob owner or a privileged user, but users often overlook the -nsetevent option, with which it may be used by any user. This option drives clearfsimport not to set the time stamps of elements to this of the source file object outside the vob (which requires privileged access). There is a minor non-obvious side-effect with this: once a version will have been created with a current time stamp, even the vob owner will not be able to import on top of it a version with an older (as it would be) time stamp, without this -nsetevent option. I.e. once you use this option, normal or privileged user, you are more or less bound to use it in the continuation.

Here is a transcript to demo the behaviour described above. This is run as vob owner:


$ ls -la /vob/test/foo
total 6
drwxr-xr-x    2 user1 group1         27 Jan 10 14:49 .
drwxr-xr-x    3 user1 group1         23 Jan 10 13:01 ..
-r--r--r--    1 user1 group1          6 Jan 10 14:49 foo.txt
$ echo foo >> foo/foo.txt
$ sudo touch -d 'Nov 11 2006' foo/foo.txt
$ sudo touch -d 'Nov 11 2006' foo
$ ls -la foo
total 12
drwxrwxrwx    2 user1 group1       4096 Nov 11  2006 .
drwxrwxrwx    3 user1 group1       4096 Jan 10 14:49 ..
-rwxrwxrwx    1 user1 group1          5 Nov 11  2006 foo.txt
$ clearfsimport -r . /vob/test
Validating directory "/vob/test".
Validating directory "/vob/test/foo".
Validating element "/vob/test/foo/foo.txt".
   Skipping element "/vob/test/foo/foo.txt", because version in VOB is newer.
Closing directories.
No change in version "/main/2" of directory "/vob/test/foo"
No change in version "/main/2" of directory "/vob/test"
$ clearfsimport -nset -r . /vob/test
Validating directory "/vob/test".
Validating directory "/vob/test/foo".
Validating element "/vob/test/foo/foo.txt".
   update version "/main/3".
Closing directories.
No change in version "/main/2" of directory "/vob/test/foo"
No change in version "/main/2" of directory "/vob/test"
$ ls -la /vob/test/foo
total 6
drwxr-xr-x    2 user1 group1         27 Jan 10 14:53 .
drwxr-xr-x    3 user1 group1         23 Jan 10 13:01 ..
-r--r--r--    1 user1 group1          6 Jan 10 14:53 foo.txt

-- MarcGirod - 21 Jan 2008

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions | key Log In
 
Copyright © 1998-2008 CM Crossroads LLC
Ideas, requests, problems regarding CmWiki?? Send feedback