From 7c811658b9ed029d6348ead661b3d03b980d0ebc Mon Sep 17 00:00:00 2001 From: navarrop Date: Wed, 29 Sep 2010 13:52:28 +0000 Subject: [PATCH] Script to transform v2 platfrom into a v3. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8297 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- tools/simgrid_update_xml_v2_to_v3.pl | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tools/simgrid_update_xml_v2_to_v3.pl diff --git a/tools/simgrid_update_xml_v2_to_v3.pl b/tools/simgrid_update_xml_v2_to_v3.pl new file mode 100644 index 0000000000..10b02fe413 --- /dev/null +++ b/tools/simgrid_update_xml_v2_to_v3.pl @@ -0,0 +1,50 @@ +#! /usr/bin/perl + +# This script updates the simgrid XML file passed as argument (modification in place) +# It is built to do the conversion from a XML platfrom version 2 to a version 3 + +# Copyright (C) 2006-2010. The SimGrid team. All rights reserved. +# +# This file is part of the SimGrid project. This is free software: +# You can redistribute and/or modify it under the terms of the +# GNU LGPL (v2.1) licence. + +use strict; + +my($line); +my($command); +my($Filecount)=1; +my($file); +my($filename_old); +my($AScount); + +if($#ARGV!=0) { + die "Error: Wrong number of parameters\nUsage:\tperl transform_platform.perl [platform_v2.xml]\n"; +} + +my($file)=$ARGV[0]; + +open FILE, "$file" or die "Error: Unable to open file: \"$file\".\n$!\n"; +while(defined($line=)) +{ + $AScount=0; + if($line =~ /^(.*)\n"; + print "\n"; + $AScount++; + } + else + { + if($line =~ /^(.*)<\/platform(.*)$/) + { + print "<\/AS>\n"; + print "$line"; + } + else + { + print "$line"; + } + } +} +close(FILE); \ No newline at end of file -- 2.20.1