Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

Tool Repository

[ tool index ]

targets.pl

Lists information about the triggered targets.

Download targets.pl

Description

targets.pl is a Perl script that lists data about each triggered target. Data about each target appears on a separate output line in a space separated format. Each line displays target name, execution exit code, start time, and end time. This is a Perl implementation of the targets example from the Build Log Overview.

Requirements

Perl 5.6 and the XML::LibXML module (exptools users can use /opt/exp/bin/perl).
On RHEL 6.4, install the Perl module by running: yum install perl-XML-LibXML

Usage

perl targets.pl filename.xml

Example Command Line

perl targets.pl makelog.xml

Example Output

See the Extended Example in the Build Log Overview for details and structure of the example build used.

cmd 0 09:50:08.60 09:50:11.40
hw 0 09:50:09.07 09:50:11.06
hw.o 0 09:50:09.57 09:50:09.98
hw 0 09:50:10.14 09:50:10.28
../../../bin 0 09:50:10.44 09:50:10.48
../../../bin/hw 0 09:50:10.65 09:50:10.74

Script

The XML document is parsed and stored in the $doc variable. Then for each tg element the nm, ec, st and et attributes are printed. A substring of the st and et attributes are actually printed to show only the time stamp without the date and timezone information.

On RHEL 6.4, access the reference documentation by running "man XML::LibXML".

#! /usr/bin/env perl
use strict;
use warnings;
use XML::LibXML;

my $parser = XML::LibXML->new;
my $doc = $parser->parse_file($ARGV[0]);

foreach my $tg ($doc->findnodes("//tg")) {
    print $tg->getAttribute("nm"), " ",
      $tg->getAttribute("ec"), " ",
      substr($tg->getAttribute("st"), 11, 11), " ",
      substr($tg->getAttribute("et"), 11, 11), "\n";
}
Last Update: Friday,12-Aug-2016 12:17:01 EDT