Subversion Repositories DevTools

Rev

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

Rev 325 Rev 331
Line 117... Line 117...
117
help(1)                                 if ( $cmd =~ m/^help$/ || $cmd eq "" );
117
help(1)                                 if ( $cmd =~ m/^help$/ || $cmd eq "" );
118
delete_sandbox()                        if ( $cmd =~ m/^delete$/ );
118
delete_sandbox()                        if ( $cmd =~ m/^delete$/ );
119
create_sandbox()                        if ( $cmd =~ m/^create$/ );
119
create_sandbox()                        if ( $cmd =~ m/^create$/ );
120
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
120
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
121
cmd(@ARGV)                              if ( $cmd =~ m/^cmd$/ );
121
cmd(@ARGV)                              if ( $cmd =~ m/^cmd$/ );
122
cmd($cmd, @ARGV )                       if ( $cmd =~ m/(^all$)|(^build$)|(^make$)/  );
122
buildcmd($cmd, @ARGV )                  if ( $cmd =~ m/(^all$)|(^build$)/  );
-
 
123
cmd($cmd, @ARGV )                       if ( $cmd =~ m/(^make$)/  );
123
clean($cmd, @ARGV)                      if ( $cmd =~ m/(^clobber$)|(^clean$)/  );
124
clean($cmd, @ARGV)                      if ( $cmd =~ m/(^clobber$)|(^clean$)/  );
124
 
125
 
125
Error ("Unknown sandbox command: $cmd");
126
Error ("Unknown sandbox command: $cmd");
126
exit 1;
127
exit 1;
127
 
128
 
