common/tools/ats/ats_specialise_test_drop.pl
changeset 836 675529c38614
parent 823 65dc12e0fcac
child 989 95924ae2e0d6
--- a/common/tools/ats/ats_specialise_test_drop.pl	Wed Jan 06 13:17:03 2010 +0000
+++ b/common/tools/ats/ats_specialise_test_drop.pl	Wed Jan 06 13:41:51 2010 +0000
@@ -12,6 +12,7 @@
 #
 # Contributors:
 #	Brendan Donegan, brendand@symbian.org
+#	Maciej Seroka, maciejs@symbian.org
 #
 # Description:
 #   This is a tool for setting the name of an ATS test drop, and/or the build id
@@ -38,6 +39,7 @@
 my $xml_in;		# Name of the input xml file. Always 'test.xml' if extracted from zipped test drop.
 my $temp_dest_name; # Leafname of temporary output file, if $destfile undefined.
 my $publish;	# Publishing folder for ats reports.
+my $bld_drive;  # Subst'd drive
 
 sub usage($);
 sub help();
@@ -50,7 +52,8 @@
 			    'src' => \$srcfile,
 			    'dest' => \$destfile,
                 'help' => \$help,
-                'publish' => \$publish);
+                'publish' => \$publish,
+				'bld-drive' => \$bld_drive);
 
 GetOptions(\%optmap,
           'test-drop-name=s',
@@ -59,12 +62,13 @@
           'src=s',
           'dest=s',
           'help!',
-          'publish=s') 
+          'publish=s', 
+		  'bld-drive=s') 
           or usage_error();
 
 # Check if Tie::File module installed
 eval("use Tie::File");
-if ($@) { $publish = '' };
+if ($@) { $publish = ''; $bld_drive = ''; };
 		  
 if ($help) {
 	help();
@@ -171,6 +175,14 @@
 	    }
 	untie @lines;
 	}
+	if ($bld_drive) { #Replace D:\ATS\winscw_smoketest path with subst'd drive
+		my @LINE;
+		tie @LINE, 'Tie::File', "test.xml" or die("Cannot tie file \"test.xml\". $!\n");
+		for (@LINE) {
+			s/D:\\ATS\\winscw_smoketest/$bld_drive/g;
+		}
+	untie @LINE;	
+	}
     if ( -f "$destfile.zip") {
         unlink("$destfile.zip") or die("Could not delete \"$destfile.zip\": $!\n");
     }