Sclc and Cdiff: Perl scripts for ClearCase
Last updated, 17-April-2003 (sclc version 1.23; cdiff version 1.0.12)
The sclc and cdiff scripts that are ancient Perl4 code I wrote and
still use. I have since converted them to use some basic Perl5 stuff
(like lexically scoped local variables and more static typechecking),
but they dont really take advantage of some of the nicer capababilities
(like references and nested data structures) that could really improve
the design and implementation. If you ever get the desire to fully
convert these to Perl5 - please drop me a line.
The cdiff script produces a cleardiff with surrounding lines
of context. The sclc script counts lines of code (and comments,
and non-comment source lines, and assembly-equivalent source lines) for
several programming languages. When installed in the same directory as
cdiff, the sclc script can also count changed lines
of code. For the documentation on how to use cdiff and sclc,
Please refer the POD documentation in each script.
- Requires Perl version 5.5 or later.
- cdiff requires ClearCase since it is a front-end to cdiff.
- if you want to count changes lines of code using version-selector
syntax via cdiff, then sclc requires cdiff (and hence ClearCase).
- if you want to use the -fmt patch option to cdiff, then you
must have an executable program capable of producing the desired
context diff output.
Porting and Installation
- cdiff and sclc assume they are both installed in the exact same
- Dont forget to change the "shebang" line (the first line of each
script - the one starting with "#!") so that it refers to where
the proper version of Perl5 is installed on your system. Once you
do that, then on Unix you just need to give the scripts "execute"
permissions in order to be able to run them. On NT, you should
probably make sure both scripts have a ".pl" extension - then you
have to do whatever NT requires you to do to make files ending in
".PL" invoke the appropriate Perl5 executable to interpret scripts
typed as command names to be invoked as if they were regular
- cdiff has a configuration section near the top of the file. You
have to fill in the values of constants with the names/locations
of certain ClearCase and operating system commands and directories
for your particular network environment.
- cdiff and sclc are known to run on Unix platforms and Win32 platforms
without any changes needed other than the configuration mentioned
above. If you have to make changes to get them running on your Win32
platform, please drop me a line and let me know what you had to change.
Brad Appleton -- <email@example.com>
Back to the ClearPerl Home Page