Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
########################################################################
263 dpurdie 2
# Copyright (C) 2008 ERG Limited, All rights reserved
227 dpurdie 3
#
263 dpurdie 4
# Module name   : jats_sandbox.pl
5
# Module type   : JATS Utility
6
# Compiler(s)   : Perl
7
# Environment(s): JATS
227 dpurdie 8
#
9
# Description   : A script to build a collection of packages in the
10
#                 same sandbox. This script will:
11
#
12
#                   Determine the packages in the sandbox
13
#                   Determine the build order of the packages
14
#                   Build the packages in the correct order
15
#                   Make the packages in the correct order
16
#
17
#                 The script will allow for:
18
#                   The creation of a sandbox
19
#                   The addition of packages to the sandbox
20
#                   Removal of packages from the sandbox
21
#
22
#
23
#                 Command syntax (basic)
24
#                   jats sandbox <command> (options | actions)@
25
#
26
#                 Commands include:
27
#                   create              - Create a sandbox
28
#                   delete              - Delete a sandbox
29
#
30
#                   add package_name    - Add a package to the sandbox
31
#                   rm  package_name    - Remove a package from the sandbox
32
#
33
#                   build               - Build all packages in the sandbox
34
#                   make                - make all packages in the sandbox
35
#
36
#......................................................................#
37
 
263 dpurdie 38
require 5.008_002;
227 dpurdie 39
use strict;
40
use warnings;
41
use JatsError;
42
use JatsSystem;
43
use FileUtils;
245 dpurdie 44
use JatsBuildFiles;
227 dpurdie 45
use JatsVersionUtils;
299 dpurdie 46
use File::Path qw(rmtree);
227 dpurdie 47
 
48
 
49
use Pod::Usage;                             # required for help support
50
use Getopt::Long qw(:config require_order); # Stop on non-option
51
my $VERSION = "1.0.0";                      # Update this
52
 
53
#
54
#   Options
55
#
56
my $opt_debug   = $ENV{'GBE_DEBUG'};        # Allow global debug
57
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
58
my $opt_help = 0;
59
 
60
#
61
#   Globals - Provided by the JATS environment
62
#
63
my $USER         = $ENV{'USER'};
64
my $UNIX         = $ENV{'GBE_UNIX'};
65
my $HOME         = $ENV{'HOME'};
66
my $GBE_SANDBOX  = $ENV{'GBE_SANDBOX'};
67
my $GBE_DPKG_SBOX= $ENV{'GBE_DPKG_SBOX'};
325 dpurdie 68
my $GBE_MACHTYPE = $ENV{'GBE_MACHTYPE'};
227 dpurdie 69
 
335 dpurdie 70
my $GBE_DPKG_LOCAL = $ENV{'GBE_DPKG_LOCAL'};
71
my $GBE_DPKG_CACHE = $ENV{'GBE_DPKG_CACHE'};
72
my $GBE_DPKG       = $ENV{'GBE_DPKG'};
73
my $GBE_DPLY       = $ENV{'GBE_DPLY'};
74
my $GBE_DPKG_STORE = $ENV{'GBE_DPKG_STORE'};
75
 
227 dpurdie 76
#
77
#   Globals
78
#
79
my @build_order = ();                     # Build Ordered list of entries
255 dpurdie 80
my %extern_deps;                          # Hash of external dependencies
227 dpurdie 81
my %packages;                             # Hash of packages
82
 
83
 
84
#-------------------------------------------------------------------------------
85
# Function        : Mainline Entry Point
86
#
87
# Description     :
88
#
89
# Inputs          :
90
#
91
my $result = GetOptions (
299 dpurdie 92
                "help|h:+"      => \$opt_help,
93
                "manual:3"      => \$opt_help,
227 dpurdie 94
                "verbose+"      => \$opt_verbose,           # flag, multiple use allowed
95
                );
96
 
97
                #
98
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
99
                #
100
 
101
#
102
#   Process help and manual options
103
#
104
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
105
pod2usage(-verbose => 1)  if ($opt_help == 2 );
299 dpurdie 106
pod2usage(-verbose => 2)  if ($opt_help > 2 );
227 dpurdie 107
 
