releaseAutomation/packageComparison.pl
author Simon Howkins <simonh@symbian.org>
Mon, 09 Nov 2009 18:13:38 +0000
changeset 109 8d399d7a7b6b
parent 106 be1e3961af1c
child 110 718b119bed63
permissions -rw-r--r--
Tweak to avoid an abort if the system definition cannot be opened to obtain the package names. Fixed a hard-coded "PDK_2.0.0".
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     1
#!perl -w
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     2
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     3
# Copyright (c) 2009 Symbian Foundation Ltd
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     4
# This component and the accompanying materials are made available
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     6
# which accompanies this distribution, and is available
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     8
#
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
     9
# Initial Contributors:
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    10
# Symbian Foundation Ltd - initial contribution.
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    11
# 
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    12
# Contributors:
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    13
#
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    14
# Description:
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    15
# Automates the creation of part of the PDK Release Notes: "Mercurial Comparison with PDK XXXXX"
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    16
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    17
use strict;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    18
use XML::Parser;
106
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    19
use Getopt::Long;
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    20
106
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    21
my $sourcesCsv;		# sources.csv file for this build
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    22
my $sysDef;		# system definition file for this build
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    23
my $previousPdkLabel;	# hg tag to compare against
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    24
my $prevSourcesCsv;	# sources.csv file for baseline build, if different to this build
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    25
my $prevSysDef;		# system definition file for baseline build, if different to this build
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    26
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    27
GetOptions((
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    28
	'sources=s' => \$sourcesCsv,
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    29
	'sysdef=s' => \$sysDef,
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    30
	'baseline=s' => \$previousPdkLabel,
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    31
	'prevSources=s' => \$prevSourcesCsv,
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    32
	'prevSysdef=s' => \$prevSysDef,
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    33
));
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    34
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    35
if (!$sourcesCsv || !$sysDef || !$previousPdkLabel)
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    36
{
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    37
	warn "Necessary argument(s) not supplied\n\n";
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    38
	usage();
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    39
	exit (1);
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    40
}
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    41
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    42
if (@ARGV)
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    43
{
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    44
	warn "Don't know what to do with these arguments: @ARGV\n\n";
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    45
	usage();
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    46
	exit (1);
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    47
}
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    48
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    49
$prevSourcesCsv ||= $sourcesCsv;
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    50
$prevSysDef ||= $sysDef;
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    51
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    52
my $packages = { current => {}, previous => {} };
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    53
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    54
# Load current manifest
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    55
open(my $manifest, "<", $sourcesCsv) or die;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    56
my @manifest = <$manifest>;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    57
close $manifest;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    58
populate($packages->{current}, @manifest);
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    59
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    60
# Load prev manifest
106
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
    61
@manifest = `hg cat -r $previousPdkLabel $prevSourcesCsv`;
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    62
populate($packages->{previous}, @manifest);
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    63
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    64
my $xml = XML::Parser->new(Style => "Objects") or die;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    65
# Load current names from current system definition
109
8d399d7a7b6b Tweak to avoid an abort if the system definition cannot be opened to obtain the package names.
Simon Howkins <simonh@symbian.org>
parents: 106
diff changeset
    66
eval { populateNames($packages->{current}, $xml->parsefile($sysDef) ) };
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    67
# Load previous names from previous system definition
109
8d399d7a7b6b Tweak to avoid an abort if the system definition cannot be opened to obtain the package names.
Simon Howkins <simonh@symbian.org>
parents: 106
diff changeset
    68
