How can I interact with ClearCase with Perl?

My project requires a few things to extract from ClearCase data using a Perl script on an Excel worksheet, this is -
Providing two specific timelines or two baselines.

  • all actions related to this base (column header "activity")
  • Owner ID (column header-Owner)
  • the whole element associated in a particular action. (column heading - "item details")
  • For each item, related versions (column heading - “Versions”)
  • for each element the total number of lines of code is added, the total number of lines of code is added, the total number of lines of code is deleted, the total number of lines of code is changed .. (column heading "Number of lines of code", "lines of added code", "lines of code deleted" and "lines code changed ")

Please kindly help me with this ...

+2
source share
3 answers

In principle, ClearCase Perl scripts are based on parsed outputs from system and cleartool commands.

The scripts are based on the cleartool command line, for example package CCCmd , and are used as:

use strict;
use Config;
require "path/to/CCCmd.pm";

sub Main
{
  my $hostname = CCCmd::RunCmd('hostname');
  chomp $hostname;
  my $lsview = CCCmd::ClearToolNoError("lsview -l -pro -host $hostname");
  return 1;
}

Main() || exit(1);
exit(0);

eg.

, Perl, , , cleartool fmt_ccase.

1/ , ( "" )

 ct descr -fmt "%[activities]CXp" baseline:aBaseline.xyz@\ideapvob

( "," ).

:

2/ ( -)

 ct descr -fmt "%u" activity:anActivityName@\ideapvob

3/ , . ( - " " )

: (./4),

4/ ( - "" )

:

 ct descr -fmt "%[versions]CQp\n"  activity:anActivityName@\ideapvob

5/ , , , .. ( " ", " ", " " " " )

, diff.

, ( ).

+5

, perl Clearcase, CPAN ClearCase:: CtCmd. perl clearcase.

+2

CCCmd RunCmd RunCmdNoError, .

0

Source: https://habr.com/ru/post/1735309/


All Articles