You can define a trigger that fires correctly depending on the type of platform on which it runs (Linux®, the UNIX system, and Windows® computers). The following techniques are available:
With one technique, you use different paths or different scripts; with the other technique, you use the same script for all platforms. You can also share triggers; see Tips for sharing scripts.
You can also share scripts; see Sharing triggers among different types of platform.
To define a trigger that fires on Linux® and the UNIX system; the Windows® system; or both types of platform, and that uses different paths to point to the trigger scripts, use the mktrtype command with the –execunix and –execwin options. These options behave the same as –exec when the trigger fires on the appropriate platform (Linux® and the UNIX system for –execunix or the Windows® system for –execwin). On the inappropriate type of platform, the related script does not run.
cleartool mktrtype –element –all –nc –preop checkin
–execunix /public/scripts/precheckin.sh
–execwin \\neon\scripts\precheckin.bat
pre_ci_trig
On Linux® or the UNIX system, only the script precheckin.sh runs. On the Windows® system, only precheckin.bat runs.
To prevent users on a new platform from bypassing the trigger process, triggers that specify only –execunix always fail on the Windows® system. Likewise, triggers that specify only –execwin fail on Linux® and the UNIX system.
To use the same trigger script on Linux®, the UNIX system, and the Windows® system, use a batch command interpreter that runs on all operating systems. For this purpose, the ratlperl program is included in the HCL VersionVault configuration. You can use this version of Perl on the Windows® system, Linux®, and the UNIX system. The commands Perl on Linux® and the UNIX system and ccperl on the Windows® system are wrapper programs that run ratlperl.
cleartool mktrtype –element –all –nc –preop checkin \
–execunix 'Perl /public/scripts/precheckin.pl' \
–execwin 'ccperl \\neon\scripts\precheckin.pl' \
pre_ci_trig
- On Linux and the UNIX system: /opt/hcl/ccm/common/bin
- On the Windows® system: <install_location>\HCL\Common\
The value install_location is the root folder in which you installed HCL VersionVault.