Subversion Repositories DevTools

Rev

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

Rev 4192 Rev 4688
Line 66... Line 66...
66
our $GBE_CORE           = $ENV{'GBE_CORE'}           || '';
66
our $GBE_CORE           = $ENV{'GBE_CORE'}           || '';
67
our $GBE_BIN            = $ENV{'GBE_BIN'}            || '';
67
our $GBE_BIN            = $ENV{'GBE_BIN'}            || '';
68
our $GBE_CONFIG         = $ENV{'GBE_CONFIG'}         || '';
68
our $GBE_CONFIG         = $ENV{'GBE_CONFIG'}         || '';
69
our $GBE_DPLY           = $ENV{'GBE_DPLY'}           || '';
69
our $GBE_DPLY           = $ENV{'GBE_DPLY'}           || '';
70
our $GBE_DPKG           = $ENV{'GBE_DPKG'}           || '';
70
our $GBE_DPKG           = $ENV{'GBE_DPKG'}           || '';
-
 
71
our $GBE_DPKG_REPLICA   = $ENV{'GBE_DPKG_REPLICA'}   || '';
71
our $GBE_DPKG_STORE     = $ENV{'GBE_DPKG_STORE'}     || '';
72
our $GBE_DPKG_STORE     = $ENV{'GBE_DPKG_STORE'}     || '';
72
our $GBE_DPKG_LOCAL     = $ENV{'GBE_DPKG_LOCAL'}     || '';
73
our $GBE_DPKG_LOCAL     = $ENV{'GBE_DPKG_LOCAL'}     || '';
73
our $GBE_DPKG_CACHE     = $ENV{'GBE_DPKG_CACHE'}     || '';
74
our $GBE_DPKG_CACHE     = $ENV{'GBE_DPKG_CACHE'}     || '';
74
our $GBE_DPKG_SBOX      = $ENV{'GBE_DPKG_SBOX'}      || '';
75
our $GBE_DPKG_SBOX      = $ENV{'GBE_DPKG_SBOX'}      || '';
75
our $GBE_SANDBOX        = $ENV{'GBE_SANDBOX'}        || '';
76
our $GBE_SANDBOX        = $ENV{'GBE_SANDBOX'}        || '';
Line 317... Line 318...
317
TestDirectoryConfig( 'GBE_DPLY' );
318
TestDirectoryConfig( 'GBE_DPLY' );
318
TestDirectoryConfig( 'GBE_DPKG' );
319
TestDirectoryConfig( 'GBE_DPKG' );
319
TestDirectoryConfig( 'GBE_DPKG_CACHE' );
320
TestDirectoryConfig( 'GBE_DPKG_CACHE' );
320
TestDirectoryConfig( 'GBE_DPKG_LOCAL' );
321
TestDirectoryConfig( 'GBE_DPKG_LOCAL' );
321
TestDirectoryConfig( 'GBE_DPKG_STORE' );
322
TestDirectoryConfig( 'GBE_DPKG_STORE' );
-
 
323
TestDirectoryConfig( 'GBE_DPKG_REPLICA' );
322
TestDirectoryConfig( 'GBE_DPKG_SBOX' );
324
TestDirectoryConfig( 'GBE_DPKG_SBOX' );
323
TestDirectoryConfig( 'GBE_SANDBOX' );
325
TestDirectoryConfig( 'GBE_SANDBOX' );
324
 
326
 
