Subversion Repositories DevTools

Rev

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

Rev 7312 Rev 7319
Line 45... Line 45...
45
use ToolsetFiles;
45
use ToolsetFiles;
46
 
46
 
47
use Pod::Usage;                             # required for help support
47
use Pod::Usage;                             # required for help support
48
use Getopt::Long qw(:config require_order); # Stop on non-option
48
use Getopt::Long qw(:config require_order); # Stop on non-option
49
use Digest;
49
use Digest;
-
 
50
use JSON;
-
 
51
 
50
 
52
 
51
my $VERSION = "1.0.0";                      # Update this
53
my $VERSION = "1.0.0";                      # Update this
52
my $SCANDEPTH = 3;                          # Almost a constant
54
my $SCANDEPTH = 3;                          # Almost a constant
53
 
55
 
54
#
56
#
Line 64... Line 66...
64
my $opt_allSandbox;                         # Extend scope to entire sandbox
66
my $opt_allSandbox;                         # Extend scope to entire sandbox
65
my $opt_processUsedBy;                      # Process dependants(consumers) not dependents(children)
67
my $opt_processUsedBy;                      # Process dependants(consumers) not dependents(children)
66
my $opt_keepgoing;                          # Ignore errors
68
my $opt_keepgoing;                          # Ignore errors
67
my $opt_reScan;                             # Rescan for buildfiles
69
my $opt_reScan;                             # Rescan for buildfiles
68
my $opt_multiBuilders = 0;                  # How handle packages with multiple bulders: 0:Error, 1:Report, 2:Ignore
70
my $opt_multiBuilders = 0;                  # How handle packages with multiple bulders: 0:Error, 1:Report, 2:Ignore
-
 
71
my $opt_onlyLevel = 0;                      # Single level processing
69
 
72
 
70
#
73
#
71
#   Globals - Provided by the JATS environment
74
#   Globals - Provided by the JATS environment
72
#
75
#
73
my $USER            = $ENV{'USER'};
76
my $USER            = $ENV{'USER'};
Line 82... Line 85...
82
my $GBE_DPKG_CACHE      = $ENV{'GBE_DPKG_CACHE'};
85
my $GBE_DPKG_CACHE      = $ENV{'GBE_DPKG_CACHE'};
83
my $GBE_DPKG            = $ENV{'GBE_DPKG'};
86
my $GBE_DPKG            = $ENV{'GBE_DPKG'};
84
my $GBE_DPLY            = $ENV{'GBE_DPLY'};
87
my $GBE_DPLY            = $ENV{'GBE_DPLY'};
85
my $GBE_DPKG_STORE      = $ENV{'GBE_DPKG_STORE'};
88
my $GBE_DPKG_STORE      = $ENV{'GBE_DPKG_STORE'};
86
my $GBE_DPKG_REPLICA    = $ENV{'GBE_DPKG_REPLICA'};
89
my $GBE_DPKG_REPLICA    = $ENV{'GBE_DPKG_REPLICA'};
-
 
90
my $GBE_DPKG_ESCROW     = $ENV{'GBE_DPKG_ESCROW'};
87
 
91
 
88
#
92
#
89
#   Globals
93
#   Globals
90
#
94
#
91
my @stopped = ();                               # Stopped entries
95
my @stopped = ();                               # Stopped entries
92
my @build_order = ();                           # Build Ordered list of entries
-
 
93
my %extern_deps;                                # Hash of external dependencies
-
 
94
my %packages;                                   # Hash of packages
96
my %packages;                                   # Hash of packages
-
 
97
my @build_order = ();                           # Build Ordered list of packages
-
 
98
my %extern_deps;                                # Hash of external dependencies
95
my $currentPkgTag;                              # Tag of the current package - if any                                          
99
my $currentPkgTag;                              # Tag of the current package - if any                                          
96
my $scanDepth;                                  # Depth for build file scan
100
my $scanDepth;                                  # Depth for build file scan
97
my $maxDname = 0;                               # Pretty display
101
my $maxDname = 0;                               # Pretty display
98
 
102
 
99
#
103
#
100
#   Known files
104
#   Known files
101
#
105
#
-
 
106
$GBE_DPKG_SBOX = '' unless defined $GBE_DPKG_SBOX;
102
my $cacheFile  = $GBE_DPKG_SBOX . '/location_cache';
107
my $cacheFile  = $GBE_DPKG_SBOX . '/location_cache';
103
my $depthFile  = $GBE_DPKG_SBOX . '/scanDepth';
108
my $depthFile  = $GBE_DPKG_SBOX . '/scanDepth';
104
my $filterFile = $GBE_DPKG_SBOX . '/buildfilter';
109
my $filterFile = $GBE_DPKG_SBOX . '/buildfilter';
105
 
110
 
106
#-------------------------------------------------------------------------------
111
#-------------------------------------------------------------------------------
Line 148... Line 153...
148
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
153
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
149
populate(@ARGV)                         if ( $cmd =~ m/^populate$/  );
154
populate(@ARGV)                         if ( $cmd =~ m/^populate$/  );
150
buildfilter(@ARGV)                      if ( $cmd =~ m/^buildfilter$/  );
155
buildfilter(@ARGV)                      if ( $cmd =~ m/^buildfilter$/  );
151
skipBuild(0, @ARGV)                     if ( $cmd =~ m/^skip$/  );
156
skipBuild(0, @ARGV)                     if ( $cmd =~ m/^skip$/  );
152
skipBuild(1, @ARGV)                     if ( $cmd =~ m/^unskip$/  );
157
skipBuild(1, @ARGV)                     if ( $cmd =~ m/^unskip$/  );
-
 
158
errorBuild(0, @ARGV)                    if ( $cmd =~ m/^error$/  );
-
 
159
errorBuild(1, @ARGV)                    if ( $cmd =~ m/^unerror$/  );
153
fingerPrintPkg(@ARGV)                   if ( $cmd =~ m/^finger/i );
160
fingerPrintPkg(@ARGV)                   if ( $cmd =~ m/^finger/i );
154
testLinks(@ARGV)                        if ( $cmd =~ m/^testlinks/i );
161
testLinks(@ARGV)                        if ( $cmd =~ m/^testlinks/i );
155
setScanDepth(@ARGV)                     if ( $cmd =~ m/^scandepth/i );
162
setScanDepth(@ARGV)                     if ( $cmd =~ m/^scandepth/i );
-
 
163
writeBuildData(@ARGV)                   if ( $cmd =~ m/^writeBuildData/i );
156
 
164
 
157
Error ("Unknown sandbox command: $cmd");
165
Error ("Unknown sandbox command: $cmd");
158
exit 1;
166
exit 1;
159
 
167
 
160
 
168
 
Line 329... Line 337...
329
    }
337
    }
330
    exit 0;
338
    exit 0;
331
}
339
}
332
 
340
 
333
#-------------------------------------------------------------------------------
341
#-------------------------------------------------------------------------------
-
 
342
# Function        : errorBuild 
-
 
343
#
-
 
344
# Description     : Mark the package as having a build error
-
 
345
#                   This inofrmation will be used in determining build info
-
 
346
#
-
 
347
# Inputs          : Mode -: Error, 1:UnError
-
 
348
#                   User commaand line 
-
 
349
#
-
 
350
# Returns         : Nothing
-
 
351
#
-
 
352
sub errorBuild
-
 
