32 |
32 |
33 # Name of the file we need to work on to extract the data necessary for the Release Notes from build_BOM.zip |
33 # Name of the file we need to work on to extract the data necessary for the Release Notes from build_BOM.zip |
34 my $name_of_file_to_compare="build-info\.xml"; |
34 my $name_of_file_to_compare="build-info\.xml"; |
35 |
35 |
36 # File used to extract path and component name for a package from build_logs.zip |
36 # File used to extract path and component name for a package from build_logs.zip |
37 my $pckg_extraction_data_file_name = "PkgComponentAnalysisSummary\.csv"; |
37 my $pckg_extraction_data_file_name = "PkgComponentAnalysisSummary.csv"; |
38 |
|
39 |
38 |
40 # When using the script as part of the build system, we don't have access to the zip files yet, therefore we need to have a look for the file directly |
39 # When using the script as part of the build system, we don't have access to the zip files yet, therefore we need to have a look for the file directly |
41 # This is working only when using pdkloc2 only. In any other cases we are not bothered!!!!! |
40 # This is working only when using pdkloc2 only. In any other cases we are not bothered!!!!! |
42 my $bom_dir="BOM"; |
41 my $bom_dir="BOM"; |
43 my $analysis_dir="analysis"; |
42 my $analysis_dir="analysis"; |
77 # Name of the file that we are creating to hold the information necessary for the Release Notes |
76 # Name of the file that we are creating to hold the information necessary for the Release Notes |
78 my $name_of_file_to_publish="releaseNotes.wiki.txt"; |
77 my $name_of_file_to_publish="releaseNotes.wiki.txt"; |
79 #Location for that file |
78 #Location for that file |
80 # This values need to be overwritten!!! |
79 # This values need to be overwritten!!! |
81 my $location_of_file_to_publish="c:\\temp"; |
80 my $location_of_file_to_publish="c:\\temp"; |
82 my $path_to_file_to_publish="$location_of_file_to_publish\\$name_of_file_to_publish"; |
|
83 |
81 |
84 # |
82 # |
85 # End configuration data for the script |
83 # End configuration data for the script |
86 # |
84 # |
87 |
85 |
125 'pdkloc1=s' => \$pdkloc1, |
123 'pdkloc1=s' => \$pdkloc1, |
126 'pdkloc2=s' => \$pdkloc2, |
124 'pdkloc2=s' => \$pdkloc2, |
127 'help!' => \$help # Not working |
125 'help!' => \$help # Not working |
128 )); |
126 )); |
129 |
127 |
130 print "\pdknb1=$pdknb1\n"; |
128 print "pdknb1=$pdknb1\n"; |
131 print "\pdknb2=$pdknb2\n"; |
129 print "pdknb2=$pdknb2\n"; |
132 print "\pdkname1=$pdkname1\n"; |
130 print "pdkname1=$pdkname1\n"; |
133 print "\pdkname2=$pdkname2\n"; |
131 print "pdkname2=$pdkname2\n"; |
134 print "\pdkloc1=$pdkloc1\n"; |
132 print "pdkloc1=$pdkloc1\n"; |
135 print "\pdkloc2=$pdkloc2\n"; |
133 print "pdkloc2=$pdkloc2\n"; |
136 print "\help=$help\n"; |
134 print "help=$help\n"; |
137 |
135 |
138 my $count_arg=0; # Caculate the number of arguments we need for the script to work and that we know are correct (help doesn't count) |
136 my $count_arg=0; # Caculate the number of arguments we need for the script to work and that we know are correct (help doesn't count) |
139 |
137 |
140 # First PDK to check |
138 # First PDK to check |
141 my $pdk_path1=""; |
139 my $pdk_path1=""; |
344 { |
342 { |
345 print "We have the PDK number, we need to define if possible the PDK name and therefore the path to the PDK\n"; |
343 print "We have the PDK number, we need to define if possible the PDK name and therefore the path to the PDK\n"; |
346 # Have a look in the default directory if there is a PDK with that number. If none or more than one with the same id, returns the list of PDKs with that same number |
344 # Have a look in the default directory if there is a PDK with that number. If none or more than one with the same id, returns the list of PDKs with that same number |
347 foreach $find_val (@pdks_with_valid_zip_in_default_loc) |
345 foreach $find_val (@pdks_with_valid_zip_in_default_loc) |
348 { |
346 { |
349 #print $find_val, "\n"; |
|
350 if($find_val =~ /$pdknb1/i) |
347 if($find_val =~ /$pdknb1/i) |
351 { |
348 { |
352 $find_pdk_for_corresponding_nb1[$nb_of_pdk_for_corresponding_nb1++]=$find_val; |
349 $find_pdk_for_corresponding_nb1[$nb_of_pdk_for_corresponding_nb1++]=$find_val; |
353 } |
350 } |
354 } |
351 } |
372 } |
369 } |
373 else |
370 else |
374 { |
371 { |
375 print "We have the PDK Name therefore we can define the path to the PDK\n"; |
372 print "We have the PDK Name therefore we can define the path to the PDK\n"; |
376 |
373 |
377 # Have a look in the default directory if there is a PDK with that number. If none or more than one with the same id, returns the list of PDKs with that same number |
|
378 foreach $find_val (@pdks_with_valid_zip_in_default_loc) |
|
379 { |
|
380 #print $find_val, "\n"; |
|
381 if($find_val =~ /$pdkname1/i) |
|
382 { |
|
383 $find_pdk_for_corresponding_name1[$nb_of_pdk_for_corresponding_name1++]=$find_val; |
|
384 } |
|
385 } |
|
386 print "Table find_pdk_for_corresponding_name1 is: \n"; |
|
387 display_array_one_line_at_the_time(@find_pdk_for_corresponding_name1); |
|
388 |
|
389 if($nb_of_pdk_for_corresponding_name1==1) |
|
390 { |
|
391 print "There is only $nb_of_pdk_for_corresponding_name1 PDK with the name corresponding to the PDK name given, we can keep going!\n"; |
|
392 } |
|
393 else |
|
394 { |
|
395 print "There is $nb_of_pdk_for_corresponding_name1 PDKs with the same name, please select one in the list above and run the perl script again with the right PDK name\n"; |
|
396 } |
|
397 |
|
398 #extract PDK name if only one |
|
399 print "pdkname1 = $pdkname1\n"; |
|
400 $pdk1_correct_name_to_use = $pdkname1; |
374 $pdk1_correct_name_to_use = $pdkname1; |
401 $pdk_path1 .= $pdkname1; |
375 $pdk_path1 .= $pdkname1; |
402 } |
376 } |
403 print "The PDK used is: $pdk1_correct_name_to_use\n"; |
377 print "The PDK used is: $pdk1_correct_name_to_use\n"; |
404 print "pdk_path1 = $pdk_path1\n"; |
378 print "pdk_path1 = $pdk_path1\n"; |
440 } |
414 } |
441 else |
415 else |
442 { |
416 { |
443 print "We have the PDK Name therefore we can define the path to the PDK\n"; |
417 print "We have the PDK Name therefore we can define the path to the PDK\n"; |
444 |
418 |
445 # Have a look in the default directory if there is a PDK with that number. If none or more than one with the same id, returns the list of PDKs with that same number |
|
446 foreach $find_val (@pdks_with_valid_zip_in_default_loc) |
|
447 { |
|
448 #print $find_val, "\n"; |
|
449 if($find_val =~ /$pdkname2/i) |
|
450 { |
|
451 $find_pdk_for_corresponding_name2[$nb_of_pdk_for_corresponding_name2++]=$find_val; |
|
452 } |
|
453 } |
|
454 print "Table find_pdk_for_corresponding_name2 is:\n"; |
|
455 display_array_one_line_at_the_time(@find_pdk_for_corresponding_name2); |
|
456 |
|
457 if($nb_of_pdk_for_corresponding_name2==1) |
|
458 { |
|
459 print "There is only $nb_of_pdk_for_corresponding_name2 PDK with the name corresponding to the PDK name given, we can keep going!\n"; |
|
460 } |
|
461 else |
|
462 { |
|
463 print "There is $nb_of_pdk_for_corresponding_name2 PDKs with the same name, please select one in the list above and run the perl script again with the right PDK name\n"; |
|
464 } |
|
465 |
|
466 #extract PDK name if only one |
|
467 print "pdkname2 = $pdkname2\n"; |
|
468 $pdk2_correct_name_to_use = $pdkname2; |
419 $pdk2_correct_name_to_use = $pdkname2; |
469 $pdk_path2 .= $pdkname2; |
420 $pdk_path2 .= $pdkname2; |
470 } |
421 } |
471 print "The PDK used is: $pdk2_correct_name_to_use\n"; |
422 print "The PDK used is: $pdk2_correct_name_to_use\n"; |
472 print "pdk_path2 = $pdk_path2\n"; |
423 print "pdk_path2 = $pdk_path2\n"; |
479 { |
430 { |
480 # Get the list of file in the location choosen. |
431 # Get the list of file in the location choosen. |
481 opendir(LOC1_DIR, $pdkloc1); |
432 opendir(LOC1_DIR, $pdkloc1); |
482 @read_files_in_loc = readdir(LOC1_DIR); |
433 @read_files_in_loc = readdir(LOC1_DIR); |
483 close(LOC1_DIR); |
434 close(LOC1_DIR); |
484 |
|
485 #print "List of files in the directory: @read_files_in_loc\n"; |
|
486 |
435 |
487 foreach $loc_var (@read_files_in_loc) |
436 foreach $loc_var (@read_files_in_loc) |
488 { |
437 { |
489 if($loc_var =~ /$build_bom_zip_file_to_extract$/) |
438 if($loc_var =~ /$build_bom_zip_file_to_extract$/) |
490 { |
439 { |
583 print "pdk_path2 = $pdk_path2\n"; |
532 print "pdk_path2 = $pdk_path2\n"; |
584 |
533 |
585 if($loc2_contains_the_xml_csv_files_we_need==$nb_of_xml_csv_files_we_need) |
534 if($loc2_contains_the_xml_csv_files_we_need==$nb_of_xml_csv_files_we_need) |
586 { |
535 { |
587 $location_of_file_to_publish=$pdkloc2; |
536 $location_of_file_to_publish=$pdkloc2; |
588 $path_to_file_to_publish="$location_of_file_to_publish\\$name_of_file_to_publish"; |
|
589 print "location_of_file_to_publish=$location_of_file_to_publish\n"; |
537 print "location_of_file_to_publish=$location_of_file_to_publish\n"; |
590 print "path_to_file_to_publish=$path_to_file_to_publish\n"; |
|
591 } |
538 } |
592 } |
539 } |
593 else |
540 else |
594 { |
541 { |
595 if($loc2_contains_the_xml_csv_files_we_need<=$nb_of_xml_csv_files_we_need) |
542 if($loc2_contains_the_xml_csv_files_we_need<=$nb_of_xml_csv_files_we_need) |
596 { |
543 { |
597 print "We can't find the files $name_of_file_to_compare and\/or $pckg_extraction_data_file_name in the location $pdkloc2 and therefore we can't go any further!!\n"; |
544 print "We can't find the files $name_of_file_to_compare and/or $pckg_extraction_data_file_name in the location $pdkloc2 and therefore we can't go any further!!\n"; |
598 } |
545 } |
599 else |
546 else |
600 { |
547 { |
601 print "We can't find the files $build_bom_zip_file_to_extract in the location $pdkloc2 and therefore we can't go any further!!\n"; |
548 print "We can't find the files $build_bom_zip_file_to_extract in the location $pdkloc2 and therefore we can't go any further!!\n"; |
602 } |
549 } |
694 my %build_info_xml1; |
641 my %build_info_xml1; |
695 my %build_info_xml2; |
642 my %build_info_xml2; |
696 my @sorting_build_info_xml1; |
643 my @sorting_build_info_xml1; |
697 my @sorting_build_info_xml2; |
644 my @sorting_build_info_xml2; |
698 |
645 |
699 #my @display_hash_array; |
|
700 my $key; |
646 my $key; |
701 # Define the path for the files to work on |
647 # Define the path for the files to work on |
702 my $path_to_pdk1_file_to_work_on="$working_dir1\\$name_of_file_to_compare"; |
648 my $path_to_pdk1_file_to_work_on="$working_dir1\\$name_of_file_to_compare"; |
703 my $path_to_pdk2_file_to_work_on="$working_dir2\\$name_of_file_to_compare"; |
649 my $path_to_pdk2_file_to_work_on="$working_dir2\\$name_of_file_to_compare"; |
704 |
650 |
718 |
664 |
719 # 3rd a) step is to sort out the 2 files / table |
665 # 3rd a) step is to sort out the 2 files / table |
720 # Sort out the tables to facilitate the checking of the different packages |
666 # Sort out the tables to facilitate the checking of the different packages |
721 @not_sorted_table = keys %build_info_xml1; |
667 @not_sorted_table = keys %build_info_xml1; |
722 |
668 |
723 #print "\nnot_sorted_table:\n @not_sorted_table\n"; |
|
724 |
|
725 # ascendant alphabetical sort |
669 # ascendant alphabetical sort |
726 @pdk1_sorting_table = sort { lc($a) cmp lc($b) } @not_sorted_table; |
670 @pdk1_sorting_table = sort { lc($a) cmp lc($b) } @not_sorted_table; |
727 |
|
728 #print "\npdk1_sorting_table :\n @pdk1_sorting_table\n"; |
|
729 |
671 |
730 print "\n"; |
672 print "\n"; |
731 |
673 |
732 # pdk2 |
674 # pdk2 |
733 %build_info_xml2 = extract_packages_and_branch_type_from_file($path_to_pdk2_file_to_work_on); |
675 %build_info_xml2 = extract_packages_and_branch_type_from_file($path_to_pdk2_file_to_work_on); |
738 |
680 |
739 # 3rd b) step is to sort out the 2 files / table |
681 # 3rd b) step is to sort out the 2 files / table |
740 # Sort out the tables to facilitate the checking of the different packages |
682 # Sort out the tables to facilitate the checking of the different packages |
741 @not_sorted_table = keys %build_info_xml2; |
683 @not_sorted_table = keys %build_info_xml2; |
742 |
684 |
743 #print "\nnot_sorted_table:\n @not_sorted_table\n"; |
|
744 |
|
745 # ascendant alphabetical sort |
685 # ascendant alphabetical sort |
746 @pdk2_sorting_table = sort { lc($a) cmp lc($b) } @not_sorted_table; |
686 @pdk2_sorting_table = sort { lc($a) cmp lc($b) } @not_sorted_table; |
747 |
|
748 #print "\npdk2_sorting_table :\n @pdk2_sorting_table\n"; |
|
749 |
687 |
750 print "\n"; |
688 print "\n"; |
751 |
689 |
752 # 4th step is to compare both data and export it to a file or something similar that is good for media wiki. |
690 # 4th step is to compare both data and export it to a file or something similar that is good for media wiki. |
753 # Compare both files to find out the difference between each packages FCL, MCL, added or deleted packages |
691 # Compare both files to find out the difference between each packages FCL, MCL, added or deleted packages |
758 my $value_package_pdk1; |
696 my $value_package_pdk1; |
759 my $value_package_pdk2; |
697 my $value_package_pdk2; |
760 |
698 |
761 while (($tab_counter1 < $total_packages_pdk1) && ($tab_counter2 < $total_packages_pdk2)) # or should it be || |
699 while (($tab_counter1 < $total_packages_pdk1) && ($tab_counter2 < $total_packages_pdk2)) # or should it be || |
762 { |
700 { |
763 #print "tab_counter1=$tab_counter1, total_packages_pdk1=$total_packages_pdk1\ntab_counter2=$tab_counter2, total_packages_pdk2=$total_packages_pdk2\n"; |
|
764 #print "packages in pdk1 is $pdk1_sorting_table[$tab_counter1] and in pdk2 is $pdk2_sorting_table[$tab_counter2]\n"; |
|
765 |
|
766 # $a cmp $b |
701 # $a cmp $b |
767 # if $a > $b value returned is 1 |
702 # if $a > $b value returned is 1 |
768 # if $a = $b value returned is 0 |
703 # if $a = $b value returned is 0 |
769 # if $a < $b value returned is -1 |
704 # if $a < $b value returned is -1 |
770 |
705 |
771 $compare_2_tables = ( $pdk1_sorting_table[$tab_counter1] cmp $pdk2_sorting_table[$tab_counter2] ); |
706 $compare_2_tables = ( $pdk1_sorting_table[$tab_counter1] cmp $pdk2_sorting_table[$tab_counter2] ); |
772 #print "compare_2_tables=$compare_2_tables\n"; |
|
773 |
707 |
774 if(!$compare_2_tables) # Compare if the the packages in the tables(index) are the same or not, if $compare_2_tables=0, then equal |
708 if(!$compare_2_tables) # Compare if the the packages in the tables(index) are the same or not, if $compare_2_tables=0, then equal |
775 { |
709 { |
776 #print "the package is the same in pdk1_sorting_table and pdk2_sorting_table\n"; |
|
777 |
|
778 $value_package_pdk1 = $build_info_xml1{$pdk1_sorting_table[$tab_counter1]}; |
710 $value_package_pdk1 = $build_info_xml1{$pdk1_sorting_table[$tab_counter1]}; |
779 $value_package_pdk2 = $build_info_xml2{$pdk2_sorting_table[$tab_counter2]}; |
711 $value_package_pdk2 = $build_info_xml2{$pdk2_sorting_table[$tab_counter2]}; |
780 #print "value_package_pdk1=$value_package_pdk1\n"; |
|
781 #print "value_package_pdk2=$value_package_pdk2\n"; |
|
782 |
712 |
783 if(($value_package_pdk1 eq $mcl_cste) && ($value_package_pdk2 eq $fcl_cste)) |
713 if(($value_package_pdk1 eq $mcl_cste) && ($value_package_pdk2 eq $fcl_cste)) |
784 { |
714 { |
785 #print "the package was MCL and is now FCL - NEW\n"; |
|
786 $new_fcl_table[$total_new_fcl++] = $pdk1_sorting_table[$tab_counter1]; |
715 $new_fcl_table[$total_new_fcl++] = $pdk1_sorting_table[$tab_counter1]; |
787 } |
716 } |
788 else |
717 else |
789 { |
718 { |
790 if(($value_package_pdk1 eq $fcl_cste) && ($value_package_pdk2 eq $mcl_cste)) |
719 if(($value_package_pdk1 eq $fcl_cste) && ($value_package_pdk2 eq $mcl_cste)) |
791 { |
720 { |
792 #print "the package was FCL and is now MCL - NO MORE\n"; |
|
793 $no_more_fcl_table[$total_no_more_fcl++] = $pdk1_sorting_table[$tab_counter1]; |
721 $no_more_fcl_table[$total_no_more_fcl++] = $pdk1_sorting_table[$tab_counter1]; |
794 } |
722 } |
795 else |
723 else |
796 { |
724 { |
797 if(($value_package_pdk1 eq $fcl_cste) && ($value_package_pdk2 eq $fcl_cste)) |
725 if(($value_package_pdk1 eq $fcl_cste) && ($value_package_pdk2 eq $fcl_cste)) |
798 { |
726 { |
799 #print "the package was FCL and is still FCL - STILL\n"; |
|
800 $still_fcl_table[$total_still_fcl++] = $pdk1_sorting_table[$tab_counter1]; |
727 $still_fcl_table[$total_still_fcl++] = $pdk1_sorting_table[$tab_counter1]; |
801 } |
728 } |
802 else |
729 else |
803 { |
730 { |
804 #print "the package was MCL and is still MCL - VERY GOOD\n"; |
731 #print "the package was MCL and is still MCL - VERY GOOD\n"; |
812 else |
739 else |
813 { |
740 { |
814 # The values are not the same, therefore it must be an added or deleted package |
741 # The values are not the same, therefore it must be an added or deleted package |
815 if($compare_2_tables<0) # If $compare_2_tables=-1, then pdk1 is smaller than pdk2, which means that it has been deleted from pdk2 |
742 if($compare_2_tables<0) # If $compare_2_tables=-1, then pdk1 is smaller than pdk2, which means that it has been deleted from pdk2 |
816 { |
743 { |
817 #print "the package $pdk1_sorting_table[$tab_counter1] has been deleted from pdk2\n"; |
|
818 $packages_removed_table[$total_packages_removed++]=$pdk1_sorting_table[$tab_counter1++]; |
744 $packages_removed_table[$total_packages_removed++]=$pdk1_sorting_table[$tab_counter1++]; |
819 } |
745 } |
820 else |
746 else |
821 { |
747 { |
822 # If $compare_2_tables=1, then pdk1 is bigger than pdk2, which means that it has been added to pdk2 |
748 # If $compare_2_tables=1, then pdk1 is bigger than pdk2, which means that it has been added to pdk2 |
823 #print "the package $pdk2_sorting_table[$tab_counter2] has been added to pdk2\n"; |
|
824 $packages_added_table[$total_packages_added++]=$pdk2_sorting_table[$tab_counter2++]; |
749 $packages_added_table[$total_packages_added++]=$pdk2_sorting_table[$tab_counter2++]; |
825 } |
750 } |
826 } |
751 } |
827 } |
752 } |
828 |
753 |
833 print "\nPrint all the values related to our calculations\n"; |
758 print "\nPrint all the values related to our calculations\n"; |
834 print "total_packages_pdk1=$total_packages_pdk1\n"; |
759 print "total_packages_pdk1=$total_packages_pdk1\n"; |
835 print "total_packages_pdk2=$total_packages_pdk2\n"; |
760 print "total_packages_pdk2=$total_packages_pdk2\n"; |
836 print "\n"; |
761 print "\n"; |
837 print "total_packages_added=$total_packages_added\n"; |
762 print "total_packages_added=$total_packages_added\n"; |
838 print "packages_added_table=\n"; |
|
839 #display_array_one_line_at_the_time(@packages_added_table); |
|
840 print "\n"; |
|
841 print "total_packages_removed=$total_packages_removed\n"; |
763 print "total_packages_removed=$total_packages_removed\n"; |
842 print "packages_removed_table=\n"; |
|
843 #display_array_one_line_at_the_time(@packages_removed_table); |
|
844 print "\n"; |
|
845 print "total_new_fcl=$total_new_fcl\n"; |
764 print "total_new_fcl=$total_new_fcl\n"; |
846 print "new_fcl_table=\n"; |
|
847 #display_array_one_line_at_the_time(@new_fcl_table); |
|
848 print "\n"; |
|
849 print "total_no_more_fcl=$total_no_more_fcl\n"; |
765 print "total_no_more_fcl=$total_no_more_fcl\n"; |
850 print "no_more_fcl_table=\n"; |
|
851 #display_array_one_line_at_the_time(@no_more_fcl_table); |
|
852 print "\n"; |
|
853 print "total_still_fcl=$total_still_fcl\n"; |
766 print "total_still_fcl=$total_still_fcl\n"; |
854 print "still_fcl_table=\n"; |
|
855 #display_array_one_line_at_the_time(@still_fcl_table); |
|
856 print "\n"; |
|
857 print "total_very_good_mcl=$total_very_good_mcl\n"; |
767 print "total_very_good_mcl=$total_very_good_mcl\n"; |
858 print "very_good_mcl_table=\n"; |
|
859 #display_array_one_line_at_the_time(@very_good_mcl_table); |
|
860 print "\n"; |
768 print "\n"; |
861 # Checking that the packages have been assigned properly. |
769 # Checking that the packages have been assigned properly. |
862 # !!!! Need to verify the formula. Not sure that is correct!!!!!! |
770 # !!!! Need to verify the formula. Not sure that is correct!!!!!! |
863 print "Verification for the total packages between the 2 pdks\n"; |
771 print "Verification for the total packages between the 2 pdks\n"; |
864 print "Formula used is: total_packages_pdk2 = total_packages_pdk1 + total_packages_added - total_packages_removed\n"; |
772 print "Formula used is: total_packages_pdk2 = total_packages_pdk1 + total_packages_added - total_packages_removed\n"; |
870 print "Formula used is: total_packages_pdk2 = total_very_good_mcl + total_new_fcl + total_no_more_fcl + total_still_fcl + total_packages_added = total\n"; |
778 print "Formula used is: total_packages_pdk2 = total_very_good_mcl + total_new_fcl + total_no_more_fcl + total_still_fcl + total_packages_added = total\n"; |
871 print "$total_packages_pdk2 = $total_very_good_mcl + $total_new_fcl + $total_no_more_fcl + $total_still_fcl + $total_packages_added - $total_packages_removed= ", ($total_very_good_mcl + $total_new_fcl + $total_no_more_fcl + $total_still_fcl + $total_packages_added - $total_packages_removed), "\n"; |
779 print "$total_packages_pdk2 = $total_very_good_mcl + $total_new_fcl + $total_no_more_fcl + $total_still_fcl + $total_packages_added - $total_packages_removed= ", ($total_very_good_mcl + $total_new_fcl + $total_no_more_fcl + $total_still_fcl + $total_packages_added - $total_packages_removed), "\n"; |
872 print "\n"; |
780 print "\n"; |
873 |
781 |
874 # 5th step is to create a txt file ready to be used for the release notes in a media wiki format. |
782 # 5th step is to create a txt file ready to be used for the release notes in a media wiki format. |
|
783 my $path_to_file_to_publish="$location_of_file_to_publish/$name_of_file_to_publish"; |
875 open(FCLCOMPARISONFILE, ">$path_to_file_to_publish"); # !!!!! First time we are accessing the file, therefore create it or replace it, AFTR THAT WE NEED TO APPEND IT ONLY!!!!! |
784 open(FCLCOMPARISONFILE, ">$path_to_file_to_publish"); # !!!!! First time we are accessing the file, therefore create it or replace it, AFTR THAT WE NEED TO APPEND IT ONLY!!!!! |
876 |
785 |
877 my $val; |
786 my $val; |
878 |
787 |
879 # Enter the beginning of the section for general information about the pdk and it's predecessor. |
788 # Enter the beginning of the section for general information about the pdk and it's predecessor. |
924 |
833 |
925 '''$pdk2_correct_name_to_use''' was built using the FCL versions of the packages listed below: for each one we list the changes in the FCL which are not in the MCL. |
834 '''$pdk2_correct_name_to_use''' was built using the FCL versions of the packages listed below: for each one we list the changes in the FCL which are not in the MCL. |
926 |
835 |
927 The previous PDK also involved some FCLs, so we indicate which problems are now fixed in the MCL, and which FCLs are new to this build. |
836 The previous PDK also involved some FCLs, so we indicate which problems are now fixed in the MCL, and which FCLs are new to this build. |
928 |
837 |
929 Cloning the source from Mercurial is made more awkward by using a mixture of MCLs and FCLs, but we provide a tool to help - see [[How_to_build_the_Platform#Automatic_Mercurial_Clone]] for details. |
838 Cloning the source from Mercurial is made more awkward by using a mixture of MCLs and FCLs, but we provide a tool to help - see [[How to build the Platform#Automatic Mercurial Clone]] for details. |
930 |
839 |
931 EOT |
840 EOT |
932 |
841 |
933 # Packages that were on MCL and that are now on FCL |
842 # Packages that were on MCL and that are now on FCL |
934 foreach $val (@new_fcl_table) |
843 foreach $val (@new_fcl_table) |
972 { |
881 { |
973 print FCLCOMPARISONFILE "''' $val ($pckg_path_name_array{$val}) '''\n\n"; |
882 print FCLCOMPARISONFILE "''' $val ($pckg_path_name_array{$val}) '''\n\n"; |
974 } |
883 } |
975 } |
884 } |
976 |
885 |
977 # Packages were on MCL and they are still on MCL. |
|
978 foreach $val (@very_good_mcl_table) |
|
979 { |
|
980 #print "Value for package $val is: $pckg_name_array{$val}\n"; |
|
981 if($pckg_name_array{$val}) |
|
982 { |
|
983 #print "There is a real name for the package: ($pckg_name_array{$val})\n"; |
|
984 #print FCLCOMPARISONFILE "=== $pckg_name_array{$val} ($pckg_path_name_array{$val}) -- VERY GOOD ===\n"; |
|
985 } |
|
986 else |
|
987 { |
|
988 #print "There is not a real name for the package: ($pckg_name_array{$val})\n"; |
|
989 #print FCLCOMPARISONFILE "=== $val ($pckg_path_name_array{$val}) -- VERY GOOD ===\n"; |
|
990 } |
|
991 } |
|
992 |
|
993 close(FCLCOMPARISONFILE); |
886 close(FCLCOMPARISONFILE); |
994 |
887 |
995 #print "Path for each packages:\n"; |
|
996 #display_hash_array_one_line_at_the_time(%pckg_path_name_array); |
|
997 #print "\n"; |
|
998 #print "Real name for each packages:\n"; |
|
999 #display_hash_array_one_line_at_the_time(%pckg_name_array); |
|
1000 #print "\n"; |
|
1001 #print "Branch type for each packages:\n"; |
|
1002 #display_hash_array_one_line_at_the_time(%build_info_xml2); |
|
1003 #print "\n"; |
|
1004 |
|
1005 # Used to verify the differences between build_info.xml and PkgComponentAnalysisSummary.csv because not the same number of packages. |
|
1006 #print "Packages list from build-info.xml:\n"; |
|
1007 #my @local_array_key_extraction; |
|
1008 #my @local_array_key_extraction_sorted; |
|
1009 #@local_array_key_extraction = keys (%build_info_xml2); |
|
1010 #@local_array_key_extraction_sorted = sort { lc($a) cmp lc($b) } @local_array_key_extraction; |
|
1011 #display_array_one_line_at_the_time(@local_array_key_extraction_sorted); |
|
1012 #print "\n"; |
|
1013 #print "Packages list from csv file:\n"; |
|
1014 #my @local_array_key_extraction; |
|
1015 #my @local_array_key_extraction_sorted; |
|
1016 #@local_array_key_extraction = keys (%pckg_name_array); |
|
1017 #@local_array_key_extraction_sorted = sort { lc($a) cmp lc($b) } @local_array_key_extraction; |
|
1018 #display_array_one_line_at_the_time(@local_array_key_extraction_sorted); |
|
1019 |
|
1020 |
|
1021 # 6th step is to export that txt file the appropriate location. |
|
1022 # That could be the location from where we launched the script! |
|
1023 print "\nYou will find the file with all the information you need for the releases note, here: $path_to_file_to_publish\n\n"; |
888 print "\nYou will find the file with all the information you need for the releases note, here: $path_to_file_to_publish\n\n"; |
1024 |
889 |
1025 # Cleanup the mess!!! |
890 # Cleanup the mess!!! |
1026 #pause_script(); # Temporary until script is finished!!!!!! |
|
1027 |
891 |
1028 $system_cmd = "rmdir /S /Q $working_dir"; |
892 $system_cmd = "rmdir /S /Q $working_dir"; |
1029 print "Exec: $system_cmd\n"; |
893 print "Exec: $system_cmd\n"; |
1030 system($system_cmd); |
894 system($system_cmd); |
1031 |
895 |
1032 exit(0); |
896 exit(0); |
1033 ## |
|
1034 ### End of the program!!! |
|
1035 ## |
|
1036 |
|
1037 |
|
1038 # |
|
1039 # Functions section!!!!! |
|
1040 # |
|
1041 |
|
1042 |
897 |
1043 # If no parameters entered or help selected, display help |
898 # If no parameters entered or help selected, display help |
1044 sub helpme |
899 sub helpme |
1045 { |
900 { |
1046 print "\nfct: helpme\n"; |
901 print "\nfct: helpme\n"; |
1061 print "\nTypical command lines from script location:\n"; |
916 print "\nTypical command lines from script location:\n"; |
1062 print "\t<perl fcls4releasenotes.pl --pdknb1=2.0.e --pdkloc2=c:\\temp\\myPDK\\>\n"; |
917 print "\t<perl fcls4releasenotes.pl --pdknb1=2.0.e --pdkloc2=c:\\temp\\myPDK\\>\n"; |
1063 print "\t<perl fcls4releasenotes.pl --pdkname1=PDK_2.0.e --pdknb2=2.0.e>\n"; |
918 print "\t<perl fcls4releasenotes.pl --pdkname1=PDK_2.0.e --pdknb2=2.0.e>\n"; |
1064 print "\t<perl fcls4releasenotes.pl --pdknb2=2.0.d --pdknb1=2.0.e>\n"; |
919 print "\t<perl fcls4releasenotes.pl --pdknb2=2.0.d --pdknb1=2.0.e>\n"; |
1065 print "\t<perl fcls4releasenotes.pl help>\n"; |
920 print "\t<perl fcls4releasenotes.pl help>\n"; |
1066 #print "\t<perl fcls4releasenotes.pl validpdks>\n"; |
|
1067 |
921 |
1068 list_pdks_at_default_location(); |
922 list_pdks_at_default_location(); |
1069 |
923 |
1070 exit(0); |
924 exit(0); |
1071 } |
925 } |
1117 |
970 |
1118 foreach $var (@directories_list_default_location) |
971 foreach $var (@directories_list_default_location) |
1119 { |
972 { |
1120 if($var =~ /^$pdk_start_pattern+/) |
973 if($var =~ /^$pdk_start_pattern+/) |
1121 { |
974 { |
1122 #print "$var\n"; |
|
1123 $pdk_dir_list_in_default_location[$nb_pdks_in_default_loc++] = $var; |
975 $pdk_dir_list_in_default_location[$nb_pdks_in_default_loc++] = $var; |
1124 } |
976 } |
1125 #else |
|
1126 #{ |
|
1127 #print "Not a PDK!!!!\n"; |
|
1128 #} |
|
1129 } |
977 } |
1130 print "There is $nb_pdks_in_default_loc PDKs in the default location $default_pdk_loc\n"; |
978 print "There is $nb_pdks_in_default_loc PDKs in the default location $default_pdk_loc\n"; |
1131 |
979 |
1132 print "This is the list of PDKs that are in the default location $default_pdk_loc\n"; |
980 print "This is the list of PDKs that are in the default location $default_pdk_loc\n"; |
1133 #display_array_one_line_at_the_time(@pdk_dir_list_in_default_location); |
|
1134 } |
981 } |
1135 |
982 |
1136 # Establish the list of PDK directories with a valid zip file to do the test |
983 # Establish the list of PDK directories with a valid zip file to do the test |
1137 sub extract_pdk_with_valid_zip_in_default_loc |
984 sub extract_pdk_with_valid_zip_in_default_loc |
1138 { |
985 { |
1150 foreach $var1 (@pdk_dir_list_in_default_location) |
997 foreach $var1 (@pdk_dir_list_in_default_location) |
1151 { |
998 { |
1152 $path_to_find_zip=$default_pdk_loc; |
999 $path_to_find_zip=$default_pdk_loc; |
1153 |
1000 |
1154 $path_to_find_zip .= $var1; |
1001 $path_to_find_zip .= $var1; |
1155 #print "path_to_find_zip=$path_to_find_zip\n"; |
|
1156 |
1002 |
1157 # Get the list of directories in the default location |
1003 # Get the list of directories in the default location |
1158 opendir(PDK_DIR, $path_to_find_zip); |
1004 opendir(PDK_DIR, $path_to_find_zip); |
1159 @read_pdk_directory = readdir(PDK_DIR); |
1005 @read_pdk_directory = readdir(PDK_DIR); |
1160 close(PDK_DIR); |
1006 close(PDK_DIR); |
1161 |
1007 |
1162 foreach $var2 (@read_pdk_directory) |
1008 foreach $var2 (@read_pdk_directory) |
1163 { |
1009 { |
1164 if($var2 =~ /$build_bom_zip_file_to_extract$/) |
1010 if($var2 =~ /$build_bom_zip_file_to_extract$/) |
1165 { |
1011 { |
1166 #print "$var2\n"; |
|
1167 $pdks_with_valid_zip_in_default_loc[$nb_pdks_with_valid_zip_in_default_loc++] = $var1; |
1012 $pdks_with_valid_zip_in_default_loc[$nb_pdks_with_valid_zip_in_default_loc++] = $var1; |
1168 } |
1013 } |
1169 #else |
|
1170 #{ |
|
1171 #print "Doesn't contain $build_bom_zip_file_to_extract!!!!\n"; |
|
1172 #} |
|
1173 } |
1014 } |
1174 } |
1015 } |
1175 print "There is $nb_pdks_with_valid_zip_in_default_loc PDKs with a valid $build_bom_zip_file_to_extract zip in the default location $default_pdk_loc\n"; |
1016 print "There is $nb_pdks_with_valid_zip_in_default_loc PDKs with a valid $build_bom_zip_file_to_extract zip in the default location $default_pdk_loc\n"; |
1176 |
1017 |
1177 print "This is the list of PDKs that have a zip file called $build_bom_zip_file_to_extract in the default location $default_pdk_loc\n"; |
1018 print "This is the list of PDKs that have a zip file called $build_bom_zip_file_to_extract in the default location $default_pdk_loc\n"; |
1178 display_array_one_line_at_the_time(@pdks_with_valid_zip_in_default_loc); |
1019 display_array_one_line_at_the_time(@pdks_with_valid_zip_in_default_loc); |
1179 } |
1020 } |
1180 |
1021 |
1181 # Function created to pause the script to allow analysis and debug of the script. |
|
1182 # Will require the user to press enter to carry on the execution of the script. |
|
1183 sub pause_script |
|
1184 { |
|
1185 print "\nfct: pause_script\n"; |
|
1186 my $local_system_cmd = "pause"; |
|
1187 print "Exec: $local_system_cmd\n"; |
|
1188 system($local_system_cmd); |
|
1189 } |
|
1190 |
|
1191 |
|
1192 # This function is used to extract the name of the package and the type |
1022 # This function is used to extract the name of the package and the type |
1193 sub extract_packages_and_branch_type_from_file |
1023 sub extract_packages_and_branch_type_from_file |
1194 { |
1024 { |
1195 # 1 Parameters passed, the path to the file to be viewed |
1025 # 1 Parameters passed, the path to the file to be viewed |
1196 my ($file_to_work_on) = @_; |
1026 my ($file_to_work_on) = @_; |
1198 print "\nfct: extract_packages_and_branch_type_from_file\n"; |
1028 print "\nfct: extract_packages_and_branch_type_from_file\n"; |
1199 |
1029 |
1200 print "$file_to_work_on\n"; |
1030 print "$file_to_work_on\n"; |
1201 |
1031 |
1202 my %local_hash_array; |
1032 my %local_hash_array; |
1203 #my @local_hash_array; |
|
1204 my $local_key; |
1033 my $local_key; |
1205 |
1034 |
1206 my $package=""; |
1035 my $package=""; |
1207 my $type_of_branch=""; |
1036 my $type_of_branch=""; |
1208 |
1037 |
1209 #@hash_array_to_display = %local_hash_array; |
|
1210 #print "%local_hash_array before starting = @hash_array_to_display\n"; |
|
1211 |
|
1212 # Open file |
1038 # Open file |
1213 open(FILETOWORKON , $file_to_work_on); |
1039 open(FILETOWORKON , $file_to_work_on); |
1214 |
1040 |
1215 # Extract data from file |
1041 # Extract data from file |
1216 my @local_array = <FILETOWORKON>; |
1042 my @local_array = <FILETOWORKON>; |
1217 #print "local_array= @local_array\n"; |
|
1218 |
1043 |
1219 # Close file |
1044 # Close file |
1220 close(FILETOWORKON); |
1045 close(FILETOWORKON); |
1221 |
1046 |
1222 |
1047 |
1223 my $extracted_line; |
1048 my $extracted_line; |
1224 |
1049 |
1225 # Go line by line |
1050 # Go line by line |
1226 foreach $extracted_line (@local_array) |
1051 foreach $extracted_line (@local_array) |
1227 { |
1052 { |
1228 #print "\nextracted_line is: $extracted_line"; # no need to add \\n as it's part of the line displayed. |
|
1229 |
|
1230 if ($extracted_line =~ /$starting_pattern_for_xml_extraction/) |
1053 if ($extracted_line =~ /$starting_pattern_for_xml_extraction/) |
1231 { |
1054 { |
1232 #print "The line extracted is our starting pattern $starting_pattern_for_xml_extraction\n"; |
|
1233 $extraction_from_xml_is_allowed=1; |
1055 $extraction_from_xml_is_allowed=1; |
1234 } |
1056 } |
1235 else |
1057 else |
1236 { |
1058 { |
1237 if ($extracted_line =~ /$ending_pattern_for_xml_extraction/) |
1059 if ($extracted_line =~ /$ending_pattern_for_xml_extraction/) |
1238 { |
1060 { |
1239 #print "The line extracted is our ending pattern $ending_pattern_for_xml_extraction\n"; |
|
1240 $extraction_from_xml_is_allowed=0; |
1061 $extraction_from_xml_is_allowed=0; |
1241 } |
1062 } |
1242 } |
1063 } |
1243 #print "extraction_from_xml_is_allowed=$extraction_from_xml_is_allowed\n"; |
|
1244 |
1064 |
1245 if($extraction_from_xml_is_allowed) |
1065 if($extraction_from_xml_is_allowed) |
1246 { |
1066 { |
1247 #print "We are looking to extract the package and branch type from the line extracted\n"; |
|
1248 |
|
1249 # Decode the line |
1067 # Decode the line |
1250 |
1068 |
1251 # Decode the branch type |
1069 # Decode the branch type |
1252 if($extracted_line =~ /$branch_type_extraction_pattern/) |
1070 if($extracted_line =~ /$branch_type_extraction_pattern/) |
1253 { |
1071 { |
1256 # Decode the package because there is a branch type in the line extracted! |
1074 # Decode the package because there is a branch type in the line extracted! |
1257 if ($extracted_line =~ m,$package_extraction_pattern,) |
1075 if ($extracted_line =~ m,$package_extraction_pattern,) |
1258 { |
1076 { |
1259 $package=$1; |
1077 $package=$1; |
1260 } |
1078 } |
1261 #print "package is $package and type_of_branch is $type_of_branch\n"; |
|
1262 $local_hash_array{$package}=$type_of_branch; |
1079 $local_hash_array{$package}=$type_of_branch; |
1263 |
1080 |
1264 } |
1081 } |
1265 else |
1082 } |
1266 { |
1083 } |
1267 #print "The extracted line doesn't contain $look_for_mcl or $look_for_fcl, therefore we need to skip it!\n"; |
1084 |
1268 } |
|
1269 } |
|
1270 } |
|
1271 |
|
1272 # Check the contain of the hash array to make sure that we have extracted the data as expected. To check against the actual file. |
|
1273 |
|
1274 # Option 1: Display all in one line |
|
1275 #@hash_array_to_display = %local_hash_array; |
|
1276 # Print "%local_hash_array when extraction is finished = @hash_array_to_display\n"; |
|
1277 |
|
1278 # Option 2: Print 1 key with 1 value by line |
|
1279 #foreach $local_key (keys(%local_hash_array)) |
|
1280 #{ |
|
1281 # print "$local_key = $local_hash_array{$local_key}\n"; |
|
1282 #} |
|
1283 |
|
1284 # Return hash array containing all the packages and branch type associated |
1085 # Return hash array containing all the packages and branch type associated |
1285 return (%local_hash_array); |
1086 return (%local_hash_array); |
1286 } |
1087 } |
1287 |
1088 |
1288 # Function used to extract all the data from the csv file about the different packages (name, path and real name) |
1089 # Function used to extract all the data from the csv file about the different packages (name, path and real name) |
1338 |
1138 |
1339 # Go line by line |
1139 # Go line by line |
1340 |
1140 |
1341 foreach $extracted_line (@local_array) |
1141 foreach $extracted_line (@local_array) |
1342 { |
1142 { |
1343 #print "\nextracted_line is: $extracted_line"; # no need to add \\n as it's part of the line displayed. |
|
1344 |
|
1345 if($extracted_line =~ m;$pckg_name_extraction_pattern;) |
1143 if($extracted_line =~ m;$pckg_name_extraction_pattern;) |
1346 { |
1144 { |
1347 $pckg_name = $1; |
1145 $pckg_name = $1; |
1348 #print "Pckg name is: $pckg_name\n"; |
|
1349 |
|
1350 #print "Is $pckg_name already exist in the hash array?: $pckg_path_name_array{$pckg_name}\n"; |
|
1351 |
1146 |
1352 if(!$pckg_path_name_array{$pckg_name}) # Check if package is not already in the table to avoid duplicates |
1147 if(!$pckg_path_name_array{$pckg_name}) # Check if package is not already in the table to avoid duplicates |
1353 { |
1148 { |
1354 #print "$pckg_name is not in the hash array, we need to add it\n"; |
|
1355 if($extracted_line =~ m;$pckg_path_extraction_pattern;) |
1149 if($extracted_line =~ m;$pckg_path_extraction_pattern;) |
1356 { |
1150 { |
1357 $pckg_path = $1; |
1151 $pckg_path = $1; |
1358 #print "Pckg path is: $pckg_path\n"; |
|
1359 } |
1152 } |
1360 if($extracted_line =~ m;$pckg_real_name_extraction_pattern;) |
1153 if($extracted_line =~ m;$pckg_real_name_extraction_pattern;) |
1361 { |
1154 { |
1362 $pckg_real_name = $1; |
1155 $pckg_real_name = $1; |
1363 #print "Pckg real name is: $pckg_real_name\n"; |
|
1364 } |
1156 } |
1365 # fill the tables |
1157 # fill the tables |
1366 $pckg_path_name_array{$pckg_name} = $pckg_path; |
1158 $pckg_path_name_array{$pckg_name} = $pckg_path; |
1367 $pckg_name_array{$pckg_name} = $pckg_real_name; |
1159 $pckg_name_array{$pckg_name} = $pckg_real_name; |
1368 } |
1160 } |
1372 my $local_value=""; |
1164 my $local_value=""; |
1373 my @local_array_sorted; |
1165 my @local_array_sorted; |
1374 |
1166 |
1375 @local_array=keys (%pckg_path_name_array); |
1167 @local_array=keys (%pckg_path_name_array); |
1376 @local_array_sorted = sort { lc($a) cmp lc($b) } @local_array; |
1168 @local_array_sorted = sort { lc($a) cmp lc($b) } @local_array; |
1377 |
|
1378 # print "\n"; |
|
1379 # my $counter_to_remove=0; |
|
1380 # foreach $local_value (@local_array_sorted) |
|
1381 # { |
|
1382 #print "$counter_to_remove: The path for package $local_value is: $pckg_path_name_array{$local_value}\n"; |
|
1383 #print "$counter_to_remove:The real name for package $local_value is: $pckg_name_array{$local_value}\n"; |
|
1384 #print "$counter_to_remove: local_array_sorted[$counter_to_remove]:$local_array_sorted[$counter_to_remove]\n"; |
|
1385 #print "$local_array_sorted[$counter_to_remove]\n"; |
|
1386 #$counter_to_remove++; |
|
1387 # } |
|
1388 } |
1169 } |
1389 |
1170 |
1390 # Function used to display one line at the time for an array |
1171 # Function used to display one line at the time for an array |
1391 sub display_array_one_line_at_the_time |
1172 sub display_array_one_line_at_the_time |
1392 { |
1173 { |
1393 my (@table_to_display_one_line_at_the_time) = @_; |
1174 foreach (@_) |
1394 |
1175 { |
1395 #print "\nfct: display_array_one_line_at_the_time\n"; # Not displayed because you could think that is part of the table. As well it's easier to copy the name of the table and the contain wihtout the need to remove something. |
1176 print "$_\n"; |
1396 |
|
1397 my $line_to_display; |
|
1398 |
|
1399 foreach $line_to_display (@table_to_display_one_line_at_the_time) |
|
1400 { |
|
1401 print "$line_to_display\n"; |
|
1402 } |
1177 } |
1403 } |
1178 } |
1404 |
1179 |
1405 # Function used to display one line at the time for an hash array |
1180 # Function used to display one line at the time for an hash array |
1406 sub display_hash_array_one_line_at_the_time |
1181 sub display_hash_array_one_line_at_the_time |
1407 { |
1182 { |
1408 my (%hash_array_to_display_one_line_at_the_time) = @_; |
1183 my (%hash_array_to_display_one_line_at_the_time) = @_; |
1409 |
1184 |
1410 my @local_keys_array; |
1185 my @local_keys_array; |
1411 my @local_keys_array_sorted; |
1186 my @local_keys_array_sorted; |
1412 |
|
1413 #print "\nfct: display_hash_array_one_line_at_the_time\n"; # Not displayed because you could think that is part of the table. As well it's easier to copy the name of the table and the contain wihtout the need to remove something. |
|
1414 |
1187 |
1415 my $line_to_display; |
1188 my $line_to_display; |
1416 |
1189 |
1417 @local_keys_array = keys (%hash_array_to_display_one_line_at_the_time); |
1190 @local_keys_array = keys (%hash_array_to_display_one_line_at_the_time); |
1418 @local_keys_array_sorted = sort { lc($a) cmp lc($b) } @local_keys_array; |
1191 @local_keys_array_sorted = sort { lc($a) cmp lc($b) } @local_keys_array; |