clearcase十大经典triggers!发布出来共享给大家!
http://liu6545.bokee.com
Preventive triggers
ClearCase contains some very powerful commands, and you may want to limit access to them in a particular ClearCase installation. The following trigger shows how to prevent some project users from initiating a specific ClearCase command.
1. Rmelem trigger
The cleartool rmelem command is one of the most powerful commands in ClearCase because it removes a complete element from version control. This command destroys information irretrievably. Using it carelessly may compromise your organization's ability to support previous releases.
Since this command can be so destructive, the cleartool rmname command should be used in its place in almost all cases.
It's probably pretty clear why this is one of the first commands on which I like to put a trigger.
Trigger installation / Trigger script
Here is the trigger definition:
cleartool mktrtype -c "Trigger to avoid rmelem command" -element -all -preop rmelem -execwin "ccperl -e \"exit 1\"" -execunix "Perl -e \"exit 1\"" NO_RMELEM
The trigger script is pretty straightforward: it simply invokes the ClearCase embedded Perl interpreter and exits with a status of false, so the ClearCase command rmelem cannot be executed.
Usage
When a user tries to execute the rmelem command, the following message appears:
Z:\rdn>cleartool rmelem test.txt
CAUTION! This will destroy the element, all its branches and versions,
including all data, meta-data and history, and will remove the element
from all directory versions that now contain it. Once you destroy the
element, there will be no way to restore it to its current state.
If you want to preserve the element, but remove references to it from
future directory versions, use the "rmname" command.
Element "test.txt" has 1 branches, 4 versions, and is entered
in 1 directory versions.
Destroy element? \\\\\[no\\\\\] yes
cleartool: Warning: Trigger "NO_RMELEM" has refused to let rmelem proceed.
cleartool: Error: Unable to remove element "test.txt".
Z:\rdn>
Post-operation triggers
Post triggers perform an action after a ClearCase operation, to ensure that the action occurs in conjunction with the operation. For instance, you may want an e-mail notification sent after check-in or check-out. Following is a list of triggers that perform common post-operation actions.
你可以通过这个链接引用该篇文章:
http://liu6545.bokee.com/viewdiary.13799181.html