353
{
-
 
354
    my ($mode, @cmd_opts ) = @_;
-
 
355
    my $machine;
-
 
356
 
-
 
357
    Getopt::Long::Configure('pass_through');
-
 
358
    getOptionsFromArray ( \@cmd_opts,
-
 
359
                        'machine!' => \$machine,
-
 
360
                        ) || Error ("Invalid command line" );
-
 
361
 
-
 
362
    SubCommandHelp( $opt_help, "Error Build") if ($opt_help );
-
 
363
    Error ("Command must be executed from within a Sandbox") unless ( $GBE_SANDBOX );
-
 
364
 
-
 
365
    #
-
 
366
    #   Determine Sandbox information
-
 
367
    #   Populate global variables
-
 
368
    #
-
 
369
    calc_sandbox_info(1);
-
 
370
 
-
 
371
    #
-
 
372
    #   Display only
-
 
373
    #   
-
 
374
    unless( @cmd_opts)
-
 
375
    {
-
 
376
        foreach my $pkg (keys %packages)
-
 
377
        {
-
 
378
            my $fe = $packages{$pkg};
-
 
379
            next unless $fe->{buildError};
-
 
380
 
-
 
381
            my $errMsg = ' (Build Error)';
-
 
382
            if ($fe->{buildCurrent}) {
-
 
383
                $errMsg .= ' (Current Package)';
-
 
384
            }
-
 
385
 
-
 
386
            Message( ' Name: ' . $fe->{dname} . $errMsg );
-
 
387
 
-
 
388
        }
-
 
389
        exit 0;
-
 
390
    }
-
 
391
 
-
 
392
    foreach ( @cmd_opts )
-
 
393
    {
-
 
394
        #
-
 
395
        #   Locate the package
-
 
396
        #
-
 
397
        my $pe;
-
 
398
        if ($currentPkgTag && ($_ eq '.'))
-
 
399
        {
-
 
400
            if (exists $packages{$currentPkgTag})
-
 
401
            {
-
 
402
                $pe = $packages{$currentPkgTag}; 
-
 
403
            }
-
 
404
        }
-
 
405
        unless ($pe) {
-
 
406
            foreach my $pkg (keys %packages)
-
 
407
            {
-
 
408
                my $entry = $packages{$pkg};
-
 
409
                if ($entry->{dname} eq $_ || $entry->{fname} eq $_ )
-
 
410
                {
-
 
411
                    $pe = $entry;
-
 
412
                    last;
-
 
413
                }
-
 
414
            }
-
 
415
        }
-
 
416
        
-
 
417
        unless ($pe) {
-
 
418
            Warning("No package found matching: $_");
-
 
419
            next;
-
 
420
        }
-
 
421
        
-
 
422
        my $errorFile;
-
 
423
        if ($machine) {
-
 
424
            $errorFile = catdir($GBE_SANDBOX, 'sandbox_dpkg_archive', '_error.' . $GBE_MACHTYPE . '.' . $pe->{dname});
-
 
425
        } else {
-
 
426
            $errorFile = catdir($GBE_SANDBOX, 'sandbox_dpkg_archive', '_error.'. $pe->{dname});
-
 
427
        }
-
 
428
        Verbose("ErrorFile: $errorFile");
-
 
429
        if ($mode)
-
 
430
        {
-
 
431
            unlink $errorFile;
-
 
432
        }
-
 
433
        else
-
 
434
        {
-
 
435
            TouchFile($errorFile);
-
 
436
        }
-
 
437
    }
-
 
438
    exit 0;
-
 
439
}
-
 
440
 
-
 
441
#-------------------------------------------------------------------------------
334
# Function        : info
442
# Function        : info
335
#
443
#
336
# Description     : Display Sandbox information
444
# Description     : Display Sandbox information
337
#
445
#
338
# Inputs          : Command line args
446
# Inputs          : Command line args
Line 378... Line 486...
378
 
486
 
379
    if ($showOrder)
487
    if ($showOrder)
