releasing/cbrtools/perl/IniData.pm
author lorewang
Mon, 22 Nov 2010 10:56:31 +0800
changeset 700 c22eff170fac
parent 602 3145852acc89
permissions -rw-r--r--
update from trunk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
602
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2000-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
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    17
package IniData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    18
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    19
use strict;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    20
use FindBin;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    21
use File::Path;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    22
use File::Spec;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    23
use Utils;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    24
use PathData;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    25
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    26
our $cache = {}; # Persistent (private) cache
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
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    31
# Constants.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    32
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    33
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    34
my $iniName = \ 'reltools.ini';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    35
my $envDir = undef; # only filled in when we do New()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    36
my $binDir = \ "$FindBin::Bin\\";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    37
my @standardIgnores = ('\\epoc32\\build\\*',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    38
           '\\epoc32\\wins\\c\\*',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    39
           '\\epoc32\\winscw\\c\\*',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    40
           '\\epoc32\\release\\*.ilk',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    41
           '\\epoc32\\release\\*.bsc',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    42
           '\\epoc32\\data\\emulator\\*.sys.ini',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    43
           '\\epoc32\\release\\tools\\*',
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    44
           '\\epoc32\\release\\tools2\\*'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    45
          );
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    46
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    47
# Support for target alias file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    48
use constant CBR_TARGET_ALIAS_LOCATION => scalar "\\epoc32\\tools\\variant\\";
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
# Constructor
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    52
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    53
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    54
sub New {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    55
  my $pkg = shift;  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    56
  my $filename = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    57
  my $ignoreepocroot = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    58
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    59
  if ( defined ($ENV{EPOCROOT}) or ! $ignoreepocroot ){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    60
     $envDir = \ Utils::PrependEpocRoot("\\epoc32\\relinfo\\");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    61
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    62
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    63
  my $self = {};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    64
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    65
  $self->{warnIniLocation} = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    66
  # Support for target alias file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    67
  # This is a persistant flag.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    68
  # If set then a warning must be printed if either HasTargetPlatforms()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    69
  # or TargetPlatforms() is used. The flag is then cleared thus the warning is a one off.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    70
  # If clear this is because the cbrtargetsalias.cfg file has been found
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    71
  # or the no_target_alias_warning flag is set in reltools.ini
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    72
  $self->{mustWarnTargetAliasLocation} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    73
  if (defined $filename and -e $filename ) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    74
    $self->{iniFileName} = $filename;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    75
  } elsif (defined $$envDir and -e "$$envDir$$iniName" ) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    76
    $self->{iniFileName} = "$$envDir$$iniName";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    77
  } elsif (-e "$$binDir$$iniName") {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    78
    $self->{warnIniLocation} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    79
    $self->{iniFileName} = "$$binDir$$iniName";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    80
  } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    81
    my $msg = "Error: \"$$iniName\" not found in ";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    82
    $msg = $msg."either \"$$envDir\" or " if ( defined ($$envDir));
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    83
    $msg = $msg."\"$$binDir\"\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    84
    die $msg;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    85
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    86
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    87
  if ($cache->{lc($self->{iniFileName})}) {           
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    88
    return $cache->{lc($self->{iniFileName})};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    89
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    90
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    91
  foreach my $thisIgnore (@standardIgnores) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    92
    push (@{$self->{binIgnore}}, $thisIgnore);
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
  bless $self, $pkg; # $self isn't blessed until we know we need it
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    96
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    97
  $self->ReadIni();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    98
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
    99
  # Support for target alias file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   100
  if (!$ignoreepocroot) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   101
    $self->{targetAliasName} = Utils::PrependEpocRoot(CBR_TARGET_ALIAS_LOCATION).'cbrtargetalias.cfg';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   102
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   103
    if ($self->ReadTargetAliasFile == 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   104
      # Successful read so clear the warning flag
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   105
      $self->{mustWarnTargetAliasLocation} = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   106
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   107
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   108
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   109
  $cache->{lc($self->{iniFileName})} = $self;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   110
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   111
  return $self;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   112
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   113
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   114
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   115
# Public
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
sub DiffTool {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   119
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   120
  unless (exists $self->{diff_tool}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   121
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   122
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   123
  return $self->{diff_tool};
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 RequireInternalVersions {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   127
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   128
  if (exists $self->{require_internal_versions}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   129
    return 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   130
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   131
  return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   132
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   133
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   134
sub IgnoreSourceFilterErrors {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   135
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   136
  if (exists $self->{ignore_source_filter_errors}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   137
    return 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   138
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   139
  return 0;
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
sub RemoteSiteType {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   143
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   144
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   145
  unless (exists $self->{remote_site_type}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   146
    $self->{remote_site_type} = 'FTP';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   147
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   148
  elsif ($self->{remote_site_type} =~ /(network|drive)/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   149
    $self->{remote_site_type} = 'NetDrive';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   150
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   151
  elsif ($self->{remote_site_type} =~ /experimentalproxy/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   152
    $self->{remote_site_type} = 'FTP::Proxy::Experimental';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   153
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   154
  elsif ($self->{remote_site_type} =~ /experimentalftp/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   155
    $self->{remote_site_type} = 'FTP::Experimental';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   156
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   157
  elsif ($self->{remote_site_type} =~ /multivolumeexport/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   158
    $self->{remote_site_type} = 'NetDrive::MultiVolumeExport';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   159
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   160
  elsif ($self->{remote_site_type} =~ /multivolumeimport/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   161
    $self->{remote_site_type} = 'NetDrive::MultiVolumeImport';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   162
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   163
  elsif ($self->{remote_site_type} =~ /proxy/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   164
    $self->{remote_site_type} = 'FTP::Proxy';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   165
  }  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   166
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   167
    $self->{remote_site_type} = 'FTP';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   168
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   169
  return $self->{remote_site_type};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   170
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   171
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   172
sub RemoteHost {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   173
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   174
  unless (exists $self->{remote_host}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   175
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   176
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   177
  return $self->{remote_host};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   178
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   179
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   180
sub RemoteUsername {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   181
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   182
  unless (exists $self->{remote_username}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   183
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   184
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   185
  return $self->{remote_username};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   186
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   187
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   188
sub RemotePassword {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   189
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   190
  unless (exists $self->{remote_password}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   191
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   192
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   193
  return $self->{remote_password};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   194
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   195
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   196
sub RemoteLogsDir {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   197
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   198
  unless (exists $self->{remote_logs}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   199
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   200
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   201
  return $self->{remote_logs};
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 Proxy {
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
  unless (exists $self->{proxy}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   207
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   208
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   209
  return $self->{proxy};
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
sub ProxyUsername {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   213
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   214
  unless (exists $self->{proxy_username}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   215
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   216
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   217
  return $self->{proxy_username};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   218
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   219
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   220
sub ProxyPassword {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   221
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   222
  unless (exists $self->{proxy_password}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   223
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   224
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   225
  return $self->{proxy_password};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   226
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   227
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   228
sub PasvTransferMode {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   229
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   230
  if (exists $self->{pasv_transfer_mode}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   231
    return 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   232
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   233
  return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   234
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   235
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   236
sub FtpServerSupportsResume {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   237
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   238
  if (defined $_[0]) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   239
    $self->{ftp_server_supports_resume} = $_[0];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   240
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   241
  if (exists $self->{ftp_server_supports_resume}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   242
    return $self->{ftp_server_supports_resume} ? 1 : 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   243
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   244
  return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   245
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   246
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   247
sub FtpTimeout {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   248
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   249
  unless (exists $self->{ftp_timeout}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   250
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   251
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   252
  return $self->{ftp_timeout};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   253
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   254
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   255
sub FtpReconnectAttempts {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   256
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   257
  unless (exists $self->{ftp_reconnect_attempts}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   258
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   259
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   260
  return $self->{ftp_reconnect_attempts};
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 TempDir {
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
  if (exists $self->{temp_dir}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   266
    return $self->{temp_dir};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   267
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   268
  return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   269
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   270
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   271
sub MaxExportVolumeSize {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   272
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   273
  if (exists $self->{max_export_volume_size}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   274
    return $self->{max_export_volume_size};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   275
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   276
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   277
    return 639 * 1024 * 1024;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   278
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   279
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   280
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   281
sub PgpTool {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   282
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   283
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   284
  unless (exists $self->{pgp_tool}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   285
    $self->{pgp_tool} = 'PGP';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   286
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   287
  elsif ($self->{pgp_tool} =~ /(gpg|gnupg)/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   288
    $self->{pgp_tool} = 'GPG';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   289
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   290
  else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   291
    $self->{pgp_tool} = 'PGP';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   292
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   293
  return $self->{pgp_tool};
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
sub PgpEncryptionKeys {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   297
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   298
  unless (exists $self->{pgp_encryption_keys}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   299
    return [];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   300
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   301
  return $self->{pgp_encryption_keys};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   302
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   303
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   304
sub PgpConfigPath {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   305
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   306
  unless (exists $self->{pgp_config_path}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   307
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   308
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   309
  return $self->{pgp_config_path};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   310
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   311
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   312
sub ExportDataFile {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   313
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   314
  unless (exists $self->{export_data_file}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   315
    die "Error: export_data_file keyword not specified in reltools.ini\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   316
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   317
  return $self->{export_data_file};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   318
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   319
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   320
sub PathData {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   321
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   322
  unless (defined $self->{pathData}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   323
    $self->{pathData} = PathData->New($self->{verbose});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   324
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   325
  return $self->{pathData};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   326
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   327
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   328
sub HtmlNotes {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   329
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   330
  return (exists $self->{html_notes});
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 FromMapping {
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 @fromMapping;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   336
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   337
  if(defined @{$self->{from_mapping}}){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   338
    @fromMapping = @{$self->{from_mapping}};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   339
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   340
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   341
  return @fromMapping;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   342
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   343
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   344
sub ToMapping {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   345
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   346
  my @toMapping;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   347
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   348
  if(defined @{$self->{to_mapping}}){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   349
    @toMapping = @{$self->{to_mapping}};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   350
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   351
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   352
  return @toMapping;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   353
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   354
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   355
sub HasMappings {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   356
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   357
  my $result = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   358
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   359
  if(defined @{$self->{from_mapping}} && defined @{$self->{to_mapping}} && Utils::SourceRoot() eq "\\"){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   360
    $result = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   361
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   362
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   363
  return $result;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   364
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   365
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   366
sub PerformMapOnFileName {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   367
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   368
  my $operand = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   369
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   370
  my @fromMapping = $self->FromMapping();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   371
  my @toMapping  = $self->ToMapping();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   372
  my $fromMappingSize = @fromMapping;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   373
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   374
  unless($operand =~ /^\\.*/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   375
    $operand = "\\"."$operand";  # Add a \\ to the beginning, which is equal to srcroot.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   376
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   377
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   378
  if(@fromMapping) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   379
    for(my $position = 0; $position<$fromMappingSize; $position++) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   380
      if($operand =~ /^\Q$fromMapping[$position]\E/i){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   381
        $operand =~ s/^\Q$fromMapping[$position]\E/$toMapping[$position]/i;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   382
        last;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   383
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   384
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   385
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   386
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   387
  return $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   388
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   389
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   390
sub PerformReverseMapOnFileName {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   391
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   392
  my $operand = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   393
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   394
  my @fromMapping = $self->FromMapping();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   395
  my @toMapping  = $self->ToMapping();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   396
  my $toMappingSize = @toMapping;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   397
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   398
  unless($operand =~ /^\\(.*)/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   399
    $operand = "\\"."$operand";  # Add a \\ to the beginning, which is equal to srcroot.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   400
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   401
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   402
  if(@toMapping) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   403
    for(my $position = 0; $position<$toMappingSize; $position++) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   404
      if($operand =~ /^\Q$toMapping[$position]\E/i){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   405
        $operand =~ s/^\Q$toMapping[$position]\E/$fromMapping[$position]/i;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   406
        last;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   407
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   408
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   409
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   410
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   411
  return $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   412
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   413
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   414
sub CheckFileNameForMappingClash {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   415
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   416
  my $fileName = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   417
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   418
  my @toMapping  = $self->ToMapping();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   419
  my $dirName;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   420
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   421
  if($fileName =~ /^(.*)\\/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   422
    $dirName = $1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   423
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   424
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   425
  if(@toMapping) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   426
    foreach my $toMap (@toMapping) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   427
      if($dirName =~ /^\Q$toMap\E/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   428
        die "ERROR: Clash in mappings. The local mapping $toMap clashes with the source directory $dirName.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   429
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   430
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   431
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   432
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   433
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   434
sub RemoteSite {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   435
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   436
  my $verbose = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   437
  unless (defined $self->{remoteSite}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   438
    my $module = 'RemoteSite::'.$self->RemoteSiteType();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   439
    eval "require $module";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   440
    $self->{remoteSite} = $module->New(host => $self->RemoteHost(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   441
               username => $self->RemoteUsername(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   442
               password => $self->RemotePassword(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   443
               passive_mode => $self->PasvTransferMode(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   444
               resume_mode => $self->FtpServerSupportsResume(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   445
               proxy => $self->Proxy(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   446
               proxy_username => $self->ProxyUsername(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   447
               proxy_password => $self->ProxyPassword(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   448
               max_export_volume_size => $self->MaxExportVolumeSize(),
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   449
               verbose => $verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   450
    die "Failed to create remote site object" unless ref $self->{remoteSite};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   451
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   452
  return $self->{remoteSite};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   453
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   454
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   455
sub LocalArchivePath {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   456
  require Carp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   457
  Carp->import;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   458
  confess ("Obsolete method called");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   459
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   460
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   461
sub RemoteArchivePath {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   462
  require Carp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   463
  Carp->import;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   464
  confess ("Obsolete method called");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   465
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   466
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   467
sub ArchivePathFile {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   468
  require Carp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   469
  Carp->import;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   470
  confess ("Obsolete method called");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   471
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   472
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   473
sub ListArchiveComponents {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   474
  require Carp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   475
  Carp->import;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   476
  confess ("Obsolete method called");
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   477
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   478
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   479
sub BinariesToIgnore {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   480
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   481
  if (exists $self->{binIgnore}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   482
    return $self->{binIgnore};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   483
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   484
  return [];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   485
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   486
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   487
sub DisallowUnclassifiedSource {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   488
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   489
  if (exists $self->{disallow_unclassified_source}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   490
    return 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   491
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   492
  return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   493
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   494
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   495
sub Win32ExtensionsDisabled {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   496
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   497
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   498
  if (exists $self->{disable_win32_extensions}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   499
    return 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   500
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   501
  return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   502
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   503
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   504
sub CategoriseBinaries {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   505
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   506
  if (exists $self->{categorise_binaries}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   507
    return 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   508
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   509
  return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   510
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   511
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   512
sub CategoriseExports {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   513
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   514
  if (exists $self->{categorise_exports}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   515
    return 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   516
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   517
  return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   518
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   519
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   520
sub RequiredBinaries {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   521
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   522
  my $component = lc(shift);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   523
  if (exists $self->{required_binaries}->{$component}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   524
    return $self->{required_binaries}->{$component};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   525
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   526
  elsif (exists $self->{required_binaries}->{default}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   527
    return $self->{required_binaries}->{default};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   528
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   529
  return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   530
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   531
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   532
sub TableFormatter {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   533
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   534
  require TableFormatter;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   535
  require POSIX;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   536
  # Not 'use' because not many commands draw tables so that would be a waste
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   537
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   538
  if (!POSIX::isatty('STDOUT')) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   539
    $self->{table_format} = "text";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   540
    $self->{table_format_args} = "";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   541
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   542
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   543
  unless (defined $self->{table_formatter}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   544
    my $format = $self->{table_format} || "text";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   545
    $self->{table_formatter} = TableFormatter::CreateFormatter($format, $self, $self->{table_format_args});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   546
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   547
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   548
  return $self->{table_formatter};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   549
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   550
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   551
sub LatestVerFilter {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   552
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   553
  unless (exists $self->{latestver_filter}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   554
    return undef;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   555
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   556
  return $self->{latestver_filter};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   557
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   558
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   559
sub IllegalWorkspaceVolumes {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   560
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   561
  if (defined $self->{illegal_workspace_volumes}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   562
    return @{$self->{illegal_workspace_volumes}};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   563
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   564
  return ();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   565
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   566
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   567
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   568
# Private
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   569
#
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   570
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   571
sub CheckMappingPath {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   572
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   573
  my $operand = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   574
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   575
  # Is used to clean up the mapping path.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   576
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   577
  $operand =~ s/\//\\/g;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   578
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   579
  die "Error: The source_map path $operand must not include a drive letter.\n" if ($operand =~ /^.:/);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   580
  die "Error: The source_map path $operand must be an absolute path without a drive letter.\n" if ($operand !~ /^\\/);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   581
  die "Error: The source_map path $operand must not be a UNC path.\n" if ($operand =~ /^\\\\/);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   582
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   583
  #Remove any \\ at the end of the path.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   584
  if($operand =~ /(.*)\\$/){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   585
    $operand = $1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   586
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   587
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   588
  return $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   589
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   590
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   591
sub BuildSystemVersion {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   592
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   593
  my $verbose = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   594
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   595
  if (exists $self->{sbs_version}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   596
  	print "User set the value of sbs_version to $self->{sbs_version}\n" if($verbose);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   597
    return $self->{sbs_version};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   598
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   599
  return "0";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   600
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   601
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   602
sub ExtractMapping {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   603
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   604
  my $operand = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   605
  my $epoc32dir = Utils::EpocRoot()."epoc32";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   606
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   607
  $operand =~ s/\s+$//;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   608
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   609
  if ($operand =~ /^(\S+)\s+(\S+)$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   610
    my $archivePath = $self->CheckMappingPath($1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   611
    my $localPath = $self->CheckMappingPath($2);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   612
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   613
    if($archivePath =~ /^\Q$epoc32dir\E/i){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   614
      die "ERROR: Archive path $epoc32dir... in source mapping is not allowed.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   615
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   616
    elsif($localPath =~ /^\Q$epoc32dir\E/i){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   617
      die "ERROR: Local path $epoc32dir... in source mapping is not allowed.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   618
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   619
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   620
    # Need to check whether the from location is already present in from_mapping array
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   621
    if(defined @{$self->{from_mapping}}){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   622
      foreach my $fromMap (@{$self->{from_mapping}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   623
        if(($archivePath =~ /^\W*\Q$fromMap\E\W*$/i) || ($fromMap =~ /^\W*\Q$archivePath\E\W*$/i)){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   624
          die "ERROR: Duplicate <archive_source_directory> $fromMap, <archive_source_directory> $archivePath found in source mappings.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   625
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   626
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   627
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   628
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   629
    # Need to check whether the to location is already present in to_mapping array
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   630
    if(defined @{$self->{to_mapping}}){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   631
      foreach my $toMap (@{$self->{to_mapping}}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   632
        if(($localPath =~ /^\W*\Q$toMap\E\W*$/i) || ($toMap =~ /^\W*\Q$localPath\E\W*$/i)){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   633
          die "ERROR: Duplicate <local_source_directory> $toMap, <local_source_directory> $localPath found in source mappings.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   634
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   635
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   636
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   637
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   638
    push @{$self->{from_mapping}}, $archivePath;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   639
    push @{$self->{to_mapping}}, $localPath;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   640
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   641
  else{
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   642
    die "ERROR: Incorrect usage of source_map keyword in reltools.ini. Expected input is source_map <archive_source_directory> <local_source_directory>\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   643
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   644
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   645
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   646
sub ReadIni {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   647
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   648
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   649
  open (INI, $self->{iniFileName}) or die "Unable to open \"$self->{iniFileName}\" for reading: $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   650
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   651
  while (local $_ = <INI>) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   652
    # Remove line feed, white space and comments.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   653
    chomp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   654
    s/^\s*$//;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   655
    
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   656
    # INC105677 - Warn user if remote_password contains an unescaped #
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   657
    if (/remote_password\s+\S*[^\\\s]\#/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   658
      warn "Warning: remote_password appears to contain a comment (# characters need to be escaped)\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   659
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   660
    
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   661
    s/(?<!\\)#.*//; # remove comments unless they are immediately preceded by \ (negative lookbehind assertion)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   662
    s/\\#/#/g; # now remove backslashes before # signs
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   663
    
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   664
    if ($_ eq '') {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   665
      # Nothing left.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   666
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   667
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   668
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   669
    my $keyWord;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   670
    my $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   671
    if (/^(\w+)\s+(.*)/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   672
      $keyWord = $1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   673
      $operand = $2;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   674
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   675
    else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   676
      # Must be a line with no operand.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   677
      $keyWord = $_;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   678
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   679
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   680
    unless (defined $keyWord) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   681
      die "Error: Invalid line in \"$self->{iniFileName}\":\n\t$_\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   682
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   683
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   684
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   685
    if ($keyWord =~ /^diff_tool$/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   686
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   687
      $self->{diff_tool} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   688
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   689
    elsif ($keyWord =~ /^require_internal_versions$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   690
      $self->{require_internal_versions} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   691
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   692
    elsif ($keyWord =~ /^ignore_source_filter_errors$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   693
      $self->{ignore_source_filter_errors} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   694
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   695
    elsif ($keyWord =~ /^html_notes$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   696
      $self->{html_notes} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   697
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   698
    elsif ($keyWord =~ /^temp_dir$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   699
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   700
      $operand = File::Spec->catdir($operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   701
      $operand =~ s/[\\\/]$//;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   702
      if (!-d $operand  && length $operand) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   703
        die "Error: Invalid line in \"$self->{iniFileName}\":\n\t$_\n$operand does not exist or is an invalid directory name\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   704
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   705
      $self->{temp_dir} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   706
    }   
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   707
    elsif ($keyWord =~ /^remote_site_type$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   708
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   709
      $self->{remote_site_type} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   710
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   711
    elsif ($keyWord =~ /^remote_host$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   712
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   713
      $self->{remote_host} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   714
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   715
    elsif ($keyWord =~ /^remote_username$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   716
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   717
      $self->{remote_username} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   718
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   719
    elsif ($keyWord =~ /^remote_password$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   720
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   721
      $self->{remote_password} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   722
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   723
    elsif ($keyWord =~ /^remote_logs_dir$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   724
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   725
      $self->{remote_logs} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   726
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   727
    elsif ($keyWord =~ /^pgp_tool$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   728
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   729
      $self->{pgp_tool} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   730
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   731
    elsif ($keyWord =~ /^pgp_encryption_key$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   732
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   733
      push @{$self->{pgp_encryption_keys}}, $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   734
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   735
    elsif ($keyWord =~ /^pgp_config_path$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   736
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   737
      $self->{pgp_config_path} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   738
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   739
    elsif ($keyWord =~ /^export_data_file$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   740
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   741
      $self->{export_data_file} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   742
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   743
    elsif ($keyWord =~ /^archive_path_file$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   744
      $self->PathData->ProcessLine(\$keyWord, \$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   745
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   746
    elsif ($keyWord =~ /^archive_path$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   747
      $self->PathData->ProcessLine(\$keyWord, \$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   748
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   749
    elsif ($keyWord =~ /^source_map$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   750
       $self->ExtractMapping($operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   751
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   752
    elsif ($keyWord =~ /^no_ini_location_warning$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   753
      $self->{warnIniLocation} = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   754
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   755
    elsif ($keyWord =~ /^ignore_binary$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   756
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   757
      push (@{$self->{binIgnore}}, $operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   758
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   759
    elsif ($keyWord =~ /^proxy$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   760
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   761
      $self->{proxy} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   762
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   763
    elsif ($keyWord =~ /^proxy_username$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   764
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   765
      $self->{proxy_username} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   766
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   767
    elsif ($keyWord =~ /^proxy_password$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   768
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   769
      $self->{proxy_password} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   770
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   771
    elsif ($keyWord =~ /^pasv_transfer_mode$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   772
      $self->{pasv_transfer_mode} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   773
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   774
    elsif ($keyWord =~ /^ftp_server_supports_resume$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   775
      $self->{ftp_server_supports_resume} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   776
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   777
    elsif ($keyWord =~ /^ftp_timeout$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   778
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   779
      $self->{ftp_timeout} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   780
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   781
    elsif ($keyWord =~ /^ftp_reconnect_attempts$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   782
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   783
      $self->{ftp_reconnect_attempts} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   784
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   785
    elsif ($keyWord =~ /^max_export_volume_size$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   786
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   787
      $self->{max_export_volume_size} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   788
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   789
    elsif ($keyWord =~ /^disallow_unclassified_source$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   790
      $self->{disallow_unclassified_source} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   791
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   792
    elsif ($keyWord =~ /^disable_win32_exten[ts]ions$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   793
      $self->{disable_win32_extensions} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   794
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   795
    elsif ($keyWord =~ /^categori[sz]e_binaries$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   796
      $self->{categorise_binaries} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   797
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   798
    elsif ($keyWord =~ /^categori[sz]e_exports$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   799
      $self->{categorise_exports} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   800
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   801
    elsif ($keyWord =~ /^latestver_filter$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   802
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   803
      require Text::Glob;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   804
      $self->{latestver_filter} = Text::Glob::glob_to_regex($operand);;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   805
    }    
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   806
    elsif ($keyWord =~ /^required_binaries$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   807
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   808
      (my $component, my $required, my $dummy) = split (/\s+/, $operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   809
      if ($dummy or not ($component and $required)) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   810
        die "Error: Invalid line in \"$self->{iniFileName}\":\n\t$_\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   811
        next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   812
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   813
      push (@{$self->{required_binaries}->{lc($component)}}, lc($required));
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   814
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   815
    #Support for target alias file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   816
    elsif ($keyWord =~ /^no_target_alias_warning$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   817
      $self->{mustWarnTargetAliasLocation} = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   818
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   819
    elsif ($keyWord =~ /^table_format$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   820
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   821
      (my $format, my $args) = $operand =~ m/^(\w+)(.*)$/;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   822
      Utils::StripWhiteSpace(\$args);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   823
      $self->{table_format} = $format;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   824
      $self->{table_format_args} = $args;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   825
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   826
    elsif ($keyWord =~ /^illegal_workspace_volumes$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   827
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   828
      if ($operand !~ /^[a-z\s,]+$/i) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   829
        die "Error: Invalid line in \"$self->{iniFileName}\":\n\t$_\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   830
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   831
      @{$self->{illegal_workspace_volumes}} = split /\s*,\s*/,$operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   832
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   833
    elsif ($keyWord =~ /^use_distribution_policy_files_first/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   834
      $self->{use_distribution_policy_files_first} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   835
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   836
    elsif ($keyWord =~ /^csv_separator$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   837
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   838
      $self->{csv_separator} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   839
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   840
    elsif ($keyWord =~ /^sbs_version$/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   841
      Utils::StripWhiteSpace(\$operand);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   842
      $self->{sbs_version} = $operand;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   843
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   844
    else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   845
      die "Error: Unknown keyword \"$keyWord\" in \"$self->{iniFileName}\"\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   846
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   847
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   848
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   849
  close (INI);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   850
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   851
  if ($self->{warnIniLocation}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   852
    if (defined $$envDir){
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   853
       print "Warning: \"$$iniName\" not found in \"$$envDir\", using version found in \"$$binDir\"\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   854
    } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   855
       print "Warning: Using \"$$iniName\" version found in \"$$binDir\"\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   856
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   857
    print "         Use the keyword \"no_ini_location_warning\" to disable this warning.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   858
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   859
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   860
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   861
sub ReadTargetAliasFile {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   862
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   863
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   864
  if (-e $self->{targetAliasName}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   865
    open (ALIAS, $self->{targetAliasName}) or die "Unable to open \"$self->{targetAliasName}\" for reading: $!\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   866
    # %allValuesSeenSoFar is a temporary hash of all the values seen so far
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   867
    my %allValuesSeenSoFar = ();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   868
    # %aliasMap is the final hash of keys to values with all aliases expanded out
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   869
    my %aliasMap = ();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   870
    $self->{alias_map} = {};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   871
    while (local $_ = <ALIAS>) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   872
      # Remove line feed, white space and comments.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   873
      chomp;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   874
      s/^\s*$//;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   875
      s/(?<!\\)#.*//; # remove comments unless they are immediately preceded by \ (negative lookbehind assertion)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   876
      s/\\#/#/g; # now remove backslashes before # signs
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   877
      if ($_ eq '') {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   878
        # Nothing left.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   879
        next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   880
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   881
      my $keyWord;        # The key field
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   882
      my @valueList;      # The list of values as read from the line.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   883
      my %seen = ();      # Temporary hash for making values on the line unique
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   884
      if (/^\s*(\S+)\s+(.+)/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   885
        # Uppercase significant
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   886
        $keyWord = uc($1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   887
        @valueList = split /\s+/, uc($2);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   888
        # Check the key for:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   889
        # A key that has been seen as already as a value i.e. a forward reference - fatal error
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   890
        # A key that has been seen as already as a key i.e. a duplicate key - fatal error
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   891
        if (exists $allValuesSeenSoFar{$keyWord}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   892
          die "Fatal error: Line \"$_\" in $self->{targetAliasName} has forward reference to \"$keyWord\"\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   893
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   894
        elsif (exists $self->{alias_map}->{$keyWord}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   895
          die "Fatal error: Line \"$_\" in $self->{targetAliasName} has duplicate key \"$keyWord\"\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   896
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   897
        # Check for:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   898
        # Circular references - fatal error
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   899
        # Duplicates in the value list - warn and ignore
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   900
        foreach my $value (@valueList) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   901
          if ($value eq $keyWord) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   902
            die "Fatal error: Line \"$_\" in $self->{targetAliasName} has circular reference in \"$keyWord\"\n"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   903
          }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   904
          elsif (exists $seen{$value}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   905
            print "Warning Line \"$_\" in $self->{targetAliasName} has duplicate value entry \"$value\" in key $keyWord\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   906
          }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   907
          else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   908
            # Add to seen map and uniqueList
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   909
            $seen{$value} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   910
            $allValuesSeenSoFar{$value} = 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   911
          }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   912
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   913
        my @resolvedList = ();  # Resolved aliases
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   914
        # Check for the special use of the value '<EMPTY>'
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   915
        # If this is present then there must be no other values.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   916
        if (exists $seen{"<EMPTY>"}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   917
          if (scalar (keys %seen) > 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   918
            die "Fatal error: Multiple targets in list declared \"<EMPTY>\" for alias \"$keyWord\"\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   919
          }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   920
        } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   921
          # Now can expand the unique list by resolving aliases against existing keys
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   922
          foreach my $uniqueLine (keys %seen) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   923
            if (exists $self->{alias_map}->{$uniqueLine}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   924
              # Expand the list to resolve the aliases
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   925
              push(@resolvedList, @{$self->{alias_map}->{$uniqueLine}});
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   926
            }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   927
            else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   928
              # No alias resolution required, just add it
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   929
              push(@resolvedList, $uniqueLine);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   930
            }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   931
          }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   932
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   933
        # Add the resolved list to the aliasMap
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   934
        push( @{$self->{alias_map}->{$keyWord}}, @resolvedList);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   935
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   936
      else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   937
        # A line with no value is illegal.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   938
        # Grab the key word
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   939
        if (/^\s*(\S+)/) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   940
          # Make uppercase as HasTargetPlatforms(), TargetPlatforms()
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   941
          # expects uppercase keys
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   942
          $keyWord = uc($1);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   943
        } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   944
          die "Fatal error: Fatal parser error.\n"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   945
        }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   946
        die "Fatal error: No targets detected for \"$keyWord\"\n"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   947
      }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   948
    unless (defined $keyWord) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   949
      die "Error: Invalid line in \"$self->{targetAliasName}\":\n\t$_\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   950
      next;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   951
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   952
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   953
  close (ALIAS);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   954
  } else {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   955
    # Failed to find target alias file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   956
    return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   957
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   958
  return 1; # Success at reading the file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   959
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   960
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   961
# Support for target alias file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   962
# Returns 1 if target platforms exist for a given alias
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   963
# or 0 if no target platforms exist for a given alias
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   964
sub HasTargetPlatforms {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   965
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   966
  my $alias = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   967
  $alias = uc($alias);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   968
  $self->CheckAliasWarning();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   969
  if (exists $self->{alias_map}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   970
    if (exists $self->{alias_map}->{$alias}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   971
      return 1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   972
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   973
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   974
  return 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   975
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   976
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   977
# Support for target alias file
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   978
# Returns the arrary of target platforms for a given alias
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   979
# or undef if no target platforms for a given alias
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   980
sub TargetPlatforms {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   981
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   982
  my $alias = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   983
  $self->CheckAliasWarning();
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   984
  $alias = uc($alias);
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   985
  if (exists $self->{alias_map}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   986
    if (exists $self->{alias_map}->{$alias}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   987
      return $self->{alias_map}->{$alias};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   988
    }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   989
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   990
  # Nothing found so return the callers argument
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   991
  return [$alias];
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   992
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   993
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   994
sub CheckAliasWarning {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   995
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   996
  if ($self->{mustWarnTargetAliasLocation} == 1) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   997
    print "Warning: \"$self->{targetAliasName}\" not found.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   998
    print "         Use the keyword \"no_target_alias_warning\" to disable this warning.\n";
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
   999
   }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1000
  $self->{mustWarnTargetAliasLocation} = 0;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1001
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1002
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1003
sub UseDistributionPolicyFilesFirst {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1004
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1005
  return !!$self->{use_distribution_policy_files_first};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1006
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1007
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1008
sub CsvSeparator {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1009
  my $self = shift;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1010
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1011
  if (defined $self->{csv_separator}) {
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1012
    return $self->{csv_separator};
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1013
  }
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1014
  
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1015
  return ',';
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1016
}
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1017
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1018
1;
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1019
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1020
__END__
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1021
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1022
=head1 NAME
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1023
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1024
IniData.pm - Provides an interface to the data contained in reltools.ini.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1025
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1026
=head1 INTERFACE
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1027
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1028
=head2 New
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1029
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1030
Expects to find a file named F<reltools.ini> in the release tools directory, dies if it can't. Parses this file according to the following keywords / value pairs:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1031
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1032
 require_internal_versions
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1033
 ignore_source_filter_errors
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1034
 no_ini_location_warning
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1035
 disallow_unclassified_source
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1036
 categorise_binaries
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1037
 categorise_exports
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1038
 html_notes
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1039
 archive_path                <archive_name> <archive_path> [<remote_archive_path>]
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1040
 diff_tool                   <tool_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1041
 export_data_file            <file_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1042
 archive_path_file           <file_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1043
 source_map                  <archive_source_directory> <local_source_directory>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1044
 remote_site_type            <server_type>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1045
 remote_host                 <host_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1046
 remote_username             <user_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1047
 remote_password             <pass_word>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1048
 remote_logs_dir             <path>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1049
 pasv_transfer_mode
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1050
 ftp_server_supports_resume
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1051
 ftp_timeout                 <time_in_seconds>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1052
 ftp_reconnect_attempts      <positive_integer>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1053
 proxy                       <host_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1054
 proxy_username              <user_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1055
 proxy_password              <pass_word>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1056
 pgp_tool                    <tool_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1057
 pgp_encryption_key          <keyid>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1058
 pgp_config_path             <dir_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1059
 ignore_binary               <wild_file_name>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1060
 required_binaries           default wins_udeb
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1061
 required_binaries           default thumb_urel
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1062
 table_format                <table_format module>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1063
 csv_separator               <csv_separator_character>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1064
 sbs_version                 <symbian_build_system>
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1065
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1066
It assumes # indicates the start of a comment, unless it is preceded by \.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1067
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1068
=head2 DiffTool
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1069
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1070
Returns the name of the differencing tool specified with the C<diff_tool> keyword.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1071
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1072
=head2 RequireInternalVersions
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1073
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1074
Returns true or false depending on whether the C<require_internal_versions> keyword has been specified.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1075
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1076
=head2 IgnoreSourceFilterErrors
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1077
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1078
Returns true or false depending on whether the C<ignore_source_filter_errors> keyword has been specified.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1079
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1080
=head2 RemoteSiteType
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1081
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1082
Returns the type of server hosting the projects remote release archive. Currently this will return either C<'FTP'>, C<'FTP::Proxy'>, C<'NetDrive'>, C<'NetDrive::MultiVolumeExport'> or C<'NetDrive::MultiVolumeImport'>. The default return value is C<'FTP'> if not set.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1083
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1084
=head2 RemoteHost
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1085
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1086
Returns the host address of the project's remote site. If the remote site is an ftp server this will be an ftp address; if it is a network drive then the return value will be a UNC path.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1087
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1088
=head2 RemoteUsername
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1089
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1090
Returns the username for the project's remote site.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1091
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1092
=head2 RemotePassword
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1093
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1094
Returns the password for the project's remote site.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1095
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1096
=head2 RemoteLogsDir
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1097
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1098
Returns the directory on the project's remote site where release notification logs are to be written.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1099
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1100
=head2 PasvTransferMode
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1101
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1102
Returns true or false depending on whether the C<pasv_transfer_mode> keyword has been specified.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1103
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1104
=head2 FtpServerSupportsResume
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1105
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1106
Returns true or false depending on whether the C<ftp_server_supports_resume> keyword has been specified.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1107
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1108
=head2 FtpTimeout
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1109
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1110
Returns the timeout in seconds allowed before dropping the connection to the FTP server
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1111
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1112
=head2 FtpReconnectAttempts
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1113
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1114
Returns the number of attempts to reconnect to the FTP site if the connection is dropped
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1115
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1116
=head2 Proxy
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1117
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1118
Returns the FTP address of a proxy server used to connect to the project's FTP site.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1119
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1120
=head2 ProxyUsername
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1121
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1122
Returns the username for a proxy server used to connect to the project's FTP site.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1123
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1124
=head2 ProxyPassword
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1125
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1126
Returns the password for a proxy server used to connect to the project's FTP site.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1127
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1128
=head2 RemoteSite
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1129
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1130
Tries to create a RemoteSite object appropriate to the data in the iniData, and return it. Caches the RemoteSite object so that it is only created once.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1131
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1132
=head2 MaxExportVolumeSize
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1133
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1134
Returns the value specified by the keyword C<max_export_volume_size>. If this has not been specified, returns 639 * 1024 * 1024.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1135
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1136
=head2 PgpTool
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1137
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1138
Returns the command line PGP client used to encrypt and decrypt releases.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1139
Currently this will return either C<'PGP'> for NAI Inc. PGP or C<'GPG'> for GNU Privacy Guard. The default return value is C<'PGP'> if not set.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1140
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1141
=head2 PgpEncryptionKeys
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1142
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1143
Returns a reference to an array of PGP key ids (an 8 digit hexadecimal number) used to encrypt all release files before exporting to the remote site. Typically these values will correspond to the local sites project PGP keys so that the user may decrypt their own releases.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1144
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1145
=head2 PgpConfigPath
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1146
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1147
Returns the directory where the users PGP configuration and keyring files are stored.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1148
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1149
=head2 ArchivePathFile
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1150
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1151
Returns the name of the archive path file.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1152
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1153
=head2 ExportDataFile
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1154
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1155
Returns the name of the export data file.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1156
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1157
=head2 LocalArchivePath
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1158
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1159
Expects to be passed a component name. Returns the path to the component's local archive (generally on a LAN share).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1160
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1161
=head2 RemoteArchivePath
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1162
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1163
Expects to be passed a component name. Returns the path to the component's remote archive (may be either on a Network share or an FTP site).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1164
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1165
=head2 ListArchiveComponents
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1166
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1167
Returns a list of component names specified in the archive path file. One of these may be 'default' (if this has been specified). The directories pointed to by this may contain multiple components.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1168
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1169
=head2 BinariesToIgnore
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1170
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1171
Returns a reference to a list of binaries to be ignored when scanning the F<\epoc32> tree. These may contain the C<*> wild character.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1172
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1173
=head2 DisallowUnclassifiedSource
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1174
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1175
Returns false unless the C<disallow_unclassified_source> keyword has been specified.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1176
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1177
=head2 Win32ExtensionsDisabled
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1178
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1179
Returns false unless the C<disable_win32_extensions> keyword has been specified. (Spelling C<disable_win32_extentions> also OK!)
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1180
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1181
=head2 CategoriseBinaries
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1182
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1183
Returns false unless the C<categorise_binaries> keyword has been specified.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1184
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1185
=head2 CategoriseExports
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1186
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1187
Returns false unless the C<categorise_exports> keyword has been specified.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1188
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1189
=head2 TableFormatter
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1190
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1191
Returns a TableFormatter object, which can be used to print a table.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1192
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1193
=head2 RequiredBinaries
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1194
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1195
Expects to be passed a component name. Returns the required binaries for that component if any were specified using the C<required_binaries> keyword. If none were, then those specified using C<required_binaries default> are returned. If there are none of those either, then C<undef> is returned - this means that all binaries should be used.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1196
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1197
=head2 PathData
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1198
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1199
Returns a PathData object appropriate to the path configuration data in the ini file. This may be a PathData::ProjectBased or a PathData::ComponentBased object.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1200
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1201
=head2 FromMapping
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1202
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1203
Returns an array of <archive_source_directory> mappings. If there are no mappings defined an undefined value is returned.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1204
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1205
=head2 ToMapping
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1206
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1207
Returns an array of <local_source_directory> mappings. If there are no mappings defined an undefined value is returned.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1208
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1209
=head2 HasMappings
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1210
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1211
Returns false if no mappings are defined. Otherwise returns true.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1212
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1213
=head2 PerformMapOnFileName
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1214
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1215
Reads a filename and takes all mappings defined into consideration with <archive_source_directory> being mapped to <local_source_directory>. Returns the new filename, with the mappings processed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1216
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1217
=head2 PerformReverseMapOnFileName
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1218
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1219
Reads a filename and takes all mappings defined into consideration with <local_source_directory> being mapped to <archive_source_directory>. Returns the new filename, with the mappings processed.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1220
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1221
=head2 CheckMappingPath
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1222
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1223
Expects a mapping path which is checked. Any problems with the path are reported and the program exits. Otherwise returns the checked mapping path.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1224
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1225
=head2 ExtractMapping
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1226
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1227
Is used to extract and store the local and archive mappings directories as defined. If an usage error is encountered, an error message is displayed and the program exits.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1228
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1229
=head2 CheckFileNameForMappingClash
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1230
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1231
Is used to check if any of the mappings defined clash with the filename passed. If there is a clash an error message is shown and the program exits.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1232
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1233
=head2 HasTargetPlatforms
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1234
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1235
Returns true if there is are any target platforms for a given alias. False otherwise.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1236
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1237
=head2 TargetPlatforms
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1238
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1239
Returns a reference to a list containing either the platforms for a given alias or the alias itself (i.e. not an alias but a platform name).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1240
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1241
=head2 CsvSeparator
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1242
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1243
Returns the separator to be used for CSV files, which by default is a comma ','.  Depending on the locale, the separator may be different.  The user can specify the separator required by using the C<csv_separator> keyword.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1244
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1245
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1246
=head1 KNOWN BUGS
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1247
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1248
None.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1249
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1250
=head1 COPYRIGHT
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1251
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1252
 Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1253
 All rights reserved.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1254
 This component and the accompanying materials are made available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1255
 under the terms of the License "Eclipse Public License v1.0"
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1256
 which accompanies this distribution, and is available
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1257
 at the URL "http://www.eclipse.org/legal/epl-v10.html".
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1258
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1259
 Initial Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1260
 Nokia Corporation - initial contribution.
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1261
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1262
 Contributors:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1263
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1264
 Description:
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1265
 
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1266
3145852acc89 add releasing to new structure
jjkang
parents:
diff changeset
  1267
=cut