Subversion Repositories DevTools

Rev

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

Rev 7319 Rev 7320
Line 80... Line 80...
80
our $BUILDNAME_PACKAGE;                         # Name
80
our $BUILDNAME_PACKAGE;                         # Name
81
our $BUILDNAME_VERSION;                         # Version
81
our $BUILDNAME_VERSION;                         # Version
82
our $BUILDNAME_PROJECT;                         # Project(optional)
82
our $BUILDNAME_PROJECT;                         # Project(optional)
83
our $BUILDNAME_SUFFIX;                          # Project (available)
83
our $BUILDNAME_SUFFIX;                          # Project (available)
84
our $DEPLOY_PATCH           = 0;                # Deplyment patch number
84
our $DEPLOY_PATCH           = 0;                # Deplyment patch number
85
our $BUILDSIGNATURE;                            # Source signature
85
our $BUILDSIGNATURE;                            # Source signature - generated
-
 
86
my  $CheckSignature;                            # Check signature
86
 
87
 
87
our %BUILDALIAS_DELAY       = ();               # Delayed aliases
88
our %BUILDALIAS_DELAY       = ();               # Delayed aliases
88
our %BUILDALIAS_TARGETS     = ();               # BuildAlias from --Targets
89
our %BUILDALIAS_TARGETS     = ();               # BuildAlias from --Targets
89
our %BUILDALIAS             = ();               # BuildAlias
90
our %BUILDALIAS             = ();               # BuildAlias
90
our %BUILDPRODUCT           = ();               # BuildProduct
91
our %BUILDPRODUCT           = ();               # BuildProduct
Line 94... Line 95...
94
our $BUILDPHASE             = 0;                # In Build Phase
95
our $BUILDPHASE             = 0;                # In Build Phase
95
our @CLOBBERDIRS            = ();               # Directories to clobber
96
our @CLOBBERDIRS            = ();               # Directories to clobber
96
our @REMOVEDIRS             = ();               # Directories to remove - if empty
97
our @REMOVEDIRS             = ();               # Directories to remove - if empty
97
our %BUILD_KNOWNFILES       = ();               # Files that will be known
98
our %BUILD_KNOWNFILES       = ();               # Files that will be known
98
our @BUILDEXCLUDE           = ();               # Platforms to be excluded
99
our @BUILDEXCLUDE           = ();               # Platforms to be excluded
-
 
100
our @BUILDARGUMENTS         = ();               # Build Atguments
99
 
101
 
100
our $Makelib                = "";
102
our $Makelib                = "";
101
our $GBE_CORE;                                  # Root of JATS
103
our $GBE_CORE;                                  # Root of JATS
102
our $InterfaceVersion;                          # Interface directory format version
104
our $InterfaceVersion;                          # Interface directory format version
103
our $ScmRoot;                                   # Package Root
105
our $ScmRoot;                                   # Package Root
Line 158... Line 160...
158
    Require( "$::GBE_CONFIG/PLATFORM", "PLATFORM_CFG.PM"  );
160
    Require( "$::GBE_CONFIG/PLATFORM", "PLATFORM_CFG.PM"  );
159
 
161
 
160
#.. Parse command line
162
#.. Parse command line
161
#
163
#
162
    $ScmBuildSrc = $0;                          # Name of the build file
164
    $ScmBuildSrc = $0;                          # Name of the build file
163
    $Cwd = shift @ARGV;
-
 
164
    $Cwd =~ tr~\\/~/~s;;                        # Need / in path, Remove doubles
165
    shift @ARGV;                                # No longer used
165
    $::ScmRoot = StripDrive($Cwd);
166
    $::ScmRoot = $CwdFull;                      # $CwdFull does not have a driver letter. $CwdFull does
166
    $Makelib = shift @ARGV;                     # Only for legacy build.pl files
167
    $Makelib = shift @ARGV;                     # Only for legacy build.pl files
167
 
168
 
168
    Verbose ("Command Line: @ARGV");
169
    Verbose ("Command Line: @ARGV");
169
    my $result = GetOptions( "help|h:+"      => \$opt_help,
170
    my $result = GetOptions( "help|h:+"      => \$opt_help,
170
                             "man:3"         => \$opt_help,
171
                             "man:3"         => \$opt_help,
Line 176... Line 177...
176
                             "package"       => \$NoPackageError,
177
                             "package"       => \$NoPackageError,
177
                             "nopackages"    => \$IgnorePkgs,
178
                             "nopackages"    => \$IgnorePkgs,
178
                             "forcebuildpkg" => \$ForceBuildPkg,
179
                             "forcebuildpkg" => \$ForceBuildPkg,
179
                             "force!"        => \$ForceBuild,
180
                             "force!"        => \$ForceBuild,
180
                             "generic!"      => \$GenericBuild,
181
                             "generic!"      => \$GenericBuild,
-
 
182
                             "signature:s"   => \$CheckSignature,
181
                             );
183
                             );
