releasing/cbrtools/perl/LatestVer
author jjkang
Fri, 25 Jun 2010 18:37:20 +0800
changeset 602 3145852acc89
permissions -rw-r--r--
add releasing to new structure
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
#!perl -w
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     2
# Copyright (c) 2002-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 $iniData = IniData->New();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
my $commandController = CommandController->New($iniData, 'LatestVer');
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
my $envDb; # this is only created when needed, by the EnvDb() function
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
my $listAll;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
my $userComp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
my $everyComponent;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
my $versionFilter;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
# Main.
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
ProcessCommandLine();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
PrintLatestVersions();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
# Subs.
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
sub ProcessCommandLine {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
  Getopt::Long::Configure ("bundling");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
  my $help;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
  GetOptions('h' => \$help, 'a:i' => \$listAll, 'v+' => \$verbose, 'f=s' => \$versionFilter);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
  if ($help) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
    Usage(0);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
  $userComp = shift @ARGV || undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
  unless ($#ARGV == -1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
    print "Error: Invalid arguments\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
    Usage(1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
  }
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
sub Usage {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
  my $exitCode = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
  Utils::PrintDeathMessage($exitCode, "\nUsage: latestver [options] [component] 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
-h   help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
-a   lists all versions in descending date order
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
-a 6 list the most recent six versions
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
-v   verbose output (-vv very verbose, -vvv very very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
-f <version wildcard> only show versions whose version numbers match that text\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
sub PrintLatestVersions {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
  # Convert the version number filter from glob-style to perl-style RE
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
  if (defined $versionFilter) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
		require Text::Glob;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
		# Surprisingly complicated to convert a glob-style to a perl-style RE
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
		# Hence we use a module. Not entirely convinced that Text::Glob
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
		# does a particularly good job (e.g. the pattern t_make*[0] doesn't work)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
		# but it's better than my attempts, and should suffice for most cases.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
		$versionFilter = Text::Glob::glob_to_regex($versionFilter);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
	}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
  # First work out what components we need to process
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
  my @compsToProcess;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
  if ($userComp) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
    @compsToProcess = ($userComp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
  } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
    # Call listcomponents with remote flag set as 0 and continue flag set as 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
    @compsToProcess = sort @{$iniData->PathData->ListComponents(0,1)};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
  # Second work out what versions we need to process
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
  my @compVersions; # contains lots of [ comp_name, reldata ]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
  foreach my $compName (@compsToProcess) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
    foreach (@{GetRelevantRelDataObjects($compName, $versionFilter)}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
      push @compVersions, [ $compName, $_ ];
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
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
  die "No versions were found.\n" unless (@compVersions);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
  # Third work out how verbose to make the output, and do it!
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
  if ($verbose) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
    my @tableData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   116
    InsertTableHeadings(\@tableData);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   117
    AddTableEntry($$_[0], \@tableData, $$_[1]) foreach (@compVersions);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
    print "\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
    $iniData->TableFormatter->PrintTable(\@tableData, 1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
  } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
    PrintMinimalVerbosity($$_[0], $$_[1]) foreach (@compVersions);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
sub PrintMinimalVerbosity {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
  my $reldata = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
  my $ver = $reldata->Version();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
  if ($userComp) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   131
    print "$ver\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   132
  } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   133
    print "$comp: $ver\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   134
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   135
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   136
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   137
sub GetRelevantRelDataObjects {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
  my $ver = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   140
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   141
  my $shownum = $listAll;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   142
  $shownum = 1 unless defined $listAll;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   143
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   144
  my $relDataObjects = RelData->OpenSet($iniData, $comp, $verbose, $ver);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   145
  $relDataObjects ||= [];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
  splice(@$relDataObjects, $shownum) unless (scalar @$relDataObjects == 0) || ($shownum==0) || ($shownum > @$relDataObjects); # if showNum==0, we got just -a so show all
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
  return $relDataObjects;
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
sub InsertTableHeadings {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
  my $tableData = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
  my @headings;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
  @headings = ('Version', 'Internal version', 'Project', 'Releaser', 'Date');
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
  if ($verbose > 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
    @headings = ('', @headings);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
  if ($verbose > 2) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
    @headings = (@headings, 'Local path', 'Remote path');
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
  if (!$userComp) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
    @headings = ('Component', @headings);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
  push @$tableData, \@headings;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
sub AddTableEntry {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
  my $tableData = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
  my $relData = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
  my @fields;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
  my $ver = $relData->Version();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
  my $releaser = $relData->NotesSource()->{releaser};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
  chomp $releaser;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
  my $project = $iniData->PathData->ComponentProject($comp, $ver);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
  @fields = ($ver, $relData->InternalVersion(), $project, $releaser, $relData->NotesSource()->{date});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   181
  # We're being very verbose, so add a 'status' field
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   182
  if ($verbose > 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   183
    my $status = "";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
    # "Installed" flag
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
    #
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
    my $installedversion = EnvDb()->Version($comp);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
    $status .= "I" if ($installedversion && $installedversion eq $ver);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
    # "Exported" flag
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
    my $remotePath||="";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
    eval {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
      my $remoteSite = $iniData->RemoteSite(0); # 0 = not verbose
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
      if ($remoteSite) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
        $remotePath = $iniData->PathData->RemoteArchivePathForExistingComponent
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   195
          ($comp, $ver, $remoteSite);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   196
        $status .= "E" if ($remotePath && $remoteSite->FileExists("$remotePath/$comp$ver.zip") );
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   197
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   198
    };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
    unshift @fields, $status;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   201
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   202
    if ($verbose > 2) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   203
      # We're being extravagently verbose, so add two 'location' fields which will 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   204
      # wrap off the end of the line - sigh.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   205
      my $localPath = '"'. $iniData->PathData->LocalArchivePathForExistingComponent
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   206
        ($comp, $ver) .'"';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   207
      $remotePath = '"'.$remotePath.'"' if ($remotePath);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   208
      $remotePath ||= '';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
      $localPath ||= '';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   210
      @fields = (@fields, $localPath, $remotePath);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   211
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   212
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
  # If we're listing several components, stick a field on the front
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
  # saying which component we're talking about in this case
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
  if (!$userComp) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
    unshift @fields, $comp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
  push @$tableData, \@fields;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
sub EnvDb {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
  $envDb ||= EnvDb->Open($iniData, $verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
__END__
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
=head1 NAME
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
LatestVer - Prints the latest version of a particular component.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   231
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   232
=head1 SYNOPSIS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   233
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   234
  latestver [options] [component]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   235
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
  -h   help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
  -a   lists all versions in descending date order
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
  -a <n>  lists the most recent 'n' versions in descending date order
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
  -v   verbose output (-vv very verbose, -vvv very very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
  -f <wildcard> filter the versions displayed
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
=head1 DESCRIPTION
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
Prints the latest version of a particular component, or all known components if the component name is omitted. Optionally prints all versions in descending date order.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
If verbose output is requested, the internal version number, storage area ("project"), releaser's name and release time is also displayed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
If very verbose output is requested, and the remote site is set in the reltools.ini file, a "flags" column will be shown with two possible letters:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
=over 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
=item I
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
This version is installed on your machine.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
=item E
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
This version is exported.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   261
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   262
=back
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   263
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   264
Using the -vv option may significantly increase the time this tool takes to run.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   265
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
If very very verbose is requested the local path is also output to screen.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
If you specify a -f version string then only versions whose version numbers contain that wildcard will be shown. The wildcard should be a glob-style regular expression (for example "*chinese*"). It is case-insensitive.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   270
If very very verbose output is requested, two more fields will show the location of the release on the local and remote archives.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   271
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   272
=head1 KNOWN BUGS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   273
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   274
None.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   275
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   276
=head1 COPYRIGHT
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   277
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   278
 Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   279
 All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   280
 This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   281
 under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   282
 which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   283
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   284
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   285
 Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   286
 Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   287
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   288
 Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   289
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   290
 Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   291
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   292
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   293
=cut