common/tools/ats/ats_generate_index.pl
changeset 850 0e8b8d588322
parent 844 385ad61f2ab3
equal deleted inserted replaced
849:5102a7131901 850:0e8b8d588322
    27   $path = $ARGV[0];
    27   $path = $ARGV[0];
    28  }
    28  }
    29 else { die "Missing parameter \"path\". For example: //v800020/Publish/SF_builds/symbian2/builds/default/symbian2_default.sf-test-bc-check.PDK_2.0.1.51/ats_reports"; }
    29 else { die "Missing parameter \"path\". For example: //v800020/Publish/SF_builds/symbian2/builds/default/symbian2_default.sf-test-bc-check.PDK_2.0.1.51/ats_reports"; }
    30 
    30 
    31 find(\&Wanted, $path);
    31 find(\&Wanted, $path);
       
    32 
       
    33 #Find and delete the link to Smoke Test Report
    32 my $n = 0;
    34 my $n = 0;
       
    35 my $item_to_find = $path . "/ATS3Report.html";
       
    36 foreach (@files) {
       
    37 	if (@files[$n] eq $item_to_find) { splice @files, $n, 1; }
       
    38 	$n++;
       
    39 }
       
    40 
       
    41 $n = 0;
    33 foreach (@files) { #Replace "//v800020/Publish" with "http://cdn.symbian,org"
    42 foreach (@files) { #Replace "//v800020/Publish" with "http://cdn.symbian,org"
    34 	@files[$n] =~ s/\/\/v800020\/Publish/http:\/\/cdn.symbian.org/;
    43 	@files[$n] =~ s/\/\/v800020\/Publish/http:\/\/cdn.symbian.org/;
    35 	$n++;
    44 	$n++;
    36 }
    45 }
       
    46 
    37 #Copy template and insert links
    47 #Copy template and insert links
    38 copy("report_template.html","index.html") or die ("Cannot copy file \"report_template.html\". $!\n");
    48 copy("report_template.html","index.html") or die ("Cannot copy file \"report_template.html\". $!\n");
    39 tie @lines, 'Tie::File', "index.html" or die ("Cannot tie file \"index.html\". $!\n");
    49 tie @lines, 'Tie::File', "index.html" or die ("Cannot tie file \"index.html\". $!\n");
    40 my $current_line = 0;
    50 my $current_line = 0;
    41 for (@lines) {
    51 for (@lines) {
    54 #copy index
    64 #copy index
    55 copy("index.html","$path/index.html") or die ("Cannot copy file \"index.html\" to $path. $!\n");
    65 copy("index.html","$path/index.html") or die ("Cannot copy file \"index.html\" to $path. $!\n");
    56 
    66 
    57 sub Wanted {
    67 sub Wanted {
    58     # only operate on ATS3Report.html files
    68     # only operate on ATS3Report.html files
    59     /ATS3Report.html/ or return;	
    69 	/ATS3Report.html/ or return;
    60 	push (@files, $File::Find::name);
    70     push (@files, $File::Find::name);
    61 }
    71 }