Subversion Repositories DevTools

Rev

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

Rev 4184 Rev 4197
Line 39... Line 39...
39
use JatsError;
39
use JatsError;
40
use JatsSystem;
40
use JatsSystem;
41
use FileUtils;
41
use FileUtils;
42
use JatsBuildFiles;
42
use JatsBuildFiles;
43
use JatsVersionUtils;
43
use JatsVersionUtils;
-
 
44
use ArrayHashUtils;
44
 
45
 
45
 
46
 
46
use Pod::Usage;                             # required for help support
47
use Pod::Usage;                             # required for help support
47
use Getopt::Long qw(:config require_order); # Stop on non-option
48
use Getopt::Long qw(:config require_order); # Stop on non-option
48
my $VERSION = "1.0.0";                      # Update this
49
my $VERSION = "1.0.0";                      # Update this
Line 133... Line 134...
133
cmd('cmd', @ARGV)                       if ( $cmd =~ m/^cmd$/ );
134
cmd('cmd', @ARGV)                       if ( $cmd =~ m/^cmd$/ );
134
create_sandbox()                        if ( $cmd =~ m/^create$/ );
135
create_sandbox()                        if ( $cmd =~ m/^create$/ );
135
delete_sandbox()                        if ( $cmd =~ m/^delete$/ );
136
delete_sandbox()                        if ( $cmd =~ m/^delete$/ );
136
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
137
info(@ARGV)                             if ( $cmd =~ m/^info$/ );
137
populate(@ARGV)                         if ( $cmd =~ m/^populate$/  );
138
populate(@ARGV)                         if ( $cmd =~ m/^populate$/  );
-
 
139
buildfilter(@ARGV)                      if ( $cmd =~ m/^buildfilter$/  );
138
 
140
 
139
Error ("Unknown sandbox command: $cmd");
141
Error ("Unknown sandbox command: $cmd");
140
exit 1;
142
exit 1;
141
 
143
 
142
 
144
 
Line 1112... Line 1114...
1112
    #
1114
    #
1113
    exit (0);
1115
    exit (0);
1114
}
1116
}
1115
 
1117
 
1116
#-------------------------------------------------------------------------------
1118
#-------------------------------------------------------------------------------
-
 
1119
# Function        : buildfilter 
-
 
1120
#
-
 
1121
# Description     : Manipulate the sandbox build filter
-
 
1122
#
-
 
1123
# Inputs          : Optional filter names
-
 
1124
#                       +NAME - will add filter
-
 
1125
#                       -NAME will remove it
-
 
1126
#                       NAME will set it
-
 
1127
#                   No args will just display the build filter
-
 
1128
#
-
 
1129
# Returns         : Does not return
-
 
1130
#
-
 
1131
sub buildfilter
-
 
1132
{
-
 
1133
    my (@cmd_opts ) = @_;
-
 
1134
    my @filter_list;
-
 
1135
    my $first_arg = 1;
-
 
1136
    my $modified;
-
 
1137
 
-
 
1138
    Getopt::Long::Configure('pass_through');
-
 
1139
    getOptionsFromArray ( \@cmd_opts ) || Error ("Invalid command line" );
-
 
1140
 
-
 
1141
    SubCommandHelp( $opt_help, "Buildfilter") if ($opt_help );
-
 
1142
 
-
 
1143
    #
-
 
1144
    #   Set the initial filter list
-
 
1145
    #   This will have been parsed by JATS before we get here
-
 
1146
    #
-
 
1147
    @filter_list = split( /[,\s]+/, join(',', $GBE_BUILDFILTER));
-
 
1148
 
-
 
1149
    #
-
 
1150
    #   Extract options for the jats extract utility
-
 
1151
    #
-
 
1152
    foreach ( @cmd_opts )
-
 
1153
    {
-
 
1154
        if (m~^\+(.*)~)
-
 
1155
        {
-
 
1156
            UniquePush( \@filter_list, $1);
-
 
1157
        }
-
 
1158
        elsif (m~^\-(.*)~)
-
 
1159
        {
-
 
1160
            ArrayDelete( \@filter_list, $1);
-
 
1161
        }
-
 
1162
        else
-
 
1163
        {
-
 
1164
            @filter_list = () if ($first_arg);
-
 
1165
            UniquePush( \@filter_list, $_);
-
 
1166
        }
-
 
1167
        $first_arg = 0;
-
 
1168
        $modified = 1;
-
 
1169
    }
-
 
1170
 
-
 
1171
    #
-
 
1172
    #   Display the results to the user
-
 
1173
    #
-
 
1174
    Message('BuildFilter:', @filter_list);
-
 
1175
 
-
 
1176
    #
-
 
1177
    #   Write out a new file
-
 
1178
    #
-
 
1179
    if ($modified)
-
 
1180
    {
-
 
1181
        FileCreate($GBE_DPKG_SBOX . '/buildfilter', @filter_list);
-
 
1182
    }
-
 
1183
 
-
 
1184
    #
-
 
1185
    # This command does not return
-
 
1186
    #
-
 
1187
    exit (0);
-
 
1188
}
-
 
1189
 
-
 
1190
 
-
 
