diff -r 000000000000 -r 83f4b4db085c bldsystemtools/sysdeftools/validate/checklinks.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bldsystemtools/sysdeftools/validate/checklinks.pl Tue Feb 02 01:39:43 2010 +0200 @@ -0,0 +1,108 @@ +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# Script to validate the unit links in a system definition or package definition XML file + +use strict; + +if (! scalar @ARGV) {&help()} + + +my $debug = 0; +my $skipfilter; # skip anything with a named filter +my $xslt = "../../../buildtools/bldsystemtools/buildsystemtools/joinsysdef.xsl"; +my $xalan = "../../../buildtools/devlib/devlibhelp/tools/doc_tree/lib/apache/xalan.jar"; +my $sysdef = shift; +while($sysdef=~/^-/) { #arguments + if($sysdef eq '-nofilter') {$skipfilter = shift} + elsif($sysdef eq '-v') {$debug = 1} + else { &help("Invalid command line option $sysdef")} + $sysdef = shift; +} +my $dir = $sysdef; +$dir =~ s,[^\\/]+$,,; +my $root="../../../.."; + my $full; + +if($sysdef=~/system_definition\.xml/) { # if running on a sysdef, ensure it's joined before continuing + ($full = `java -jar $dir$xalan -in $sysdef -xsl $dir$xslt`) || die "bad XML syntax"; +}else { # assume any other file has no hrefs to include (valid by convention) + $root=''; + open S, $sysdef; + $full=join('',); + close S; +} +$full=~s///sg; # remove all comments; +my $count=1; + +my $filter = ''; +foreach (split(/