releaseAutomation/packageComparison.pl
author Simon Howkins <simonh@symbian.org>
Mon, 09 Nov 2009 14:58:53 +0000
changeset 106 be1e3961af1c
parent 105 1350a673dd5f
child 109 8d399d7a7b6b
permissions -rw-r--r--
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.
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
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    66
my $tree = $xml->parsefile($sysDef);
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    67
populateNames($packages->{current}, $tree);
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    68
# Load previous names from previous system definition
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
    69
eval { $tree = $xml->parsestring(scalar `hg cat -r $previousPdkLabel $prevSysDef`) } or die $!;
105
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    70
populateNames($packages->{previous}, $tree);
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
# 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
    73
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    74
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
    75
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
    76
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    77
== Packages ==
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
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
    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 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
    82
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    83
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
    84
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    85
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    86
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    87
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
    88
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
    89
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    90
=== Packages added ===
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
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
    93
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    94
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    95
foreach (@addedPackages)
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 "==== $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
    98
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
    99
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
   100
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   101
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
   102
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
   103
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   104
=== Packages removed ===
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
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
   107
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   108
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   109
foreach (@removedPackages)
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 "==== $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
   112
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   113
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
   114
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   115
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
   116
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
   117
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   118
=== Packages moved ===
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
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
   121
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   122
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   123
foreach (@movedPackages)
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 "==== $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
   126
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   127
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
   128
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   129
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
   130
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
   131
if ($openedPackageCount)
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   132
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   133
	print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   134
=== 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
   135
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   136
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
   137
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   138
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   139
	foreach (@openedPackages)
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 "==== $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
   142
	}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   143
	print "\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   144
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   145
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   146
print <<EOT;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   147
== FCLs ==
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
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
   150
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   151
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
   152
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   153
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
   154
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   155
EOT
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   156
# 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
   157
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
   158
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   159
	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
   160
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   161
# 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
   162
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
   163
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   164
	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
   165
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   166
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   167
print "\n=== FCLs used in PDK_2.0.0 but no longer needed ===\n\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   168
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
   169
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
   170
foreach (@revertedToMCL)
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 "==== $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
   173
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   174
print "\n";
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   175
exit(0);
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
sub populate
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   178
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   179
	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
   180
	my @entries = @_;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   181
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   182
	# 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
   183
	shift @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
	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
   186
	{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   187
		chomp $entry;
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   188
		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
   189
		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
   190
		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
   191
		# 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
   192
		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
   193
		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
   194
		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
   195
		$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
   196
	}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   197
}
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
sub populateNames
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   200
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   201
	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
   202
	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
   203
	foreach (@$itemsUnderThisElement)
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 $_)
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 (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
   208
			{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   209
				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
   210
				{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   211
					$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
   212
					$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
   213
				}
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
			else
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
				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
   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
}
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
sub inPrev
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   224
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   225
	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
   226
	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
   227
}
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
sub packageSort
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   230
{
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   231
	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
   232
	$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
   233
}
1350a673dd5f Alternative script for generating release note information about package changes and FCL usage.
Simon Howkins <simonh@symbian.org>
parents:
diff changeset
   234
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
   235
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
   236
{
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
   237
	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
   238
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
   239
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
   240
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
   241
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
   242
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
   243
}