1191
#-------------------------------------------------------------------------------
1117
# Function        : getPkgDetailsByName
1192
# Function        : getPkgDetailsByName
1118
#
1193
#
1119
# Description     : Determine the PVID for a given package name and version
1194
# Description     : Determine the PVID for a given package name and version
1120
#
1195
#
1121
# Inputs          : $pname          - Package name
1196
# Inputs          : $pname          - Package name
Line 1420... Line 1495...
1420
    help                - Same as -help
1495
    help                - Same as -help
1421
    create              - Create a sandbox in the current directory
1496
    create              - Create a sandbox in the current directory
1422
    populate            - Populate the sandbox with packages
1497
    populate            - Populate the sandbox with packages
1423
    delete              - Delete the sandbox
1498
    delete              - Delete the sandbox
1424
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
1499
    info [[-v]-v]       - Sandbox information. -v: Be more verbose
-
 
1500
    buildfilter         - Modify and display sandbox buildfilter
1425
    cmd                 - Do commands in all sandbox components
1501
    cmd                 - Do commands in all sandbox components
1426
    all                 - Do 'build', if required, then a make in all components
1502
    all                 - Do 'build', if required, then a make in all components
1427
    build               - Force 'build and make' in all sandbox components
1503
    build               - Force 'build and make' in all sandbox components
1428
    make                - Do 'make' in all sandbox components
1504
    make                - Do 'make' in all sandbox components
1429
    clean               - Do 'make clean' in all sandbox components
1505
    clean               - Do 'make clean' in all sandbox components
Line 1919... Line 1995...
1919
This should be considered a debug option. Undocumented internal information will
1995
This should be considered a debug option. Undocumented internal information will
1920
be displayed.
1996
be displayed.
1921
 
1997
 
1922
=back
1998
=back
1923
 
1999
 
-
 
2000
=head1 Buildfilter
-
 
2001
 
-
 
2002
=head2 NAME
-
 
2003
 
-
 
2004
Display and Modify Sandbox buildfilter
-
 
2005
 
-
 
2006
=head2 SYNOPSIS
-
 
2007
 
-
 
2008
jats sandbox buildfilter [command options] [TARGETS]+
-
 
2009
 
-
 
2010
 Command Options
-
 
2011
    -help[=n]               - Command specific help, [n=1,2,3]
-
 
2012
    -man                    - Same as -help=3
-
 
2013
 
-
 
2014
 Target Names
-
 
2015
    -TARGET                 - Remove target from the current buildfilter
-
 
2016
    +TARGET                 - Add target to current buildfilter
-
 
2017
    TARGET                  - If first target, then reset buildfilter 
-
 
2018
                              and add target, otherwise add target.
-
 
2019
 
-
 
2020
=head2 OPTIONS
-
 
2021
 
-
 
2022
The 'buildfilter' command takes the following options:
-
 
2023
 
-
 
2024
=over 8
-
 
2025
 
-
 
2026
=item -TARGET
-
 
2027
 
-
 
2028
If a target name starts with a '-' and is not an option, then that target will be
-
 
2029
removed from the current buildfilter. 
-
 
2030
 
-
 
2031
If the named target is not a part of the current buildfilter then nothing will happen.
-
 
2032
 
-
 
2033
=item +TARGET
-
 
2034
 
-
 
2035
If a target name starts with a '+' then that target will be added to the current buildfilter.
-
 
2036
 
-
 
2037
If the named target is already a part of the current buildfilter then nothing will happen.
-
 
2038
 
-
 
2039
 
-
 
2040
=item TARGET
-
 
2041
 
-
 
2042
If a target name does not start with either a '-' or a '+' then the target will be added to the
-
 
2043
current buildfilter.
-
 
2044
 
-
 
2045
If this is the first named target then the build filter will be set to this one target.
-
 
2046
 
-
 
2047
=back
-
 
2048
 
-
 
2049
=head2 DESCRIPTION
-
 
2050
 
-
 
2051
The 'buildfilter' command will display and optionally modify the build filter used within
-
 
2052
the sandbox.
-
 
2053
 
-
 
2054
=head2 EXAMPLES
-
 
2055
 
-
 
2056
The command
-
 
2057
 
-
 
2058
    jats sandbox buildfilter 
-
 
2059
 
-
 
2060
will simply display the current buildfilter.
-
 
2061
 
-
 
2062
The command
-
 
2063
 
-
 
2064
    jats sandbox buildfilter +COBRA +PPC_603E
-
 
2065
 
-
 
2066
will append the build targets COBRA and PPC_603E to the current buildfilter.
-
 
2067
 
-
 
2068
The command
-
 
2069
 
-
 
2070
    jats sandbox buildfilter -COBRA
-
 
2071
 
-
 
2072
will remove the build target COBRA from the current buildfilter.
-
 
2073
 
-
 
2074
The command
-
 
2075
 
-
 
2076
    jats sandbox buildfilter COBRA +PPC_603E
-
 
2077
 or jats sandbox buildfilter COBRA PPC_603E
-
 
2078
 
-
 
2079
will set the buildfilter to be COBRA and PPC_603E
-
 
2080
 
1924
=head1 Command all
2081
=head1 Command all
1925
 
2082
 
1926
=head2 NAME
2083
=head2 NAME
1927
 
2084
 
1928
Build packages in the sandbox
2085
Build packages in the sandbox