Line 147... Line 148...
147
# Inputs          : None
148
# Inputs          : None
148
#
149
#
149
#
150
#
150
sub create_sandbox
151
sub create_sandbox
151
{
152
{
-
 
153
    Error ("Unexpected arguments: @ARGV") if ( @ARGV );
152
    Error ("Cannot create a sandbox within a sandbox",
154
    Error ("Cannot create a sandbox within a sandbox",
153
           "Sandbox base is: $GBE_SANDBOX" ) if ( $GBE_SANDBOX );
155
           "Sandbox base is: $GBE_SANDBOX" ) if ( $GBE_SANDBOX );
154
    mkdir ('sandbox_dpkg_archive') || Error ("Cannot create the directory: sandbox_dpkg_archive") ;
156
    mkdir ('sandbox_dpkg_archive') || Error ("Cannot create the directory: sandbox_dpkg_archive") ;
155
    exit  0;
157
    exit  0;
156
}
158
}
Line 165... Line 167...
165
#
167
#
166
# Returns         : 
168
# Returns         : 
167
#
169
#
168
sub delete_sandbox
170
sub delete_sandbox
169
{
171
{
-
 
172
    Error ("Unexpected arguments: @ARGV") if ( @ARGV );
170
    unless ( $GBE_SANDBOX )
173
    unless ( $GBE_SANDBOX )
171
    {
174
    {
172
        Warning("No sandbox found to delete");
175
        Warning("No sandbox found to delete");
173
    }
176
    }
174
    else
177
    else
Line 194... Line 197...
194
#
197
#
195
# Returns         : Will exit
198
# Returns         : Will exit
196
#
199
#
197
sub info
200
sub info
198
{
201
{
-
 
202
    Error ("Unexpected arguments: @ARGV") if ( @ARGV );
199
    #
203
    #
200
    #   Allow user to specify verboseness as an argument
204
    #   Allow user to specify verboseness as an argument
201
    #
205
    #
202
    foreach  ( @_ )
206
    foreach  ( @_ )
203
    {
207
    {
Line 471... Line 475...
471
 
475
 
472
    exit 0;
476
    exit 0;
473
}
477
}
474
 
478
 
475
#-------------------------------------------------------------------------------
479
#-------------------------------------------------------------------------------
-
 
480
# Function        : buildcmd
-
 
481
#
-
 
482
# Description     : Build the entire sandbox
-
 
483
#                   The all and the build are similar.
-
 
484
#                   Its not really useful to do a build without a make
-
 
485
#                   so we don't try
-
 
486
#
-
 
487
# Inputs          : Arguments passed to jats make
-
 
488
#
-
 
489
#
-
 
490
# Returns         : Will exit
-
 
491
#
-
 
492
 
-
 
493
sub buildcmd
-
 
494
{
-
 
495
    my ($cmd, @make_opts) = @_;
-
 
496
    my @build_opts;
-
 
497
 
-
 
498
    #
-
 
499
    #   Insert default options
-
 
500
    #
-
 
501
    push @build_opts, '-noforce' if ( $cmd eq 'all' );
-
 
502
    push @build_opts, '-force' if ( $cmd ne 'all' );
-
 
503
 
-
 
504
    push @make_opts, 'all'  unless ( @make_opts  );
-
 
505
 
-
 
506
    #
-
 
507
    #   Determine Sandbox information
-
 
508
    #   Populate global variables
-
 
509
    #
-
 
510
    calc_sandbox_info();
-
 
511
    foreach my $fe ( @build_order )
-
 
512
    {
-
 
513
        my $dir = $fe->{dir};
-
 
514
        Message( "Level:" . $fe->{level} . " Name: " . $fe->{mname} ,
-
 
515
                  DisplayPath ("        Path: $fe->{dir}" ));
-
 
516
 
-
 
517
        JatsCmd( "-cd=$dir", 'build', @build_opts) && Error ("Build Cmd failure") if ( $result );
-
 
518
        JatsCmd( "-cd=$dir", 'make',  @make_opts)  && Error ("Make Cmd failure")  if ( $result );
-
 
519
    }
-
 
520
 
-
 
521
    exit 0;
-
 
522
}
-
 
523
 
-
 
524
 
-
 
525
#-------------------------------------------------------------------------------
476
# Function        : clean
526
# Function        : clean
477
#
527
#
478
# Description     : Execute a command in all the sandboxes
528
# Description     : Execute a command in all the sandboxes
479
#                       Locate the base of the sandbox
529
#                       Locate the base of the sandbox
480
#                       Locate all packages in the sandbox
530
#                       Locate all packages in the sandbox
Line 537... Line 587...
537
    help                - Same as -help
587
    help                - Same as -help
538
    create              - Create a sandbox in the current directory
588
    create              - Create a sandbox in the current directory
539
    delete              - Delete the sandbox
589
    delete              - Delete the sandbox
540
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
590
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
541
    cmd                 - Do commands in all sandbox components
591
    cmd                 - Do commands in all sandbox components
542
    all                 - Do 'build and make' in all sandbox components
592
    all                 - Do 'build', if required, then a make in all sandbox components
543
    build               - Do 'build' in all sandbox components
593
    build               - Force 'build and make' in all sandbox components
544
    make                - Do 'make' in all sandbox components
594
    make                - Do 'make' in all sandbox components
545
    clean               - Do 'make clean' in all sandbox components
595
    clean               - Do 'make clean' in all sandbox components
546
    clobber             - Do 'build clobber' is all sandbox components
596
    clobber             - Do 'build clobber' is all sandbox components
547
 
597
 
548
=head1 OPTIONS
598
=head1 OPTIONS
Line 669... Line 719...
669
This should be considered a debug option. Undocument internal information will
719
This should be considered a debug option. Undocument internal information will
670
be displayed.
720
be displayed.
671
 
721
 
672
=back
722
=back
673
 
723
 
-
 
724
=head3 all
-
 
725
 
-
 
726
The 'all' command will perform build, if the build files are out of date,
-
 
727
followed by a make in each of the packages within the sandbox, in the correct
-
 
728
build order.
-
 
729
 
-
 
730
Any arguments are passed to the 'make' phase of the process.
-
 
731
 
-
 
732
This command may be used to:
-
 
733
 
-
 
734
=over 8
-
 
735
 
-
 
736
=item * Pickup any build file changes.
-
 
737
 
-
 
738
=item * Resume a failed build.
-
 
739
 
-
 
740
=back
-
 
741
 
-
 
742
=head3 build
-
 
743
 
-
 
744
The 'build' command will force a build followed by a make in each of the packages
-
 
745
within the sandbox, in the correct build order.
-
 
746
 
-
 
747
Any arguments are passed to the 'make' phase of the process.
-
 
748
 
-
 
749
In practice, the 'sandbox all' command is quicker.
-
 
750
 
-
 
751
=head3 make
-
 
752
 
-
 
753
The 'make' command will perform a 'make' operation in each of the packages
-
 
754
within the sandbox, in the correct build order.
-
 
755
 
-
 
756
Any arguments are passed to the 'make'.
-
 
757
 
-
 
758
=head3 cmd
-
 
759
 
-
 
760
The 'cmd' command will pass all of its arguments to JATS in the build directory
-
 
761
of each of the packages within the sandbox, in the package build order.
-
 
762
 
-
 
763
=head3 clean
-
 
764
 
-
 
765
The 'clean' command will perform a 'jats make clean' in all components in the
-
 
766
sandbox.
-
 
767
 
-
 
768
=head3 clobber
-
 
769
 
-
 
770
The 'clobber' command will perform a 'jats clobber' in all components in the
-
 
771
sandbox.
-
 
772
 
674
=cut
773
=cut
675
 
774
 
676
 
775