Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Tool to update tesh files.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 22 Jul 2010 15:23:53 +0000 (15:23 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 22 Jul 2010 15:23:53 +0000 (15:23 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8054 48e7efb5-ca39-0410-a469-dd3cf9ba447f

buildtools/Cmake/update_tesh.pl [new file with mode: 0644]

diff --git a/buildtools/Cmake/update_tesh.pl b/buildtools/Cmake/update_tesh.pl
new file mode 100644 (file)
index 0000000..9d75190
--- /dev/null
@@ -0,0 +1,54 @@
+#!/usr/bin/perl -w
+use strict;
+
+if($#ARGV!=2) {
+    die "Usage: perl make_tesh.pl <directory> <old.tesh> <new.tesh>\n";
+}
+
+my($directory)=$ARGV[0];
+my($old)=$ARGV[1];
+my($new)=$ARGV[2];
+
+chdir("$directory");
+
+open SH_LIGNE, $old or die "Unable to open $old. $!\n";
+
+my($line);
+my($line_exec);
+my($l);
+my($tmp);
+
+print "#! ./tesh\n";
+
+while(defined($line=<SH_LIGNE>))
+{
+       if($line =~ /^p(.*)$/)
+       {
+               print "$line\n";
+       }
+       else
+       {
+               if($line =~ /^\$(.*)$/) 
+               {
+                       $line_exec = $line;
+                       $line =~ s/\$\{srcdir\:\=\.\}/./g;
+                       $line =~ s/\$SG_TEST_EXENV//g;
+                       $line =~ s/\$EXEEXT//g;
+                       $line =~ s/^\$\ */.\//g;
+                       $line =~ s/^.\/lua/lua/g;
+                       $line =~ s/^.\/ruby/ruby/g;
+                       print "$line_exec\n";
+                       chomp $line;
+                       open (FILE, "$line 2>&1|");
+                       while(defined($l=<FILE>))
+                       {
+                       chomp $l;
+                       print "\> $l\n";
+                       }
+
+               }
+               close(FILE);
+       }
+}
+
+close(SH_LIGNE);