releasing/cbrtools/perl/Symbian/CBR/DeltaRelease/Manifest.pm
author kelvzhu
Mon, 18 Oct 2010 16:16:46 +0800
changeset 655 3f65fd25dfd4
parent 602 3145852acc89
permissions -rw-r--r--
sync up SVN codes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     2
# All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     7
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     8
# Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    10
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    11
# Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    12
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    13
# Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    14
# 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    15
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    16
# Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    17
# Symbian::CBR::Delta::Manifest.pm
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    18
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
package Symbian::CBR::DeltaRelease::Manifest;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
use strict;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
use XML::Simple;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
use Carp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
use POSIX qw(strftime);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
use base qw (Exporter);
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
#Constants
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
use constant DELTA_MANIFEST_FILE      => 'delta_manifest_baseline.xml';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
use constant META_FILES               => 'metafiles';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
use constant ADDED_ZIPS               => 'addedZips';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
our @EXPORT_OK = qw(DELTA_MANIFEST_FILE META_FILES ADDED_ZIPS);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
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
#Public.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
sub new {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
  my $pkg = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
  my $self = {};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
  bless $self, $pkg;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
  return $self;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    49
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    50
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    51
sub Save {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
  my $destination = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
  mkpath ($destination) unless (-e $destination);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
  my $manifestFile = File::Spec->catfile($destination,DELTA_MANIFEST_FILE);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
  print "Writing Delta manifest file.\n " ;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
  #Hash structure to be provided as input for XML::Simple->XMLout()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
  my $manifestHash = {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
    version => "1.0.0",
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
    meta => { 'reference-baseline' => { 'value' => $self->{referenceBaseline} },
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
              'reference-version' => { 'value' => $self->{referenceVersion} },
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
              'nominated-baseline' => { 'value' => $self->{nominatedBaseline} },
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
              'nominated-version' => { 'value' => $self->{nominatedVersion} },
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
              'created-time' => { 'value' => strftime( '%Y-%m-%dT%H:%M:%S', localtime() ) } }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
  };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
  my $cgroups = {};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
  foreach my $thisComp (sort keys %{$self->{components}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
    my $compStatus = $self->{components}{$thisComp}{'status'};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
    my $nomVer = $self->{components}{$thisComp}{'nominatedVersion'} if (defined $self->{components}{$thisComp}{'nominatedVersion'});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
    my $refVer = $self->{components}{$thisComp}{'referenceVersion'} if (defined $self->{components}{$thisComp}{'referenceVersion'});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
    my $zgroups = {};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
    my @zGroupArray = ();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
    foreach  my $thisZip (sort keys %{$self->{components}{$thisComp}{'zipFiles'}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
      my $thisZipFileStatus = $self->{components}{$thisComp}{'zipFiles'}{$thisZip}{'status'};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
      if ( !defined $zgroups->{$thisZip} ) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
        $zgroups->{$thisZip} = {file => []};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
        if ($thisZip =~ /^exports([A-Z])\.zip$/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
          $zgroups->{$thisZip}{'ipr-category'} = $1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
          $zgroups->{$thisZip}{'content-type'} = "exports";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
        elsif ($thisZip =~ /^source([A-Z])\.zip$/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
          $zgroups->{$thisZip}{'ipr-category'} = $1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
          $zgroups->{$thisZip}{'content-type'} = "source";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
        elsif ($thisZip =~ /^binaries\.zip$/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
          $zgroups->{$thisZip}{'content-type'} = "binary";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
        elsif ($thisZip =~ /^binaries\_([_a-zA-Z0-9]+)\.zip$/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
          $zgroups->{$thisZip}{'content-type'} = "binary";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
          $zgroups->{$thisZip}{'platform'} = $1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
        $zgroups->{$thisZip}{status} = $thisZipFileStatus;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    93
        push @zGroupArray, $zgroups->{$thisZip};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    94
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    95
      foreach my $thisFile (keys %{$self->{components}{$thisComp}{'zipFiles'}{$thisZip}{files}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
        my $file = { path => $thisFile };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
        $file->{status} = $self->{components}{$thisComp}{'zipFiles'}{$thisZip}{files}{$thisFile}{status};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
        $file->{type} = $self->{components}{$thisComp}{'zipFiles'}{$thisZip}{files}{$thisFile}{type};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
        push @{$zgroups->{$thisZip}{file}}, $file;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
    if ( !defined $cgroups->{$thisComp} ) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
      $cgroups->{$thisComp} = { files => [] };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
      $cgroups->{$thisComp}{name} = $thisComp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
      $cgroups->{$thisComp}{status} = $compStatus;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
      $cgroups->{$thisComp}{referenceVersion} = $refVer if(defined $refVer);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
      $cgroups->{$thisComp}{nominatedVersion} = $nomVer if(defined $nomVer);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   108
      push @{$manifestHash->{component}}, $cgroups->{$thisComp};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   109
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   110
    foreach my $zgroup (@zGroupArray) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
      push @{$cgroups->{$thisComp}{files}}, $zgroup;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
    foreach my $thisFile (sort keys %{$self->{components}{$thisComp}{metafiles}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
      my $file = { path => $thisFile };
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
      push @{$cgroups->{$thisComp}{metafiles}{file}}, $file;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   116
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   117
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   118
  #Use the hash structure for calling the XMLout() to write the manifest file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
  eval {XMLout(
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
        $manifestHash,
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
        xmldecl     => '<?xml version="1.0" ?>',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
        rootname    => 'manifest',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
        outputfile  => $manifestFile )};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   124
  croak "Error: Can't write manifest file: $@\n" if $@;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   125
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   126
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
sub LoadManifest {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
  my $manifestFile = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
  print "Reading $manifestFile file.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   131
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   132
  my $manifest    = eval{XMLin(
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   133
                    $manifestFile,
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   134
                    forcearray => [ qw(component files file metafiles) ], keyattr => [])
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
  croak "Error: Can't read manifest file '$manifestFile': $@\n" if $@;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
  # Mapping from xml keyword to our internal data structure keyword
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   140
  my %metaFieldMap = ('nominated-baseline' => 'nominatedBaseline',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   141
                      'nominated-version'  => 'nominatedVersion',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   142
                      'reference-baseline' => 'referenceBaseline',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   143
                      'reference-version'  => 'referenceVersion',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   144
                      'created-time'       => 'createdTime');
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   145
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
  foreach my $metaInformation (@{$manifest->{meta}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
    $self->{$metaFieldMap{$metaInformation->{name}}} = $metaInformation->{value};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   149
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   150
  foreach my $component ( @{$manifest->{component} } ) {  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   151
    $self->{components}->{$component->{name}} = {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
                referenceVersion => $component->{referenceVersion},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
                nominatedVersion => $component->{nominatedVersion},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
                status => $component->{status}}; 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
    foreach my $zipfile ( @{ $component->{files} } ) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
      my $content = $zipfile->{'content-type'};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
      my $category;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
      my $platform;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
      my $zipFileName ;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
      if ($content eq "source" or $content eq "exports") {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
        $category = $zipfile->{'ipr-category'};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
        $zipFileName = $content.$category.".zip";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
      else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
        $platform = $zipfile->{platform};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
        if (defined $platform) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
          $zipFileName = "binaries_".$platform.".zip";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
        else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
          $zipFileName = "binaries.zip";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
      
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
      $self->{components}->{$component->{name}}->{zipFiles}->{$zipFileName}->{status} = $zipfile->{status};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
     
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
      foreach my $file (@{$zipfile->{file}}) {      
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
        $self->{components}->{$component->{name}}->{zipFiles}->{$zipFileName}->{files}->{$file->{path}} = {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
                                                                                          status => $file->{status},
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
                                                                                          type => $file->{type}};
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
    foreach my $metafiles ( @{ $component->{metafiles} } ) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
      foreach my $file (@{$metafiles->{file}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
        my $name = $file->{path};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
        $self->{components}->{$component->{name}}->{metafiles}->{$name} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
sub SetReferenceBaselineComp {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   195
  $self->{referenceBaseline} = $comp;
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
sub SetReferenceBaselineVer {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
  my $version = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   201
  $self->{referenceVersion} = $version;
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
sub SetNominatedBaselineComp {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   205
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   206
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   207
  $self->{nominatedBaseline} = $comp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   208
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   210
sub SetNominatedBaselineVer {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   211
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   212
  my $version = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
  $self->{nominatedVersion} = $version;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
sub SetComponentDetails {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
  my $status = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
  my $refVersion = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
  my $nomVersion = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
  $self->{components}{$comp}{'status'} = $status;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
  $self->{components}{$comp}{'referenceVersion'} = $refVersion if(defined $refVersion);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
  $self->{components}{$comp}{'nominatedVersion'} = $nomVersion if(defined $nomVersion);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
sub SetZipfileDetails {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
  my $zipFile = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   231
  my $status = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   232
  $self->{components}{$comp}{zipFiles}{$zipFile}{'status'} = $status;
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
sub SetFileDetails {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
  my $zipFile = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
  my $file = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
  my $status = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
  my $type = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
  $self->{components}{$comp}{zipFiles}{$zipFile}{files}{$file}{status} = $status;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
  $self->{components}{$comp}{zipFiles}{$zipFile}{files}{$file}{type} = $type;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
sub RecordMetaFile {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
  my $file = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
  $self->{components}{$comp}{metafiles}{$file} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
sub GetReferenceBaselineComp {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
  return $self->{referenceBaseline} ;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
sub GetReferenceBaselineVer {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
  return $self->{referenceVersion};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   261
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   262
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   263
sub GetNominatedBaselineComp {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   264
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   265
  return $self->{nominatedBaseline};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
sub GetNominatedBaselineVer {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   270
  return $self->{nominatedVersion};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   271
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   272
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   273
sub ListAllComponents {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   274
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   275
  return $self->{components};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   276
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   277
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   278
sub GetCompStatus {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   279
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   280
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   281
  return $self->{components}{$comp}{'status'};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   282
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   283
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   284
sub GetCompReferenceVer {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   285
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   286
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   287
  return $self->{components}{$comp}{'referenceVersion'};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   288
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   289
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   290
sub GetCompNominatedVer {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   291
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   292
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   293
  return $self->{components}{$comp}{'nominatedVersion'};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   294
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   295
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   296
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   297
sub GetZipFilesForComp {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   298
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   299
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   300
  return ($self->{components}{$comp}{zipFiles} || {});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   301
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   302
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   303
sub GetZipStatus {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   304
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   305
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   306
  my $zipFile = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   307
  return $self->{components}{$comp}{zipFiles}{$zipFile}{'status'};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   308
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   309
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   310
sub GetFilesForZip {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   311
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   312
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   313
  my $zipFile = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   314
  return ($self->{components}{$comp}{zipFiles}{$zipFile}{files} || {});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   315
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   316
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   317
sub GetFileStatus {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   318
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   319
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   320
  my $zipFile = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   321
  my $file  = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   322
  $self->{components}{$comp}{zipFiles}{$zipFile}{files}{$file}{status};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   323
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   324
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   325
sub GetFileType {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   326
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   327
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   328
  my $zipFile = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   329
  my $file  = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   330
  return $self->{components}{$comp}{zipFiles}{$zipFile}{files}{$file}{type};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   331
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   332
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   333
sub GetMetaFiles {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   334
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   335
  my $comp = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   336
  return ($self->{components}{$comp}{metafiles} || {});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   337
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   338
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   339
1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   340
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   341
__END__
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   342
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   343
=head1 NAME
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   344
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   345
Symbian::CBR::DeltaRelease::Manifest.pm - Provides an interface to data associated with a deltas created from reference version to the nominated version.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   346
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   347
=head2 new
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   348
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   349
Creates a new Symbian::CBR::Delta::Manifest object.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   350
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   351
=head2 Save
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   352
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   353
Expects to be passed a destination path. Creates destination path if destination path is not existing, and save the hash structure to xml file.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   354
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   355
=head2 LoadManifest
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   356
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   357
Expects to be passed a manifest file name. Reads delta manifest file and converts into a hash structure.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   358
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   359
=head1 KNOWN BUGS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   360
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   361
None.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   362
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   363
=head1 COPYRIGHT
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   364
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   365
 Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   366
 All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   367
 This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   368
 under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   369
 which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   370
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   371
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   372
 Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   373
 Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   374
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   375
 Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   376
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   377
 Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   378
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   379
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   380
=cut