Subversion Repositories DevTools

Rev

Rev 6932 | Rev 6943 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6932 Rev 6933
Line 270... Line 270...
270
    push @ManifestFiles::Manifests, \%data;
270
    push @ManifestFiles::Manifests, \%data;
271
}
271
}
272
 
272
 
273
#==================================================================================================
273
#==================================================================================================
274
#   End of externally exposed methods
274
#   End of externally exposed methods
275
#   The remainder is package-internal
275
#       The remainder is package-internal
276
#
276
#
277
package ManifestFiles;
277
package ManifestFiles;
278
 
278
 
279
use strict;
279
use strict;
280
use warnings;
280
use warnings;
Line 300... Line 300...
300
   
300
   
301
our %package_dirs;                  # Package dirs discovered and used
301
our %package_dirs;                  # Package dirs discovered and used
302
our $ManifestFiles;                 # Files in the Manifest
302
our $ManifestFiles;                 # Files in the Manifest
303
our $noWarn = 0;                    # Control unused package warnings
303
our $noWarn = 0;                    # Control unused package warnings
304
our $pkgBase;                       # Where the package is being sourced from
304
our $pkgBase;                       # Where the package is being sourced from
305
our $noSigs = 0;                    # Control signature generation
305
our $noSigs = 1;                    # Control signature generation (Force noSigs. could use use undef)
306
 
306
 
307
#
307
#
308
#   Internal
308
#   Internal
309
#
309
#
310
my $certName;                       # Signing Cert Name
310
my $certName;                       # Signing Cert Name
Line 1145... Line 1145...
1145
#
1145
#
1146
# Returns         : 
1146
# Returns         : 
1147
#
1147
#
1148
sub GenSigInit
1148
sub GenSigInit
1149
{
1149
{
1150
    Debug("GenSigInit: $noSigs");
1150
    Debug("GenSigInit:", $noSigs);
1151
    return if $noSigs;
1151
    return if $noSigs;
1152
 
1152
 
1153
    my @warnings;
1153
    my @warnings;
1154
 
1154
 
1155
    #
1155
    #
-
 
1156
    #   Locate and setup openssl
-
 
1157
    #   Should be provided by a package
-
 
1158
    #   set OPENSSL_CONF=...../openssl.cfg 
-
 
1159
    #   
-
 
1160
    $opensslProg = ::ToolExtensionProgram( 'openssl', '', '.exe');
-
 
1161
 
-
 
1162
    #   Generate  a dummy openssl.cnf - to keep the uitility happy (quiet)
-
 
1163
    $opensslConf = FullPath(CatPaths( $::ScmRoot, $::ScmInterface, 'openssl.cfg'));
-
 
1164
    TouchFile($opensslConf);
-
 
1165
    ::ToolsetGenerate($opensslConf);
-
 
1166
    $ENV{OPENSSL_CONF}= $opensslConf;
-
 
1167
 
-
 
1168
    #
-
 
1169
    #   Figure out default operation if openssl cannot be found
-
 
1170
    #       If --signature - then report error
-
 
1171
    #       If not specified, then default is -NoSig
-
 
1172
    #
-
 
1173
    unless ($opensslProg) {
-
 
1174
        if (defined $noSigs) {
-
 
1175
            ReportError ("The openssl utility is not available. Must be provided by a package") unless $opensslProg;  
-
 
1176
        } else {
-
 
1177
            Verbose("openssl not found in a package. Default to no signature");
-
 
1178
            $noSigs = 1;
-
 
1179
            return;
-
 
1180
        }
-
 
1181
    }
-
 
1182
 
-
 
1183
    #
1156
    #   Signatures 'should' be generated for a target paltform of 'MANSIG'
1184
    #   Signatures 'should' be generated for a target paltform of 'MANSIG'
1157
    #       In the automated build system this will be a controlled machine
1185
    #       In the automated build system this will be a controlled machine
1158
    #   Warn if attemting to create signatures for a different target    
1186
    #   Warn if attemting to create signatures for a different target    
1159
    #
1187
    #
1160
    push @warnings, "# Package build for platform other than MANSIG - will generate test signatures" if ($::ScmPlatform ne 'MANSIG');
1188
    push @warnings, "# Package build for platform other than MANSIG - will generate test signatures" if ($::ScmPlatform ne 'MANSIG');
Line 1187... Line 1215...
1187
    push @warnings, "#  Using uncontrolled test key to sign the manifest" if ($localKey);
1215
    push @warnings, "#  Using uncontrolled test key to sign the manifest" if ($localKey);
1188
    Warning("#############################################################", "#",
1216
    Warning("#############################################################", "#",
1189
             @warnings,
1217
             @warnings,
1190
            "#", "#############################################################") if (@warnings);
1218
            "#", "#############################################################") if (@warnings);
1191
 
1219
 
1192
    #
-
 
1193
    #   Locate and setup openssl
-
 
1194
    #   Should be provided by a package
-
 
1195
    #   set OPENSSL_CONF=...../openssl.cfg 
-
 
1196
    #   
-
 
1197
    $opensslProg = ::ToolExtensionProgram( 'openssl', '', '.exe');
-
 
1198
    ReportError ("The openssl utility is not available. Must be provided by a package") unless $opensslProg;  
-
 
1199
 
-
 
1200
    #   Generate  a dummy openssl.cnf - to keep the uitility happy (quiet)
-
 
1201
    $opensslConf = FullPath(CatPaths( $::ScmRoot, $::ScmInterface, 'openssl.cfg'));
-
 
1202
    TouchFile($opensslConf);
-
 
1203
    ::ToolsetGenerate($opensslConf);
-
 
1204
    $ENV{OPENSSL_CONF}= $opensslConf;
-
 
1205
 
-
 
1206
    ErrorDoExit();
1220
    ErrorDoExit();
1207
    Message("OpenSsl Prog: $opensslProg");
1221
    Message("OpenSsl Prog: $opensslProg");
1208
    Message("OpenSsl Conf: $opensslConf");
1222
    Message("OpenSsl Conf: $opensslConf");
1209
    Message("Signing with: $keyFile");
1223
    Message("Signing with: $keyFile");
1210
 
1224
 
Line 1219... Line 1233...
1219
#
1233
#
1220
# Returns         : Nothing 
1234
# Returns         : Nothing 
1221
#
1235
#
1222
sub GenSignatures
1236
sub GenSignatures
1223
{
1237
{
1224
    Debug("GenSignatures: $noSigs");
1238
    Debug("GenSignatures:", $noSigs);
1225
    return if $noSigs;
1239
    return if $noSigs;
1226
 
1240
 
1227
    foreach my $entry ( @{$ManifestFiles}) {
1241
    foreach my $entry ( @{$ManifestFiles}) {
1228
        Verbose("PostProcess: $entry->{srcFile}, $entry->{pkgPath}");
1242
        Verbose("PostProcess: $entry->{srcFile}, $entry->{pkgPath}");
1229
 
1243