Professional Documents
Culture Documents
CCPerl Interop
CCPerl Interop
General Notes
Me
dsb@cleartool.com http://www.cleartool.com
Sharing modules
Make use of SMB symlink translation
Must
or /usr/local (\\server\local).
All maintenance from UNIX.
Local .bat, remote/shared perl script (ulb) Use perls bin directory UNC path entries must be user and at end
Trigger Definition
% ct lstype -l trtype:mkelem_post trigger type "mkelem_post" 02-Aug-99.18:35:01 by [VOB Admin] (vobadm.ccusers@sparc5) owner: vobadm group: ccusers all element trigger post-operation mkelem action: -execunix /usr/local/bin/perl /data/ccase/triggers/mkelem_post.tgr action: -execwin perl //ultra10/triggers/mkelem_post.tgr excluded users: vobadm My triggers are at http://www.cleartool.com
Quoting: make use of qq() and q() Especially in e scripts No single quote () in cmd.exe Remember: 2>&1 works on Windows -e foo@@/main/0 Useful for testing dynamic-vs-snapshot Follow with ct desc for snapshot support
exit(system(cmd)!=0));
complex/long-running programs
My Perl Modules
ClearCase::ClearPrompt ClearCase::Wrapper ClearCase::SyncTree ClearCase::CRDB Env::Path IPC::ClearTool ClearCase::Argv
ClearCase::ClearPrompt
Handles temp files automatically Capable of asynchronous operation Handles trigger series automatically Captures/emails error msgs (*CC 4.2)
use ClearCase::ClearPrompt qw(clearprompt +TRIGGERSERIES +CAPTURE=vobadm); clearprompt(proceed, -prompt, Hi!)); $bug = clearprompt(qw(text -def 0 prompt), Bug #?);
ClearCase::Wrapper
Not an API, a program in module form Potentially wraps all cleartool access Cannot affect Windows GUI Many cmdline features (-rec/-all/-dir)
ClearCase::SyncTree
Analogous to citree, clearfsimport Preserves CRs Maps filenames Takes or derives file lists Regular expression filtering Comes with synctree program
ClearCase::CRDB
Unreleased CR analysis (impact analysis) Comes with whouses program Forward or backward analysis
Env::Path
Simply adds methods to existing EVs Prepend, Append, Remove InsertBefore, InsertAfter Uniqify, DeleteNonexistent Replace, Whence (take REs) Comes with envpath program Comes with whence program for Windows
use Env::Path PATH; PATH->Remove(/usr/ucb);
IPC::ClearTool
Interop Speedup: order of magnitude, or none. Significant constant overhead CAL on Windows, coprocess on UNIX Preferred interface via ClearCase::Argv
ClearCase::Argv Features
Command line as object Advanced Option Parsing (option sets) Interoperability
Prog,
ClearCase::Argv examples
my $ct = ClearCase::Argv->new; $ct->autochomp(1); my @co = $ct->lsco([-s, -all], .)->qx; $ct->ci([-c, comment], @co)->system; my @co = ctqx(lsco s all .); ctsystem(qw(mkelem c comment), @co);
Special-purpose Objects
my $ct = ClearCase::Argv->new; $ct->autofail(1); $ct->autochomp(1); my $ctq = ClearCase::Argv->new; $ct->stdout(0); $ct->stderr(0);
Setting attributes
Per-object: $ct->stderr(1); Globally: ClearCase::Argv->stderr(1); export ARGV_STDERR=1 ClearCase::Argv->attropts;
-/dbg=1 -/quiet=1 -/ipc=1
Question Time
At http://www.cleartool.com:
This