Search code examples
clearcaseclearcase-ucm

clearfsimport does not remove files at the component root dir


I am using this command line to import files into a VOB:

clearfsimport -recurse -rmname -nsetevent -filter <sourceDir>/* <vobComponentRootDir>

Content of sourceDir:

fileA
fileB

Content of vobComponentRootDir before import:

fileC

Content of vobComponentRootDir after import:

fileA
fileB
fileC

fileC is not removed, despite I used '-rmname' option.
I suspect it is because it is at the root of the component

I want to automate this import and have the same content in sourceDir and vobComponentRootDir.

How can I complete this ?


Solution

  • The -rmname option that I mentioned in "How to delete file elements by file extension in ClearCase?" for clearfsimport might now always work:

    The second link is relevant here and would explain why fileC remains.

    This is working as designed.
    The -rmname option only applies to directories and you must be in a vob directory when you run the command.

    It is best to not use a full vob as a component, but to use a multi-component vob.

    If not possible, then you can try and move the content of vobComponentRootDir in a subfolder (just for the clearfsimport to work): vobComponentRootDir\subfolder.
    And move that same content back in vobComponentRootDir once the cleafsimport is completed.