325
################################################################################
327
################################################################################
326
#   Setup the Machine Type
328
#   Setup the Machine Type
Line 376... Line 378...
376
#   If we want to run an alternate version of JATS, then don't attempt to
378
#   If we want to run an alternate version of JATS, then don't attempt to
377
#   cache the initial version of JATS.
379
#   cache the initial version of JATS.
378
#
380
#
379
if ( $ENV{GBE_CACHE_JATS} && ! $GBE_JATS_SANE && ! $GBE_JATS_VERSION)
381
if ( $ENV{GBE_CACHE_JATS} && ! $GBE_JATS_SANE && ! $GBE_JATS_VERSION)
380
{
382
{
-
 
383
    Debug0("Caching JATS");
381
    my $state = "Not Cached: Not running from dpkg_archive";
384
    my $state = "Not Cached: Not running from dpkg_archive";
382
    #
385
    #
383
    #   Must have the DPKG_ARCHIVE cache
386
    #   Must have the DPKG_ARCHIVE cache
384
    #   Must be running from DPKG_ARCHIVE - prevent messing with local copies
387
    #   Must be running from DPKG_ARCHIVE - prevent messing with local copies
385
    #
388
    #
Line 391... Line 394...
391
        #       GBE_NOT_RELEASED being set
394
        #       GBE_NOT_RELEASED being set
392
        #       Lack of descpkg file
395
        #       Lack of descpkg file
393
        #
396
        #
394
        if ( ! $GBE_NOT_RELEASED  && -f "$GBE_CORE/descpkg" )
397
        if ( ! $GBE_NOT_RELEASED  && -f "$GBE_CORE/descpkg" )
395
        {
398
        {
396
            my ($archive, $package) = LocateJatsVersion( $GBE_VERSION );
399
            my ($archive, $package, $aName) = LocateJatsVersion( $GBE_VERSION );
397
            if ( $archive )
400
            if ( $archive )
398
            {
401
            {
399
                Verbose ("Update cached version of JATS: $GBE_VERSION");
-
 
400
                #
402
                #
401
                #   Attempt to cache the package
403
                #   If the required version is found in the cache, then use it
402
                #   Need enough JATS environment to run the cache_dpkg utility
404
                #   This will bypass the slowish process of invoking cache_dpkg
-
 
405
                #   at the expense of not being able to handle situations where
-
 
406
                #   version is updated on the fly
403
                #
407
                #
-
 
408
                if (($aName ne 'GBE_DPKG_CACHE') && ( $ENV{GBE_CACHE_JATS} < 2))
404
                {
409
                {
-
 
410
                    Verbose ("Update cached version of JATS: $GBE_VERSION");
-
 
411
                    #
-
 
412
                    #   Attempt to cache the package
-
 
413
                    #   Need enough JATS environment to run the cache_dpkg utility
-
 
414
                    #
-
 
415
                    {
405
                    local %ENV = %ENV;
416
                        local %ENV = %ENV;
-
 
417
 
-
 
418
                        $ENV{GBE_TOOLS} = "$GBE_CORE/TOOLS";
-
 
419
                        $ENV{PERL5LIB} = "$GBE_CORE/TOOLS/LIB" ;
-
 
420
                        $ENV{GBE_BIN}  = "$GBE_CORE/BIN.$GBE_MACHTYPE";
-
 
421
                        $ENV{GBE_VERBOSE}  = $GBE_VERBOSE;
406
 
422
 
407
                    $ENV{GBE_TOOLS} = "$GBE_CORE/TOOLS";
423
                        etool ( 'cache_dpkg.pl', $package );
408
                    $ENV{PERL5LIB} = "$GBE_CORE/TOOLS/LIB" ;
424
                    }
-
 
425
                }
409
                    $ENV{GBE_BIN}  = "$GBE_CORE/BIN.$GBE_MACHTYPE";
426
                else
410
                    $ENV{GBE_VERBOSE}  = $GBE_VERBOSE;
427
                {
411
 
-
 
412
                    etool ( 'cache_dpkg.pl', $package );
428
                    Verbose("Required version found in cache");
413
                }
429
                }
414
 
430
 
415
                my $tgt = "$GBE_DPKG_CACHE/$package";
431
                my $tgt = "$GBE_DPKG_CACHE/$package";
416
                if ( -d $tgt )
432
                if ( -d $tgt )
417
                {
433
                {
Line 745... Line 761...
745
Error ("GBE_DPKG_STORE is not a directory : $GBE_DPKG_STORE")
761
Error ("GBE_DPKG_STORE is not a directory : $GBE_DPKG_STORE")
746
    if ( $GBE_DPKG_STORE && ! -d $GBE_DPKG_STORE );
762
    if ( $GBE_DPKG_STORE && ! -d $GBE_DPKG_STORE );
747
 
763
 
748
Error ("GBE_DPLY is not a directory : $GBE_DPLY")
764
Error ("GBE_DPLY is not a directory : $GBE_DPLY")
749
    if ( $GBE_DPLY && ! -d $GBE_DPLY );
765
    if ( $GBE_DPLY && ! -d $GBE_DPLY );
-
 
766
 
-
 
767
Error ("GBE_DPKG_REPLICA is not a directory : $GBE_DPKG_REPLICA")
-
 
768
    if ( $GBE_DPKG_REPLICA && ! -d $GBE_DPKG_REPLICA );
750
    
769
    
751
########################################################################
770
########################################################################
752
#
771
#
753
#       Locate a local_dpkg_archive directory, by searching from the CWD
772
#       Locate a local_dpkg_archive directory, by searching from the CWD
754
#       to the root of the file system
773
#       to the root of the file system
Line 1022... Line 1041...
1022
    $ENV{'GBE_CONFIG'}        = $GBE_CONFIG;
1041
    $ENV{'GBE_CONFIG'}        = $GBE_CONFIG;
1023
    $ENV{'GBE_DPLY'}          = $GBE_DPLY;
1042
    $ENV{'GBE_DPLY'}          = $GBE_DPLY;
1024
    $ENV{'GBE_DPKG'}          = $GBE_DPKG;
1043
    $ENV{'GBE_DPKG'}          = $GBE_DPKG;
1025
    $ENV{'JATS_HOME'}         = $GBE_DPKG;
1044
    $ENV{'JATS_HOME'}         = $GBE_DPKG;
1026
    $ENV{'GBE_DPKG_CACHE'}    = $GBE_DPKG_CACHE;
1045
    $ENV{'GBE_DPKG_CACHE'}    = $GBE_DPKG_CACHE;
-
 
1046
    $ENV{'GBE_DPKG_REPLICA'}  = $GBE_DPKG_REPLICA;
1027
    $ENV{'GBE_DPKG_STORE'}    = $GBE_DPKG_STORE;
1047
    $ENV{'GBE_DPKG_STORE'}    = $GBE_DPKG_STORE;
1028
    $ENV{'GBE_DPKG_LOCAL'}    = $GBE_DPKG_LOCAL;
1048
    $ENV{'GBE_DPKG_LOCAL'}    = $GBE_DPKG_LOCAL;
1029
    $ENV{'GBE_SANDBOX'}       = $GBE_SANDBOX;
1049
    $ENV{'GBE_SANDBOX'}       = $GBE_SANDBOX;
1030
    $ENV{'GBE_DPKG_SBOX'}     = $GBE_DPKG_SBOX;
1050
    $ENV{'GBE_DPKG_SBOX'}     = $GBE_DPKG_SBOX;
1031
    $ENV{'GBE_PERL'}          = $GBE_PERL;
1051
    $ENV{'GBE_PERL'}          = $GBE_PERL;
Line 1102... Line 1122...
1102
# Description     : Scan archives looking for a specified version of JATS
1122
# Description     : Scan archives looking for a specified version of JATS
1103
#                   Complicated by the name change from core_devl to jats
1123
#                   Complicated by the name change from core_devl to jats
1104
#                   that occurred circa version 2.71.7.
1124
#                   that occurred circa version 2.71.7.
1105
#                   The required version may be in either of the packages
1125
#                   The required version may be in either of the packages
1106
#
1126
#
-
 
1127
#                   Ensure that package is complete
-
 
1128
#                   The caching process will write built.cache during the creation process
-
 
1129
#
1107
# Inputs          : $version            - Version to locate
1130
# Inputs          : $version            - Version to locate
1108
#
1131
#
1109
# Returns         : undef               - if not found
1132
# Returns         : undef               - if not found
1110
#                   Array of:
1133
#                   Array of:
1111
#                       Repository
1134
#                       Repository
Line 1115... Line 1138...
1115
{
1138
{
1116
    my ($version) = @_;
1139
    my ($version) = @_;
1117
    my $package;
1140
    my $package;
1118
    my $path;
1141
    my $path;
1119
 
1142
 
1120
    foreach my $archive (qw ( GBE_DPKG_LOCAL GBE_DPKG_CACHE GBE_DPKG GBE_DPKG_STORE ))
1143
    foreach my $archive (qw ( GBE_DPKG_LOCAL GBE_DPKG_CACHE GBE_DPKG_REPLICA GBE_DPKG GBE_DPKG_STORE ))
1121
    {
1144
    {
1122
        no strict 'refs';
1145
        no strict 'refs';
1123
        $path = ${$archive};
1146
        $path = ${$archive};
1124
        use strict 'refs';
1147
        use strict 'refs';
1125
        next unless ( $path );
1148
        next unless ( $path );
Line 1127... Line 1150...
1127
        foreach my $package (qw( jats core_devl ))
1150
        foreach my $package (qw( jats core_devl ))
1128
        {
1151
        {
1129
            Verbose2( "ExamineDir: $path/$package/$version" );
1152
            Verbose2( "ExamineDir: $path/$package/$version" );
1130
            if ( -d "$path/$package/$version" )
1153
            if ( -d "$path/$package/$version" )
1131
            {
1154
            {
-
 
1155
                unless (-f "$path/$package/$version/built.cache")
-
 
1156
                {
1132
                return $path, "$package/$version";
1157
                    return $path, "$package/$version", $archive;
-
 
1158
                }
1133
            }
1159
            }
1134
        }
1160
        }
1135
    }
1161
    }
1136
    return;
1162
    return;
1137
}
1163
}
Line 2027... Line 2053...
2027
    Error ("Jar not found: $ANT_HOME/lib/ant-launcher.jar") unless ( -e "$ANT_HOME/lib/ant-launcher.jar" );
2053
    Error ("Jar not found: $ANT_HOME/lib/ant-launcher.jar") unless ( -e "$ANT_HOME/lib/ant-launcher.jar" );
2028
    Error ("Directory not found: $ANT_HOME") unless ( -d "$ANT_HOME" );
2054
    Error ("Directory not found: $ANT_HOME") unless ( -d "$ANT_HOME" );
2029
    Error ("Directory not found: $ANT_HOME/lib") unless ( -d "$ANT_HOME/lib" );
2055
    Error ("Directory not found: $ANT_HOME/lib") unless ( -d "$ANT_HOME/lib" );
2030
 
2056
 
2031
    #
2057
    #
-
 
2058
    #   Documented KLUDGE
-
 
2059
    #   The 'ant-using' mechanism only understands GBE_DPKG
-
 
2060
    #   This is not good in a cloud build configuration where GBE_DPKG_REPLICA is the fastest repository
-
 
2061
    #   Solution: In an GBE_ABT environment IFF GBE_DPKG_REPLIA exists then set GBE_DPKG
-
 
2062
    #
-
 
2063
    if ($GBE_ABT && $GBE_DPKG_REPLICA)
-
 
2064
    {
-
 
2065
        $ENV{GBE_DPKG_ORIGINAL} = $ENV{GBE_DPKG};
-
 
2066
        $ENV{GBE_DPKG} = $ENV{GBE_DPKG_REPLICA};
-
 
2067
        Message("Setting GBE_DPKG to GBE_DPKG_REPLICA");
-
 
2068
    }
-
 
2069
 
-
 
2070
    #
2032
    #   Use the ant-launcher to invoke ant directly
2071
    #   Use the ant-launcher to invoke ant directly
2033
    #
2072
    #
2034
    $RESULT = System ( "$JAVA_HOME/bin/java",
2073
    $RESULT = System ( "$JAVA_HOME/bin/java",
-
 
2074
                       #"-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=y",      # Enable Remote Debug
2035
                       "-classpath","$ANT_HOME/lib/ant-launcher.jar",
2075
                       "-classpath","$ANT_HOME/lib/ant-launcher.jar",
2036
                       "-Dant.home=$ANT_HOME",
2076
                       "-Dant.home=$ANT_HOME",
2037
                       "org.apache.tools.ant.launch.Launcher",
2077
                       "org.apache.tools.ant.launch.Launcher",
2038
                       "-lib","$ANT_HOME/lib",
2078
                       "-lib","$ANT_HOME/lib",
2039
                       @user_args
2079
                       @user_args
Line 2403... Line 2443...
2403
 
2443
 
2404
=item B<-version=xxx>
2444
=item B<-version=xxx>
2405
 
2445
 
2406
When this option is invoked JATS will attempt to use the specified version to
2446
When this option is invoked JATS will attempt to use the specified version to
2407
perform all processing. JATS will search the GBE_DPKG_LOCAL, GBE_DPKG_CACHE,
2447
perform all processing. JATS will search the GBE_DPKG_LOCAL, GBE_DPKG_CACHE,
2408
GBE_DPKG, GBE_DPKG_STORE in order to locate the specified version of the package.
2448
GBE_DPKG_REPLICA, GBE_DPKG, GBE_DPKG_STORE in order to locate the specified 
-
 
2449
version of the package.
2409
 
2450
 
2410
The entire command line will be passed to the JATS wrapper script within that
2451
The entire command line will be passed to the JATS wrapper script within that
2411
version. This bypasses the jats.bat or jats.sh startup scripts.
2452
version. This bypasses the jats.bat or jats.sh startup scripts.
2412
 
2453
 
2413
JATS will attempt to transfer the target version to the local cache in an
2454
JATS will attempt to transfer the target version to the local cache in an