[cciug] Perl Help (a new problem)

From: Shanks, Jon (jshanks@logicon.com)
Date: Fri Jan 28 2000 - 18:50:11 EST


Hello all,

I have been working on putting something in place here for a few days now. I
had a previous related issue called "Trigger help needed". Wolfgang Laun got
me on the path I needed to be on, but now I need help with the specific
syntax in Perl.

Basically what I am trying to do (which was my original issue) is have a
trigger that fires upon checkin for all files. The corresponding script
would check the attribute value on the file. If the attribute is set to
"inspected" then the script would return 1 so that the checkin would fail.
He is the script so far

$ACCEPT=0;
$REJECT=1;
$CLEARCASE_PN = $ENV{ "CLEARCASE_PN" } . '@@';

$cmd="cleartool describe -s -aattr Status $CLEARCASE_PN";
print STDERR $cmd , "\n\n";

if (system($cmd) != "\"inspected\"") {
  print STDERR "Accepted\n";
  exit $ACCEPT;
  }
else {
  print STDERR "Rejected\n";
  exit $REJECT;
}

The "$CLEARCASE_PN = $ENV{ "CLEARCASE_PN" } . '@@';" line get me the file
name with the @@ at the end (I couldn't find an EV that would give me this)
which is needed to check for an attribute set on the element instead of on a
version.

My problem is that the system($cmd) call doesn't return the actual attribute
value. When I check that value I get 0 no matter if the attribute is set on
the file or not. How do I go about getting the actual attribute value
returned so that my if statement will work? Is there a better way? Please
help.

Thanks!

~~~~~~~~~~~~~~~~~~~~~~~
Jon Shanks
Sr. CM Analyst
Logicon Advanced Technology
Colorado Springs, CO

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



This archive was generated by hypermail 2b29 : Sun May 06 2001 - 00:22:41 EDT