182
    Usage() if ( $opt_help || !$result );
184
    Usage() if ( $opt_help || !$result );
183
 
185
 
184
    Debug( "Host:          ", $ScmHost );
186
    Debug( "Host:          ", $ScmHost );
185
    Debug( "Cwd:           ", $Cwd );
187
    Debug( "Cwd:           ", $CwdFull );
-
 
188
    Debug( "ScmRoot:       ", $::ScmRoot );
186
    Debug( "Makelib:       ", $Makelib );
189
    Debug( "Makelib:       ", $Makelib );
187
    Debug( "BuildFile:     ", $ScmBuildSrc );
190
    Debug( "BuildFile:     ", $ScmBuildSrc );
188
    Debug( "Debug:         ", $::ScmDebug );
191
    Debug( "Debug:         ", $::ScmDebug );
189
    Debug( "Verbose:       ", $::ScmVerbose );
192
    Debug( "Verbose:       ", $::ScmVerbose );
190
    Debug( "Expert:        ", $Expert );
193
    Debug( "Expert:        ", $Expert );
Line 505... Line 508...
505
                    {
508
                    {
506
                        push @pargs, '--NotDefault' if ( $notdefault );
509
                        push @pargs, '--NotDefault' if ( $notdefault );
507
                        push @pargs, '--FunctionName=BuildAlias';
510
                        push @pargs, '--FunctionName=BuildAlias';
508
                        BuildPlatforms( $platform, @pargs );
511
                        BuildPlatforms( $platform, @pargs );
509
                    }
512
                    }
-
 
513
                    else
-
 
514
                    {
-
 
515
                        my @badArgs = grep (/^--/, @pargs) ;
-
 
516
                        if (@badArgs) {
-
 
517
                            Warning("Platform arguments in define mode are ignored:($platform)", @badArgs);
-
 
518
                        }
-
 
519
                        
-
 
520
                    }
510
                }
521
                }
511
 
522
 
512
                #
523
                #
513
                #   Start collecting args for the next platform
524
                #   Start collecting args for the next platform
514
                #
525
                #
Line 646... Line 657...
646
        #   If there are NO additive expressions in the alias, then
657
        #   If there are NO additive expressions in the alias, then
647
        #   assume all the active targets
658
        #   assume all the active targets
648
        #
659
        #
649
        unless (keys %add) {
660
        unless (keys %add) {
650
            %add = map { $_ => 1 } @BUILD_ACTIVEPLATFORMS;
661
            %add = map { $_ => 1 } @BUILD_ACTIVEPLATFORMS;
651
Debug0("Adding: @BUILD_ACTIVEPLATFORMS");
-
 
652
        }
662
        }
653
 
663
 
654
        foreach ( keys %remove) {
664
        foreach ( keys %remove) {
655
            delete $add { $_};
665
            delete $add { $_};
656
        }
666
        }
Line 1196... Line 1206...
1196
 
1206
 
1197
 
1207
 
1198
sub BuildArgument
1208
sub BuildArgument
1199
{
1209
{
1200
    my( $platform, @arguments ) = @_;
1210
    my( $platform, @arguments ) = @_;
1201
    my( @platforms );
-
 
1202
 
1211
 
1203
    Debug( "BuildArgument($platform, @arguments)" );
1212
    Debug( "BuildArgument($platform, @arguments)" );
1204
 
-
 
1205
    Error( "BuildArgument must appear before BuildName()..." )
1213
    Error( "BuildArgument must appear before BuildName()..." ) if ( $BUILDNAME ne "" );
1206
        if ( $BUILDNAME ne "" );
-
 
1207
 
1214
 
1208
    #
1215
    #
1209
    #   Allow a wildcard to apply a single argument to all platforms
1216
    #   Just save the arguments for later processing
1210
    #   Should only be used AFTER all the platforms have been specified
-
 
1211
    #
1217
    #
1212
    if ( $platform eq '*' )
1218
    push @BUILDARGUMENTS, \@_;
1213
    {
-
 
1214
        @platforms = @BUILDPLATFORMS;          # Simple Wildcard
-
 
1215
    }
-
 
1216
    else
-
 
1217
    {
-
 
1218
        @platforms = ExpandPlatforms( $platform );  # aliasing
-
 
1219
    }
1219
}
1220
 
1220
 
-
 
1221
#-------------------------------------------------------------------------------
-
 
1222
# Function        : ProcessBuildArgument  
-
 
1223
#
-
 
1224
# Description     : Process BuildArgument operations
-
 
1225
#                   This needs to be done AFTER aliases have been created (cleaned up )
-
 
1226
#
-
 
1227
# Inputs          : Global data: @BUILDARGUMENTS 
-
 
1228
#
-
 
1229
# Returns         : 
-
 
1230
#
-
 
1231
sub ProcessBuildArgument 
-
 
1232
{
1221
    foreach my $platform ( @platforms )
1233
    foreach my $set ( @BUILDARGUMENTS )
1222
    {
1234
    {
-
 
1235
        my ($platform, @arguments ) = @{$set};
-
 
1236
        my @platforms;
-
 
1237
        #
-
 
1238
        #   Allow a wildcard to apply a single argument to all platforms
-
 
1239
        #   Should only be used AFTER all the platforms have been specified
-
 
1240
        #
-
 
1241
        if ( $platform eq '*' )
-
 
1242
        {
1223
        next if ( $platform =~ /^--/ );         # argument, ignore
1243
            @platforms = @BUILDPLATFORMS;          # Simple Wildcard
-
 
1244
        }
-
 
1245
        else
-
 
1246
        {
-
 
1247
            @platforms = ExpandPlatforms( $platform );  # aliasing
-
 
1248
        }
1224
 
1249
 
-
 
1250
        foreach my $platform ( @platforms )
-
 
1251
        {
-
 
1252
            next if ( $platform =~ /^--/ );         # argument, ignore
1225
        PlatformArgument( $platform, @arguments );
1253
            PlatformArgument( $platform, @arguments );
-
 
1254
        }
1226
    }
1255
    }
1227
}
1256
}
1228
 
