1

My question is somewhat inverse to this one: Does ClearCase provide a way to make configspec rules overridable by others (even if they occur later in the configspec)?

Suppose you are releasing module A and module B contained in directories 'files/of/module/A' and 'files/of/module/B', say. To make sure that A doesn't depend on files from B's directory, I would like to add a rule like

element files/of/module/B/ -none

to the configspec that determines the release of A (and vice versa for B), call them 'A.release' and 'B.release'. But if we now want to integrate A and B somewhere together, our configspec looks like

include A.release
include B.release

But this won't work since 'A.release' hides all of B's files.

Is there a way to make the -none rule overridable, something along the lines of -none (weak), as long as the other rules aren't 'weak', too?

Community
  • 1
  • 1

2 Answers2

0

One idea to test would be with included config spec files.

Specifically:

  • test if you can specify a relative path ../none.csp (which includes the element files/of/module/B/ -none selection rule)
  • test what happen where there is no ../none.csp in the parent folder oa view

That way, your config spec would be:

include A.release
include ../none.csp
include B.release

One snapshot view would be created where none.csp is, and the element files/of/module/B/ -none would apply.

One other snapshot view would be created where that file is not there, and the none rule would not apply.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for the suggestion to have the `-none` rule in a separate file. This would make it easier to add/remove. Why is it important that that file is in the parent folder? Do you suggest to add another rule to the config spec that releaes 'A' and 'B' together that hides the `none.csp` file? – Robert Schmidt May 03 '17 at 15:33
  • @RobertSchmidt you can have it in the same folder. The idea was just to isolate `none.csp`, as it could be reused by other config spec files. – VonC May 03 '17 at 15:46
  • Ok, thanks for the clarification. Can I take from your answer that Clearcase doesn't support any such thing as overridable rules? – Robert Schmidt May 03 '17 at 19:29
  • @RobertSchmidt It does in that the selection rules matter: the first one matching an element wins. So if one view has a `../none.csp` in its parent folder, that `-none` rule will apply. If another view does *not* have that same `none.csp` file, no `-none` rule will apply. Example of rule order which does matter: http://stackoverflow.com/a/16001035/6309 – VonC May 03 '17 at 20:47
0

If B does not have -none rules for A, you could reverse the lines as well. B-then-A...

Myself, I would either evaluate using UCM, or possibly separate the various configspec phases into separate files:

  1. Module A
  2. Module A -none rules
  3. Module B
  4. Module B -none rules

This way you could have a configspec that runs like this: include /net/server1/export/cfgspecs/modulea.config include /net/server1/export/cfgspecs/moduleb-none.config

And later use: include /net/server1/export/cfgspecs/modulea.config include /net/server1/export/cfgspecs/moduleb.config

Brian Cowan
  • 1,048
  • 6
  • 7