releasing/cbrtools/perl/EnvInfo
author kelvzhu
Mon, 18 Oct 2010 16:16:46 +0800
changeset 655 3f65fd25dfd4
parent 602 3145852acc89
permissions -rw-r--r--
sync up SVN codes
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 CommandController;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
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
# Globals.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    29
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
my $verbose = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
my $full = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
my $component;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
my $iniData = IniData->New();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
my $commandController = CommandController->New($iniData, 'EnvInfo');
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
my $envDb;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
my $overallStatus;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
my $displayClean = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
my $displayDirty = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
my $displayPendingRelease = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
my $noScan = 0;
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
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
# Main.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
ProcessCommandLine();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
CheckEnv();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
DisplayInfo();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
# Subs.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
sub ProcessCommandLine {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
  Getopt::Long::Configure ("bundling");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
  my $help;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
  GetOptions("h" => \$help, "f+" => \$full, "c" => \$displayClean, "d" => \$displayDirty, "p" => \$displayPendingRelease, "n" => \$noScan, "v+" => \$verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
  if ($help) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
    Usage(0);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
  if (not $full and ($displayClean or $displayDirty or $displayPendingRelease)) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
    print "Warning: Inappropriate option(s), must be invoked together with -f\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
  if (not $displayClean and not $displayDirty and not $displayPendingRelease) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
    $displayClean = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
    $displayDirty = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
    $displayPendingRelease = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
  $component = $ARGV[0];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
  $envDb = EnvDb->Open($iniData, $verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
sub Usage {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
  my $exitCode = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
  Utils::PrintDeathMessage($exitCode, "\nUsage: envinfo [options] [<component>]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
-h  help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
-v  verbose output (-vv very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
-f  display fuller information (the remaining switches only apply when this is used)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
-ff display even fuller information (internal version and mrp name)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
-c  display the components with status \"clean\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
-d  display the components with status \"dirty\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
-p  display the components with status \"pending release\"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
-n  no scan\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
sub CheckEnv {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
  unless ($noScan or not $full) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
    if (defined $component) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
      $envDb->CheckComp($component, undef, 1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
    else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
      ($overallStatus, undef, undef, my $unaccountedFiles, my $duplicates) = $envDb->CheckEnv(1, 0, 1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
      if (scalar (@$unaccountedFiles) > 0) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
	foreach my $line (@$unaccountedFiles) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
	  print "Warning: $line has unknown origin\n"; 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
	}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   108
      if (scalar (@$duplicates) > 0) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   109
	foreach my $args (@$duplicates) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   110
	  print "Warning: $args->[1] attempting to release $args->[0] which has already been released by $args->[2]\n"; 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
	}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
  }
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
sub DisplayInfo {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
  # Create a list of the components to be displayed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
  my @comps;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
  if (defined $component) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
    my $ver = $envDb->Version($component);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
    unless (defined $ver) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
      die "Error: $component not found\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
    push @comps, $component;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
    my $versionInfo = $envDb->VersionInfo();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
    foreach my $comp (sort keys %{$versionInfo}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
      push @comps, $comp;
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
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   134
  my $tableData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   135
  if ($full == 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   136
    $tableData = GenFullInfoTable(\@comps);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   137
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
  elsif ($full > 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
    $tableData = GenEvenFullerInfoTable(\@comps);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   140
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   141
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   142
    $tableData = GenMinimalInfoTable(\@comps);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   143
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   144
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   145
  # Only print the table if there's something in it.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
  if (scalar(@$tableData) > 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
    print "\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
    $iniData->TableFormatter->PrintTable($tableData, 1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   149
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   150
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   151
  # Only display the overall status if a full check was done.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
  if (defined $overallStatus) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
    print "\nOverall status: ", EnvDb::StatusString($overallStatus), "\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
sub GenMinimalInfoTable {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
  my $comps = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
  # Create a two dimentional array of the data to be printed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
  my $tableData = [["Component", "Version"]];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
  my $row = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
  foreach my $comp (@$comps) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
    my $ver = $envDb->Version($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
    $tableData->[$row++] = [$comp, $ver];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
  return $tableData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
sub GenFullInfoTable {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
  my $comps = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
  # Create a two dimentional array of the data to be printed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
  my $tableData = [["Component", "Version", "Project", "Status"]];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
  my $row = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
  foreach my $comp (@$comps) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
    my $ver = $envDb->Version($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
    my $status = $envDb->Status($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
    if (not $displayClean and $status == EnvDb::STATUS_CLEAN) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   181
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   182
    elsif (not $displayDirty and ($status == EnvDb::STATUS_DIRTY or $status == EnvDb::STATUS_DIRTY_SOURCE)) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   183
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
    elsif (not $displayPendingRelease and $status == EnvDb::STATUS_PENDING_RELEASE) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
    my $project = $iniData->PathData->ComponentProject($comp, $ver);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
    unless (defined $project) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
      $project = "-";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
    $tableData->[$row++] = [$comp, $ver, $project, EnvDb::StatusString($status)];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
  return $tableData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   195
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   196
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   197
sub GenEvenFullerInfoTable {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   198
  my $comps = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
  # Create a two dimentional array of the data to be printed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   201
  my $tableData = [["Component", "Version", "Internal version", "Project",  "Status", "Mrp"]];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   202
  my $row = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   203
  foreach my $comp (@$comps) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   204
    my $ver = $envDb->Version($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   205
    my $status = $envDb->Status($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   206
    if (not $displayClean and $status == EnvDb::STATUS_CLEAN) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   207
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   208
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
    elsif (not $displayDirty and ($status == EnvDb::STATUS_DIRTY or $status == EnvDb::STATUS_DIRTY_SOURCE)) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   210
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   211
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   212
    elsif (not $displayPendingRelease and $status == EnvDb::STATUS_PENDING_RELEASE) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
    my $mrpName = $envDb->MrpName($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
    unless (defined $mrpName) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
      $mrpName = "-";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
    my $intVer = $envDb->InternalVersion($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
    unless (defined $intVer) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
      $intVer = "-";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
    my $project = $iniData->PathData->ComponentProject($comp, $ver);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
    unless (defined $project) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
      $project= "-";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
    $tableData->[$row++] = [$comp, $ver, $intVer, $project, EnvDb::StatusString($status), $mrpName];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
  return $tableData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   231
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   232
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   233
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   234
=head1 NAME
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   235
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
EnvInfo - Displays information about the installed components in the current environment.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
=head1 SYNOPSIS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
  envinfo [options] [<component>]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
  -h  help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
  -v  verbose output (-vv very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
  -f  display fuller information (the remaining switches only apply when this is used)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
  -ff display even fuller information (internal version and mrp name)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
  -c  display the components with status "clean"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
  -d  display the components with status "dirty"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
  -p  display the components with status "pending release"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
  -n  no scan
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
=head1 DESCRIPTION
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
By default displays a brief summary table of the information contained in the current drive's environment database. For example:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
 Component   Version
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
 mycomp1     026
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
 mycomp2     057
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   261
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   262
If envoked with the C<-f> switch, a scan is performed of the F<\epoc32> tree and the status of each component is also reported:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   263
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   264
 Component   Version   Status
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   265
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
 mycomp1     026       clean
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
 mycomp2     057       clean
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
 Overall status: clean
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   270
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   271
The C<Status> field may have the following values:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   272
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   273
=over 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   274
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   275
=item *
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   276
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   277
B<clean> - The component's binaries all match the time stamp information that was stored when they were installed (or when they were last validated using either C<ValidateRel> or C<ValidateEnv>).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   278
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   279
=item *
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   280
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   281
B<dirty> - One or more of the component's binaries doesn't match the time stamp information that was stored when they were installed. This may be because the source has been re-built but not changed (see the commands C<ValidateRel> and C<ValidateEnv> for details of how to check if a re-built set of binaries are identical to an already released set), or because changes have been made.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   282
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   283
=item *
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   284
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   285
B<pending release> - The component is waiting to be released (see the commands C<PrepEnv> and C<MakeEnv> for details of how to make releases).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   286
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   287
=back
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   288
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   289
The overall status of the environment is displayed last. This may have the following values:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   290
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   291
=over 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   292
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   293
=item *
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   294
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   295
B<clean> - All the installed components have a status of C<clean> and there are no files in the F<\epoc32> tree that have unkown origins (i.e. they are all known to belong to a component).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   296
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   297
=item *
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   298
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   299
B<dirty> - One or more of the installed components has a status of C<dirty>, or there is one or more files in the F<\epoc32> tree that has unknown origins.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   300
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   301
=item *
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   302
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   303
B<pending release> - All components have a status of either C<clean> or C<pending release> and there are no files in the F<\epoc32> with unknown origins. This status indicates that C<MakeEnv> may be used to release this environment.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   304
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   305
=back
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   306
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   307
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   308
By default when C<EnvInfo> is envoked with the C<-f> switch, it will perform a scan of the F<\epoc32> tree checking all the time stamps. To avoid this processing, use the C<-n> switch also. This will cause the status of each component when the last scan was performed to be displayed (which may now be out of date). The output of C<EnvInfo> can be filtered according to status using the switches C<-c>, C<-d> and C<-p>. For example, if you wanted to view all the components that are either C<dirty> or C<pending release>, type:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   309
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   310
  envinfo -fdp
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   311
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   312
If envoked with a C<component> argument, then only the details of the specified component will be displayed and a scan of the F<\epoc32> tree will not be performed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   313
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   314
=head1 KNOWN BUGS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   315
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   316
None.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   317
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   318
=head1 COPYRIGHT
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   319
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   320
 Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   321
 All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   322
 This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   323
 under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   324
 which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   325
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   326
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   327
 Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   328
 Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   329
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   330
 Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   331
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   332
 Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   333
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   334
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   335
=cut