X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bd99b1d06dd70aa739697de68cd200bd3ea54246..8838d77194db9264fdec177b93194cc9e8c1b7e2:/tools/simgrid_update_xml.pl diff --git a/tools/simgrid_update_xml.pl b/tools/simgrid_update_xml.pl index 24ff690fe1..16d4bc783c 100755 --- a/tools/simgrid_update_xml.pl +++ b/tools/simgrid_update_xml.pl @@ -1,7 +1,7 @@ #! /usr/bin/perl # This script updates the simgrid XML file passed as argument (modification in place) -# It is built to do the conversion incrementally (even if for now, only 2 versions are defined) +# It is built to do the conversion incrementally. # Copyright (C) 2006-2010. The SimGrid team. All rights reserved. # @@ -19,10 +19,12 @@ my($output_string); $ARGV[0] or die "simgrid_update_xml.pl \n"; open INPUT, "$ARGV[0]" or die "Cannot open input file $ARGV[0]: $!\n"; -$output_string .= "\n"; -$output_string .= "\n"; -$output_string .= "\n"; -$output_string .= " \n"; +$output_string = "\n". + "\n". + "\n"; + + +my($AS_opened)=0; my $line; while (defined($line = )) { @@ -71,11 +73,28 @@ while (defined($line = )) { $line =~ s/\broute_element\b/link:ctn/g; } - if($line =~ /^(.*)<\/platform>(.*)$/) { - $output_string .= " <\/AS>\n<\/platform>"; - } else { - $output_string .= "$line\n"; + if ($fromversion < 3) { + $line =~ s/\blink:ctn\b/link_ctn/g; + $line =~ s/\btrace:connect\b/trace_connect/g; + + if($AS_opened && (($line=~ /<\/platform>/) || ($line=~ /\n"; + $AS_opened=1; + } } + + if($line=~/