Subversion Repositories DevTools

Rev

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

Rev 335 Rev 337
Line 24... Line 24...
24
#                   jats sandbox <command> (options | actions)@
24
#                   jats sandbox <command> (options | actions)@
25
#
25
#
26
#                 Commands include:
26
#                 Commands include:
27
#                   create              - Create a sandbox
27
#                   create              - Create a sandbox
28
#                   delete              - Delete a sandbox
28
#                   delete              - Delete a sandbox
29
#
-
 
30
#                   add package_name    - Add a package to the sandbox
29
#                   info                - Show sandbox info
31
#                   rm  package_name    - Remove a package from the sandbox
-
 
32
#
30
#
33
#                   build               - Build all packages in the sandbox
31
#                   build               - Build all packages in the sandbox
34
#                   make                - make all packages in the sandbox
32
#                   make                - make all packages in the sandbox
35
#
33
#
36
#......................................................................#
34
#......................................................................#
Line 89... Line 87...
89
# Inputs          :
87
# Inputs          :
90
#
88
#
91
my $result = GetOptions (
89
my $result = GetOptions (
92
                "help|h:+"      => \$opt_help,
90
                "help|h:+"      => \$opt_help,
93
                "manual:3"      => \$opt_help,
91
                "manual:3"      => \$opt_help,
94
                "verbose+"      => \$opt_verbose,           # flag, multiple use allowed
92
                "verbose:+"     => \$opt_verbose,           # flag, multiple use allowed
95
                );
93
                );
96
 
94
 
97
                #
95
                #
98
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
96
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
99
                #
97
                #
Line 126... Line 124...
126
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
124
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
127
cmd(@ARGV)                              if ( $cmd =~ m/^cmd$/ );
125
cmd(@ARGV)                              if ( $cmd =~ m/^cmd$/ );
128
buildcmd($cmd, @ARGV )                  if ( $cmd =~ m/(^all$)|(^build$)/  );
126
buildcmd($cmd, @ARGV )                  if ( $cmd =~ m/(^all$)|(^build$)/  );
129
cmd($cmd, @ARGV )                       if ( $cmd =~ m/(^make$)/  );
127
cmd($cmd, @ARGV )                       if ( $cmd =~ m/(^make$)/  );
130
clean($cmd, @ARGV)                      if ( $cmd =~ m/(^clobber$)|(^clean$)/  );
128
clean($cmd, @ARGV)                      if ( $cmd =~ m/(^clobber$)|(^clean$)/  );
-
 
129
cache(@ARGV)                            if ( $cmd =~ m/^cache$/  );
131
 
130
 
132
Error ("Unknown sandbox command: $cmd");
131
Error ("Unknown sandbox command: $cmd");
133
exit 1;
132
exit 1;
134
 
133
 
135
 
134
 
Line 533... Line 532...
533
# Returns         : Will exit
532
# Returns         : Will exit
534
#
533
#
535
 
534
 
536
sub buildcmd
535
sub buildcmd
537
{
536
{
538
    my ($cmd, @make_opts) = @_;
537
    my ($cmd, @cmd_opts) = @_;
539
    my @build_opts;
538
    my @build_opts;
-
 
539
    my @make_opts;
540
 
540
 
541
    #
541
    #
542
    #   Insert default options
542
    #   Insert default options
543
    #
543
    #
544
    push @build_opts, '-noforce' if ( $cmd eq 'all' );
544
    push @build_opts, '-noforce' if ( $cmd eq 'all' );
545
    push @build_opts, '-force' if ( $cmd ne 'all' );
545
    push @build_opts, '-force' if ( $cmd ne 'all' );
546
 
546
 
-
 
547
    #
-
 
548
    #   Attempt to split the options into build and make options
-
 
549
    #   Only handle the often used options to build.
-
 
550
    #
-
 
551
    foreach  ( @cmd_opts )
-
 
552
    {
-
 
553
        if ( m/^-cache/ || m/^-package/ || m/^-forcebuildpkg/ || m/-expert/) {
-
 
554
            push @build_opts, $_;
-
 
555
        } else {
-
 
556
            push @make_opts, $_;
-
 
557
        }
-
 
558
    }
-
 
559
 
547
    push @make_opts, 'all'  unless ( @make_opts  );
560
    push @make_opts, 'all'  unless ( @make_opts  );
548
 
561
 
549
    #
562
    #
550
    #   Determine Sandbox information
563
    #   Determine Sandbox information
551
    #   Populate global variables
564
    #   Populate global variables
Line 606... Line 619...
606
    exit 0;
619
    exit 0;
607
}
620
}
608
 