108
#
109
#   Configure the error reporting process now that we have the user options
110
#
111
ErrorConfig( 'name'    => 'SANDBOX',
112
             'verbose' => $opt_verbose );
113
 
114
#
115
#   Validate user options
116
#
117
 
118
#
119
#   Parse the user command and decide what to do
120
#
121
#
122
my $cmd = shift @ARGV || "";
123
help(1)                                 if ( $cmd =~ m/^help$/ || $cmd eq "" );
299 dpurdie 124
delete_sandbox()                        if ( $cmd =~ m/^delete$/ );
227 dpurdie 125
create_sandbox()                        if ( $cmd =~ m/^create$/ );
126
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
127
cmd(@ARGV)                              if ( $cmd =~ m/^cmd$/ );
331 dpurdie 128
buildcmd($cmd, @ARGV )                  if ( $cmd =~ m/(^all$)|(^build$)/  );
129
cmd($cmd, @ARGV )                       if ( $cmd =~ m/(^make$)/  );
273 dpurdie 130
clean($cmd, @ARGV)                      if ( $cmd =~ m/(^clobber$)|(^clean$)/  );
227 dpurdie 131
 
132
Error ("Unknown sandbox command: $cmd");
133
exit 1;
134
 
135
 
136
#-------------------------------------------------------------------------------
137
#
138
#   Give the user a clue
139
#
140
sub help
141
{
142
    my ($level) = @_;
143
    $level = $opt_help unless ( $level );
144
 
145
    pod2usage(-verbose => 0, -message => "Version: ". $VERSION)  if ($level == 1 );
146
    pod2usage(-verbose => $level -1 );
147
}
148
 
149
#-------------------------------------------------------------------------------
150
# Function        : create_sandbox
151
#
152
# Description     : create a sandbox in the current current directory
153
#
154
# Inputs          : None
155
#
156
#
157
sub create_sandbox
158
{
331 dpurdie 159
    Error ("Unexpected arguments: @ARGV") if ( @ARGV );
227 dpurdie 160
    Error ("Cannot create a sandbox within a sandbox",
161
           "Sandbox base is: $GBE_SANDBOX" ) if ( $GBE_SANDBOX );
162
    mkdir ('sandbox_dpkg_archive') || Error ("Cannot create the directory: sandbox_dpkg_archive") ;
163
    exit  0;
164
}
165
 
166
#-------------------------------------------------------------------------------
299 dpurdie 167
# Function        : delete_sandbox
168
#
169
# Description     : Delete a sandbox
170
#                   Its up to the user the delete the components in the sandbox
171
#
172
# Inputs          : None
173
#
174
# Returns         : 
175
#
176
sub delete_sandbox
177
{
331 dpurdie 178
    Error ("Unexpected arguments: @ARGV") if ( @ARGV );
299 dpurdie 179
    unless ( $GBE_SANDBOX )
180
    {
181
        Warning("No sandbox found to delete");
182
    }
183
    else
184
    {
185
        my $sdir = "$GBE_SANDBOX/sandbox_dpkg_archive";
186
        rmtree($sdir,0,0);
187
        Error ("Sandbox directory not completly removed")
188
            if ( -e $sdir );
189
 
190
        Message("Sandbox information deleted",
191
                "Sandbox components must be manually deleted");
192
    }
193
    exit 0;
194
}
195
 
