metatools/sysdeftools/rootsysdef.pl
changeset 636 29e6a24e9521
parent 624 f70b728ea30c
child 639 0e65f93be3cb
equal deleted inserted replaced
635:945d232265c4 636:29e6a24e9521
    53 		"  -output [file]\tspecifies the file to save the output to. If set, all hrefs will set to be relative to this location. If not specified all href will be absolute file URIs and this will write to stdout\n\n",
    53 		"  -output [file]\tspecifies the file to save the output to. If set, all hrefs will set to be relative to this location. If not specified all href will be absolute file URIs and this will write to stdout\n\n",
    54 
    54 
    55 		"  -w [Note|Warning|Error]\tspecifies prefix text for any notifications. Defautls to Error\n\n",
    55 		"  -w [Note|Warning|Error]\tspecifies prefix text for any notifications. Defautls to Error\n\n",
    56 		"  -root [dir]\tspecifies the root directory of the filesystem. All globbing will be done relative to this path\n\n",
    56 		"  -root [dir]\tspecifies the root directory of the filesystem. All globbing will be done relative to this path\n\n",
    57 
    57 
    58 		"  -glob [wildcard path]\tThe wildcard search to look for pkgdef files. eg  \"\\*\\*\package_definition.xml\". Can specify any number of these.\n",
    58 		"  -glob [wildcard path]\tThe wildcard search to look for pkgdef files. eg  \"\\*\\*\\package_definition.xml\". Can specify any number of these.\n",
    59 		"  -placeholders [bool]\tif set, all packages not found in the template will be left in as empty placeholders\n";
    59 		"  -placeholders [bool]\tif set, all packages not found in the template will be left in as empty placeholders\n";
    60 		"  -name [text]\tthe name in <systemModel> to use for the generated root sysdef. If not present, this will use the name from the templat\n";
    60 		"  -name [text]\tthe name in <systemModel> to use for the generated root sysdef. If not present, this will use the name from the templat\n";
    61 	exit(1);
    61 	exit(1);
    62 	}
    62 	}
    63 
    63 
   162 my %newContainer;
   162 my %newContainer;
   163 my %foundDescendants;
   163 my %foundDescendants;
   164 
   164 
   165 foreach(keys %add)
   165 foreach(keys %add)
   166 	{
   166 	{
   167 	my   $fragment = $parser->parsefile ($_);
   167 
       
   168 	my   $fragment;
       
   169 	
       
   170 	eval {
       
   171 		$fragment  = $parser->parsefile ($_);
       
   172 	};
       
   173 	$fragment || die "could not parse $_";
   168 	my $fdoc = $fragment->getDocumentElement();
   174 	my $fdoc = $fragment->getDocumentElement();
   169 	my $topmost =&firstElement($fdoc);
   175 	my $topmost =&firstElement($fdoc);
   170 	if(!$topmost) {
   176 	if(!$topmost) {
   171 		print STDERR "$warning: $_ has no content. Skipping\n";
   177 		print STDERR "$warning: $_ has no content. Skipping\n";
   172 		next;
   178 		next;