eval { populateNames($packages->{previous}, $xml->parsestring(scalar `hg cat -r $previousPdkLabel $prevSysDef`) ) };
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    69
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    70
# Output release note info...
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    71
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    72
my $currPackageCount = scalar keys %{$packages->{current}};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    73
my $prevPackageCount = scalar keys %{$packages->{previous}};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    74
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    75
== Packages ==
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    76
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    77
This section provides general information on the packages included in this PDK release compared to '''$previousPdkLabel'''.
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    78
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    79
Number total of packages in this PDK release is: '''$currPackageCount'''
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    80
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    81
Number total of packages in $previousPdkLabel is: '''$prevPackageCount'''
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    82
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    83
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    84
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    85
my @addedPackages = sort { packageSort($packages->{current}) } grep { !exists $packages->{previous}->{$_} } keys %{$packages->{current}};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    86
my $addedPackageCount = scalar @addedPackages;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    87
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    88
=== Packages added ===
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    89
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    90
Number total of packages added is: '''$addedPackageCount'''
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    91
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    92
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    93
foreach (@addedPackages)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    94
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    95
	print "==== $packages->{current}->{$_}->{name} ([$packages->{current}->{$_}->{url} $packages->{current}->{$_}->{path}]) ====\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    96
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    97
print "\n" if @addedPackages;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    98
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    99
my @removedPackages = sort { packageSort($packages->{previous}) } grep { !exists $packages->{current}->{$_} } keys %{$packages->{previous}};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   100
my $removedPackageCount = scalar @removedPackages;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   101
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   102
=== Packages removed ===
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   103
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   104
Number total of packages removed is: '''$removedPackageCount'''
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   106
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   107
foreach (@removedPackages)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   108
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   109
	print "==== $packages->{previous}->{$_}->{name} ([$packages->{previous}->{$_}->{url} $packages->{previous}->{$_}->{path}]) ====\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   110
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   111
print "\n" if @removedPackages;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   112
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   113
my @movedPackages = sort { packageSort($packages->{current}) } grep { inPrev($_) && $packages->{current}->{$_}->{path} ne $packages->{previous}->{$_}->{path} } keys %{$packages->{current}};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   114
my $movedPackageCount = scalar @movedPackages;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   115
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   116
=== Packages moved ===
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   117
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   118
Number total of packages moved is: '''$movedPackageCount'''
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   119
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   120
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   121
foreach (@movedPackages)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   122
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   123
	print "==== $packages->{current}->{$_}->{name} ([$packages->{previous}->{$_}->{url} $packages->{previous}->{$_}->{path}] to [$packages->{current}->{$_}->{url} $packages->{current}->{$_}->{path}]) ====\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   124
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   125
print "\n" if @movedPackages;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   126
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   127
my @openedPackages = sort { packageSort($packages->{current}) } grep { inPrev($_) && $packages->{current}->{$_}->{license} eq "oss" && $packages->{previous}->{$_}->{license} eq "sfl" } keys %{$packages->{current}};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   128
my $openedPackageCount = scalar @openedPackages;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   129
if ($openedPackageCount)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   130
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   131
	print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   132
=== Packages newly released under a fully Open license ===
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   133
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   134
Number total of packages relicensed is: '''$openedPackageCount'''
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   135
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   136
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   137
	foreach (@openedPackages)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   138
	{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   139
		print "==== $packages->{current}->{$_}->{name} ([$packages->{current}->{$_}->{url} $packages->{current}->{$_}->{path}]) ====\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   140
	}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   141
	print "\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   142
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   143
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   144
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   145
== FCLs ==
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   146
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   147
This PDK 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.
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   148
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   149
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.
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   150
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   151
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]] for details.
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   152
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   153
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   154
# Newly from FCL
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   155
foreach (sort { packageSort($packages->{current}) } grep { inPrev($_) && $packages->{previous}->{$_}->{codeline} eq "MCL" && $packages->{current}->{$_}->{codeline} eq "FCL" } keys %{$packages->{current}})
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   156
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   157
	print "==== $packages->{current}->{$_}->{name} ([$packages->{current}->{$_}->{url} $packages->{current}->{$_}->{path}]) -- NEW ====\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   158
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   159
# Still from FCL
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   160
foreach (sort { packageSort($packages->{current}) } grep {inPrev($_) && $packages->{previous}->{$_}->{codeline} eq "FCL" && $packages->{current}->{$_}->{codeline} eq "FCL"} keys %{$packages->{current}})
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   161
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   162
	print "==== $packages->{current}->{$_}->{name} ([$packages->{current}->{$_}->{url} $packages->{current}->{$_}->{path}]) ====\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   163
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   164
109
8d399d7a7b6b Tweak to avoid an abort if the system definition cannot be opened to obtain the package names.
Simon Howkins <simonh@symbian.org>
parents: 106
diff changeset
   165
