releasing/cbrtools/perl/InstallSnapShot
author Zheng Shen <zheng.shen@nokia.com>
Tue, 20 Jul 2010 15:02:28 +0800
changeset 617 3a747a240983
parent 602 3145852acc89
permissions -rw-r--r--
ROM Tools 12.2.0.4 Postlinker 2.2.5 Revert package_definition.xml to changeset 360bd6b35136
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) 2003-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
use CleanEnv;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
use GetEnv;
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
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    30
# Constants.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
my $KMissingFileName = "__missing.txt";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
my $KCompsFileName = "__comps.txt";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
# Globals.
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
my $verbose = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
my $reallyClean = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
my $force = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
my $snapShotFileName;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
my $iniData = IniData->New();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
my $commandController = CommandController->New($iniData, 'InstallSnapShot');
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
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
# Main.
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
ProcessCommandLine();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
InstallSnapShot();
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
#
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, 'r' => \$reallyClean, 'f' => \$force, 'v+' => \$verbose);
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
  $snapShotFileName = shift @ARGV;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
  defined $snapShotFileName or die Usage(1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
  unless ($snapShotFileName =~ /\.zip$/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
    $snapShotFileName .= '.zip';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
  unless ($snapShotFileName and scalar(@ARGV) == 0) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
    print "Error: Invalid number of arguments\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
    Usage(1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
sub Usage {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
  my $exitCode = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
  Utils::PrintDeathMessage($exitCode, "\nUsage: installsnapshot [options] <snap_shot_file_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
  -h  help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
  -r  really clean
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
  -f  force (don't prompt)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
  -v  verbose output (-vv very verbose)\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
sub InstallSnapShot {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
  my $newEnv = ReadSnapShotEnv();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
  CheckEnvAvailable($newEnv);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
  unless (CleanEnv::CleanEnv($iniData, $reallyClean, $force, $verbose)) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
    die "\nAborting because environment was not cleaned...\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
  print "Installing snapshot environment...\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
  GetEnv::GetEnv($iniData, $newEnv, 0, undef, 0, 0, $verbose, undef, 0);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
  print "Unpacking \"$snapShotFileName\"...\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
  Utils::Unzip($snapShotFileName, Utils::EpocRoot(), $verbose, 1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
  my $problems = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
  unlink (Utils::PrependEpocRoot($KMissingFileName)) or (++$problems and print "Warning: Couldn't delete \"$KMissingFileName\": $!\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
  unlink (Utils::PrependEpocRoot($KCompsFileName)) or (++$problems and print "Warning: Couldn't delete \"$KMissingFileName\": $!\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   108
  my $missingFiles = ReadSnapShotMissingFiles();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   109
  foreach my $thisMissingFile (@$missingFiles) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   110
    print "Removing \"$thisMissingFile\"...\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
    unlink $thisMissingFile or (++$problems and print "Warning: Couldn't delete \"$thisMissingFile\": $!\n");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
  if ($problems) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
    print "There were problems installing this snapshot\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   116
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   117
    print "Snapshot \"$snapShotFileName\" successfully installed\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
sub CheckEnvAvailable {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
  my $env = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
  print "Checking that all the component releases referred to by snap shot \"$snapShotFileName\" are available...\n" if ($verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
  my $pathData = $iniData->PathData();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
  my $errors = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
  foreach my $thisComp (sort keys %$env) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
    unless ($pathData->ReleaseExists($thisComp, $env->{$thisComp})) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
      print "Error: $thisComp $env->{$thisComp} is referred to by snap shot \"$snapShotFileName\" but does not exist\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
      $errors = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   131
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   132
  if ($errors) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   133
    die "Aborting (environment not altered)...\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 ReadSnapShotEnv {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
  print "Reading snap shot environment details from \"$KCompsFileName\" within \"$snapShotFileName\"...\n" if ($verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
  Utils::InitialiseTempDir($iniData);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   140
  my %env;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   141
  eval {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   142
    Utils::UnzipSingleFile($snapShotFileName, $KCompsFileName, Utils::TempDir(), $verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   143
    my $file = Utils::ConcatenateDirNames(Utils::TempDir(), $KCompsFileName);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   144
    open (COMPS, $file) or die "Couldn't open \"$file\": $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   145
    while (my $line = <COMPS>) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
      (my $comp, my $ver) = $line =~ /^(\S+)\s+(\S+)$/;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
      unless ($comp and $ver) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
	die "Invalid line in \"$file\"\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   149
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   150
      $env{$comp} = $ver;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   151
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
    close (COMPS);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
  };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
  Utils::RemoveTempDir();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
  if ($@) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
    die "Error: Problem reading environment from snap shot \"$snapShotFileName\": $@";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
  return \%env;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
sub ReadSnapShotMissingFiles {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
  print "Reading list of files missing from snap shot environment from \"$KMissingFileName\" within \"$snapShotFileName\"...\n" if ($verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
  Utils::InitialiseTempDir($iniData);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
  my @missingFiles;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
  eval {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
    Utils::UnzipSingleFile($snapShotFileName, $KMissingFileName, Utils::TempDir(), $verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
    my $file = Utils::ConcatenateDirNames(Utils::TempDir(), $KMissingFileName);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
    open (MISSING, $file) or die "Couldn't open \"$file\": $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
    while (my $line = <MISSING>) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
      chomp $line;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
      $line = Utils::PrependEpocRoot($line);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
      push (@missingFiles, $line);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
    close (MISSING);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
  };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
  Utils::RemoveTempDir();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
  if ($@) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
    die "Error: Problem reading missing files from snap shot \"$snapShotFileName\": $@";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
  return \@missingFiles;
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
__END__
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
=head1 NAME
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
InstallSnapShot - Installs a snap shot created with MakeSnapShot.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
=head1 SYNOPSIS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
  installsnapshot [options] <snap_shot_file_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
options:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   195
  -h  help
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   196
  -r  really clean
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   197
  -f  force (don't prompt)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   198
  -v  verbose output (-vv very verbose)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
=head1 DESCRIPTION
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   201
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   202
The release tools exist to make it relatively straight forward to share binary files in a controlled way. In order to acheive a suitable level of control, a fair amount of rigor is imposed on users when they are making releases. There are times when this is inappropriate. For example, if a user wants to temporarily capture the current state of their environment. The commands C<MakeSnapShot> and C<InstallSnapShot> exist to make it easy to accurately capture the current state of an environment, and subsequently revert to it, without the overhead of doing a full environment release. Snap shots should only be used in preference to full environment releases when there is a B<temporary> need to capture an environment, because:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   203
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   204
=over 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   205
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   206
=item 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   207
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   208
No mechansims are provided for exporting or importing snap shots.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   210
=item 2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   211
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   212
No release notes are provided with snap shots.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
=item 3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
The contents of snap shots are inherently dirty - they consist of all the files that could not be accounted for with proper releases. Reliance on snap shots as a means of distributing software would therefore eventually become a self defeating activity since the snap shot files would get larger and larger over time.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
=back
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
C<InstallSnapShot> uses a snap shot zip file generated by C<MakeSnapShot> to set the current environment state to that which the specified snap shot was made from. The following steps are performed:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
=over 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
=item 1
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
The environment is cleaned. If the C<-r> option is specified, files that are normally ignored (e.g. the contents of F<\epoc32\build>) are also removed. If the C<-f> option is specified, the cleaning process is carried out without warning the user before deleting files and reinstalling components.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
=item 2
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
Component releases are installed, removed or upgraded in such a way as to set the current environment to that which was present when the snap shot was made.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   231
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   232
=item 3
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   233
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   234
The contents of the snap shot zip file is installed, overwriting exisitng files, thereby restoring the snap shot, but at the same time making the environment dirty.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   235
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
=item 4
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
Any files that were missing from the snap shot environment are removed from the current environment.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
=back
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
C<MakeSnapShot> generates a zip file that contains all the dirty files currently present in the environment. It makes no attempt to understand which component own which files. It also creates some metadata that list the component versions currently installed. This can subsequently be used by C<InstallSnapShot> to revert to the snap shot state.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
=head1 STATUS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
Supported. If you find a problem, please report it to us.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
=head1 KNOWN BUGS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
None.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
=head1 COPYRIGHT
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
 Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
 All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
 This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
 under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
 which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   261
 Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   262
 Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   263
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   264
 Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   265
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
 Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
=cut