releasing/cbrtools/perl/DiffRel
author Ross Qin <ross.qin@nokia.com>
Tue, 30 Nov 2010 13:59:58 +0800
changeset 712 df89378e9223
parent 602 3145852acc89
permissions -rw-r--r--
Fix these errors: Some cases of PREQ1230 fail because of buildrom issue rombuild crashs when create ext-romimage readimage crashes on reading wk42 vasco_ui core image vc2008 compiling issues
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
#!perl
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     2
# Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     3
# All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     4
# This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     5
# under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     6
# which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     8
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     9
# Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    11
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    12
# Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    13
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    14
# Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    15
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    16
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    17
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    18
use strict;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
use FindBin;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
use lib "$FindBin::Bin";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
use Getopt::Long;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
use IniData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
use EnvDb;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
use Utils;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
use CommandController;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    27
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    28
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    29
# Globals.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
my $verbose = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
my $iniData = IniData->New();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
my $commandController = CommandController->New($iniData, 'DiffRel');
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
my $comp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
my $ver1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
my $ver2;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
my $specifiedLocalDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
my $specifiedReleaseDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
my $specifiedDiffTool;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
# Main.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
ProcessCommandLine();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
DoDiff();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
# Subs.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
sub ProcessCommandLine {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
  Getopt::Long::Configure ("bundling");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
  my $help;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
  GetOptions('h' => \$help, 'l=s' => \$specifiedLocalDir, 'r=s' => \$specifiedReleaseDir, 'v+' => \$verbose, 't=s' => \$specifiedDiffTool);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
  if ($help) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
    Usage(0);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
  $comp = shift @ARGV;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
  $ver1 = shift @ARGV;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
  $ver2 = shift @ARGV;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
  unless ($comp and $#ARGV = -1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
    print "Error: Invalid arguments\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
    Usage(1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
  if ($ver2 and $specifiedLocalDir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
    print "Warning: The '-l' switch has no effect when specifying a pair of versions to difference\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
  if ($ver2 and $specifiedReleaseDir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
    print "Warning: The '-r' switch has no effect when specifying a pair of versions to difference\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
  if ($specifiedReleaseDir and $specifiedReleaseDir !~ /^\\/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
    die "Error: Release directories must be absolute (i.e. start with '\\')\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
  if ($specifiedLocalDir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
    Utils::AbsoluteFileName(\$specifiedLocalDir);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
sub Usage {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
  my $exitCode = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
  Utils::PrintDeathMessage($exitCode, "\nUsage: diffrel [options] <component> [<version_1>] [<version_2>]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
-h                help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
-l <local_dir>    specify a specific local directory to difference against
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
-r <release_dir>  specify a specific directory within the release zip file to difference against
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
-t <tool>         specify a particular diffing tool to use (instead of that specified in reltools.ini)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
-v                verbose output (-vv very verbose)\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
sub DoDiff {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
  my $diffTool = $specifiedDiffTool || $iniData->DiffTool();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
  unless (defined $diffTool) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
    die "Error: No differencing tool specified - use diff_tool keyword in reltools.ini\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   108
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   109
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   110
  my $envDb = EnvDb->Open($iniData, $verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
  unless ($ver1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
    $ver1 = $envDb->Version($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
    unless ($ver1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
      die "Error: $comp not currently installed\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   116
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   117
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
  Utils::InitialiseTempDir($iniData);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
  eval {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
    if ($ver2) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
      DiffPair($envDb, $diffTool);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
    else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
      DiffAgainstLocalDir($envDb, $diffTool);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
  };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
  Utils::RemoveTempDir();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
  if ($@) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
    die $@;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   131
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   132
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   133
sub DiffAgainstLocalDir {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   134
  my $envDb = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   135
  my $diffTool = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   136
  my $tempDir = Utils::TempDir();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   137
  $envDb->UnpackSource($comp, $ver1, $tempDir, 0, 0, 1); # 0 = overwrite, 0 = do not show progress, 1 = validate
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
  my $significantDir = Utils::SignificantDir($tempDir);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   140
  my $localDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   141
  if ($specifiedLocalDir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   142
    $localDir = $specifiedLocalDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   143
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   144
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   145
    $localDir = $significantDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
    $localDir =~ s/\Q$tempDir\E//;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
    unless ($localDir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
      $localDir = '\\';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   149
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   150
    $localDir = Utils::PrependSourceRoot($localDir);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   151
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
  # UnpackSource does not return a success status so we check the dir manually
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
  if (!-d $localDir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
    warn "Nothing to do".($verbose ? '' : ' (run with -v for more info)').".\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
    return;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
  my $releaseDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
  if ($specifiedReleaseDir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
    $releaseDir = "$tempDir$specifiedReleaseDir";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
    $releaseDir = $significantDir;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
  # UnpackSource does not return a success status so we check the dir manually
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
  if (!-d $releaseDir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
    warn "Nothing to do".($verbose ? '' : ' (run with -v for more info)').".\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
    return;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
  if ($localDir eq '\\') {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
    print "Warning: About to diff \"$releaseDir\" against the root of your development environment.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
         You could alternatively use the -l and -r options to specify which directories to diff.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
         Are you sure you want to continue? [y/n] ";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
    my $response = <STDIN>;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
    chomp $response;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
    unless ($response eq 'y') {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
      warn "Aborting...\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
      return;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   181
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   182
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   183
  $localDir =~ s/^[\\\/]// unless ($localDir =~ m/^[\\\/][\\\/]/);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
  if ($verbose) { print "Envoking \"call $diffTool \"$releaseDir\" \"$localDir\"\"\n"; }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
  system "call \"$diffTool\" \"$releaseDir\" \"$localDir\"";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
sub DiffPair {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
  my $envDb = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
  my $diffTool = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
  my $tempDir = Utils::TempDir();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
  my $ver1Dir = "$tempDir\\1";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
  my $ver2Dir = "$tempDir\\2";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   195
  $envDb->UnpackSource($comp, $ver1, $ver1Dir, 0, 0, 1); # 0 = overwrite, 0 = do not show progress, 1 = validate
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   196
  $envDb->UnpackSource($comp, $ver2, $ver2Dir, 0, 0, 1); # 0 = overwrite, 0 = do not show progress, 1 = validate
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   197
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   198
  if (!-d $ver1Dir or !-d $ver2Dir) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
    warn "Nothing to do".($verbose ? '' : ' (run with -v for more info)').".\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
    return;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   201
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   202
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   203
  if ($verbose) { print "Envoking \"call $diffTool $ver1Dir $ver2Dir\"\n"; }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   204
  system "call \"$diffTool\" \"$ver1Dir\" \"$ver2Dir\"";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   205
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   206
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   207
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   208
=head1 NAME
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   210
DiffRel - Displays the source differences between two component releases.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   211
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   212
=head1 SYNOPSIS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
  diffrel [options] <component> [<version_1>] [<version_2>]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
  -h                help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
  -l <local_dir>    specify a specific local directory to difference against
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
  -r <release_dir>  specify a specific directory within the release zip file to difference against
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
  -t <diff_tool>    specify a particular diffing tool to use (instead of that in reltools.ini)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
  -v                verbose output (-vv very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
=head1 DESCRIPTION
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
C<DiffRel> allows you to lauch a differencing tool of your choice to anyalise the source differences between either a pair of releases or a single release and the source in your development drive. The differencing tool to be used must be specified in C<reltools.ini> using the keyword C<diff_tool> and it must support differencing a pair of directories specified as command line arguments.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
There are three main ways of envoking C<DiffRel>:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
=over 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   231
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   232
=item * Specifying a component and a pair of versions
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   233
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   234
C<DiffRel> will difference the source of a pair of component releases. It will unpack the source from the specified versions into two temporary directories. The differencing tool will then be launched with the names of the temporary directories passed as command line arguments.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   235
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
=item * Specifying a component and a single version
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
C<DiffRel> will difference the source of the specified version against that present in your development drive. It will unpack the source from the specified version into a temporary directory. It will then attempt to find a suitable pair of directories to difference (this process described in detail later) and then launch the differencing tool, passing the directory names as command line arguments.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
=item * Specifying just a component name
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
As above, except the source of the currently installed version of the component will be differenced against that in your development drive.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
=back
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
As mentioned previously, when C<DiffRel> is asked to perform a diff against the source code in your development drive, it attempts find a suitable pair of directories to pass to your differencing tool. The source code belonging to a particular component often lives in a deeply nested directory structure containing the source for other components also. C<DiffRel> therefore attempts to find the deepest sub-directory that captures all the source belonging to a particular component. It does this as follows:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
=over 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
=item 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
C<DiffRel> unpacks the source belonging to the component to be differenced against into a temporary directory.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
=item 2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
C<DiffRel> then examines the sub-directories of the temporary directory, looking for the deepest sub-directory that captures all files.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
=item 3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
By default the full path to this sub-directory is used as the first argument to the differencing tool. Optionally, this argument can be manually specified using the C<-r> option. In this case, C<DiffRel> with add the name of the temporary directory to the start of the path you specify.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   261
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   262
=item 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   263
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   264
By default, the sub-directory found in (2), minus the leading temporary directory name is used as the second argument to your differencing tool. Optionally, this argument can be manually specified using the C<-l> option. In this case, C<DiffRel> will use the path you specify unaltered.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   265
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
=back
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
Normally C<DiffRel>'s default behaviour will do the right thing. Situations where you may want to use the C<-r> and / or the C<-l> option include:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   270
=over 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   271
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   272
=item 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   273
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   274
If the source of the component you need to difference is in a different location in your development environment compared to that of the released version.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   275
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   276
=item 2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   277
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   278
If the source of the component you need to difference is contained in two or more root level directories. In this case C<DiffRel> will warn that it is about to difference against the root of your development drive (which is unlikely to be a good idea since there are likely to be source directories of other components at this level).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   279
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   280
=back
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   281
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   282
=head1 KNOWN BUGS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   283
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   284
None.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   285
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   286
=head1 COPYRIGHT
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   287
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   288
 Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   289
 All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   290
 This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   291
 under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   292
 which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   293
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   294
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   295
 Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   296
 Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   297
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   298
 Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   299
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   300
 Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   301
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   302
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   303
=cut