releasing/cbrtools/perl/ImportRel
author marvin shi <marvin.shi@nokia.com>
Wed, 17 Nov 2010 16:47:55 +0800
changeset 696 30aa553e9465
parent 602 3145852acc89
permissions -rw-r--r--
features: bsym for rofsbuild and log input support for rombuild
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 File::Path;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
use IniData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
use RelTransfer::Import;
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;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
my $commandController;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
my $force = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
my $ftpResume = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
my %releases; # Data structure changed to a double hash (from a single hash).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
              # Top level keys are (case lowered) component names with has reference values.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
              # Second level hash keys are versions, with a dummy value.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
              # This arrangement makes it possible for a single component to have more than one
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
              # version, and to easily delete versions that have already been imported.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
my $passphraseFile;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
my $noPassphraseRetry;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
my %goodImports;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
my %failedImports;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
my %alreadyImported;
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
# Main.
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
ProcessCommandLine();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
CheckAlreadyImported();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
ImportRelease() if (keys %releases); # It may be that all components have already been imported
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
PrintReport();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
# Subs.
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
sub ProcessCommandLine {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
  Getopt::Long::Configure ("bundling");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
  my $help;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
  GetOptions("h" => \$help, "v+" => \$verbose, "f" => \$force, "r" => \$ftpResume, "p=s" => \$passphraseFile, "noPassphraseRetry" => \$noPassphraseRetry);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
  if ($help) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
    Usage(0);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
  if (scalar(@ARGV) == 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
    if (-f $ARGV[0]) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
      open IN, $ARGV[0] or die "Error: Couldn't open $ARGV[0] for reading: $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
      while (my $line = <IN>) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
	chomp $line;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
	$line =~ s/^\s*$//;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
	$line =~ s/#.*//;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
	if ($line eq '') {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
	  next; #Nothing left
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
	}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
	my ($comp, $ver) = split(" ", $line);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
	if (defined $comp and defined $ver) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
	  $releases{lc($comp)}->{$ver} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
	}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
	else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
	  print "Error: Invalid file format in $ARGV[0]\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
	  Usage(1);
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
      close IN;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
    else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
      print "Error: $ARGV[0] is not a file\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
      Usage(1);
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
  elsif (scalar(@ARGV) == 2) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
    $releases{lc($ARGV[0])}->{$ARGV[1]} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
    print "Error: Invalid arguments\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
    Usage(1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
  $iniData = IniData->New(undef,1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
  $commandController = CommandController->New($iniData, 'ImportRel');
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
  #if ftp resume option is used override value in reltools.ini
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
  if ($ftpResume) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
    $iniData->FtpServerSupportsResume(1);
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
sub Usage {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
  my $exitCode = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
  Utils::PrintDeathMessage($exitCode, "\nUsage: importrel [options] (<component> <version>) | (<component_ver_list_file>)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   116
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   117
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
-h  help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
-f  force import overwriting if necessary
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
-r  use FTP reconnect and resume transfer mode
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
-p <file> file containing passphrase
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
-v  verbose output (-vv very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
--noPassphraseRetry  Will cause ImportRel to terminate if an incorrect passphrase is specified\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
sub CheckAlreadyImported {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
#remove releases from attempted imports if they already exist locally
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
  unless ($force) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
    foreach my $comp (sort keys %releases) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
      foreach my $ver (keys %{$releases{$comp}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   131
	my $loc = $iniData->PathData->LocalArchivePathForExistingComponent($comp, $ver);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   132
	if ($loc && -d $loc) { 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   133
	  push (@{$alreadyImported{$comp}}, $ver);          
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   134
	  print "$comp $ver already exists in local archive\n" if ($verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   135
	  delete $releases{$comp}->{$ver};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   136
	  unless (scalar(keys %{$releases{$comp}}) > 0) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   137
	    delete $releases{$comp};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
	  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
	}	
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   140
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   141
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   142
  }
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
sub ReadPassphraseFile {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
  return undef unless $passphraseFile;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
  open(PP, $passphraseFile) or die "Couldn't open passphrase file \"$passphraseFile\" because $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
  my $passphrase = join ("\n", <PP>);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   149
  close PP;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   150
  return $passphrase;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   151
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
sub ImportRelease {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
  my $importer = RelTransfer::Import->New(ini_data => $iniData,
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
					  force => $force,
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
					  verbose => $verbose,
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
            passphrase => ReadPassphraseFile);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
  #do the import
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
  foreach my $comp (sort keys %releases) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
    my $imported;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
    foreach my $ver (keys %{$releases{$comp}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
      eval {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
        $imported = $importer->TransferRelease($comp, $ver, $noPassphraseRetry);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
      };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
      if ($@) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
        print $@;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
        if ($@ =~ /cannot\s+connect/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
          print "\nConnection to remote site dropped aborting import\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
          last;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
        my $error = $@;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
        chomp $error;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
        $error =~ s/^error: ("?$comp $ver"? )?//i;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
        $failedImports{$comp}->{$ver} = $error;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
      else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
        if ($imported) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
          push (@{$goodImports{$comp}}, $ver);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
        } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
          push (@{$alreadyImported{$comp}}, $ver);
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
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
sub PrintReport { 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
  print "\n=========IMPORT SUMMARY==========\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
  my $tableData = [["Component", "Version", "status"]];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
  foreach my $comp (sort keys %goodImports) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
    foreach my $ver (@{$goodImports{$comp}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
      push (@$tableData, [$comp, $ver, 'successfully imported']);
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
    
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   198
  foreach my $comp (sort keys %alreadyImported) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
    foreach my $ver (@{$alreadyImported{$comp}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
      push (@$tableData, [$comp, $ver, 'has already been imported']);
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
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   204
  if (scalar @{$tableData} > 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   205
    $iniData->TableFormatter->PrintTable($tableData, 1);
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
  if (scalar (keys %alreadyImported) > 0) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
    print "\nYou can specify the -f option to force the re-import of component releases\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   210
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   211
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   212
  #handle failed imports
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
  if (keys %failedImports) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
    print "\n=========FAILED IMPORTS==========\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
    my $failureTableData = [["Component", "Version", "Failure reason"]];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
    foreach my $comp (sort keys %failedImports) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
      foreach my $ver (sort keys %{$failedImports{$comp}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
        push (@$failureTableData, [$comp, $ver, $failedImports{$comp}->{$ver}]);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
    $iniData->TableFormatter->PrintTable($failureTableData, 1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
    print "\nError: Unable to import component release successfully.  Component release might be corrupted.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
  else
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
  {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
    if (keys %goodImports) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
      print "\nAll releases imported successfully\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
    } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
      print "\nNothing to do!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
    }
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
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   235
__END__
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
=head1 NAME
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
ImportRel - Imports a component release from a remote site.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
=head1 SYNOPSIS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
  importrel [options] (<component> <version>) | (<component_ver_list_file>)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
  -h  help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
  -f  force import overwriting if necessary
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
  -r  use FTP reconnect and resume transfer mode
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
  -p <file> file containing passphrase
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
  -v  verbose output (-vv very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
  --noPassphraseRetry  Will cause ImportRel to terminate if an incorrect passphrase is specified
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
=head1 DESCRIPTION
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
Attempts to import the component release specified on the command line from the projects remote site to the local archive.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
The name of file containing a list of components and versions maybe passed as an argument to the tool instead of a single component to import multiple releases.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
Using the C<-f> option will force releases to be imported even if they already exist in the local archive.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   261
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   262
If the C<-r> option is used and the FTP connection is dropped during the download of a release, the tools will automatically reconnect to the FTP site and resume the download. This feature may not be supported by some FTP servers.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   263
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   264
It is recommended NOT to use the C<-p> option as it may be a security risk. You will be prompted if a passphrase is needed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   265
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
=head1 KNOWN BUGS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
None
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   270
=head1 COPYRIGHT
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   271
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   272
 Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   273
 All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   274
 This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   275
 under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   276
 which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   277
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   278
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   279
 Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   280
 Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   281
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   282
 Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   283
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   284
 Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   285
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   286
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   287
=cut