196
#-------------------------------------------------------------------------------
227 dpurdie 197
# Function        : info
198
#
199
# Description     : Display Sandbox information
200
#
201
# Inputs          : Command line args
202
#                   -v  - Be more verbose
203
#
204
# Returns         : Will exit
205
#
206
sub info
207
{
208
    #
209
    #   Allow user to specify verboseness as an argument
210
    #
335 dpurdie 211
    my @unknown;
227 dpurdie 212
    foreach  ( @_ )
213
    {
335 dpurdie 214
        $opt_verbose++, next if ( m/^-v/ );
215
        push @unknown, $_;
227 dpurdie 216
    }
335 dpurdie 217
    Error ("sandbox info: Unknown options: @unknown") if @unknown;
227 dpurdie 218
 
219
    #
220
    #   Determine Sandbox information
221
    #   Populate global variables
222
    #
223
    calc_sandbox_info();
224
 
225
    #
226
    #   Display information
227
    #
228
    Message ("Base: $GBE_SANDBOX");
229
    Message ("Archive: $GBE_DPKG_SBOX");
230
 
231
    Message ("Build Order");
232
    foreach my $fe ( @build_order )
233
    {
245 dpurdie 234
        Message( "    Level:" . $fe->{level} . " Name: " . $fe->{mname} );
227 dpurdie 235
        Message( DisplayPath ("        Path: $fe->{dir}" )) if $opt_verbose;
236
 
237
        if ( $opt_verbose )
238
        {
239
            foreach my $idep ( sort keys %{$fe->{ideps}} )
240
            {
241
                my ($ppn,$pps) = split( $; , $idep);
242
                Message ("        I:$ppn.$pps");
243
            }
244
 
245
            foreach my $edep ( sort keys %{$fe->{edeps}} )
246
            {
247
                my ($ppn,$pps) = split( $; , $edep);
248
                my $pv = $fe->{edeps}{$edep};
249
                Message ("        E:$ppn $pv.$pps");
250
            }
251
 
252
        }
253
    }
254
 
255 dpurdie 255
    Message("External Dependencies");
227 dpurdie 256
    foreach my $de ( sort keys %extern_deps )
257
    {
258
        my ($pn,$ps) = split( $; , $de);
259
        my @vlist = keys %{$extern_deps{$de}};
335 dpurdie 260
        my $flag = $#vlist ? '+' : '';
227 dpurdie 261
        foreach my $pv ( @vlist )
262
        {
335 dpurdie 263
            my $exists = check_package_existance( $pn, "$pv.$ps") ? '' : '*';
264
            my $flags = sprintf ("%4.4s", $flag . $exists);
265
            Message ("${flags}${pn} ${pv}.${ps}");
227 dpurdie 266
            if ( $opt_verbose )
267
            {
268
                foreach my $pkg ( @{$extern_deps{$de}{$pv}} )
269
                {
270
                    my ($ppn,$pps) = split( $; , $pkg);
271
                    Message ("        U:$ppn.$pps");
272
 
273
                }
274
            }
275
        }
276
    }
277
 
278
    if ( $opt_verbose > 2 )
279
    {
280
        DebugDumpData( "extern_deps", \%extern_deps);
281
        DebugDumpData( "build_order", \@build_order);
282
        DebugDumpData( "packages", \%packages);
283
    }
284
    exit (0);
285
}
286
 
287
#-------------------------------------------------------------------------------
335 dpurdie 288
# Function        : check_package_existance
289
#
290
# Description     : Determine if a given package-version exists
291
#
292
# Inputs          : $name           - Package Name
293
#                   $ver            - Package Version
294
#
295
# Returns         : true            - Package exists
296
#
297
sub check_package_existance
298
{
299
    my ($name, $ver) = @_;
300
    #
301
    #   Look in each package archive directory
302
    #
303
    foreach my $dpkg ( $GBE_DPKG_SBOX,
304
                       $GBE_DPKG_LOCAL,
305
                       $GBE_DPKG_CACHE,
306
                       $GBE_DPKG,
307
                       $GBE_DPLY,
308
                       $GBE_DPKG_STORE )
309
    {
310
        next unless ( $dpkg );
311
        if ( -d "$dpkg/$name/$ver" )
312
        {
313
            return 1;
314
        }
315
    }
316
   return 0;
317
}
318
 
319
 
