releaseAutomation/fcls4releasenotes.pl
author Arnaud Lenoir
Mon, 21 Sep 2009 16:13:48 +0100
changeset 80 9f8bdafe5d68
child 81 63e14a36aefd
permissions -rw-r--r--
Perl script for the releases notes automation with fcl!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
80
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     1
# Copyright (c) 2009 Symbian Foundation Ltd
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     2
# This component and the accompanying materials are made available
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     4
# which accompanies this distribution, and is available
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     6
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     7
# Initial Contributors:
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
     9
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    10
# Contributors:
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    11
# Arnaud Lenoir
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    12
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    13
# Description:
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    14
# Task 243 - Generate FCLs details between 2 PDKs to be included as part of the release notes
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    15
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    16
# Here is the location for the naming convention for the PDKs: http://developer.symbian.org/wiki/index.php/Build_and_Integration
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    17
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    18
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    19
# Configuration data and constants for the script
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    20
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    21
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    22
my $default_pdk_loc='\\\\bishare\\releases\\';
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    23
print "default_pdk_loc=$default_pdk_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    24
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    25
# Nb of arguments to be passed to the script to work. If that need to change, just modify nb_arg_to_pass!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    26
my $nb_arg_to_pass=2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    27
print "nb_arg_to_pass=$nb_arg_to_pass\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    28
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    29
# Name of the file that contains the data we need to extract for this script
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    30
my $name_zip_file_to_extract="build_BOM\.zip";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    31
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    32
# Pattern used to search for PDKs
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    33
my $pdk_start_pattern="PDK_";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    34
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    35
# Pattern used to extract info from the xml file
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    36
my $starting_pattern_for_xml_extraction="<name>Sources</name>";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    37
my $ending_pattern_for_xml_extraction="</project>";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    38
# Pattern to extract data from the line in the file
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    39
# Branch type. If not a branch type, we are not interested
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    40
my $branch_type_extraction_pattern="(MCL|FCL)";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    41
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    42
my $mcl_cste="MCL";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    43
my $fcl_cste="FCL";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    44
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    45
# package name
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    46
#/imgeditor/#:86a88f39b644</baseline>
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    47
# # is used to define the changeset number for mercurial.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    48
# Therefore if we have a look what is before "/#", we should always find the package name!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    49
my $package_extraction_pattern = "([^/]+)/?#";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    50
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    51
# When that "boolean value is set to 1 or true, then the line we read in the file can be search for the information we want to extract
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    52
# If $starting_pattern_for_xml_extraction true, then set extraction_from_xml_is_allowed to true/1
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    53
# If $ending_pattern_for_xml_extraction false, then reset extraction_from_xml_is_allowed to false/0
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    54
# $ending_pattern_for_xml_extraction is called several times in the program, but this is not a problem as we don't set it to false/0 and therefore do nothing!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    55
my $extraction_from_xml_is_allowed=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    56
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    57
# Temporary location used to do the work
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    58
my $working_drive="c:";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    59
my $working_directory="temp";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    60
my $working_sub_directory="fcl_extraction";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    61
my $working_pdk1_directory="pdk1";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    62
my $working_pdk2_directory="pdk2";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    63
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    64
# Name of the file we need to work on to extract the data necessary for the Release Notes
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    65
my $name_of_file_to_compare="build-info.xml";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    66
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    67
# Name of the file that we are creating to hold the information necessary for the Release Notes
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    68
my $name_of_file_to_publish="fcl_info.txt";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    69
#Location for that file
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    70
my $location_of_file_to_publish="c:\\temp";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    71
my $file_path="$location_of_file_to_publish\\$name_of_file_to_publish";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    72
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    73
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    74
# End configuration data for the script
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    75
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    76
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    77
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    78
# Get parameters passed to the script. Save only the 2 first parameters as we need only 2 parameters for the script
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    79
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    80
my $nb_arg_passed = scalar(@ARGV);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    81
print "nb_arg_passed=$nb_arg_passed\n"; # Find out the number of arguement passed
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    82
print "@ARGV\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    83
if ($nb_arg_passed != $nb_arg_to_pass)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    84
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    85
	helpme();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    86
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    87
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    88
# Needs to be done here, otherwise lost if try to recover them later on. Why?
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    89
my $arg1_passed = $ARGV[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    90
my $arg2_passed = $ARGV[1];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    91
print "arg1_passed= $arg1_passed \t arg2_passed=$arg2_passed\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    92
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    93
# Modules necessary to run this script
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    94
use Getopt::Long;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    95
use strict;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    96
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    97
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    98
# Arguments / Data used for the script
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
    99
my $pdknb1 = '';
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   100
my $pdknb2 = '';
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   101
my $pdkloc1 = '';
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   102
my $pdkloc2 = '';
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   103
my $pdkname1 = '';
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   104
my $pdkname2 = '';
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   105
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   106
my $help = 0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   107
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   108
GetOptions((
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   109
	'pdknb1=s' => \$pdknb1,
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   110
	'pdknb2=s' => \$pdknb2,
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   111
	'pdkname1=s' => \$pdkname1,
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   112
	'pdkname2=s' => \$pdkname2,
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   113
	'pdkloc1=s' => \$pdkloc1,
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   114
	'pdkloc2=s' => \$pdkloc2,
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   115
	'help!' => \$help
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   116
));
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   117
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   118
print "\$pdknb1=$pdknb1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   119
print "\$pdknb2=$pdknb2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   120
print "\$pdkname1=$pdkname1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   121
print "\$pdkname2=$pdkname2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   122
print "\$pdkloc1=$pdkloc1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   123
print "\$pdkloc2=$pdkloc2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   124
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   125
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)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   126
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   127
# First PDK to check
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   128
my $pdk_path1="";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   129
my $pdk_complete_name1=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   130
my $pdk_complete_path1=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   131
my $pdk_path1_now_in_use=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   132
my $pdk_values_to_search1=""; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   133
my $pdk_path1_exist=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   134
my $pdk_zip1_exit=0; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   135
my $pdk1_correct_name_to_use="";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   136
my $loc1_contains_the_zip_file_we_need=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   137
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   138
# Second PDK to check
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   139
my $pdk_path2="";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   140
my $pdk_complete_name2=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   141
my $pdk_complete_path2=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   142
my $pdk_path2_now_in_use=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   143
my $pdk_values_to_search2=""; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   144
my $pdk_path2_exist=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   145
my $pdk_zip2_exist=0; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   146
my $pdk2_correct_name_to_use="";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   147
my $loc2_contains_the_zip_file_we_need=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   148
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   149
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   150
# Default directory management
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   151
my @directories_list_default_location=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   152
my $nb_dir_in_default_loc;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   153
my @pdk_dir_list_in_default_location=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   154
my $nb_pdks_in_default_loc=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   155
my @pdks_with_valid_zip_in_default_loc=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   156
my $nb_pdks_with_valid_zip_in_default_loc=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   157
my @find_pdk_for_corresponding_nb1=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   158
my $nb_of_pdk_for_corresponding_nb1=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   159
my @find_pdk_for_corresponding_nb2=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   160
my $nb_of_pdk_for_corresponding_nb2=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   161
my @find_pdk_for_corresponding_name1=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   162
my $nb_of_pdk_for_corresponding_name1=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   163
my @find_pdk_for_corresponding_name2=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   164
my $nb_of_pdk_for_corresponding_name2=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   165
my @read_files_in_loc=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   166
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   167
# Data / statistics to be displayed in the release notes
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   168
# We consider that pdk1 is the old version and pdk2 is the new version.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   169
# Note that for the moment, the scripts is not able to make sure that the old version of the pdk is set as pdk1 and the new version of the pdk is set as pdk2!!!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   170
# Can be done for pdknb and pdkname but not for pdkloc as for the moment, no way to find out the pdk version from the build-info.xmL!!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   171
# Totals
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   172
my $total_packages_pdk1=0;		# Nb of packages included in the pdk1
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   173
my $total_packages_pdk2=0;		# Nb of packages included in the pdk2
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   174
my $total_packages_added=0;		# Nb of packages added in the pdk2
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   175
my $total_packages_removed=0;	# Nb of packages removed from the pdk2
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   176
my $total_new_fcl=0;			# Nb of packages that are now on fcl in pdk2 (means were mcl in pdk1 and are now fcl in pdk2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   177
my $total_no_more_fcl=0;		# Nb of packages that are no more on fcl in pdk2 (means were fcl in pdk1 and are now mcl in pdk2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   178
my $total_still_fcl=0;			# Nb of packages that are still on fcl in pdk2 (means were fcl in pdk1 and are still fcl in pdk2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   179
my $total_very_good_mcl=0;		# Nb of packages that are very good on mcl in pdk1 and pdk2 (means were on mcl in pdk1 and are still mcl in pdk2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   180
# Tables
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   181
my @pdk1_sorting_table;			# Table for pdk1 that is used to sort out and compare the 2 pdks
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   182
my @pdk2_sorting_table;			# Table for pdk2 that is used to sort out and compare the 2 pdks
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   183
my @packages_added_table;		# Table that contains the packages that have been added to pdk2
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   184
my @packages_removed_table;		# Table that contains the packages that have been deleted from pdk2
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   185
my @new_fcl_table;				# Table containing the packages that are now on fcl in pdk2 (means were mcl in pdk1 and are now fcl in pdk2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   186
my @no_more_fcl_table;			# Table containing the packages that are no more on fcl in pdk2 (means were fcl in pdk1 and are now mcl in pdk2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   187
my @still_fcl_table;			# Table containing the packages that are still on fcl in pdk2 (means were fcl in pdk1 and are still fcl in pdk2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   188
my @very_good_mcl_table;		# Table containing the packages that are very good on mcl in pdk1 and pdk2 (means were on mcl in pdk1 and are still mcl in pdk2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   189
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   190
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   191
# Check that we have only 2 values for the PDKs. If not 2, then not good!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   192
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   193
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   194
# Script code start here!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   195
if($pdknb1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   196
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   197
	$count_arg++;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   198
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   199
	# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   200
	$pdk_path1 = $default_pdk_loc;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   201
	$pdk_complete_name1=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   202
	$pdk_complete_path1=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   203
	$pdk_path1_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   204
	$pdk_values_to_search1=$pdknb1; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   205
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   206
if($pdknb2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   207
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   208
	$count_arg++;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   209
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   210
	# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   211
	$pdk_path2 = $default_pdk_loc;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   212
	$pdk_complete_name2=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   213
	$pdk_complete_path2=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   214
	$pdk_path2_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   215
	$pdk_values_to_search2=$pdknb2; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   216
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   217
if($pdkname1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   218
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   219
	$count_arg++;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   220
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   221
	if(!$pdk_path1_now_in_use)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   222
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   223
		# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   224
		$pdk_path1 = $default_pdk_loc;	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   225
		$pdk_complete_path1=1;	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   226
		$pdk_path1_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   227
		$pdk_values_to_search1=$pdkname1; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   228
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   229
	else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   230
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   231
		if(!$pdk_path2_now_in_use)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   232
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   233
			# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   234
			$pdk_path2 = $default_pdk_loc;	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   235
			$pdk_complete_path2=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   236
			$pdk_path2_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   237
			$pdk_values_to_search2=$pdkname1; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   238
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   239
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   240
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   241
if($pdkname2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   242
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   243
	$count_arg++;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   244
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   245
	if(!$pdk_path2_now_in_use)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   246
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   247
		# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   248
		$pdk_path2 = $default_pdk_loc;	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   249
		$pdk_complete_path2=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   250
		$pdk_path2_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   251
		$pdk_values_to_search2=$pdkname2; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   252
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   253
	else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   254
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   255
		if(!$pdk_path1_now_in_use)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   256
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   257
			# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   258
			$pdk_path1 = $default_pdk_loc;	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   259
			$pdk_complete_path1=1;	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   260
			$pdk_path1_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   261
			$pdk_values_to_search1=$pdkname2; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   262
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   263
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   264
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   265
if($pdkloc1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   266
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   267
	$count_arg++;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   268
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   269
	if(!$pdk_path1_now_in_use)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   270
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   271
		# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   272
		$pdk_path1 = $pdkloc1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   273
		$pdk_path1_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   274
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   275
	else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   276
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   277
		if(!$pdk_path2_now_in_use)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   278
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   279
			# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   280
			$pdk_path2 = $pdkloc1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   281
			$pdk_path2_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   282
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   283
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   284
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   285
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   286
if($pdkloc2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   287
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   288
	$count_arg++;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   289
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   290
	if(!$pdk_path2_now_in_use)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   291
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   292
		# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   293
		$pdk_path2 = $pdkloc2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   294
		$pdk_path2_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   295
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   296
	else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   297
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   298
		if(!$pdk_path1_now_in_use)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   299
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   300
			# Get data for first pdk used for the comparison
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   301
			$pdk_path1 = $pdkloc2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   302
			$pdk_path1_now_in_use=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   303
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   304
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   305
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   306
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   307
print "count_arg=$count_arg\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   308
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   309
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   310
# If no parameters entered or help selected, display help
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   311
if ($count_arg != $nb_arg_to_pass)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   312
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   313
	#$help = 1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   314
	helpme();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   315
	print"\nThe script accepts $nb_arg_to_pass parameters only!\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   316
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   317
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   318
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   319
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   320
# If we reach this point, this means that we have the right numbers of arguments passed to the script.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   321
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   322
print "\nWe are on the right path!!!!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   323
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   324
print "pdk_path1=$pdk_path1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   325
print "pdk_complete_name1=$pdk_complete_name1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   326
print "pdk_complete_path1=$pdk_complete_path1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   327
print "pdk_values_to_search1=$pdk_values_to_search1\n"; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   328
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   329
print "pdk_path2=$pdk_path2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   330
print "pdk_complete_name2=$pdk_complete_name2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   331
print "pdk_complete_path2=$pdk_complete_path2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   332
print "pdk_values_to_search2=$pdk_values_to_search2\n"; # Not necessary
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   333
print "\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   334
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   335
# Get directory listing of all directories in the default location $default_pdk_loc
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   336
extract_dir_default_loc();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   337
extract_pdk_in_default_loc();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   338
extract_pdk_with_valid_zip_in_default_loc();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   339
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   340
# Compose path if necessary.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   341
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   342
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   343
my $find_val=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   344
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   345
if ($pdk_complete_path1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   346
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   347
	if ($pdk_complete_name1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   348
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   349
		print "We have the PDK number, we need to define if possible the PDK name and therefore the path to the PDK\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   350
		# 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
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   351
		foreach $find_val (@pdks_with_valid_zip_in_default_loc)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   352
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   353
			#print $find_val, "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   354
			if($find_val =~ /$pdknb1/i)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   355
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   356
				$find_pdk_for_corresponding_nb1[$nb_of_pdk_for_corresponding_nb1++]=$find_val;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   357
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   358
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   359
		print "Table find_pdk_for_corresponding_nb1 is:\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   360
		display_array_one_line_at_the_time(@find_pdk_for_corresponding_nb1);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   361
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   362
		if($nb_of_pdk_for_corresponding_nb1==1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   363
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   364
			print "There is only $nb_of_pdk_for_corresponding_nb1 PDK with the name corresponding to the PDK number given, we can keep going!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   365
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   366
		else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   367
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   368
			print "There is $nb_of_pdk_for_corresponding_nb1 PDKs with the same name, please select one in the list above and run the perl script again with the right PDK name\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   369
			exit(0);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   370
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   371
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   372
		#extract PDK name if only one
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   373
		$pdk1_correct_name_to_use = $find_pdk_for_corresponding_nb1[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   374
		$pdk_path1 .= $find_pdk_for_corresponding_nb1[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   375
		print "pdknb1 = $pdknb1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   376
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   377
	else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   378
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   379
		print "We have the PDK Name therefore we can define the path to the PDK\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   380
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   381
		# 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
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   382
		foreach $find_val (@pdks_with_valid_zip_in_default_loc)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   383
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   384
			#print $find_val, "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   385
			if($find_val =~ /$pdkname1/i)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   386
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   387
				$find_pdk_for_corresponding_name1[$nb_of_pdk_for_corresponding_name1++]=$find_val;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   388
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   389
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   390
		print "Table find_pdk_for_corresponding_name1 is: \n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   391
		display_array_one_line_at_the_time(@find_pdk_for_corresponding_name1);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   392
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   393
		if($nb_of_pdk_for_corresponding_name1==1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   394
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   395
			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";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   396
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   397
		else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   398
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   399
			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";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   400
			exit(0);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   401
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   402
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   403
		#extract PDK name if only one
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   404
		$pdk1_correct_name_to_use = $find_pdk_for_corresponding_name1[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   405
		$pdk_path1 .= @find_pdk_for_corresponding_name1[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   406
		print "pdkname1 = $pdkname1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   407
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   408
	print "The PDK used is: $pdk1_correct_name_to_use\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   409
	print "pdk_path1 = $pdk_path1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   410
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   411
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   412
$find_val=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   413
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   414
if ($pdk_complete_path2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   415
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   416
	if ($pdk_complete_name2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   417
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   418
		print "We have the PDK number, we need to define if possible the PDK name and therefore the path to the PDK\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   419
		# 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
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   420
		foreach $find_val (@pdks_with_valid_zip_in_default_loc)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   421
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   422
			#print $find_val, "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   423
			if($find_val =~ /$pdknb2/i)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   424
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   425
				$find_pdk_for_corresponding_nb2[$nb_of_pdk_for_corresponding_nb2++]=$find_val;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   426
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   427
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   428
		print "Table find_pdk_for_corresponding_nb is:\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   429
		display_array_one_line_at_the_time(@find_pdk_for_corresponding_nb2);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   430
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   431
		if($nb_of_pdk_for_corresponding_nb2==1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   432
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   433
			print "There is only $nb_of_pdk_for_corresponding_nb2 PDK with the name corresponding to the PDK number given, we can keep going!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   434
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   435
		else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   436
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   437
			print "There is $nb_of_pdk_for_corresponding_nb2 PDKs with the same name, please select one in the list above and run the perl script again with the right PDK name\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   438
			exit(0);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   439
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   440
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   441
		#extract PDK name if only one
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   442
		$pdk2_correct_name_to_use = $find_pdk_for_corresponding_nb2[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   443
		$pdk_path2 .= $find_pdk_for_corresponding_nb2[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   444
		print "pdknb2 = $pdknb2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   445
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   446
	else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   447
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   448
		print "We have the PDK Name therefore we can define the path to the PDK\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   449
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   450
		# 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
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   451
		foreach $find_val (@pdks_with_valid_zip_in_default_loc)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   452
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   453
			#print $find_val, "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   454
			if($find_val =~ /$pdkname2/i)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   455
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   456
				$find_pdk_for_corresponding_name2[$nb_of_pdk_for_corresponding_name2++]=$find_val;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   457
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   458
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   459
		print "Table find_pdk_for_corresponding_name2 is:\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   460
		display_array_one_line_at_the_time(@find_pdk_for_corresponding_name2);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   461
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   462
		if($nb_of_pdk_for_corresponding_name2==1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   463
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   464
			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";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   465
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   466
		else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   467
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   468
			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";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   469
			exit(0);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   470
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   471
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   472
		#extract PDK name if only one
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   473
		$pdk2_correct_name_to_use = $find_pdk_for_corresponding_name2[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   474
		$pdk_path2 .= @find_pdk_for_corresponding_name2[0];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   475
		print "pdkname2 = $pdkname2\n";		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   476
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   477
	print "The PDK used is: $pdk2_correct_name_to_use\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   478
	print "pdk_path2 = $pdk_path2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   479
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   480
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   481
# Find out if the locations are correct or not. We just need to make sure that the location contains the build_BOM.zip, if it's the case, then bingo! If not, exit the program.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   482
my $loc_var;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   483
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   484
if($pdkloc1)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   485
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   486
	# Get the list of file in the location choosen.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   487
	opendir(LOC1_DIR, $pdkloc1);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   488
	@read_files_in_loc = readdir(LOC1_DIR);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   489
	close(LOC1_DIR);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   490
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   491
	#print "List of files in the directory: @read_files_in_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   492
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   493
	foreach $loc_var (@read_files_in_loc)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   494
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   495
		#if($loc_var =~ /$name_zip_file_to_extract[^.\w]/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   496
		if($loc_var =~ /$name_zip_file_to_extract$/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   497
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   498
			print "We found the file: $loc_var\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   499
			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   500
			$pdk1_correct_name_to_use = "PDK1";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   501
			$pdk_path1 = $pdkloc1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   502
			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   503
			print "The PDK used is: $pdk1_correct_name_to_use\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   504
			print "pdk_path1 = $pdk_path1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   505
			$loc1_contains_the_zip_file_we_need=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   506
			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   507
			# As we have found the file, we can probably break!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   508
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   509
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   510
	if(!$loc1_contains_the_zip_file_we_need)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   511
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   512
		print "We can't find the file $name_zip_file_to_extract in the location $pdkloc2 and therefore we can't go any further!!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   513
		exit(0);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   514
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   515
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   516
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   517
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   518
if($pdkloc2)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   519
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   520
	# Get the list of file in the location choosen.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   521
	opendir(LOC2_DIR, $pdkloc2);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   522
	@read_files_in_loc = readdir(LOC2_DIR);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   523
	close(LOC2_DIR);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   524
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   525
	#print "List of files in the directory: @read_files_in_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   526
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   527
	foreach $loc_var (@read_files_in_loc)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   528
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   529
		#if($loc_var =~ /$name_zip_file_to_extract[^.\w]/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   530
		if($loc_var =~ /$name_zip_file_to_extract$/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   531
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   532
			print "We found the file: $loc_var\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   533
			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   534
			$pdk2_correct_name_to_use = "PDK2";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   535
			$pdk_path2 = $pdkloc2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   536
			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   537
			print "The PDK used is: $pdk2_correct_name_to_use\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   538
			print "pdk_path2 = $pdk_path2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   539
			$loc2_contains_the_zip_file_we_need=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   540
			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   541
			# As we have found the file, we can probably break!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   542
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   543
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   544
	if(!$loc2_contains_the_zip_file_we_need)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   545
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   546
		print "We can't find the file $name_zip_file_to_extract in the location $pdkloc2 and therefore we can't go any further!!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   547
		exit(0);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   548
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   549
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   550
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   551
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   552
print "If we are here, this means that both $name_zip_file_to_extract have been found and we can start the real work to compare the 2 files to extract what we need!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   553
print "This is the value for the path we are looking at for pdk_path1: $pdk_path1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   554
print "This is the value for the path we are looking at for pdk_path2: $pdk_path2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   555
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   556
# When we are at this point, we know we have 2 build_BOM.zip files that we can compare them!!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   557
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   558
my $system_cmd = "";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   559
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   560
my $working_dir="$working_drive\\$working_directory\\$working_sub_directory";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   561
my $working_dir1="$working_drive\\$working_directory\\$working_sub_directory\\$working_pdk1_directory";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   562
my $working_dir2="$working_drive\\$working_directory\\$working_sub_directory\\$working_pdk2_directory";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   563
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   564
# 1st step is to extract the 2 zip files to allow us to have access to build-info.xml
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   565
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   566
# Extract just one file from the zip file using "7z e -r -oOutput_Directory"
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   567
#7z e -r build_BOM.zip build-info.xml
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   568
# Where 7z is the unzip program
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   569
# Where e is for extraction of a file
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   570
# Where -r is for recursive to make sure we have a look in the subdirectories
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   571
# Where -oOutput_Directory is the directory where we want the files to be unzipped
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   572
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   573
# Where $working_sub_directory is the directory where we will be carry the work to be done for the script.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   574
# Where $working_pdk1_directory is the subdirectory destination for the PDK1
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   575
# Where $name_zip_file_to_extract is the name of the zip file (in our case: build_BOM.zip)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   576
# Where $pdk_path1 is the place where the zip file to unzip is
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   577
# where $name_of_file_to_compare is the name of the file we want to extract from the zip file (in our case: build-info.xml)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   578
# Example: 7z e -r -oc:\temp\fcl_extraction\pdk1 C:\temp\Task243Test\PDK_1\build_BOM.zip build-info.xml
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   579
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   580
# Extract file from 1st PDK
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   581
$system_cmd = "7z e -r -o$working_dir1 $pdk_path1\\$name_zip_file_to_extract $name_of_file_to_compare";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   582
print "Exec: $system_cmd\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   583
system($system_cmd);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   584
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   585
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   586
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   587
# Extract file from 2nd PDK
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   588
$system_cmd = "7z e -r -o$working_dir2 $pdk_path2\\$name_zip_file_to_extract $name_of_file_to_compare";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   589
print "Exec: $system_cmd\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   590
system($system_cmd);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   591
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   592
# 2nd step is to extract the information we need from the 2 files build-info.xml
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   593
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   594
# Create 2 hash arrays that will contain the name of the package as key and the value associated as MCL or FCL
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   595
my %build_info_xml1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   596
my %build_info_xml2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   597
my @sorting_build_info_xml1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   598
my @sorting_build_info_xml2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   599
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   600
#my @display_hash_array;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   601
my $key;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   602
# Define the path for the files to work on
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   603
my $path_to_pdk1_file_to_work_on="$working_dir1\\$name_of_file_to_compare";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   604
my $path_to_pdk2_file_to_work_on="$working_dir2\\$name_of_file_to_compare";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   605
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   606
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   607
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   608
my $count_packages=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   609
my @not_sorted_table;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   610
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   611
# Keep only what we need and keep it safe somewhere.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   612
# pdk1
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   613
%build_info_xml1 = extract_packages_and_branch_type_from_file($path_to_pdk1_file_to_work_on);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   614
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   615
print "%build_info_xml1:\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   616
# Define the number of packages for pdk1
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   617
$total_packages_pdk1 = keys %build_info_xml1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   618
print "\nThere is $total_packages_pdk1 packages for $pdk1_correct_name_to_use\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   619
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   620
# 3rd a) step is to sort out the 2 files / table
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   621
# Sort out the tables to facilitate the checking of the different packages
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   622
@not_sorted_table = keys %build_info_xml1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   623
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   624
#print "\nnot_sorted_table:\n @not_sorted_table\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   625
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   626
# ascendant alphabetical sort
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   627
@pdk1_sorting_table = sort { lc($a) cmp lc($b) } @not_sorted_table;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   628
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   629
#print "\npdk1_sorting_table :\n @pdk1_sorting_table\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   630
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   631
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   632
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   633
# pdk2
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   634
%build_info_xml2 = extract_packages_and_branch_type_from_file($path_to_pdk2_file_to_work_on);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   635
print "%build_info_xml2:\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   636
# Define the number of packages for pdk2
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   637
$total_packages_pdk2 = keys %build_info_xml2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   638
print "\nThere is $total_packages_pdk2 packages for $pdk2_correct_name_to_use\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   639
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   640
# 3rd b) step is to sort out the 2 files / table
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   641
# Sort out the tables to facilitate the checking of the different packages
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   642
@not_sorted_table = keys %build_info_xml2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   643
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   644
#print "\nnot_sorted_table:\n @not_sorted_table\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   645
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   646
# ascendant alphabetical sort
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   647
@pdk2_sorting_table = sort { lc($a) cmp lc($b) } @not_sorted_table;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   648
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   649
#print "\npdk2_sorting_table :\n @pdk2_sorting_table\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   650
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   651
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   652
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   653
# 4th step is to compare both data and export it to a file or something similar that is good for media wiki.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   654
# Compare both files to find out the difference between each packages FCL, MCL, added or deleted packages
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   655
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   656
my $tab_counter1=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   657
my $tab_counter2=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   658
my $compare_2_tables;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   659
my $value_package_pdk1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   660
my $value_package_pdk2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   661
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   662
while (($tab_counter1 < $total_packages_pdk1) && ($tab_counter2 < $total_packages_pdk2)) # or should it be ||
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   663
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   664
	#print "tab_counter1=$tab_counter1, total_packages_pdk1=$total_packages_pdk1\ntab_counter2=$tab_counter2, total_packages_pdk2=$total_packages_pdk2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   665
	#print "packages in pdk1 is $pdk1_sorting_table[$tab_counter1] and in pdk2 is $pdk2_sorting_table[$tab_counter2]\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   666
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   667
	# $a cmp $b
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   668
	# if $a > $b value returned is 1
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   669
	# if $a = $b value returned is 0
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   670
	# if $a < $b value returned is -1
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   671
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   672
	$compare_2_tables = ( $pdk1_sorting_table[$tab_counter1] cmp $pdk2_sorting_table[$tab_counter2] );
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   673
	#print "compare_2_tables=$compare_2_tables\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   674
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   675
	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
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   676
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   677
		#print "the package is the same in pdk1_sorting_table and pdk2_sorting_table\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   678
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   679
		$value_package_pdk1 = $build_info_xml1{$pdk1_sorting_table[$tab_counter1]};
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   680
		$value_package_pdk2 = $build_info_xml2{$pdk2_sorting_table[$tab_counter2]};
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   681
		#print "value_package_pdk1=$value_package_pdk1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   682
		#print "value_package_pdk2=$value_package_pdk2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   683
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   684
		if(($value_package_pdk1 eq $mcl_cste) && ($value_package_pdk2 eq $fcl_cste))
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   685
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   686
			#print "the package was MCL and is now FCL - NEW\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   687
			$new_fcl_table[$total_new_fcl++] = $pdk1_sorting_table[$tab_counter1];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   688
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   689
		else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   690
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   691
			if(($value_package_pdk1 eq $fcl_cste) && ($value_package_pdk2 eq $mcl_cste))
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   692
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   693
				#print "the package was FCL and is now MCL - NO MORE\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   694
				$no_more_fcl_table[$total_no_more_fcl++] = $pdk1_sorting_table[$tab_counter1];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   695
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   696
			else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   697
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   698
				if(($value_package_pdk1 eq $fcl_cste) && ($value_package_pdk2 eq $fcl_cste))
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   699
				{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   700
					#print "the package was FCL and is still FCL - STILL\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   701
					$still_fcl_table[$total_still_fcl++] = $pdk1_sorting_table[$tab_counter1];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   702
				}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   703
				else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   704
				{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   705
					#print "the package was MCL and is still MCL - VERY GOOD\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   706
					$very_good_mcl_table[$total_very_good_mcl++] = $pdk1_sorting_table[$tab_counter1];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   707
				}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   708
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   709
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   710
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   711
		$tab_counter1++;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   712
		$tab_counter2++;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   713
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   714
	else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   715
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   716
		# The values are not the same, therefore it must be an added or deleted package
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   717
		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
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   718
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   719
			#print "the package $pdk1_sorting_table[$tab_counter1] has been deleted from pdk2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   720
			$packages_removed_table[$total_packages_removed++]=$pdk1_sorting_table[$tab_counter1++];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   721
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   722
		else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   723
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   724
			# If $compare_2_tables=1, then pdk1 is bigger than pdk2, which means that it has been added to pdk2
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   725
			#print "the package $pdk2_sorting_table[$tab_counter2] has been added to pdk2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   726
			$packages_added_table[$total_packages_added++]=$pdk2_sorting_table[$tab_counter2++];
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   727
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   728
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   729
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   730
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   731
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   732
print "\nPrint all the values related to our calculations\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   733
print "total_packages_pdk1=$total_packages_pdk1\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   734
print "total_packages_pdk2=$total_packages_pdk2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   735
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   736
print "total_packages_added=$total_packages_added\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   737
print "packages_added_table=\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   738
display_array_one_line_at_the_time(@packages_added_table);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   739
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   740
print "total_packages_removed=$total_packages_removed\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   741
print "packages_removed_table=\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   742
display_array_one_line_at_the_time(@packages_removed_table);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   743
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   744
print "total_new_fcl=$total_new_fcl\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   745
print "new_fcl_table=\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   746
display_array_one_line_at_the_time(@new_fcl_table);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   747
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   748
print "total_no_more_fcl=$total_no_more_fcl\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   749
print "no_more_fcl_table=\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   750
display_array_one_line_at_the_time(@no_more_fcl_table);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   751
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   752
print "total_still_fcl=$total_still_fcl\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   753
print "still_fcl_table=\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   754
display_array_one_line_at_the_time(@still_fcl_table);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   755
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   756
print "total_very_good_mcl=$total_very_good_mcl\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   757
print "very_good_mcl_table=\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   758
display_array_one_line_at_the_time(@very_good_mcl_table);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   759
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   760
# Checking that the packages have been assigned properly.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   761
# !!!! Need to verify the formula. Not sure that is correct!!!!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   762
print "Verification for the total packages between the 2 pdks\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   763
print "Formula used is: total_packages_pdk2 = total_packages_pdk1 + total_packages_added - total_packages_removed\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   764
print "$total_packages_pdk2 = $total_packages_pdk1 + $total_packages_added - $total_packages_removed\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   765
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   766
print "Formula used is: total_packages_pdk1 = total_very_good_mcl + total_new_fcl + total_no_more_fcl + total_still_fcl= total\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   767
print "$total_packages_pdk1 = $total_very_good_mcl + $total_new_fcl + $total_no_more_fcl + $total_still_fcl = ", ($total_very_good_mcl + $total_new_fcl + $total_no_more_fcl + $total_still_fcl), "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   768
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   769
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";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   770
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";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   771
print "\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   772
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   773
# 5th step is to create a txt file ready to be used for the release notes in a media wiki format.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   774
open(FCLCOMPARISONFILE, ">$file_path");	# !!!!! First time we are accessing the file, therefore create it or replace it, AFTR THAT WE NEED TO APPEND IT ONLY!!!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   775
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   776
my $val;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   777
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   778
# Enter the beginning of the section for general information about the pdk and it's predecessor.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   779
print FCLCOMPARISONFILE <<"EOT";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   780
== Packages ==
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   781
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   782
This sectin is about general information on the packages included in the platfrom.\n
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   783
This is an analysis between '''$pdk2_correct_name_to_use''' and '''$pdk1_correct_name_to_use'''
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   784
EOT
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   785
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   786
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   787
print FCLCOMPARISONFILE "\n Number total of packages in $pdk1_correct_name_to_use is: '''$total_packages_pdk1'''\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   788
print FCLCOMPARISONFILE "\n Number total of packages in $pdk2_correct_name_to_use is: '''$total_packages_pdk2'''\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   789
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   790
print FCLCOMPARISONFILE "=== Packages added ===\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   791
print FCLCOMPARISONFILE "\n Number total of packages added in $pdk2_correct_name_to_use is: '''$total_packages_added'''\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   792
foreach $val (@packages_added_table)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   793
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   794
	print FCLCOMPARISONFILE "''' $val (sf/app/contacts) '''\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   795
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   796
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   797
print FCLCOMPARISONFILE "=== Packages removed ===\n\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   798
print FCLCOMPARISONFILE "''' Number total of packages removed in $pdk2_correct_name_to_use is: $total_packages_removed'''\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   799
foreach $val (@packages_removed_table)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   800
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   801
	print FCLCOMPARISONFILE "''' $val (sf/app/contacts) '''\n\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   802
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   803
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   804
# Enter the beginning of the section for the FCL
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   805
print FCLCOMPARISONFILE <<"EOT";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   806
== FCLs ==
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   807
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   808
'''$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.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   809
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
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   810
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   811
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.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   812
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   813
EOT
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   814
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   815
# Packages that were on MCL and that are now on FCL
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   816
foreach $val (@new_fcl_table)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   817
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   818
	print FCLCOMPARISONFILE "=== $val (sf/app/contacts) -- NEW ===\n\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   819
	# Needs to be recovered from Mercurial. How????
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   820
	#[http://developer.symbian.org/bugs/show_bug.cgi?id=156 Bug 156]: Add a missing bld.inf, to renable compilation of the package
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   821
	#[http://developer.symbian.org/bugs/show_bug.cgi?id=197 Bug 197]: PSAlgorithmInternalCRKeys.h is missing
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   822
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   823
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   824
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   825
# Packages that were on FCL and that are now on FCL
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   826
foreach $val (@still_fcl_table)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   827
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   828
	print FCLCOMPARISONFILE "=== $val (sf/app/contacts) ===\n\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   829
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   830
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   831
print FCLCOMPARISONFILE "=== FCLs used in $pdk1_correct_name_to_use but not needed in $pdk2_correct_name_to_use ===\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   832
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   833
foreach $val (@no_more_fcl_table)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   834
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   835
	print FCLCOMPARISONFILE "''' $val (sf/app/contacts) '''\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   836
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   837
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   838
# Packages were on MCL and they are still on MCL.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   839
foreach $val (@very_good_mcl_table)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   840
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   841
	#print FCLCOMPARISONFILE "=== $val (sf/app/contacts) -- VERY GOOD ===\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   842
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   843
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   844
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   845
close(FCLCOMPARISONFILE);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   846
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   847
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   848
# 6th step is to export that txt file the appropriate location.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   849
# That could be the location from where we launched the script!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   850
print "\nYou will find the file with all the informatin you need for the releases note, here: $file_path\n\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   851
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   852
# Cleanup the mess!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   853
#pause_script(); # Temporary until script is finished!!!!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   854
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   855
$system_cmd = "rmdir /S /Q $working_dir";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   856
print "Exec: $system_cmd\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   857
system($system_cmd);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   858
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   859
##
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   860
### End of the program!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   861
##
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   862
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   863
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   864
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   865
# Functions section!!!!!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   866
#
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   867
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   868
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   869
# If no parameters entered or help selected, display help
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   870
sub helpme
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   871
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   872
	print "\nfct: helpme\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   873
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   874
	print "Generate FCLs details between 2 PDKs to be included as part of the release notes\n";	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   875
	print "Default location for PDKs is: $default_pdk_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   876
	print "Usage: perl fcls4releasenotes.pl --input_data1=x --input_data2=y\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   877
	print "Where input_data1 and input_data2 could be pdknb1 or pdknb2 or pdkloc1 or pdkloc2 or pdkname1 or pdkname2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   878
	print "Where pdknb is the PDK number, for example 2.0.e\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   879
	print "Where pdkloc is the root location where your file $name_zip_file_to_extract is. For ex: \\\\bishare\\releases\\PDK_2.0.e\\ or c:\\temp\\myPDK\\\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   880
	print "Where pdkname is the full name of the PDK, like for ex PDK_candidate_2.0.d_flat\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   881
	print "\nTypical command lines from script location:\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   882
	print "\t<perl fcls4releasenotes.pl --pdknb1=2.0.e --pdkloc1=c:\\temp\\myPDK\\>\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   883
	print "\t<perl fcls4releasenotes.pl --pdkname1=PDK_2.0.e --pdknb1=2.0.e>\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   884
	print "\t<perl fcls4releasenotes.pl --pdknb1=2.0.d --pdknb2=2.0.e>\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   885
	print "\t<perl fcls4releasenotes.pl help>\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   886
	#print "\t<perl fcls4releasenotes.pl validpdks>\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   887
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   888
	list_pdks_at_default_location();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   889
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   890
	exit(0);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   891
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   892
# End section related to help
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   893
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   894
# Extract list of PDKs that are in the default location.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   895
sub list_pdks_at_default_location
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   896
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   897
	print "\nfct: list_pdks_at_default_location\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   898
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   899
	# Do a dir of the default location
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   900
	print "List of directories in the default location $default_pdk_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   901
	extract_dir_default_loc();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   902
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   903
	# Extract all the PDKs that have the pattern PDK_
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   904
	print "All available PDKS in the default location $default_pdk_loc that have the pattern $pdk_start_pattern\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   905
	extract_pdk_in_default_loc();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   906
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   907
	# Extract all the PDKs that have the file build_BOM.zip
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   908
	print "All available PDKS in the default location $default_pdk_loc that contains the zip file $name_zip_file_to_extract\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   909
	extract_pdk_with_valid_zip_in_default_loc();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   910
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   911
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   912
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   913
# Generates list of directories in the default location used for the storage of the PDKs
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   914
sub extract_dir_default_loc
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   915
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   916
	print "\nfct: extract_dir_default_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   917
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   918
	# Get the list of directories in the default location
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   919
	opendir(DEFAULT_DIR, $default_pdk_loc);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   920
	@directories_list_default_location = readdir(DEFAULT_DIR);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   921
	close(DEFAULT_DIR);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   922
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   923
	$nb_dir_in_default_loc = scalar(@directories_list_default_location);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   924
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   925
	print "nb_dir_in_default_loc=$nb_dir_in_default_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   926
	#display_array_one_line_at_the_time(@directories_list_default_location);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   927
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   928
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   929
# Establish the list of directories that are an actual PDK
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   930
sub extract_pdk_in_default_loc
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   931
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   932
	print "\nfct: extract_pdk_in_default_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   933
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   934
	my $var;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   935
	$nb_pdks_in_default_loc=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   936
	print "pdk_start_pattern = $pdk_start_pattern\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   937
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   938
	foreach $var (@directories_list_default_location)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   939
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   940
		if($var =~ /^$pdk_start_pattern+/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   941
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   942
			#print "$var\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   943
			$pdk_dir_list_in_default_location[$nb_pdks_in_default_loc++] = $var;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   944
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   945
		#else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   946
		#{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   947
			#print "Not a PDK!!!!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   948
		#}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   949
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   950
	print "There is $nb_pdks_in_default_loc PDKs in the default location $default_pdk_loc\n";	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   951
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   952
	print "This is the list of PDKs that are in the default location $default_pdk_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   953
	#display_array_one_line_at_the_time(@pdk_dir_list_in_default_location);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   954
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   955
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   956
# Establish the list of PDK directories with a valid zip file to do the test
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   957
sub extract_pdk_with_valid_zip_in_default_loc
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   958
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   959
	print "\nfct: extract_pdk_with_valid_zip_in_default_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   960
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   961
	my $var1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   962
	my $var2;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   963
	my $path_to_find_zip = "";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   964
	my @read_pdk_directory=();
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   965
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   966
	$nb_pdks_with_valid_zip_in_default_loc=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   967
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   968
	print "name_zip_file_to_extract=$name_zip_file_to_extract\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   969
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   970
	foreach $var1 (@pdk_dir_list_in_default_location)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   971
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   972
		$path_to_find_zip=$default_pdk_loc;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   973
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   974
		$path_to_find_zip .= $var1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   975
		#print "path_to_find_zip=$path_to_find_zip\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   976
				
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   977
		# Get the list of directories in the default location
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   978
		opendir(PDK_DIR, $path_to_find_zip);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   979
		@read_pdk_directory = readdir(PDK_DIR);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   980
		close(PDK_DIR);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   981
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   982
		foreach $var2 (@read_pdk_directory)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   983
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   984
			if($var2 =~ /$name_zip_file_to_extract$/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   985
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   986
				#print "$var2\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   987
				$pdks_with_valid_zip_in_default_loc[$nb_pdks_with_valid_zip_in_default_loc++] = $var1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   988
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   989
			#else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   990
			#{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   991
				#print "Doesn't contain $name_zip_file_to_extract!!!!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   992
			#}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   993
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   994
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   995
	print "There is $nb_pdks_with_valid_zip_in_default_loc PDKs with a valid $name_zip_file_to_extract zip in the default location $default_pdk_loc\n";	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   996
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   997
	print "This is the list of PDKs that have a zip file called $name_zip_file_to_extract in the default location $default_pdk_loc\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   998
	display_array_one_line_at_the_time(@pdks_with_valid_zip_in_default_loc);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
   999
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1000
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1001
# Function created to pause the script to allow analysis and debug of the script.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1002
# Will require the user to press enter to carry on the execution of the script.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1003
sub pause_script
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1004
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1005
	print "\nfct: pause_script\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1006
	my $local_system_cmd = "pause";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1007
	print "Exec: $local_system_cmd\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1008
	system($local_system_cmd);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1009
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1010
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1011
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1012
# This function is used to extract the name of the package and the type
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1013
sub extract_packages_and_branch_type_from_file
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1014
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1015
	# 1 Parameters passed, the path to the file to be viewed
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1016
	my ($file_to_work_on) = @_;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1017
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1018
	print "\nfct: extract_packages_and_branch_type_from_file\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1019
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1020
	print "$file_to_work_on\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1021
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1022
	my %local_hash_array;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1023
	#my @hash_array_to_display;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1024
	my $local_key;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1025
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1026
	my $package="";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1027
	my $type_of_branch="";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1028
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1029
	#@hash_array_to_display = %local_hash_array;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1030
	#print "%local_hash_array before starting = @hash_array_to_display\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1031
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1032
	# Open file
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1033
	open(FILETOWORKON , $file_to_work_on);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1034
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1035
	# Extract data from file
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1036
	my @local_array = <FILETOWORKON>;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1037
	#print "local_array= @local_array\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1038
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1039
	# Close file
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1040
	close(FILETOWORKON);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1041
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1042
	my $extracted_line;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1043
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1044
	# Go line by line
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1045
	foreach  $extracted_line (@local_array)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1046
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1047
		#print "\nextracted_line is: $extracted_line"; # no need to add \\n as it's part of the line displayed.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1048
		
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1049
		if ($extracted_line =~ /$starting_pattern_for_xml_extraction/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1050
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1051
			#print "The line extracted is our starting pattern $starting_pattern_for_xml_extraction\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1052
			$extraction_from_xml_is_allowed=1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1053
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1054
		else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1055
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1056
		if ($extracted_line =~ /$ending_pattern_for_xml_extraction/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1057
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1058
				#print "The line extracted is our ending pattern $ending_pattern_for_xml_extraction\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1059
				$extraction_from_xml_is_allowed=0;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1060
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1061
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1062
		#print "extraction_from_xml_is_allowed=$extraction_from_xml_is_allowed\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1063
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1064
		if($extraction_from_xml_is_allowed)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1065
		{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1066
			#print "We are looking to extract the package and branch type from the line extracted\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1067
			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1068
			# Decode the line			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1069
			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1070
			# Decode the branch type			
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1071
			if($extracted_line =~ /$branch_type_extraction_pattern/)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1072
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1073
				$type_of_branch=$1;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1074
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1075
				# Decode the package because there is a branch type in the line extracted!
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1076
				if ($extracted_line =~ m,$package_extraction_pattern,)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1077
				{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1078
					$package=$1;					
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1079
				}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1080
					#print "package is $package and type_of_branch is $type_of_branch\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1081
					$local_hash_array{$package}=$type_of_branch;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1082
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1083
			else
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1084
			{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1085
				#print "The extracted line doesn't contain $look_for_mcl or $look_for_fcl, therefore we need to skip it!\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1086
			}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1087
		}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1088
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1089
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1090
	# Check the contain of the hash array to make sure that we have extracted the data as expected. To check against the actual file.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1091
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1092
	# Option 1: Display all in one line
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1093
	#@hash_array_to_display = %local_hash_array;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1094
	# Print "%local_hash_array when extraction is finished = @hash_array_to_display\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1095
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1096
	# Option 2: Print 1 key with 1 value by line
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1097
	#foreach $local_key (keys(%local_hash_array))
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1098
	#{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1099
	#	print "$local_key = $local_hash_array{$local_key}\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1100
	#}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1101
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1102
	# Return hash array containing all the packages and branch type associated
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1103
	return (%local_hash_array);
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1104
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1105
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1106
sub display_array_one_line_at_the_time
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1107
{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1108
	my (@table_to_display_one_line_at_the_time) = @_;
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1109
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1110
	#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.
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1111
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1112
	my $line_to_display;	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1113
	
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1114
	foreach $line_to_display (@table_to_display_one_line_at_the_time)
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1115
	{
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1116
		print "$line_to_display\n";
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1117
	}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1118
}
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1119
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1120
# PDKs with build_bom.zip file in the default PDKs location 14-09-2009
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1121
#Z:\Releases\PDK_2.0.e
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1122
#Z:\Releases\PDK_candidate_2.0.d_flat
9f8bdafe5d68 Perl script for the releases notes automation with fcl!
Arnaud Lenoir
parents:
diff changeset
  1123
#Z:\Releases\PDK_candidate_2.0e_FCL_27.78