621
 
609
 
622
 
610
#-------------------------------------------------------------------------------
623
#-------------------------------------------------------------------------------
-
 
624
# Function        : cache
-
 
625
#
-
 
626
# Description     : Cache external packages into the sandbox
-
 
627
#
-
 
628
# Inputs          : @opts                   - User options
-
 
629
#
-
 
630
# Returns         : Nothing
-
 
631
#
-
 
632
sub cache
-
 
633
{
-
 
634
    my (@opts) = @_;
-
 
635
    Warning("Unknown options: @opts") if ( @opts );
-
 
636
 
-
 
637
    #
-
 
638
    #   Determine Sandbox information
-
 
639
    #   Populate global variables
-
 
640
    #
-
 
641
    Message("Cache External Dependencies");
-
 
642
    calc_sandbox_info();
-
 
643
 
-
 
644
    #
-
 
645
    #   Walk the list of external depenedencies and cache each one
-
 
646
    #
-
 
647
    foreach my $de ( sort keys %extern_deps )
-
 
648
    {
-
 
649
        my ($pn,$ps) = split( $; , $de);
-
 
650
        my @vlist = keys %{$extern_deps{$de}};
-
 
651
        foreach my $pv ( @vlist )
-
 
652
        {
-
 
653
            Message ("Cache ${pn} ${pv}.${ps}");
-
 
654
            JatsTool ('cache_dpkg', "${pn}/${pv}.${ps}" );
-
 
655
        }
-
 
656
    }
-
 
657
    
-
 
658
    exit 0;
-
 
659
    
-
 
660
}
-
 
661
 
-
 
662
 
-
 
663
#-------------------------------------------------------------------------------
611
#   Documentation
664
#   Documentation
612
#
665
#
613
 
666
 
614
=pod
667
=pod
615
 
668
 
Line 635... Line 688...
635
    all                 - Do 'build', if required, then a make in all sandbox components
688
    all                 - Do 'build', if required, then a make in all sandbox components
636
    build               - Force 'build and make' in all sandbox components
689
    build               - Force 'build and make' in all sandbox components
637
    make                - Do 'make' in all sandbox components
690
    make                - Do 'make' in all sandbox components
638
    clean               - Do 'make clean' in all sandbox components
691
    clean               - Do 'make clean' in all sandbox components
639
    clobber             - Do 'build clobber' is all sandbox components
692
    clobber             - Do 'build clobber' is all sandbox components
-
 
693
    cache               - Cache external dependent packages
640
 
694
 
641
=head1 OPTIONS
695
=head1 OPTIONS
642
 
696
 
643
=over 8
697
=over 8
644
 
698
 
Line 817... Line 871...
817
=head3 clobber
871
=head3 clobber
818
 
872
 
819
The 'clobber' command will perform a 'jats clobber' in all components in the
873
The 'clobber' command will perform a 'jats clobber' in all components in the
820
sandbox.
874
sandbox.
821
 
875
 
-
 
876
=head3 cache
-
 
877
 
-
 
878
The 'cache' command will cache all external dependent packages into the sandbox.
-
 
879
 
-
 
880
This allows the simple creation of a small development environment that is
-
 
881
not tied to the larger Development Environment. It may then be used in a
-
 
882
disconnected mode to perform development.
-
 
883
 
-
 
884
 
822
=cut
885
=cut
823
 
886
 
824
 
887