320
#-------------------------------------------------------------------------------
227 dpurdie 321
# Function        : calc_sandbox_info
322
#
323
# Description     : Examine the sandbox and determine all the important
324
#                   information
325
#
326
# Inputs          : None
327
#
328
# Returns         : Will exit if not in a sandbox
329
#                   Populates global variables
330
#                       @build_order - build ordered array of build entries
331
#
332
sub calc_sandbox_info
333
{
334
    #
335
    #   Start from the root of the sandbox
336
    #
337
    Error ("Command must be executed from within a Sandbox") unless ( $GBE_SANDBOX );
338
    chdir ($GBE_SANDBOX) || Error ("Cannot chdir to $GBE_SANDBOX");
339
 
340
    #
341
    #   Locate all packages within the sandbox
342
    #   These will be top-level directories - one per package
343
    #
344
    my @dirlist;
345
    my @build_list;
255 dpurdie 346
    foreach my $pname ( glob("*") )
227 dpurdie 347
    {
255 dpurdie 348
        next if ( $pname =~ m~^\.~ );
349
        next if ( $pname =~ m~dpkg_archive$~ );
297 dpurdie 350
        next if ( $pname =~ m~^CVS$~ );
255 dpurdie 351
        next unless ( -d $pname );
352
        Verbose ("Package discovered: $pname");
275 dpurdie 353
 
325 dpurdie 354
        if ( -f "$pname/stop" || -f "$pname/stop.$GBE_MACHTYPE" )
275 dpurdie 355
        {
356
            Warning("Package contains stop file: $pname");
357
            next;
358
        }
359
 
255 dpurdie 360
        push @dirlist, $pname;
227 dpurdie 361
 
362
        #
363
        #   Locate the build files in each package
245 dpurdie 364
        #   Scan the build files and extract dependancy information
227 dpurdie 365
        #
255 dpurdie 366
        my $bscanner = BuildFileScanner( $pname, 'build.pl', '--LocateAll', '--ScanDependencies' );
245 dpurdie 367
        $bscanner->scan();
368
        my @blist = $bscanner->getInfo();
255 dpurdie 369
        Warning ("Package does not have build files: $pname") unless ( @blist );
370
        Warning ("Package has multiple build files: $pname") if ( $#blist > 0 );
245 dpurdie 371
        push @build_list, @blist;
227 dpurdie 372
    }
373
 
374
    #
375
    #   Process each build file and extract
376
    #       Name of the Package
377
    #       Dependency list
378
    #   Build up a hash of dependence information
379
    #
380
 
381
    my %depends;
299 dpurdie 382
    my %multi;
245 dpurdie 383
    foreach my $be ( @build_list )
227 dpurdie 384
    {
245 dpurdie 385
        Verbose( DisplayPath ("Build file: " . $be->{dir} . " Name: " . $be->{file} ));
386
#        DebugDumpData ("be", $be );
227 dpurdie 387
 
388
        #
299 dpurdie 389
        #   Catch multiple builds for the same package
390
        #   Report later - when we have all
391
        #
321 dpurdie 392
        next unless ( $be->{mname} );
299 dpurdie 393
        push @{$multi{$be->{mname}}},$be->{dir};
394
 
395
        #
227 dpurdie 396
        #   Add into dependency struct
397
        #
245 dpurdie 398
        $depends{$be->{package}}{depends} = $be->{depends};
399
        $depends{$be->{package}}{entry} = $be;
227 dpurdie 400
    }
401
 
299 dpurdie 402
    foreach my $mname ( sort keys %multi )
403
    {
404
        ReportError ("Mutiple builders for : $mname", @{$multi{$mname}} )
405
            if ( scalar @{$multi{$mname}} > 1 );
406
    }
407
    ErrorDoExit();
408
 
245 dpurdie 409
#DebugDumpData ("depends", \%depends );
410
 
227 dpurdie 411
    #
412
    #   Determine the build order
413
    #
414
    @build_order = ();
415
    my $more = 1;
416
    my $level = 0;
417
 
418
    #
255 dpurdie 419
    #   Remove any dependencies to 'external' packages
227 dpurdie 420
    #   These will not be met internally and can be regarded as constant
421
    #
422
    foreach my $key ( keys %depends )
423
    {
424
        foreach my $build ( keys( %{$depends{$key}{depends}} ))
425
        {
426
            unless (exists $depends{$build})
427
            {
428
                push @{$extern_deps{$build}{$depends{$key}{depends}{$build}}}, $key;
429
                $depends{$key}{entry}{edeps}{$build} = $depends{$key}{depends}{$build};
430
                delete ($depends{$key}{depends}{$build}) ;
431
                Verbose2( "Not in set: $build");
432
            }
433
            else
434
            {
435
                $depends{$key}{entry}{ideps}{$build} = 1;
436
            }
437
        }
438
    }
439
    while ( $more )
440
    {
441
        $more = 0;
442
        $level++;
443
        my @build;
444
 
445
        #
446
        #   Locate packages with no dependencies
447
        #
448
        foreach my $key ( keys %depends )
449
        {
450
            next if ( keys( %{$depends{$key}{depends}} ) );
451
            push @build, $key;
452
        }
453
 
454
        foreach my $build ( @build )
455
        {
456
            $more = 1;
457
            my $fe = $depends{$build}{entry};
458
            $fe->{level} = $level;
459
            $packages{$build} = $fe;
460
            push @build_order, $fe;
461
            delete $depends{$build};
462
            delete $fe->{depends};                          # remove now its not needed
463
        }
464
 
465
        foreach my $key ( keys %depends )
466
        {
467
            foreach my $build ( @build )
468
            {
469
                delete $depends{$key}{depends}{$build};
470
            }
471
        }
472
    }
473
 
474
    #
475
    #   Just to be sure to be sure
476
    #
245 dpurdie 477
    if ( keys %depends )
478
    {
479
        #DebugDumpData ("depends", \%depends );
480
        Error( "Internal algorithm error: Bad dependancy walk",
481
               "Possible circular dependency");
482
    }
227 dpurdie 483
 
484
#    DebugDumpData ("Order", \@build_order);
485
}
486
 
487
#-------------------------------------------------------------------------------
488
# Function        : cmd
489
#
490
# Description     : Execute a command in all the sandboxes
491
#                       Locate the base of the sandbox
492
#                       Locate all packages in the sandbox
493
#                       Locate all build files in each sandbox
494
#                       Determine build order
495
#                       Issue commands for each sandbox in order
496
#
255 dpurdie 497
# Inputs          : Arguments passed to jats build
227 dpurdie 498
#
499
# Returns         : Will exit
500
#
501
sub cmd
502
{
503
    my @cmds = @_;
504
    #
505
    #   Determine Sandbox information
506
    #   Populate global variables
507
    #
508
    calc_sandbox_info();
509
    foreach my $fe ( @build_order )
510
    {
511
        my $dir = $fe->{dir};
255 dpurdie 512
        Message( "Level:" . $fe->{level} . " Name: " . $fe->{mname} ,
227 dpurdie 513
                  DisplayPath ("        Path: $fe->{dir}" ));
514
 
263 dpurdie 515
        my $result = JatsCmd( "-cd=$dir", @cmds);
255 dpurdie 516
        Error ("Cmd failure") if ( $result );
227 dpurdie 517
    }
518
 
519
    exit 0;
520
}
521
 
522
#-------------------------------------------------------------------------------
331 dpurdie 523
# Function        : buildcmd
524
#
525
# Description     : Build the entire sandbox
526
#                   The all and the build are similar.
527
#                   Its not really useful to do a build without a make
528
#                   so we don't try
529
#
530
# Inputs          : Arguments passed to jats make
531
#
532
#
533
# Returns         : Will exit
534
#
535
 
536
sub buildcmd
537
{
538
    my ($cmd, @make_opts) = @_;
539
    my @build_opts;
540
 
541
    #
542
    #   Insert default options
543
    #
544
    push @build_opts, '-noforce' if ( $cmd eq 'all' );
545
    push @build_opts, '-force' if ( $cmd ne 'all' );
546
 
547
    push @make_opts, 'all'  unless ( @make_opts  );
548
 
549
    #
550
    #   Determine Sandbox information
551
    #   Populate global variables
552
    #
553
    calc_sandbox_info();
554
    foreach my $fe ( @build_order )
555
    {
556
        my $dir = $fe->{dir};
557
        Message( "Level:" . $fe->{level} . " Name: " . $fe->{mname} ,
558
                  DisplayPath ("        Path: $fe->{dir}" ));
559
 
560
        JatsCmd( "-cd=$dir", 'build', @build_opts) && Error ("Build Cmd failure") if ( $result );
561
        JatsCmd( "-cd=$dir", 'make',  @make_opts)  && Error ("Make Cmd failure")  if ( $result );
562
    }
563
 
564
    exit 0;
565
}
566
 
567
 
568
#-------------------------------------------------------------------------------
273 dpurdie 569
# Function        : clean
570
#
571
# Description     : Execute a command in all the sandboxes
572
#                       Locate the base of the sandbox
573
#                       Locate all packages in the sandbox
574
#                       Locate all build files in each sandbox
575
#                       Determine build order
576
#                       Issue commands for each sandbox in order
577
#
578
# Inputs          : Arguments passed to jats build
579
#
580
# Returns         : Will exit
581
#
582
sub clean
583
{
584
    my ($mode, @cmds ) = @_;
585
    #
586
    #   Determine Sandbox information
587
    #   Populate global variables
588
    #
589
    calc_sandbox_info();
590
 
591
    my @cmd = $mode eq 'clobber' ? ('clobber') : ('make', 'clean' );
592
 
593
    #
594
    #   Clobber and clean need to be done in the reverse order
595
    #
596
    foreach my $fe ( reverse @build_order )
597
    {
598
        my $dir = $fe->{dir};
599
        Message( "Level:" . $fe->{level} . " Name: " . $fe->{mname} ,
600
                  DisplayPath ("        Path: $fe->{dir}" ));
601
 
602
        my $result = JatsCmd( "-cd=$dir", @cmd, @cmds);
603
        Error ("Cmd failure") if ( $result );
604
    }
605
 
606
    exit 0;
607
}
608
 
609
 
610
#-------------------------------------------------------------------------------
227 dpurdie 611
#   Documentation
612
#
613
 
614
=pod
615
 
616
=head1 NAME
617
 
618
jats_sandbox - Build in a Development Sandbox
619
 
620
=head1 SYNOPSIS
621
 
255 dpurdie 622
  jats sandbox [options] [commands]
227 dpurdie 623
 
624
 Options:
299 dpurdie 625
    -help[=n]          - Display help with specified detail
227 dpurdie 626
    -help -help        - Detailed help message
627
    -man               - Full documentation
628
 
629
 Commands:
630
    help                - Same as -help
631
    create              - Create a sandbox in the current directory
299 dpurdie 632
    delete              - Delete the sandbox
255 dpurdie 633
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
227 dpurdie 634
    cmd                 - Do commands in all sandbox components
331 dpurdie 635
    all                 - Do 'build', if required, then a make in all sandbox components
636
    build               - Force 'build and make' in all sandbox components
275 dpurdie 637
    make                - Do 'make' in all sandbox components
273 dpurdie 638
    clean               - Do 'make clean' in all sandbox components
639
    clobber             - Do 'build clobber' is all sandbox components
227 dpurdie 640
 
641
=head1 OPTIONS
642
 
643
=over 8
644
 
299 dpurdie 645
=item B<-help[=n]>
227 dpurdie 646
 
647
Print a brief help message and exits.
299 dpurdie 648
There are three levels of help
227 dpurdie 649
 
299 dpurdie 650
=over 8
651
 
652
=item   1 Brief synopsis
653
 
654
=item   2 Synopsis and option summary
655
 
656
=item   3 Detailed help in man format
657
 
658
=back 8
659
 
227 dpurdie 660
=item B<-help -help>
661
 
662
Print a detailed help message with an explanation for each option.
663
 
664
=item B<-man>
665
 
299 dpurdie 666
Prints the manual page and exits. This is the same a -help=3
227 dpurdie 667
 
279 dpurdie 668
=back
669
 
227 dpurdie 670
=head1 DESCRIPTION
671
 
299 dpurdie 672
This program is the primary tool for the maintenance of Development Sandboxes.
673
 
227 dpurdie 674
More documentation will follow.
675
 
279 dpurdie 676
=head2 SANDBOX DIRECTORY
677
 
299 dpurdie 678
The sandbox directory is marked as being a sandbox through the use of the
679
'sandbox create' command. This will create a suitable structure within the
279 dpurdie 680
current directory.
681
 
682
Several JATS commands operate differently within a sandbox. The 'extract' and
683
'release' commands will create static viwes within the sandbox and not the
684
normal directory. The 'sandbox' sub commands can only be used within a sandbox.
685
 
686
The sandbox directory contains sub directories, each should contain a single
687
package. Sub directories may be created with the 'jats extract' command.
688
 
689
Note: Symbolic links are not supported. They cannot work as he sandbox mechanism
690
requires that all the packages be conatined within a sub directory tree so
691
that the root of the sandbox can be located by a simple scan of the directory
692
tree.
693
 
325 dpurdie 694
If a package subdirectory contains a file called 'stop' or 'stop.
695
<GBE_MACHTYPE>', then that package will not be considered as a part of the
696
build-set. A 'stop' file will prevent consideration all build platforms. The 'stop.
697
<GBE_MACHTYPE>' will only prevent consideration if being built on a GBE_MACHTYPE
698
type of computer.
279 dpurdie 699
 
299 dpurdie 700
=head2 COMMAND SUMMARY
701
 
702
=head3 create
703
 
704
The 'create' command will create a sandbox in the users current directory. It is
705
not possible to create a sandbox within a sandbox.
706
 
707
A sandbox can be created in a directory that contains files and subdirectories.
708
 
709
The create command simply places a known directory in the current directory.
710
This dorectory is used by the sandboxing process. It may be manually deleted, or
711
deleted with the 'delete' command.
712
 
713
=head3 delete
714
 
715
The 'delete' command will delete the sandbox's marker directory. The command may
716
be executed anywhere within the sandbox.
717
 
718
Once the sanbox has been deleted, the user must remove the components within the
719
sandbox.
720
 
721
=head3 info
722
 
723
The 'info' command will display information about the build order and the
724
depenedencies of packages that it finds within the sandbox.
725
 
726
The command will accept one option '-v' to increase the verbosity of the
727
information being displayed.
728
 
729
=over 8
730
 
731
=item * No Verbosity
732
 
733
The basic command will display the build order and the external
335 dpurdie 734
dependencies. External dependencies may be prefixed with one of the
735
following indicators:
299 dpurdie 736
 
335 dpurdie 737
=over 8
738
 
739
=item   +   Multiple versions of this package are being used by sandboxed components.
740
 
741
=item   *   The package cannot be found in any of the package archives.
742
 
743
=back
744
 
299 dpurdie 745
=item Verbosity of 1
746
 
747
This level of verbosoity will display the build order and detailed information
748
on the dependencies. The dependencies will be prefixed with:
749
 
750
=over 8
751
 
752
=item   E   Dependent Package is external to the sandbox
753
 
754
=item   I   Dependent Package is internal to the sandbox
755
 
756
=back
757
 
335 dpurdie 758
External dependencies may be prefixed with one of the indicators described for
759
no-verbosity. Additionally the internal consumer of the external package is also
760
shown. These are prefixed with a 'U'.
299 dpurdie 761
 
762
=item Verbosity of 2
763
 
764
Reserved forfuture use
765
 
766
=item Verbosity over 2
767
 
768
This should be considered a debug option. Undocument internal information will
769
be displayed.
770
 
771
=back
772
 
331 dpurdie 773
=head3 all
774
 
775
The 'all' command will perform build, if the build files are out of date,
776
followed by a make in each of the packages within the sandbox, in the correct
777
build order.
778
 
779
Any arguments are passed to the 'make' phase of the process.
780
 
781
This command may be used to:
782
 
783
=over 8
784
 
785
=item * Pickup any build file changes.
786
 
787
=item * Resume a failed build.
788
 
789
=back
790
 
791
=head3 build
792
 
793
The 'build' command will force a build followed by a make in each of the packages
794
within the sandbox, in the correct build order.
795
 
796
Any arguments are passed to the 'make' phase of the process.
797
 
798
In practice, the 'sandbox all' command is quicker.
799
 
800
=head3 make
801
 
802
The 'make' command will perform a 'make' operation in each of the packages
803
within the sandbox, in the correct build order.
804
 
805
Any arguments are passed to the 'make'.
806
 
807
=head3 cmd
808
 
809
The 'cmd' command will pass all of its arguments to JATS in the build directory
810
of each of the packages within the sandbox, in the package build order.
811
 
812
=head3 clean
813
 
814
The 'clean' command will perform a 'jats make clean' in all components in the
815
sandbox.
816
 
817
=head3 clobber
818
 
819
The 'clobber' command will perform a 'jats clobber' in all components in the
820
sandbox.
821
 
227 dpurdie 822
=cut
823
 
255 dpurdie 824