380
    {
488
    {
381
        Message ("Build Order");
489
        Message ("Build Order");
382
        foreach my $pname ( @stopped ) {
490
        foreach my $pname ( @stopped ) {
383
            Message( "    Level:" . "--"  . " [---] Name: " . $pname . ' (Stopped)');
491
            Message( "    Level:" . "--"  . " [----] Name: " . $pname . ' (Stopped)');
384
        }
492
        }
385
 
493
 
386
        foreach my $fe ( @build_order )
494
        foreach my $fe ( @build_order )
387
        {
495
        {
388
            displayHeader($fe, { indent => '    ', testFingerPrint =>  $showFingerPrint, showSimplePath => $showPath });
496
            displayHeader($fe, { indent => '    ', testFingerPrint =>  $showFingerPrint, showSimplePath => $showPath });
Line 604... Line 712...
604
    #
712
    #
605
    #   Process all packages in the sandbox
713
    #   Process all packages in the sandbox
606
    #
714
    #
607
    foreach my $linkFile ( glob "$GBE_DPKG_SBOX/*/*.lnk")
715
    foreach my $linkFile ( glob "$GBE_DPKG_SBOX/*/*.lnk")
608
    {
716
    {
609
        my $pkg = TagFileRead($linkFile);
717
        my $pkg = getPackageLink( TagFileRead($linkFile) );
610
 
-
 
611
        $pkg =~ s~\\~/~g;
-
 
612
        if ($pkg =~ s~^GBE_SANDBOX/~$GBE_SANDBOX/~)
-
 
613
        {
-
 
614
                # If the target sandbox is in the 'deploymode' then the package
-
 
615
                # will not be in the expected location. It will be in a 'build/deploy'
-
 
616
                # subdir. Remove the pkg/name dir to get to the root of the package
-
 
617
                my @dirs = File::Spec->splitdir( $pkg );
-
 
618
                splice(@dirs, -2);
-
 
619
                my $deployBox = catdir(@dirs, 'build', 'deploy');
-
 
620
                $pkg = $deployBox if ( -d $deployBox);
-
 
621
        }
-
 
622
 
-
 
623
        unless ( -d $pkg )
718
        unless ( -d $pkg )
624
        {
719
        {
625
            if ($opt_delete)
720
            if ($opt_delete)
626
            {
721
            {
627
                Message ("Delete: $linkFile");
722
                Message ("Delete: $linkFile");
Line 637... Line 732...
637
    
732
    
638
    exit (0);
733
    exit (0);
639
}
734
}
640
 
735
 
641
#-------------------------------------------------------------------------------
736
#-------------------------------------------------------------------------------
-
 
737
# Function        : getPackageLink 
-
 
738
#
-
 
739
# Description     : Read a package link file and process the data to generate 
-
 
740
#                   the link to the package
-
 
741
#
-
 
742
# Inputs          : $linkFile   - File that contains the link
-
 
743
#
-
 
744
# Returns         : The resolved link
-
 
745
#
-
 
746
sub getPackageLink
-
 
747
{
-
 
748
    my ($linkFile) = @_;
-
 
749
    my $pkg = TagFileRead($linkFile);
-
 
750
    $pkg =~ s~\\~/~g;
-
 
751
    if ($pkg =~ s~^GBE_SANDBOX/~$GBE_SANDBOX/~)
-
 
752
    {
-
 
753
            # If the target sandbox is in the 'deploymode' then the package
-
 
754
            # will not be in the expected location. It will be in a 'build/deploy'
-
 
755
            # subdir. Remove the pkg/name dir to get to the root of the package
-
 
756
            my @dirs = File::Spec->splitdir( $pkg );
-
 
757
            splice(@dirs, -2);
-
 
758
            my $deployBox = catdir(@dirs, 'build', 'deploy');
-
 
759
            $pkg = $deployBox if ( -d $deployBox);
-
 
760
    }
-
 
761
 
-
 
762
    return $pkg;
-
 
763
}
-
 
764
 
-
 
765
 
-
 
766
#-------------------------------------------------------------------------------
642
# Function        : setScanDepth 
767
# Function        : setScanDepth 
643
#
768
#
644
# Description     : Set the depth of the build file scan usd in this sandbox 
769
# Description     : Set the depth of the build file scan usd in this sandbox 
645
#
770
#
646
# Inputs          : Command line arguments
771
# Inputs          : Command line arguments
Line 730... Line 855...
730
    #   Look in each package archive directory
855
    #   Look in each package archive directory
731
    #
856
    #
732
    foreach my $dpkg ( $GBE_DPKG_SBOX,
857
    foreach my $dpkg ( $GBE_DPKG_SBOX,
733
                       $GBE_DPKG_LOCAL,
858
                       $GBE_DPKG_LOCAL,
734
                       $GBE_DPKG_CACHE,
859
                       $GBE_DPKG_CACHE,
-
 
860
                       $GBE_DPKG_ESCROW,
-
 
861
                       '--NotEscrow',
735
                       $GBE_DPKG_REPLICA,
862
                       $GBE_DPKG_REPLICA,
736
                       $GBE_DPKG,
863
                       $GBE_DPKG,
737
                       $GBE_DPLY,
864
                       $GBE_DPLY,
738
                       $GBE_DPKG_STORE )
865
                       $GBE_DPKG_STORE )
739
    {
866
    {
740
        next unless ( $dpkg );
867
        next unless ( $dpkg );
741
        if ( -d "$dpkg/$name/$ver" )
868
        if ( $dpkg eq '--NotEscrow' )
742
        {
869
        {
-
 
870
            last if ($GBE_DPKG_ESCROW);
743
            return 1;
871
            next;
744
        }
872
        }
745
    }
873
    }
746
   return 0;
874
   return 0;
747
}
875
}
748
 
876
 
Line 753... Line 881...
753
#                   Skip the make process if a package with a matching signature 
881
#                   Skip the make process if a package with a matching signature 
754
#                   can be found. ie: We have a pre-built version
882
#                   can be found. ie: We have a pre-built version
755
#                   
883
#                   
756
# Inputs          : $fe     - Package Entry
884
# Inputs          : $fe     - Package Entry
757
#
885
#
-
 
886
# Returns         : Two items
758
# Returns         : True - Prebuilt package found
887
#                   Found       - True - Prebuilt package found
759
#                   False - Prebuild package not found
888
#                               - False - Prebuild package not found
-
 
889
#                   Signature   - Package Signature
-
 
890
#                                 Undef if not found     
760
#
891
#
761
sub locatePreBuiltPackage
892
sub locatePreBuiltPackage
762
{
893
{
763
    my ($fe) = @_;
894
    my ($fe) = @_;
764
 
895
 
765
    #
896
    #
766
    #   Get the package signature
897
    #   Get the package signature
767
    #   This is held in the packages interface directory
-
 
768
    #
898
    #
769
    my $ifaceDir = getpkgInterface($fe);
899
    my $pkgSig = getPackageSignature($fe);
770
    return 0 unless $ifaceDir;
-
 
771
 
-
 
772
    my $sigFile = catdir($ifaceDir, 'Package.sig');
-
 
773
    return 0 unless -f $sigFile;
900
    return (0, undef) unless $pkgSig;
774
 
-
 
775
    my $pkgSig = TagFileRead($sigFile);
-
 
776
 
901
 
777
    #
902
    #
778
    #   Look in each package archive directory
903
    #   Look in each package archive directory
779
    #   
904
    #   
780
    foreach my $dpkg ( $GBE_DPKG_SBOX,
905
    foreach my $dpkg ( $GBE_DPKG_SBOX,
Line 787... Line 912...
787
    {
912
    {
788
        my $pkgDir = catdir( $dpkg, $fe->{mname}, $pkgSig);
913
        my $pkgDir = catdir( $dpkg, $fe->{mname}, $pkgSig);
789
        if (-d $pkgDir )
914
        if (-d $pkgDir )
790
        {
915
        {
791
            Debug("Prebuilt Package found: $pkgSig");
916
            Debug("Prebuilt Package found: $pkgSig");
792
            return 1;
917
            return (1, $pkgSig);
793
        }
918
        }
794
    }
919
    }
795
    return 0;
920
    return (0, $pkgSig);
-
 
921
}
-
 
922
 
-
 
923
 
-
 
924
#-------------------------------------------------------------------------------
-
 
925
# Function        : getPackageSignature
-
 
926
#
-
 
927
# Description     : Determine if we have calculated the package signature
-
 
928
#                   
-
 
929
# Inputs          : $fe     - Package Entry
-
 
930
#
-
 
931
# Returns         : Package signature
-
 
932
#                   undef if not found
-
 
933
#
-
 
934
sub getPackageSignature
-
 
935
{
-
 
936
    my ($fe) = @_;
-
 
937
 
-
 
938
    #
-
 
939
    #   Get the package signature
-
 
940
    #   This is held in the packages interface directory
-
 
941
    #
-
 
942
    my $ifaceDir = getpkgInterface($fe);
-
 
943
    return 0 unless $ifaceDir;
-
 
944
 
-
 
945
    my $sigFile = catdir($ifaceDir, 'Package.sig');
-
 
946
    return 0 unless -f $sigFile;
-
 
947
 
-
 
948
    return TagFileRead($sigFile);
-
 
949
 
796
}
950
}
797
 
951
 
798
#-------------------------------------------------------------------------------
952
#-------------------------------------------------------------------------------
799
# Function        : getpkgInterface 
953
# Function        : getpkgInterface 
800
#
954
#
Line 831... Line 985...
831
#                   Operation will be modified by
985
#                   Operation will be modified by
832
#                       $opt_toPackage
986
#                       $opt_toPackage
833
#                       $opt_fromPackage
987
#                       $opt_fromPackage
834
#                       @opt_justPackage
988
#                       @opt_justPackage
835
#                       @opt_ignorePackage
989
#                       @opt_ignorePackage
-
 
990
#                       $opt_onlyLevel
836
#
991
#
837
# Inputs          : quiet       undef - noisy
992
# Inputs          : quiet       undef - noisy
838
#                               1 - quiet           
993
#                               1 - quiet           
839
#
994
#
840
# Returns         : Will exit if not in a sandbox
995
# Returns         : Will exit if not in a sandbox
Line 1168... Line 1323...
1168
                Warning("Package marked for skip: $fe->{dname}, $fe->{dir}") unless $quiet;
1323
                Warning("Package marked for skip: $fe->{dname}, $fe->{dir}") unless $quiet;
1169
                $scan_add = 0;
1324
                $scan_add = 0;
1170
                $fe->{buildSkip} = 1;
1325
                $fe->{buildSkip} = 1;
1171
            }
1326
            }
1172
 
1327
 
-
 
1328
            #
-
 
1329
            #   Test for a build error marker
-
 
1330
            #
-
 
1331
            my $errorFile = catdir($GBE_SANDBOX, 'sandbox_dpkg_archive', '_error.'. $fe->{dname});
-
 
1332
            my $errorMachFile = catdir($GBE_SANDBOX, 'sandbox_dpkg_archive', '_error.' . $GBE_MACHTYPE . '.' . $fe->{dname});
-
 
1333
            if ( -f $errorFile || -f $errorMachFile )
-
 
1334
            {
-
 
1335
                Warning("Package marked as error: $fe->{dname}, $fe->{dir}") unless $quiet;
-
 
1336
                $fe->{buildError} = 1;
-
 
1337
            }
-
 
1338
 
-
 
1339
            #
-
 
1340
            #   Select one level
-
 
1341
            #
-
 
1342
            if ($opt_onlyLevel && $opt_onlyLevel != $level) {
-
 
1343
                $scan_add = 0;
-
 
1344
            }
-
 
1345
 
1173
            $fe->{level} = $level;
1346
            $fe->{level} = $level;
1174
            $fe->{buildActive} = $scan_add;
1347
            $fe->{buildActive} = $scan_add;
1175
            $packages{$build} = $fe;
1348
            $packages{$build} = $fe;
1176
            push (@build_order, $fe);
1349
            push (@build_order, $fe);
1177
            delete $depends{$build};
1350
            delete $depends{$build};
Line 1257... Line 1430...
1257
            push @{$packages{$itag}{usedBy}}, $fe->{tag};
1430
            push @{$packages{$itag}{usedBy}}, $fe->{tag};
1258
        }
1431
        }
1259
    }
1432
    }
1260
 
1433
 
1261
    #
1434
    #
-
 
1435
    #   Now have a full dependency list AND full usage list
-
 
1436
    #   Locate packages that have a buildError and mark the consumers
-
 
1437
    #   as have a dependency on an package in error
-
 
1438
    #
-
 
1439
    foreach my $fe ( @build_order )
-
 
1440
    {
-
 
1441
        if ($fe->{buildError} && exists($fe->{'usedBy'}))
-
 
1442
        {
-
 
1443
            foreach my $entry (@{$fe->{'usedBy'}}) {
-
 
1444
                push @{$packages{$entry}{buildExclude}}, $fe->{tag};
-
 
1445
            }
-
 
1446
        }
-
 
1447
    }
-
 
1448
 
-
 
1449
    #
1262
    #   If the CWD is within a package then limit the build to that package and
1450
    #   If the CWD is within a package then limit the build to that package and
1263
    #   its dependents, unless user specifies entire sandbox.
1451
    #   its dependents, unless user specifies entire sandbox.
1264
    #   
1452
    #   
1265
    if ($currentPkgTag && ! $opt_allSandbox )
1453
    if ($currentPkgTag && ! $opt_allSandbox )
1266
    {
1454
    {
Line 1339... Line 1527...
1339
#   DebugDumpData ("Order", \@build_order);
1527
#   DebugDumpData ("Order", \@build_order);
1340
#   DebugDumpData("External Depends", \%extern_deps );
1528
#   DebugDumpData("External Depends", \%extern_deps );
1341
}
1529
}
1342
 
1530
 
1343
#-------------------------------------------------------------------------------
1531
#-------------------------------------------------------------------------------
-
 
1532
# Function        : writeBuildData 
-
 
1533
#
-
 
1534
# Description     : 
-
 
1535
#
-
 
1536
# Inputs          : Command line arguments 
-
 
1537
#
-
 
1538
# Returns         : 
-
 
1539
#
-
 
1540
sub writeBuildData
-
 
1541
{
-
 
1542
    my (@cmd_opts ) = @_;
-
 
1543
    my $opt_outfile;
-
 
1544
 
-
 
1545
    Getopt::Long::Configure('pass_through');
-
 
1546
    getOptionsFromArray ( \@cmd_opts,
-
 
1547
                           'outfile=s'  => \$opt_outfile,
-
 
1548
                          ) || Error ("Invalid command line" );
-
 
1549
    SubCommandHelp( $opt_help, 'Write Build Data') if ($opt_help  );
-
 
1550
 
-
 
1551
    #
-
 
1552
    #   Calculate sandbox info
-
 
1553
    #   All data written will be based on this information
-
 
1554
    #
-
 
1555
    calc_sandbox_info(1);
-
 
1556
    calc_signature_info();
-
 
1557
 
-
 
1558
    #
-
 
1559
    #   Generate build data
-
 
1560
    #   Consists of a few sections
-
 
1561
    #       BuildPlan   - Package names to be built, in order
-
 
1562
    #                     In practice only the first can be built
-
 
1563
    #                     the others can be used as an indication of builds to be performed
-
 
1564
    #                     
-
 
1565
    #   
-
 
1566
    my %BuildData;
-
 
1567
    my @BuildPlan = ();
-
 
1568
    my @BuildEntry;
-
 
1569
 
-
 
1570
    foreach my $fe ( @build_order ) {
-
 
1571
        next if $fe->{buildError};
-
 
1572
        next if $fe->{buildExclude};
-
 
1573
        next if $fe->{buildSkip};
-
 
1574
        next unless $fe->{buildActive};
-
 
1575
        next if $fe->{si} eq 1;
-
 
1576
 
-
 
1577
        push @BuildPlan, $fe->{fname};
-
 
1578
        push @BuildEntry, $fe;
-
 
1579
    }
-
 
1580
 
-
 
1581
    push @{$BuildData{BuildPlan}}, @BuildPlan;
-
 
1582
 
-
 
1583
    #
-
 
1584
    #   Add information on the first item
-
 
1585
    #   This is the package that will be built so we need more information
-
 
1586
    #
-
 
1587
    my $BuildPkg = $BuildEntry[0];
-
 
1588
    my $pkgData;
-
 
1589
    if ($BuildPkg)
-
 
1590
    {
-
 
1591
        $pkgData->{fname} = $BuildPkg->{fname};
-
 
1592
        $pkgData->{dname} = $BuildPkg->{dname};
-
 
1593
        $pkgData->{dir} = $BuildPkg->{dir};
-
 
1594
        $pkgData->{name} = $BuildPkg->{name};
-
 
1595
        $pkgData->{version} = $BuildPkg->{version};
-
 
1596
        $pkgData->{prj} = $BuildPkg->{prj};
-
 
1597
        $pkgData->{signature} = $BuildPkg->{signature};
-
 
1598
    }
-
 
1599
 
-
 
1600
    $BuildData{BuildPkgData} = $pkgData;
-
 
1601
    $BuildData{BuildPkg} = $BuildPkg->{fname};
-
 
1602
 
-
 
1603
#DebugDumpData("data", $BuildPkg);
-
 
1604
 
-
 
1605
    print( to_json( \%BuildData, { ascii => 1, pretty => 1 }) . "\n");
-
 
1606
#    DebugDumpData("BuildData",\%BuildData);
-
 
1607
    #
-
 
1608
    #   All done
-
 
1609
    #
-
 
1610
    exit(0);
-
 
1611
}
-
 
1612
 
-
 
1613
#-------------------------------------------------------------------------------
-
 
1614
# Function        : calc_signature_info 
-
 
1615
#
-
 
1616
# Description     : Calculate signature information for all packages in the sandbox
-
 
1617
#                   Used to create build system information 
-
 
1618
#
-
 
1619
# Inputs          : Nothing 
-
 
1620
#
-
 
1621
# Returns         : Updates global data structures
-
 
1622
#                   The %packages item {si} will be set to one of:
-
 
1623
#                       1 - Have a prebuild package
-
 
1624
#                       2 - Have generated a signature, but do not have a prebuilt package
-
 
1625
#                       3 - Error generating the signature
-
 
1626
#                       4 - Excluded - Dependent package has no signature
-
 
1627
#                       5 - Excluded - Packages skipped or not active 
-
 
1628
#
-
 
1629
sub calc_signature_info
-
 
1630
{
-
 
1631
    foreach my $fe ( @build_order )
-
 
1632
    {
-
 
1633
        next if (exists $fe->{si});
-
 
1634
        if ( !$fe->{buildActive} || $fe->{buildSkip} ) {
-
 
1635
            $fe->{si} = 5;
-
 
1636
            next;
-
 
1637
        }
-
 
1638
 
-
 
1639
        #
-
 
1640
        #   If this package has a signature file then we don't need to re-create it
-
 
1641
        #
-
 
1642
        my $result = 0;
-
 
1643
        my ($preBuilt, $haveSignature) = locatePreBuiltPackage($fe);
-
 
1644
        unless ($haveSignature) {
-
 
1645
            my $dir = $fe->{dir};
-
 
1646
            $result = JatsCmd( "-cd=$dir", 'build', 'signature');
-
 
1647
            }
-
 
1648
 
-
 
1649
        unless ($result) {
-
 
1650
            #
-
 
1651
            #   Signature generated OK
-
 
1652
            #
-
 
1653
            ($preBuilt, $haveSignature) = locatePreBuiltPackage($fe);
-
 
1654
            if ($preBuilt) {
-
 
1655
                $fe->{si} = 1;
-
 
1656
                $fe->{signature} = $haveSignature;
-
 
1657
            } elsif ($haveSignature) {
-
 
1658
                $fe->{si} = 2;
-
 
1659
                $fe->{signature} = $haveSignature;
-
 
1660
            } else {
-
 
1661
                $result = 1;
-
 
1662
            }
-
 
1663
        }
-
 
1664
 
-
 
1665
        #
-
 
1666
        #   Error creating the signature
-
 
1667
        #   Mark this package and all those that depend on it
-
 
1668
        #   
-
 
1669
        if ($result) {
-
 
1670
            $fe->{si} = 3;
-
 
1671
            if ( exists($fe->{'usedBy'}))
-
 
1672
            {
-
 
1673
                foreach my $entry (@{$fe->{'usedBy'}}) {
-
 
1674
                    my $pe = $packages{$entry};
-
 
1675
                    $pe->{si} = 4; 
-
 
1676
                }
-
 
1677
            }
-
 
1678
        }
-
 
1679
    }
-
 
1680
}
-
 
1681
 
-
 
1682
#-------------------------------------------------------------------------------
1344
# Function        : calc_rootFingerPrint 
1683
# Function        : calc_rootFingerPrint 
1345
#
1684
#
1346
# Description     : Calculate a finger print of all the directories in the
1685
# Description     : Calculate a finger print of all the directories in the
1347
#                   sandbox root.
1686
#                   sandbox root.
1348
#                   
1687
#                   
Line 1493... Line 1832...
1493
        my $active = displayHeader($fe, { showPath => 1 });
1832
        my $active = displayHeader($fe, { showPath => 1 });
1494
        if ($active) {
1833
        if ($active) {
1495
 
1834
 
1496
            #
1835
            #
1497
            #   Determine build success tag file
1836
            #   Determine build success tag file
1498
            #   If the tag file exists, then see if any files in the files in the package source are more
1837
            #   If the tag file exists, then see if any files in the package source are more
1499
            #   recent than the tag file
1838
            #   recent than the tag file
1500
            #
1839
            #
1501
            my $mustBuild = 1;
1840
            my $mustBuild = 1;
1502
            my $sigMatch = 0;
1841
            my $sigMatch = 0;
1503
            my $tagFile = getPkgFingerPrintFile($fe);
1842
            my $tagFile = getPkgFingerPrintFile($fe);
Line 2228... Line 2567...
2228
        'entireSandBox!'    => \$opt_allSandbox,
2567
        'entireSandBox!'    => \$opt_allSandbox,
2229
        'users!'            => \$opt_processUsedBy,
2568
        'users!'            => \$opt_processUsedBy,
2230
        'keepgoing!'        => \$opt_keepgoing,
2569
        'keepgoing!'        => \$opt_keepgoing,
2231
        'rescan!'           => \$opt_reScan,
2570
        'rescan!'           => \$opt_reScan,
2232
        'multiBuilders:s'   => $parseMulti, 
2571
        'multiBuilders:s'   => $parseMulti, 
-
 
2572
        'onlylevel:i'       => \$opt_onlyLevel,
2233
        );
2573
        );
2234
 
2574
 
2235
    #
2575
    #
2236
    #   Merge in the user options
2576
    #   Merge in the user options
2237
    #
2577
    #
Line 2258... Line 2598...
2258
#                       showPath        => Bool
2598
#                       showPath        => Bool
2259
#                       showSimplePath  => Bool
2599
#                       showSimplePath  => Bool
2260
#                       testFingerPrint => Bool
2600
#                       testFingerPrint => Bool
2261
#
2601
#
2262
# Returns         : True if this entry is to be fully process
2602
# Returns         : True if this entry is to be fully process
2263
#                   False if its being skipped 
2603
#                   False if its being skipped
-
 
2604
#                   
-
 
2605
#                   The entry may be have a buildError or a buildExclude
-
 
2606
#                   and still be active
2264
#
2607
#
2265
sub displayHeader
2608
sub displayHeader
2266
{
2609
{
2267
    my $fe = shift @_;
2610
    my $fe = shift @_;
2268
    if ($fe->{buildActive} || $fe->{buildSkip})
2611
    if ($fe->{buildActive} || $fe->{buildSkip})
Line 2297... Line 2640...
2297
#-------------------------------------------------------------------------------
2640
#-------------------------------------------------------------------------------
2298
# Function        : addBuildInfo 
2641
# Function        : addBuildInfo 
2299
#
2642
#
2300
# Description     : Add some build info status
2643
# Description     : Add some build info status
2301
#                   It will have a .sig file if its been sucessfully built
2644
#                   It will have a .sig file if its been sucessfully built
-
 
2645
#                   
-
 
2646
#                   StatusFlags
-
 
2647
#                   Position 1: S - Build Skipped, s - Build Suppressed
-
 
2648
#                   Position 2: Blank - Not processed  , - = NoBuild, B - Built * - Current package
-
 
2649
#                   Position 3: P - Prebuilt, L - Local, M - Both local and prebuilt
-
 
2650
#                   Position 4: G - Good Fingerprint, b - Bad Fingerprint
2302
#
2651
#
2303
# Inputs          : $fe     - Package info 
2652
# Inputs          : $fe     - Package info 
2304
#
2653
#
2305
# Returns         : True - sig file present
2654
# Returns         : StatusFlags
-
 
2655
#                   StatusText
2306
#
2656
#
2307
sub addBuildInfo
2657
sub addBuildInfo
2308
{
2658
{
2309
    my ($fe, $args) = @_;
2659
    my ($fe, $args) = @_;
2310
    my $txt = '';
2660
    my $txt = '';
2311
    my $statusB = ' ';
-
 
2312
    my $statusF = ' ';
-
 
2313
    my $statusS = ' ';
2661
    my $statusS = ' ';
-
 
2662
    my $statusB = ' ';
2314
    my $statusP = ' ';
2663
    my $statusP = ' ';
-
 
2664
    my $statusF = ' ';
2315
 
2665
 
2316
    unless ($fe->{buildActive}) {
2666
    unless ($fe->{buildActive}) {
2317
        $txt .= ($fe->{buildSkip}) ? ' (Build Skipped)' : ' (Build Suppressed)';
2667
        $txt .= ($fe->{buildSkip}) ? ' (Build Skipped)' : ' (Build Suppressed)';
2318
        $statusS = ($fe->{buildSkip}) ? 'S' : 's';
2668
        $statusS = ($fe->{buildSkip}) ? 'S' : 's';
2319
    }
2669
    }
2320
 
2670
 
-
 
2671
    if ($fe->{buildError} || $fe->{buildExclude} ) {
-
 
2672
        $txt .= ($fe->{buildError})   ? ' (Build Error)' : '';
-
 
2673
        $txt .= ($fe->{buildExclude}) ? ' (Build Excluded)' : '';
-
 
2674
        $statusS = ($fe->{buildError}) ? 'E' : 'e';
-
 
2675
    }
-
 
2676
 
-
 
2677
 
2321
    if ($fe->{buildCurrent})
2678
    if ($fe->{buildCurrent})
2322
    {
2679
    {
2323
        $statusB = '*';
2680
        $statusB = '*';
2324
        $txt .= ' (Current Package)';
2681
        $txt .= ' (Current Package)';
2325
    }
2682
    }
2326
 
2683
 
2327
    my $sigFile = getPkgFingerPrintFile($fe);
2684
    my $fpFile = getPkgFingerPrintFile($fe);
2328
    if (-f $sigFile)
2685
    if (-f $fpFile)
2329
    {
2686
    {
2330
        my $nobFile = $sigFile;
2687
        my $nobFile = $fpFile;
2331
        $nobFile =~ s~ffp$~nob~;
2688
        $nobFile =~ s~ffp$~nob~;
2332
        if (-f $nobFile) {
2689
        if (-f $nobFile) {
2333
            $txt .= ' [NoBuild]';
2690
            $txt .= ' [NoBuild]';
2334
            $statusB = '-';
2691
            $statusB = '-';
2335
        } else {
2692
        } else {
2336
            $txt .= ' [Built]';
2693
            $txt .= ' [Built]';
2337
            $statusB = 'B';
2694
            $statusB = 'B';
2338
        }
2695
        }
-
 
2696
    }
2339
 
2697
 
2340
        if ($args->{testFingerPrint})
2698
    if ($args->{testFingerPrint})
-
 
2699
    {
-
 
2700
        if ( TagFileMatch($fpFile, genPkgFingerPrint($fe, 'Test')) )
2341
        {
2701
        {
2342
            if ( TagFileMatch($sigFile, genPkgFingerPrint($fe, 'Test')) )
-
 
2343
            {
-
 
2344
                $txt .= ' [GoodFinger]';
2702
            $txt .= ' [GoodFinger]';
2345
                $statusF = 'G';
2703
            $statusF = 'G';
2346
            } else {
2704
        } else {
2347
                $txt .= ' [BadFinger]';
2705
            $txt .= ' [BadFinger]';
2348
                $statusF = 'b';
2706
            $statusF = 'b';
2349
            }
-
 
2350
        }
2707
        }
2351
    }
2708
    }
2352
 
2709
 
2353
    my $preBuilt = locatePreBuiltPackage($fe);
2710
    my ($preBuilt, $haveSignature) = locatePreBuiltPackage($fe);
-
 
2711
    if ($haveSignature) {
-
 
2712
        $txt .= ' [SigCalc]';
-
 
2713
        $statusP = 's';
-
 
2714
    }
2354
    if ($preBuilt) {
2715
    if ($preBuilt) {
2355
        $txt .= ' [PreBuilt]';
2716
        $txt .= ' [PreBuilt]';
2356
        $statusP = 'P';
2717
        $statusP = 'P';
2357
    } 
2718
    }
-
 
2719
    
-
 
2720
    my $plink = catdir( $GBE_DPKG_SBOX, $fe->{name}, 'sandbox.' . $fe->{prj} . '.lnk' );
-
 
2721
    my $linkTarget = getPackageLink ($plink);
-
 
2722
    Verbose ("Sandbox link: $plink -> $linkTarget");
-
 
2723
    if (-d $linkTarget) {
-
 
2724
        $txt .= ' [Local]';
-
 
2725
        if ($preBuilt) {
-
 
2726
            $statusP = 'M';
-
 
2727
        } else {
-
 
2728
            $statusP = 'L';
-
 
2729
        }
-
 
2730
    }
2358
 
2731
 
2359
    return "$statusS$statusB$statusP$statusF", $txt ;
2732
    return "$statusS$statusB$statusP$statusF", $txt ;
2360
 
-
 
2361
}
2733
}
2362
 
2734
 
2363
#-------------------------------------------------------------------------------
2735
#-------------------------------------------------------------------------------
2364
# Function        : opts_add2List
2736
# Function        : opts_add2List
2365
#
2737
#
Line 2638... Line 3010...
2638
    -help[=n]                  - Display help with specified detail
3010
    -help[=n]                  - Display help with specified detail
2639
    -help -help                - Detailed help message
3011
    -help -help                - Detailed help message
2640
    -man                       - Full documentation
3012
    -man                       - Full documentation
2641
 
3013
 
2642
 Options for recursion control:
3014
 Options for recursion control:
-
 
3015
    -onlyLevel=number          - Limit building to one level
2643
    -toPackage=name            - Stop building after package
3016
    -toPackage=name            - Stop building after package
2644
    -fromPackage=name          - Start building from package
3017
    -fromPackage=name          - Start building from package
2645
    -justPackage=name[,name]   - Build named packages
3018
    -justPackage=name[,name]   - Build named packages
2646
    -ignorePackage=name[,name] - Do not build named packages
3019
    -ignorePackage=name[,name] - Do not build named packages
2647
    -entireSandbox             - Process the entire sandbox
3020
    -entireSandbox             - Process the entire sandbox
Line 2657... Line 3030...
2657
    populate            - Populate the sandbox with packages
3030
    populate            - Populate the sandbox with packages
2658
    delete              - Delete the sandbox
3031
    delete              - Delete the sandbox
2659
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
3032
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
2660
    buildfilter         - Modify and display sandbox buildfilter
3033
    buildfilter         - Modify and display sandbox buildfilter
2661
    [un]skip            - Mark a package to be skipped during the build
3034
    [un]skip            - Mark a package to be skipped during the build
-
 
3035
    [un]error           - Mark a package as having build errors
2662
    fingerprint         - Various fingerprint operations
3036
    fingerprint         - Various fingerprint operations
2663
    testlinks           - Test / Delete broken package symlinks
3037
    testlinks           - Test / Delete broken package symlinks
2664
    scandepth           - Set/Display the build file scan depth
3038
    scandepth           - Set/Display the build file scan depth
2665
    cmd                 - Do commands in all sandbox components
3039
    cmd                 - Do commands in all sandbox components
2666
    all                 - Do 'build', if required, then a make in all components
3040
    all                 - Do 'build', if required, then a make in all components
2667
    build               - Force 'build and make' in all sandbox components
3041
    build               - Force 'build and make' in all sandbox components
2668
    make                - Do 'make' in all sandbox components
3042
    make                - Do 'make' in all sandbox components
2669
    clean               - Do 'make clean' in all sandbox components
3043
    clean               - Do 'make clean' in all sandbox components
2670
    clobber             - Do 'build clobber' is all sandbox components
3044
    clobber             - Do 'build clobber' is all sandbox components
2671
    cache               - Cache external dependent packages
3045
    cache               - Cache external dependent packages
-
 
3046
    writeBuildData      - Write out build data
2672
 
3047
 
2673
 Use the command
3048
 Use the command
2674
    jats sandbox 'command' -h
3049
    jats sandbox 'command' -h
2675
 for command specific help
3050
 for command specific help
2676
 
3051
 
Line 2705... Line 3080...
2705
 
3080
 
2706
=item B<-man>
3081
=item B<-man>
2707
 
3082
 
2708
Prints the manual page and exits. This is the same a -help=3
3083
Prints the manual page and exits. This is the same a -help=3
2709
 
3084
 
-
 
3085
=item B<-onlyLevel=number>
-
 
3086
 
-
 
3087
This option is available in all commands that process multiple packages.
-
 
3088
Package processing will be limited to the specified level. 
-
 
3089
 
-
 
3090
This can be used to perform a multi-machine build. Level-1 builds are performed 
-
 
3091
on all machines and the results merged into the common package store, then Level-2 builds 
-
 
3092
are performed on all machines.
-
 
3093
 
-
 
3094
Level-1 packages have no dependencies.
-
 
3095
 
-
 
3096
Level-2 packages only have dependancies on Level-1 packages
-
 
3097
 
-
 
3098
Level-N packages only have dependancies on packages below Level N-1
-
 
3099
 
2710
=item B<-toPackage=name>
3100
=item B<-toPackage=name>
2711
 
3101
 
2712
This option is available in all commands that process multiple packages.
3102
This option is available in all commands that process multiple packages.
2713
Package processing will stop at the named package.
3103
Package processing will stop at the named package.
2714
 
3104
 
Line 2864... Line 3254...
2864
 
3254
 
2865
Remaining lines are joined together to form a buildfilter
3255
Remaining lines are joined together to form a buildfilter
2866
 
3256
 
2867
=back
3257
=back
2868
 
3258
 
-
 
3259
=for comment ==================================================================
-
 
3260
 
2869
=head1 Create Sandbox
3261
=head1 Create Sandbox
2870
 
3262
 
2871
=head2 NAME
3263
=head2 NAME
2872
 
3264
 
2873
Create Sandbox
3265
Create Sandbox
Line 2893... Line 3285...
2893
 
3285
 
2894
The create command simply places a known directory in the current directory.
3286
The create command simply places a known directory in the current directory.
2895
This directory is used by the sandboxing process. It may be manually deleted, or
3287
This directory is used by the sandboxing process. It may be manually deleted, or
2896
deleted with the 'delete' command.
3288
deleted with the 'delete' command.
2897
 
3289
 
-
 
3290
=for comment ==================================================================
-
 
3291
 
2898
=head1 Populate Sandbox
3292
=head1 Populate Sandbox
2899
 
3293
 
2900
=head2 NAME
3294
=head2 NAME
2901
 
3295
 
2902
Populate a Sandbox
3296
Populate a Sandbox
Line 2905... Line 3299...
2905
 
3299
 
2906
jats sandbox populate [command options] [packageName packageVersion]
3300
jats sandbox populate [command options] [packageName packageVersion]
2907
 
3301
 
2908
 Common Options:
3302
 Common Options:
2909
    -help[=n], -man            - Command specific help, [n=1,2,3]
3303
    -help[=n], -man            - Command specific help, [n=1,2,3]
-
 
3304
    -onlyLevel=number          - Limit building to one level
2910
    -toPackage=name            - Stop building after package
3305
    -toPackage=name            - Stop building after package
2911
    -fromPackage=name          - Start building from package
3306
    -fromPackage=name          - Start building from package
2912
    -justPackage=name[,name]   - Build named packages
3307
    -justPackage=name[,name]   - Build named packages
2913
    -ignorePackage=name[,name] - Do not build named packages
3308
    -ignorePackage=name[,name] - Do not build named packages
2914
    -entireSandbox             - Process the entire sandbox
3309
    -entireSandbox             - Process the entire sandbox
Line 3087... Line 3482...
3087
packages that are required to build the packages in the sandbox. It will not
3482
packages that are required to build the packages in the sandbox. It will not
3088
examine the dependents of these packages.
3483
examine the dependents of these packages.
3089
 
3484
 
3090
=back
3485
=back
3091
 
3486
 
-
 
3487
=for comment ==================================================================
-
 
3488
 
3092
=head1 Delete Sandbox
3489
=head1 Delete Sandbox
3093
 
3490
 
3094
=head2 NAME
3491
=head2 NAME
3095
 
3492
 
3096
Delete a sandbox
3493
Delete a sandbox
Line 3110... Line 3507...
3110
be executed anywhere within the sandbox.
3507
be executed anywhere within the sandbox.
3111
 
3508
 
3112
Once the sandbox has been deleted, the user must remove the components within the
3509
Once the sandbox has been deleted, the user must remove the components within the
3113
sandbox.
3510
sandbox.
3114
 
3511
 
-
 
3512
=for comment ==================================================================
-
 
3513
 
3115
=head1 Sandbox Information
3514
=head1 Sandbox Information
3116
 
3515
 
3117
=head2 NAME
3516
=head2 NAME
3118
 
3517
 
3119
Display Sandbox Information
3518
Display Sandbox Information
Line 3122... Line 3521...
3122
 
3521
 
3123
jats sandbox info [command options]
3522
jats sandbox info [command options]
3124
 
3523
 
3125
 Common Options:
3524
 Common Options:
3126
    -help[=n], -man            - Command specific help, [n=1,2,3]
3525
    -help[=n], -man            - Command specific help, [n=1,2,3]
-
 
3526
    -onlyLevel=number          - Limit building to one level
3127
    -toPackage=name            - Stop building after package
3527
    -toPackage=name            - Stop building after package
3128
    -fromPackage=name          - Start building from package
3528
    -fromPackage=name          - Start building from package
3129
    -justPackage=name[,name]   - Build named packages
3529
    -justPackage=name[,name]   - Build named packages
3130
    -ignorePackage=name[,name] - Do not build named packages
3530
    -ignorePackage=name[,name] - Do not build named packages
3131
    -entireSandbox             - Process the entire sandbox
3531
    -entireSandbox             - Process the entire sandbox
Line 3235... Line 3635...
3235
This should be considered a debug option. Undocumented internal information will
3635
This should be considered a debug option. Undocumented internal information will
3236
be displayed.
3636
be displayed.
3237
 
3637
 
3238
=back
3638
=back
3239
 
3639
 
-
 
3640
=for comment ==================================================================
-
 
3641
 
3240
=head1 Buildfilter
3642
=head1 Buildfilter
3241
 
3643
 
3242
=head2 NAME
3644
=head2 NAME
3243
 
3645
 
3244
Display and Modify Sandbox buildfilter
3646
Display and Modify Sandbox buildfilter
Line 3316... Line 3718...
3316
    jats sandbox buildfilter COBRA +PPC_603E
3718
    jats sandbox buildfilter COBRA +PPC_603E
3317
 or jats sandbox buildfilter COBRA PPC_603E
3719
 or jats sandbox buildfilter COBRA PPC_603E
3318
 
3720
 
3319
will set the buildfilter to be COBRA and PPC_603E
3721
will set the buildfilter to be COBRA and PPC_603E
3320
 
3722
 
-
 
3723
=for comment ==================================================================
-
 
3724
 
3321
=head1 Skip Build
3725
=head1 Skip Build
3322
 
3726
 
3323
=head2 NAME
3727
=head2 NAME
3324
 
3728
 
3325
Mark a package to be skipped during the build
3729
Mark a package to be skipped during the build
Line 3363... Line 3767...
3363
 
3767
 
3364
    jats sandbox skip package1 
3768
    jats sandbox skip package1 
3365
 
3769
 
3366
will mark package1 to be skipped during the following builds.
3770
will mark package1 to be skipped during the following builds.
3367
 
3771
 
-
 
3772
=for comment ==================================================================
-
 
3773
 
-
 
3774
=head1 Error Build
-
 
3775
 
-
 
3776
=head2 NAME
-
 
3777
 
-
 
3778
Mark a package as having a build error
-
 
3779
 
-
 
3780
=head2 SYNOPSIS
-
 
3781
 
-
 
3782
jats sandbox [un]error [command options] [PackageName]+
-
 
3783
 
-
 
3784
 Command Options
-
 
3785
    -help[=n]               - Command specific help, [n=1,2,3]
-
 
3786
    -man                    - Same as -help=3
-
 
3787
    -[no]machine            - Skip on on this type of machine
-
 
3788
 
-
 
3789
=head2 ARGUMENTS
-
 
3790
 
-
 
3791
Arguments to the 'error' command are the names of packages to be marked.
-
 
3792
 
-
 
3793
If no packages are named then the command will display all packages that are marked as errored.
-
 
3794
 
-
 
3795
If the named package is '.', then the current package will be marked.
-
 
3796
 
-
 
3797
=head2 OPTIONS
-
 
3798
 
-
 
3799
The 'error' command takes the following options:
-
 
3800
 
-
 
3801
=over 8
-
 
3802
 
-
 
3803
=item -[no]machine
-
 
3804
 
-
 
3805
This option will flag that the package will be skipped only on this type of build machine.
-
 
3806
 
-
 
3807
=back
-
 
3808
 
-
 
3809
=head2 DESCRIPTION
-
 
3810
 
-
 
3811
The 'error' command markes the named packages to as having build errors. These packages, and packages that
-
 
3812
they consume them will be excluded from any build consideration.
-
 
3813
 
-
 
3814
=head2 EXAMPLES
-
 
3815
 
-
 
3816
The command
-
 
3817
 
-
 
3818
    jats sandbox error package1 
-
 
3819
 
-
 
3820
will mark package1 as having a build error.
-
 
3821
 
-
 
3822
=for comment ==================================================================
-
 
3823
 
3368
=head1 Sandbox Finger Print
3824
=head1 Sandbox Finger Print
3369
 
3825
 
3370
=head2 NAME
3826
=head2 NAME
3371
 
3827
 
3372
Various fingerprint operations
3828
Various fingerprint operations
Line 3420... Line 3876...
3420
    jats sandbox fingerprint -generate
3876
    jats sandbox fingerprint -generate
3421
 
3877
 
3422
will regenerate the fingerprint of the current package. Useful after trivial edits to 
3878
will regenerate the fingerprint of the current package. Useful after trivial edits to 
3423
enable the sandbox builder to bypass the package and not to rebuild it and all of its dependents.
3879
enable the sandbox builder to bypass the package and not to rebuild it and all of its dependents.
3424
 
3880
 
-
 
3881
=for comment ==================================================================
-
 
3882
 
3425
=head1 Command all
3883
=head1 Command all
3426
 
3884
 
3427
=head2 NAME
3885
=head2 NAME
3428
 
3886
 
3429
Build packages in the sandbox
3887
Build packages in the sandbox
Line 3432... Line 3890...
3432
 
3890
 
3433
jats sandbox all [command options] [arguments]
3891
jats sandbox all [command options] [arguments]
3434
 
3892
 
3435
 Common Options:
3893
 Common Options:
3436
    -help[=n], -man            - Command specific help, [n=1,2,3]
3894
    -help[=n], -man            - Command specific help, [n=1,2,3]
-
 
3895
    -onlyLevel=number          - Limit building to one level
3437
    -toPackage=name            - Stop building after package
3896
    -toPackage=name            - Stop building after package
3438
    -fromPackage=name          - Start building from package
3897
    -fromPackage=name          - Start building from package
3439
    -justPackage=name[,name]   - Build named packages
3898
    -justPackage=name[,name]   - Build named packages
3440
    -ignorePackage=name[,name] - Do not build named packages
3899
    -ignorePackage=name[,name] - Do not build named packages
3441
    -entireSandbox             - Process the entire sandbox
3900
    -entireSandbox             - Process the entire sandbox
Line 3485... Line 3944...
3485
 
3944
 
3486
Resume a failed build.
3945
Resume a failed build.
3487
 
3946
 
3488
=back
3947
=back
3489
 
3948
 
-
 
3949
=for comment ==================================================================
-
 
3950
 
3490
=head1 Command build
3951
=head1 Command build
3491
 
3952
 
3492
=head2 NAME
3953
=head2 NAME
3493
 
3954
 
3494
Build packages in the sandbox
3955
Build packages in the sandbox
Line 3497... Line 3958...
3497
 
3958
 
3498
jats sandbox build [command options] [arguments]
3959
jats sandbox build [command options] [arguments]
3499
 
3960
 
3500
 Common Options:
3961
 Common Options:
3501
    -help[=n], -man            - Command specific help, [n=1,2,3]
3962
    -help[=n], -man            - Command specific help, [n=1,2,3]
-
 
3963
    -onlyLevel=number          - Limit building to one level
3502
    -toPackage=name            - Stop building after package
3964
    -toPackage=name            - Stop building after package
3503
    -fromPackage=name          - Start building from package
3965
    -fromPackage=name          - Start building from package
3504
    -justPackage=name[,name]   - Build named packages
3966
    -justPackage=name[,name]   - Build named packages
3505
    -ignorePackage=name[,name] - Do not build named packages
3967
    -ignorePackage=name[,name] - Do not build named packages
3506
    -entireSandbox             - Process the entire sandbox
3968
    -entireSandbox             - Process the entire sandbox
Line 3536... Line 3998...
3536
 
3998
 
3537
Any arguments are passed to the 'make' phase of the process.
3999
Any arguments are passed to the 'make' phase of the process.
3538
 
4000
 
3539
In practice, the 'sandbox all' command is quicker.
4001
In practice, the 'sandbox all' command is quicker.
3540
 
4002
 
-
 
4003
=for comment ==================================================================
-
 
4004
 
3541
=head1 Clean
4005
=head1 Clean
3542
 
4006
 
3543
=head2 NAME
4007
=head2 NAME
3544
 
4008
 
3545
Clean all sandbox components
4009
Clean all sandbox components
Line 3548... Line 4012...
3548
 
4012
 
3549
jats sandbox clean|clobber [command options]
4013
jats sandbox clean|clobber [command options]
3550
 
4014
 
3551
 Common Options:
4015
 Common Options:
3552
    -help[=n], -man            - Command specific help, [n=1,2,3]
4016
    -help[=n], -man            - Command specific help, [n=1,2,3]
-
 
4017
    -onlyLevel=number          - Limit building to one level
3553
    -toPackage=name            - Stop building after package
4018
    -toPackage=name            - Stop building after package
3554
    -fromPackage=name          - Start building from package
4019
    -fromPackage=name          - Start building from package
3555
    -justPackage=name[,name]   - Build named packages
4020
    -justPackage=name[,name]   - Build named packages
3556
    -ignorePackage=name[,name] - Do not build named packages
4021
    -ignorePackage=name[,name] - Do not build named packages
3557
    -entireSandbox             - Process the entire sandbox
4022
    -entireSandbox             - Process the entire sandbox
Line 3574... Line 4039...
3574
sandbox.
4039
sandbox.
3575
 
4040
 
3576
The 'clobber' command will perform a 'jats clobber' in all components in the
4041
The 'clobber' command will perform a 'jats clobber' in all components in the
3577
sandbox.
4042
sandbox.
3578
 
4043
 
-
 
4044
=for comment ==================================================================
-
 
4045
 
3579
=head1 make
4046
=head1 make
3580
 
4047
 
3581
=head2 NAME
4048
=head2 NAME
3582
 
4049
 
3583
Make packages in the sandbox
4050
Make packages in the sandbox
Line 3586... Line 4053...
3586
 
4053
 
3587
jats sandbox make [command options] [arguments]
4054
jats sandbox make [command options] [arguments]
3588
 
4055
 
3589
 Common Options:
4056
 Common Options:
3590
    -help[=n], -man            - Command specific help, [n=1,2,3]
4057
    -help[=n], -man            - Command specific help, [n=1,2,3]
-
 
4058
    -onlyLevel=number          - Limit building to one level
3591
    -toPackage=name            - Stop building after package
4059
    -toPackage=name            - Stop building after package
3592
    -fromPackage=name          - Start building from package
4060
    -fromPackage=name          - Start building from package
3593
    -justPackage=name[,name]   - Build named packages
4061
    -justPackage=name[,name]   - Build named packages
3594
    -ignorePackage=name[,name] - Do not build named packages
4062
    -ignorePackage=name[,name] - Do not build named packages
3595
    -entireSandbox             - Process the entire sandbox
4063
    -entireSandbox             - Process the entire sandbox
Line 3611... Line 4079...
3611
The 'make' command will perform a 'make' operation in each of the packages
4079
The 'make' command will perform a 'make' operation in each of the packages
3612
within the sandbox, in the correct build order.
4080
within the sandbox, in the correct build order.
3613
 
4081
 
3614
Any arguments are passed to the 'make'.
4082
Any arguments are passed to the 'make'.
3615
 
4083
 
-
 
4084
=for comment ==================================================================
-
 
4085
 
3616
=head1 cmd
4086
=head1 cmd
3617
 
4087
 
3618
=head2 NAME
4088
=head2 NAME
3619
 
4089
 
3620
Process each package with a specified command.
4090
Process each package with a specified command.
Line 3623... Line 4093...
3623
 
4093
 
3624
jats sandbox cmd [command options] [arguments]
4094
jats sandbox cmd [command options] [arguments]
3625
 
4095
 
3626
 Common Options:
4096
 Common Options:
3627
    -help[=n], -man            - Command specific help, [n=1,2,3]
4097
    -help[=n], -man            - Command specific help, [n=1,2,3]
-
 
4098
    -onlyLevel=number          - Limit building to one level
3628
    -toPackage=name            - Stop building after package
4099
    -toPackage=name            - Stop building after package
3629
    -fromPackage=name          - Start building from package
4100
    -fromPackage=name          - Start building from package
3630
    -justPackage=name[,name]   - Build named packages
4101
    -justPackage=name[,name]   - Build named packages
3631
    -ignorePackage=name[,name] - Do not build named packages
4102
    -ignorePackage=name[,name] - Do not build named packages
3632
    -entireSandbox             - Process the entire sandbox
4103
    -entireSandbox             - Process the entire sandbox
Line 3675... Line 4146...
3675
external to the sandbox, although all version information in the build.pl
4146
external to the sandbox, although all version information in the build.pl
3676
files will be updated.
4147
files will be updated.
3677
 
4148
 
3678
    jats sandbox cmd upddep -rtagid=12345
4149
    jats sandbox cmd upddep -rtagid=12345
3679
 
4150
 
-
 
4151
=for comment ==================================================================
-
 
4152
 
3680
=head1 Cache
4153
=head1 Cache
3681
 
4154
 
3682
=head2 NAME
4155
=head2 NAME
3683
 
4156
 
3684
Cache dependent packages
4157
Cache dependent packages
Line 3710... Line 4183...
3710
 
4183
 
3711
This command allows the simple creation of a small development environment that
4184
This command allows the simple creation of a small development environment that
3712
is not tied to the larger Development Environment. It may then be used in a
4185
is not tied to the larger Development Environment. It may then be used in a
3713
disconnected mode to perform development.
4186
disconnected mode to perform development.
3714
 
4187
 
-
 
4188
=for comment ==================================================================
-
 
4189
 
3715
=head1 Sandbox Test Links
4190
=head1 Sandbox Test Links
3716
 
4191
 
3717
=head2 NAME
4192
=head2 NAME
3718
 
4193
 
3719
Test and delete sandbox link files
4194
Test and delete sandbox link files
Line 3759... Line 4234...
3759
 
4234
 
3760
    jats sandbox testlinks
4235
    jats sandbox testlinks
3761
 
4236
 
3762
will test the symbolic links in the sandbox metadata.
4237
will test the symbolic links in the sandbox metadata.
3763
 
4238
 
-
 
4239
=for comment ==================================================================
-
 
4240
 
3764
=head1 Sandbox Scan Depth
4241
=head1 Sandbox Scan Depth
3765
 
4242
 
3766
=head2 NAME
4243
=head2 NAME
3767
 
4244
 
3768
Set and Display the build file scanner depth
4245
Set and Display the build file scanner depth
Line 3802... Line 4279...
3802
 
4279
 
3803
    jats sandbox scandepth 5
4280
    jats sandbox scandepth 5
3804
 
4281
 
3805
will set future build file scan to a maximum of 5 directories below the root of the sandbox.
4282
will set future build file scan to a maximum of 5 directories below the root of the sandbox.
3806
 
4283
 
-
 
4284
=for comment ==================================================================
-
 
4285
 
-
 
4286
=head1 Write Build Data
-
 
4287
 
-
 
4288
=head2 NAME
-
 
4289
 
-
 
4290
Write out build system data
-
 
4291
 
-
 
4292
=head2 SYNOPSIS
-
 
4293
 
-
 
4294
jats sandbox writeBuildData [options]
-
 
4295
 
-
 
4296
 Command Options
-
 
4297
    -help[=n]               - Command specific help, [n=1,2,3]
-
 
4298
    -man                    - Same as -help=3
-
 
4299
    -outfile=path           - Specify the location of the output file
-
 
4300
 
-
 
4301
=head2 ARGUMENTS
-
 
4302
 
-
 
4303
This command does not take any arguments
-
 
4304
 
-
 
4305
=head2 OPTIONS
-
 
4306
 
-
 
4307
The 'writeBuildData' command takes the following options:
-
 
4308
 
-
 
4309
=over 8
-
 
4310
 
-
 
4311
=item -outfile=path
-
 
4312
 
-
 
4313
This option will control the location of the generated file. The path includes the name of the output file.
-
 
4314
 
-
 
4315
The directory in which the file is to be created must exist. The file itself will be deleted and 
-
 
4316
recreated. Ideally it should not be present at the beginning of the command.
-
 
4317
 
-
 
4318
=back
-
 
4319
 
-
 
4320
=head2 DESCRIPTION
-
 
4321
 
-
 
4322
The writeBuildData command is used by the automated build system to extract information from 
-
 
4323
the sandbox. Data is written to a JSON file.
-
 
4324
 
-
 
4325
=head2 EXAMPLES
-
 
4326
 
-
 
4327
The command
-
 
4328
 
-
 
4329
    jats sandbox writeBuildData -outpath=data.json
-
 
4330
 
-
 
4331
will write a json formatted file that contains data for the build system.
-
 
4332
 
3807
=cut
4333
=cut
3808
 
4334