1257
 
1229
 
1258
 
1230
sub BuildPlatforms
1259
sub BuildPlatforms
Line 1240... Line 1269...
1240
    #
1269
    #
1241
    #   Expand the user specified platforms to allow the use of BuildAlias
1270
    #   Expand the user specified platforms to allow the use of BuildAlias
1242
    #   The (bad) side effect of this is that platform options get reorganised
1271
    #   The (bad) side effect of this is that platform options get reorganised
1243
    #       PLATFORM,--Uses=ANOTHER  ==> PLATFORM --Uses=ANOTHER
1272
    #       PLATFORM,--Uses=ANOTHER  ==> PLATFORM --Uses=ANOTHER
1244
    #
1273
    #
1245
    #   Insert markers(++) into @aruments to mark when to process collected data
1274
    #   Insert markers(++) into @arguments to mark when to process collected data
1246
    #   Insert before each PLATFORM and at the end of the list
1275
    #   Insert before each PLATFORM and at the end of the list
1247
    #   platform specifier or the end of the list. Scan the arguments
1276
    #   platform specifier or the end of the list. Scan the arguments
1248
    #
1277
    #
1249
    @arguments = ExpandPlatforms( @arguments );
1278
    @arguments = ExpandPlatforms( @arguments );
1250
    my @new_args;
1279
    my @new_args;
Line 1508... Line 1537...
1508
    Log( "DeployPatch. $DEPLOY_PATCH" ) if ($DEPLOY_PATCH);
1537
    Log( "DeployPatch. $DEPLOY_PATCH" ) if ($DEPLOY_PATCH);
1509
    Log( "Project .... $BUILDNAME_PROJECT" )if ($BUILDNAME_PROJECT);
1538
    Log( "Project .... $BUILDNAME_PROJECT" )if ($BUILDNAME_PROJECT);
1510
    Log( "Project .... ****** Specifically supressed ******" )unless ($BUILDNAME_PROJECT);
1539
    Log( "Project .... ****** Specifically supressed ******" )unless ($BUILDNAME_PROJECT);
1511
    Log( "DateTime ... $::CurrentTime" );
1540
    Log( "DateTime ... $::CurrentTime" );
1512
    Log( "AutoBuild... Enabled:$::GBE_ABT" ) if defined($::GBE_ABT) ;
1541
    Log( "AutoBuild... Enabled:$::GBE_ABT" ) if defined($::GBE_ABT) ;
1513
    Log( "Build dir... $Cwd" ) if defined($::GBE_ABT) || $::GBE_DPKG_SBOX;
1542
    Log( "Build dir... $CwdFull" ) if defined($::GBE_ABT) || $::GBE_DPKG_SBOX;
1514
    Log( "Build Mach.. $::GBE_HOSTNAME" ) if defined($::GBE_ABT);
1543
    Log( "Build Mach.. $::GBE_HOSTNAME" ) if defined($::GBE_ABT);
-
 
1544
    Log( "Build Cmd .. $CmdSwitch") if $CmdSwitch;
1515
 
1545
 
1516
    Log( "PERL ....... $::GBE_PERL" );
1546
    Log( "PERL ....... $::GBE_PERL" );
1517
    Log( "BIN  ....... $::GBE_BIN" );
1547
    Log( "BIN  ....... $::GBE_BIN" );
1518
    Log( "TOOLS ...... $::GBE_TOOLS" );