print "\n=== FCLs used in $previousPdkLabel but no longer needed ===\n\n";
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   166
my @revertedToMCL = sort { packageSort($packages->{current}) } grep { inPrev($_) && $packages->{previous}->{$_}->{codeline} eq "FCL" && $packages->{current}->{$_}->{codeline} eq "MCL" } keys %{$packages->{current}};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   167
print "(none)\n" unless @revertedToMCL;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   168
foreach (@revertedToMCL)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   169
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   170
	print "==== $packages->{current}->{$_}->{name} ([$packages->{current}->{$_}->{url} $packages->{current}->{$_}->{path}]) ====\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   171
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   172
print "\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   173
exit(0);
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   174
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   175
sub populate
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   176
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   177
	my $hash = shift;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   178
	my @entries = @_;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   179
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   180
	# Discard the column headings
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   181
	shift @entries;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   182
	
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   183
	foreach my $entry (@entries)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   184
	{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   185
		chomp $entry;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   186
		my ($repo) = $entry =~ m{^(.*?),};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   187
		my ($packageId) = $repo =~ m{/(\w+)/?$};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   188
		my ($codeline) = $repo =~ m{/(MCL|FCL)/};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   189
		# Skip the RnD repos and other complications
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   190
		next unless $codeline;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   191
		my ($license, $path) = $repo =~ m{/([^/\\]*)/$codeline/(.+?)/?$};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   192
		my $url = "http://developer.symbian.org/$license/$codeline/$path";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   193
		$hash->{$packageId} = {license => $license, codeline => $codeline, path => $path, name => "''$packageId''", url => $url, sortKey => lc $packageId};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   194
	}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   195
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   196
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   197
sub populateNames
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   198
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   199
	my $packages = shift;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   200
	my $itemsUnderThisElement = shift;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   201
	foreach (@$itemsUnderThisElement)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   202
	{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   203
		if (ref $_)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   204
		{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   205
			if (ref $_ eq "main::block" || ref $_ eq "main::package")
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   206
			{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   207
				if (exists $packages->{$_->{name}})
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   208
				{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   209
					$packages->{$_->{name}}->{name} = $_->{"long-name"};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   210
					$packages->{$_->{name}}->{sortKey} = lc $_->{"long-name"};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   211
				}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   212
			}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   213
			else
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   214
			{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   215
				populateNames($packages, $_->{Kids});
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   216
			}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   217
		}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   218
	}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   219
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   220
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   221
sub inPrev
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   222
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   223
	my $id = shift;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   224
	exists $packages->{previous}->{$id};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   225
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   226
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   227
sub packageSort
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   228
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   229
	my $details = shift;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   230
	$details->{$a}->{sortKey} cmp $details->{$b}->{sortKey};
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   231
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   232
106
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
   233
sub usage
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
   234
{
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
   235
	warn <<EOT;
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
   236
Generates release notes detail about packages and FCLs used.
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   237
106
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
   238
packageComparison.pl -sources=<SOURCES.CSV> -sysdef=<SYSTEM_DEFINITION.XML> -baseline=<PDK RELEASE LABEL> [-prevSources=<PREV SOURCES.CSV>] [-prevSysdef=<PREV>]
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
   239
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
   240
EOT
be1e3961af1c Updated to parse options in a more standard way, added new options to allow a different path to the sources/sysdef in the earlier release, and to provide a usage message.
Simon Howkins <simonh@symbian.org>
parents: 105
diff changeset
   241
}