hi

yes that's somehow tricky ...
wonder if anybody could provide some more info how to deal with that problem

can only provide a short script how we attach attributes to a version of an 
element, hope that helps 

element line in the logfile looks like

Version 
\SR5\Projects\Demo_Standard\WinCCDb_backup\Oracle_9.2\BackupConfig.xml@@\main\Integration_Release_4.1\FE_4.1_FEAT00002195_SPC_Nbg\1
     2004 09/20 15:37:59 (GMT)       3f038d90.595f11d2.b08c.00:10:4b:c5:ab:35   
     18f829fd.499643ba.979d.18:87:87:8f:d7:48        
76fad73e.84c44505.9826.ec:16:41:eb:a6:d8
Version 
\SR5\Projects\Demo_Standard\WinCCDb_backup\Oracle_9.2\DOR_WINCC_RT.dmp@@\main\Integration_Release_4.1\FE_4.1_FEAT00002195_SPC_Nbg\1
     2004 09/20 15:38:11 (GMT)       3f038d90.595f11d2.b08c.00:10:4b:c5:ab:35   
     d4caa0be.69e94de3.ab80.8b:d9:91:27:c7:59        
46ea5ee3.cef74b01.8782.68:bc:91:e5:56:2d
Version 
\SR5\Projects\Demo_DMS_GIS\WinCCDb_backup\Oracle_9.2@@\main\FE_4.1_FEAT00002195_SPC_Nbg\1
       2004 09/20 15:38:53 (GMT)       3f038d90.595f11d2.b08c.00:10:4b:c5:ab:35 
       8db35116.91fb4df2.9d95.61:6c:8d:1c:26:66        
604581d4.cac742ac.b7d5.65:76:89:95:3a:b1



# FixAttr.pl
#
#  This script is intended to be run after FixLog has added additional versions 
to the log.  It will look at all the
#  versions in the site log for the defect, and if the version does not have a 
VFID attribute or if the VFID attribute
#  does not match the defect identifier, it will set the VFID and Created_By 
attributes.
#
#  Usage - FixAttr.pl defect
#
#  Where defect is the fully qualified defect identifier - eg SPC400002236
#
#  This needs to be run in a view where the local log files are visible

($defectid) = @ARGV;

if (!$defectid) {
  print "Usage - FixAttr.pl defect\n";
  exit 1;
}

use Win32:LE;
$ccapp = Win32:LE -> new ('CLEARCASE.Application');

$defectdir = substr($defectid,0,length($defectid)-3);

$site = $ccapp -> VOB('\SR5') -> ThisReplica;
$viewname = $ccapp -> View -> TagName;

$defectfile = "\\CM_$site\\$defectdir\\$defectid";

if (!open (DEFECT,"<$defectfile")) {
  print "Unable to open $defectfile\n";
  exit 1;
}

@info = (<DEFECT>
close (DEFECT);

foreach (@info) {
  if (m/^Connection/) {
    ($junk,$junk,$fullname) = split('\t');
  }
  if (!m/^Version/) {next};

  # Get version oids from version line and get version object
  ($junk,$version,$junk,$vobuuid,$eloid,$veroid) = split ('\t');
  $versionobj = $ccapp -> Version([$vobuuid,$veroid,$viewname]);

  # Get current VFID attribute for version obj
  $attobj = $versionobj -> Attribute('VFID');
  if (!$attobj) {
    $vfid = 'none';
  } else {
    $vfid = $attobj -> Value;
  }

  if ($vfid ne $defectid) {
    print "$version\n$vfid\t$fullname\n";
    $vobobj = $ccapp -> VOB($vobuuid);
    # Set CreatedBy attribute
    $atttype = $vobobj -> AttributeType('CreatedBy');
    $atttype -> Apply($versionobj,$fullname);
    # Set VFID attribute
    $atttype = $vobobj -> AttributeType('VFID');
    $atttype -> Apply($versionobj,$defectid);
  }
}

<============================================================
To unsubscribe, send email to
[EMAIL PROTECTED] and put these words in the
message body: unsubscribe cciug
============================================================>

Reply via email to