1548
    Log( "TOOLS ...... $::GBE_TOOLS" );
1519
    Log( "CONFIG ..... $::GBE_CONFIG" );
1549
    Log( "CONFIG ..... $::GBE_CONFIG" );
Line 1583... Line 1613...
1583
            #   Flag for jmake to do very little
1613
            #   Flag for jmake to do very little
1584
            #
1614
            #
1585
            CreateBuildPlatformEntry('Internal', 0, undef, 'NOBUILD');
1615
            CreateBuildPlatformEntry('Internal', 0, undef, 'NOBUILD');
1586
            $IgnorePkgs = 1;
1616
            $IgnorePkgs = 1;
1587
            $NoBuild = 1;
1617
            $NoBuild = 1;
-
 
1618
            $genToolsetActive = 0;
1588
            Log( "Build for .. ". PrintPlatforms(['NOBUILD - ' . $msg], $sep));
1619
            Log( "Build for .. ". PrintPlatforms(['NOBUILD - ' . $msg], $sep));
1589
 
1620
 
1590
        } else {
1621
        } else {
1591
            Error( $msg );
1622
            Error( $msg );
1592
        }
1623
        }
Line 1682... Line 1713...
1682
# Returns         : 
1713
# Returns         : 
1683
#
1714
#
1684
sub needToolset
1715
sub needToolset
1685
{
1716
{
1686
    my $toolsetNeeded;
1717
    my $toolsetNeeded;
-
 
1718
    return 0 if $SignatureOnly;
1687
 
1719
 
1688
    $toolsetNeeded = 1 if (!defined($::GBE_ABT));
1720
    $toolsetNeeded = 1 if (!defined($::GBE_ABT));
1689
    if (!$toolsetNeeded && defined($::GBE_BUILDFILTER) ) {
1721
    if (!$toolsetNeeded && defined($::GBE_BUILDFILTER) ) {
1690
        $toolsetNeeded = grep( /^TOOLSET$/, split( ' ', $::GBE_BUILDFILTER ) );
1722
        $toolsetNeeded = grep( /^TOOLSET$/, split( ' ', $::GBE_BUILDFILTER ) );
1691
    }
1723
    }
Line 1967... Line 1999...
1967
    Debug( "Name:      $name" );
1999
    Debug( "Name:      $name" );
1968
    Debug( "Version:   $version" );
2000
    Debug( "Version:   $version" );
1969
 
2001
 
1970
    DataDirective("LinkPkgArchive");            # This directive allowed here
2002
    DataDirective("LinkPkgArchive");            # This directive allowed here
1971
 
2003
 
1972
   if ( $IgnorePkgs )
2004
    if ( $IgnorePkgs )
1973
   {
2005
    {
1974
       Log( "LinkPkgArchive .. $name ($version) - Ignored" );
2006
        Log( "LinkPkgArchive .. $name ($version) - Ignored" );
1975
       return;
2007
        return;
1976
   }
2008
    }
1977
 
2009
 
1978
    #
2010
    #
1979
    #   Ensure that we have do not have multiple definitions
2011
    #   Ensure that we have do not have multiple definitions
1980
    #
2012
    #
1981
    if ( PackageEntry::Exists( $name, $version ) )
2013
    if ( PackageEntry::Exists( $name, $version ) )
Line 2252... Line 2284...
2252
    my $ifaceDir = catdir($::GBE_SANDBOX, 'sandbox_dpkg_archive', $name, $version . '.int');
2284
    my $ifaceDir = catdir($::GBE_SANDBOX, 'sandbox_dpkg_archive', $name, $version . '.int');
2253
    $ifaceDir = TagFileRead($ifaceDir);
2285
    $ifaceDir = TagFileRead($ifaceDir);
2254
    $ifaceDir =~ s~\\~/~g;
2286
    $ifaceDir =~ s~\\~/~g;
2255
    $ifaceDir =~ s~GBE_SANDBOX/~$::GBE_SANDBOX/~;
2287
    $ifaceDir =~ s~GBE_SANDBOX/~$::GBE_SANDBOX/~;
2256
    my $pkgSigFile = catfile( $ifaceDir, 'Package.sig');
2288
    my $pkgSigFile = catfile( $ifaceDir, 'Package.sig');
2257
Debug0 ('SigFile:', $ifaceDir ,$pkgSigFile);
-
 
-
 
2289
 
2258
    # Temp: Remove when we no longer have package-versions
2290
    # Temp: Remove when we no longer have package-versions
2259
    return unless -f $pkgSigFile; 
2291
    return unless -f $pkgSigFile; 
2260
 
2292
 
2261
    Error("Package signature not found for $name/$version", "You must 'build' the package before using it")
2293
    Error("Package signature not found for $name/$version", "You must 'build' the package before using it")
2262
        unless ( -f $pkgSigFile);
2294
        unless ( -f $pkgSigFile);
Line 2313... Line 2345...
2313
        #       Note: The .lnk file may be present, but it won't point to anything valid until
2345
        #       Note: The .lnk file may be present, but it won't point to anything valid until
2314
        #             the package has been built.
2346
        #             the package has been built.
2315
        #
2347
        #
2316
        if ($in_sandbox)
2348
        if ($in_sandbox)
2317
        {
2349
        {
-
 
2350
            #
-
 
2351
            #   In the build system we do NOT want to consume packages from within the sandbox
-
 
2352
            #   because they may be partially formed. They need to be consumed from a published
-
 
2353
            #   archive.
-
 
2354
            #   
-
 
2355
            #   In development its OK to consume locally generated packages
-
 
2356
            #   
-
 
2357
            next if (defined($::GBE_ABT));
-
 
2358
 
2318
            my $pkgLinkFile = $pkg;
2359
            my $pkgLinkFile = $pkg;
2319
            $pkgLinkFile =~ s~pkgsig$~lnk~;
2360
            $pkgLinkFile =~ s~pkgsig$~lnk~;
2320
 
2361
 
2321
            if ( -f $pkgLinkFile )
2362
            if ( -f $pkgLinkFile )
2322
            {
2363
            {
Line 2509... Line 2550...
2509
    Debug( "Name:      $name" );
2550
    Debug( "Name:      $name" );
2510
    Debug( "Version:   $version" );
2551
    Debug( "Version:   $version" );
2511
 
2552
 
2512
    DataDirective("BuildPkgArchive");           # This directive allowed here
2553
    DataDirective("BuildPkgArchive");           # This directive allowed here
2513
 
2554
 
2514
   if ( $IgnorePkgs )
2555
    if ( $IgnorePkgs )
2515
   {
2556
    {
2516
       Log( "BuildPkgArchive . $name ($version) - Ignored" );
2557
        Log( "BuildPkgArchive . $name ($version) - Ignored" );
2517
       return;
2558
        return;
2518
   }
2559
    }
2519
    
2560
    
2520
    #
2561
    #
2521
    #   Ensure that we have do not have multiple definitions
2562
    #   Ensure that we have do not have multiple definitions
2522
    #
2563
    #
2523
    if ( PackageEntry::Exists( $name, $version ) )
2564
    if ( PackageEntry::Exists( $name, $version ) )
Line 2551... Line 2592...
2551
        #       If the package is a 'local' package then force transfer
2592
        #       If the package is a 'local' package then force transfer
2552
        #       If the user has specified --cache then force transfer
2593
        #       If the user has specified --cache then force transfer
2553
        #       If package is newer that copy, then force transfer
2594
        #       If package is newer that copy, then force transfer
2554
        #       If copy does not exist, then force a transfer
2595
        #       If copy does not exist, then force a transfer
2555
        #
2596
        #
2556
        my $tag_dir = "$Cwd/$BUILDINTERFACE/BuildTags";
2597
        my $tag_dir = "$CwdFull/$BUILDINTERFACE/BuildTags";
2557
        my $tag_file = "$tag_dir/${name}_${version}.tag";
2598
        my $tag_file = "$tag_dir/${name}_${version}.tag";
2558
        my $arglist = GenerateInstallArgumentList();
2599
        my $arglist = GenerateInstallArgumentList();
2559
 
2600
 
2560
        my $package_installed;
2601
        my $package_installed;
2561
        $package_installed = 1
2602
        $package_installed = 1
Line 2591... Line 2632...
2591
                #
2632
                #
2592
                #   Determine all the Platforms, Products and Targets
2633
                #   Determine all the Platforms, Products and Targets
2593
                #   that need to be installed
2634
                #   that need to be installed
2594
                #
2635
                #
2595
                
2636
                
2596
                System( "cd $pkg; $::GBE_PERL $::GBE_TOOLS/installpkg.pl $Cwd/$BUILDINTERFACE $Cwd @opts $arglist");
2637
                System( "cd $pkg; $::GBE_PERL $::GBE_TOOLS/installpkg.pl $CwdFull/$BUILDINTERFACE $CwdFull @opts $arglist");
2597
                Error( "Package installation error" ) if ( $? != 0 );
2638
                Error( "Package installation error" ) if ( $? != 0 );
2598
            }
2639
            }
2599
            else
2640
            else
2600
            {
2641
            {
2601
                Error ("Unknown package format for package $name/$version found in $pkg");
2642
                Error ("Unknown package format for package $name/$version found in $pkg");
Line 2641... Line 2682...
2641
#
2682
#
2642
sub CreateInterfacePackage
2683
sub CreateInterfacePackage
2643
{
2684
{
2644
    foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
2685
    foreach my $platform ( @BUILD_ACTIVEPLATFORMS )
2645
    {
2686
    {
2646
        my $entry = PackageEntry::Interface( "$::Cwd/$BUILDINTERFACE" );
2687
        my $entry = PackageEntry::Interface( "$CwdFull/$BUILDINTERFACE" );
2647
 
2688
 
2648
        #
2689
        #
2649
        #   Locate include and lib bits within the interface
2690
        #   Locate include and lib bits within the interface
2650
        #   This is much simpler than for a LinkPkgArchive as the form
2691
        #   This is much simpler than for a LinkPkgArchive as the form
2651
        #   has been sanitized
2692
        #   has been sanitized
Line 2816... Line 2857...
2816
            $platform_filter = "";
2857
            $platform_filter = "";
2817
        }
2858
        }
2818
        else
2859
        else
2819
        {
2860
        {
2820
            $platform_filter = "";
2861
            $platform_filter = "";
2821
            $platform_filter = $::GBE_BUILDFILTER
2862
            $platform_filter = uc $::GBE_BUILDFILTER
2822
                if ( defined($::GBE_BUILDFILTER) );
2863
                if ( defined($::GBE_BUILDFILTER) );
2823
        }
2864
        }
2824
        Debug( "GeneratePlatformList: Filter:$platform_filter" );
2865
        Debug( "GeneratePlatformList: Filter:$platform_filter" );
2825
 
2866
 
2826
        #
2867
        #
Line 3361... Line 3402...
3361
                push @{$BUILDINFO{$aliasTarget}{USERALIAS}}, $alias;
3402
                push @{$BUILDINFO{$aliasTarget}{USERALIAS}}, $alias;
3362
            }
3403
            }
3363
        }
3404
        }
3364
    }
3405
    }
3365
    CleanUp_Aliases();
3406
    CleanUp_Aliases();
-
 
3407
    ProcessBuildArgument();
3366
 
3408
 
3367
    #
3409
    #
3368
    #   Create dummy package to describe the Interface directory
3410
    #   Create dummy package to describe the Interface directory
3369
    #
3411
    #
3370
    CreateInterfacePackage();
3412
    CreateInterfacePackage();
Line 3436... Line 3478...
3436
    return if ( $Clobber );
3478
    return if ( $Clobber );
3437
 
3479
 
3438
    if ( ! $ForceBuild  )
3480
    if ( ! $ForceBuild  )
3439
    {
3481
    {
3440
        my @build_warn;
3482
        my @build_warn;
3441
        my $bstamp = -M "$Cwd/$ScmBuildSrc";
3483
        my $bstamp = -M "$CwdFull/$ScmBuildSrc";
3442
        my $tstamp = -M "$Cwd/Makefile.gbe";
3484
        my $tstamp = -M "$CwdFull/Makefile.gbe";
3443
 
3485
 
3444
        push @build_warn, "Missing: Makefile.gbe" unless ( defined $tstamp );
3486
        push @build_warn, "Missing: Makefile.gbe" unless ( defined $tstamp );
3445
        push @build_warn, "Modified build file ($ScmBuildSrc)" if ( $tstamp && $bstamp < $tstamp );
3487
        push @build_warn, "Modified build file ($ScmBuildSrc)" if ( $tstamp && $bstamp < $tstamp );
3446
 
3488
 
3447
        #
3489
        #
Line 3560... Line 3602...
3560
    my $link_file;
3602
    my $link_file;
3561
    my $tag;
3603
    my $tag;
3562
    my $root_path;
3604
    my $root_path;
3563
 
3605
 
3564
    #
3606
    #
-
 
3607
    #   In the build system we do NOT want to consume packages from within the sandbox
-
 
3608
    #   because they may be partially formed. They need to be consumed from a published
-
 
3609
    #   archive.
-
 
3610
    #   
-
 
3611
    #   If we are in an ABT sandbox, then don't create a link file
-
 
3612
    #   
-
 
3613
    return if (defined($::GBE_ABT));
-
 
3614
 
-
 
3615
    #
3565
    #   Determine the path (and name) of the target archive
3616
    #   Determine the path (and name) of the target archive
3566
    #   Use sandbox_dpkg_archive if it exists
3617
    #   Use sandbox_dpkg_archive if it exists
3567
    #   Use local_dpkg_acrhive for backward compatability (should be removed after JATS 2.64.2+)
3618
    #   Use local_dpkg_acrhive for backward compatability (should be removed after JATS 2.64.2+)
3568
    #
3619
    #
3569
    if ( $target_archive = $::GBE_DPKG_SBOX )
3620
    if ( $target_archive = $::GBE_DPKG_SBOX )
3570
    {
3621
    {
3571
        $target_archive_name = "sandbox_dpkg_archive";
3622
        $target_archive_name = "sandbox_dpkg_archive";
3572
        $tag = "Sandbox";
3623
        $tag = "Sandbox";
3573
        $link_file  = 'sandbox' . ${BUILDNAME_SUFFIX} . '.lnk';
3624
        $link_file  = 'sandbox' . ${BUILDNAME_SUFFIX} . '.lnk';
3574
        $root_path = 'GBE_SANDBOX' . substr($Cwd, length($::GBE_SANDBOX));
3625
        $root_path = 'GBE_SANDBOX' . substr($CwdFull, length($::GBE_SANDBOX));
3575
        Verbose2("Root Path: $::GBE_SANDBOX, $root_path");
3626
        Verbose2("Root Path: $::GBE_SANDBOX, $root_path");
3576
    }
3627
    }
3577
    elsif ( $target_archive = $::GBE_DPKG_LOCAL )
3628
    elsif ( $target_archive = $::GBE_DPKG_LOCAL )
3578
    {
3629
    {
3579
        $target_archive_name = "local_dpkg_archive";
3630
        $target_archive_name = "local_dpkg_archive";
3580
        $link_file = "$BUILDVERSION.lnk";
3631
        $link_file = "$BUILDVERSION.lnk";
3581
        $tag = "Local";
3632
        $tag = "Local";
3582
        $root_path = $Cwd;
3633
        $root_path = $CwdFull;
3583
    }
3634
    }
3584
    else
3635
    else
3585
    {
3636
    {
3586
        Verbose("Cannot locate local or sandbox archive")
3637
        Verbose("Cannot locate local or sandbox archive")
3587
            unless $Clobber;
3638
            unless $Clobber;
Line 3682... Line 3733...
3682
 
3733
 
3683
        #
3734
        #
3684
        #   File with path to the interface directory
3735
        #   File with path to the interface directory
3685
        #   Relative to the base of the sandbox
3736
        #   Relative to the base of the sandbox
3686
        #
3737
        #
3687
        FileCreate($int_path, catdir('GBE_SANDBOX',RelPath($Cwd,$::GBE_SANDBOX),$BUILDINTERFACE ));
3738
        FileCreate($int_path, CatPaths('GBE_SANDBOX',RelPath($CwdFull,$::GBE_SANDBOX),$BUILDINTERFACE ));
3688
 
3739
 
3689
        #
3740
        #
3690
        #   Indicate packages not build on this machine
3741
        #   Indicate packages not build on this machine
3691
        #
3742
        #
3692
        unlink $nob_path;           # Delete the NoBuild marker
3743
        unlink $nob_path;           # Delete the NoBuild marker
Line 3816... Line 3867...
3816
    #   The file is created later in the build proccess, but the makefile generation 
3867
    #   The file is created later in the build proccess, but the makefile generation 
3817
    #   needs to have a known path to the file.
3868
    #   needs to have a known path to the file.
3818
    #    
3869
    #    
3819
    #   It will be a file that is 'known' to JATS
3870
    #   It will be a file that is 'known' to JATS
3820
    #
3871
    #
3821
    $descpkgPath = BuildAddKnownFile ( $NoBuild ? $Cwd : $Srcdir, 'descpkg' );
3872
    $descpkgPath = BuildAddKnownFile ( $NoBuild ? $CwdFull : $Srcdir, 'descpkg' );
3822
 
3873
 
3823
    #.. Build support files
3874
    #.. Build support files
3824
    #
3875
    #
3825
    DeleteCfg();
3876
    DeleteCfg();
3826
    BuildConfig();
3877
    BuildConfig();
Line 3845... Line 3896...
3845
        #       Due to the normal way that makelib.pl is executed,
3896
        #       Due to the normal way that makelib.pl is executed,
3846
        #       the following substitutions are done.
3897
        #       the following substitutions are done.
3847
        #
3898
        #
3848
        @ARGV = ();
3899
        @ARGV = ();
3849
        $0 = "makefile.pl ";
3900
        $0 = "makefile.pl ";
3850
        push @ARGV, "$Cwd";                         # current working directory
3901
        push @ARGV, "$CwdFull";                         # current working directory
3851
        push @ARGV, "$::GBE_TOOLS/makelib.pl";      # makelib.pl image
3902
        push @ARGV, "$::GBE_TOOLS/makelib.pl";      # makelib.pl image
3852
        push @ARGV, "--interface=$BUILDINTERFACE"
3903
        push @ARGV, "--interface=$BUILDINTERFACE"
3853
            if ($BUILDINTERFACE);
3904
            if ($BUILDINTERFACE);
3854
 
3905
 
3855
        Debug( "ARGV:      @ARGV" );
3906
        Debug( "ARGV:      @ARGV" );
Line 3933... Line 3984...
3933
{
3984
{
3934
    Message("Generate Package Signature");
3985
    Message("Generate Package Signature");
3935
    #   Generate the package signature using the new method
3986
    #   Generate the package signature using the new method
3936
    #       Quick parse the build and makefiles
3987
    #       Quick parse the build and makefiles
3937
    #
3988
    #
3938
    $BUILDSIGNATURE = JatsSignatureBuilder::GeneratePackageSignature ($Cwd, catfile($Cwd, $BUILDINTERFACE));
3989
    $BUILDSIGNATURE = JatsSignatureBuilder::GeneratePackageSignature ($CwdFull, catfile($CwdFull, $BUILDINTERFACE));
-
 
3990
 
-
 
3991
    #
-
 
3992
    #   In the build system,
-
 
3993
    #   Check that all builds actually create the same signature. If not then it indicates something is wrong
-
 
3994
    #   with the signature generation process across machines.
-
 
3995
    #
-
 
3996
    if (defined $CheckSignature)
-
 
3997
    {
-
 
3998
        if ($CheckSignature ne $BUILDSIGNATURE ) {
-
 
3999
            Error ("Package Signature check failure",
-
 
4000
                   "Generated Signature: $BUILDSIGNATURE",
-
 
4001
                   "Check Signature    : $CheckSignature"
-
 
4002
                  );
-
 
4003
        }
-
 
4004
    }
3939
 
4005
 
3940
    #
4006
    #
3941
    #   See if the package exists in one of the package stores
4007
    #   See if the package exists in one of the package stores
3942
    #   Look in each package archive directory
4008
    #   Look in each package archive directory
3943
    #   
4009
    #   
Line 4129... Line 4195...
4129
    push @desc, "Version:       $BUILDVERSION";
4195
    push @desc, "Version:       $BUILDVERSION";
4130
    push @desc, "Signature:     $BUILDSIGNATURE" if defined $BUILDSIGNATURE;
4196
    push @desc, "Signature:     $BUILDSIGNATURE" if defined $BUILDSIGNATURE;
4131
    push @desc, "Released By:   $::USER";
4197
    push @desc, "Released By:   $::USER";
4132
    push @desc, "Released On:   $::CurrentTime";
4198
    push @desc, "Released On:   $::CurrentTime";
4133
    push @desc, "Build Machine: $::GBE_HOSTNAME";
4199
    push @desc, "Build Machine: $::GBE_HOSTNAME";
4134
    push @desc, "Path:          $Cwd";
4200
    push @desc, "Path:          $CwdFull";
4135
    push @desc, "Jats Version:  $::GBE_VERSION";
4201
    push @desc, "Jats Version:  $::GBE_VERSION";
4136
    push @desc, "Jats Path:     $::GBE_CORE";
4202
    push @desc, "Jats Path:     $::GBE_CORE";
4137
    push @desc, "";
4203
    push @desc, "";
4138
    push @desc, "Build Dependencies:";
4204
    push @desc, "Build Dependencies:";
4139
    push @desc, "";
4205
    push @desc, "";
Line 5041... Line 5107...
5041
                     file will be copied locally.
5107
                     file will be copied locally.
5042
    -[no]force     - Force build even if build.pl is not newer
5108
    -[no]force     - Force build even if build.pl is not newer
5043
                     Default: -force
5109
                     Default: -force
5044
    -[no]generic   - Build system sanity test
5110
    -[no]generic   - Build system sanity test
5045
                     Default: Do not test
5111
                     Default: Do not test
-
 
5112
    -signature=xx  - Check package signature
5046
 
5113
 
5047
 Sticky settings:
5114
 Sticky settings:
5048
    -all           - Build for all platforms ignoring GBE_BUILDFILTER
5115
    -all           - Build for all platforms ignoring GBE_BUILDFILTER
5049
    -expert[=n]    - Relaxing dependency checks on the user makefiles
5116
    -expert[=n]    - Relaxing dependency checks on the user makefiles
5050
 
5117
 
Line 5149... Line 5216...
5149
 
5216
 
5150
The default is to not perform the test.
5217
The default is to not perform the test.
5151
 
5218
 
5152
This option is intended to be used by the automated build system.
5219
This option is intended to be used by the automated build system.
5153
 
5220
 
-
 
5221
=item B<-signature=xxxx>
-
 
5222
 
-
 
5223
If used, this option will perform a sanity test on the packages signature. It will
-
 
5224
ensure that the generated package signature is the same as that provided.
-
 
5225
 
-
 
5226
The default is to not perform the test.
-
 
5227
 
-
 
5228
This option is intended to be used by the automated build system.
-
 
5229
 
5154
=item B<-all>
5230
=item B<-all>
5155
 
5231
 
5156
This option will cause the build process to generate makefiles for all
5232
This option will cause the build process to generate makefiles for all
5157
possible build targets ignoring the use of GBE_BUILDFILTER.
5233
possible build targets ignoring the use of GBE_BUILDFILTER.
5158
 
5234