Subversion Repositories DevTools

Rev

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

Rev 7322 Rev 7323
Line 48... Line 48...
48
use Pod::Usage;                             # required for help support
48
use Pod::Usage;                             # required for help support
49
use Getopt::Long qw(:config require_order); # Stop on non-option
49
use Getopt::Long qw(:config require_order); # Stop on non-option
50
use Digest;
50
use Digest;
51
use JSON;
51
use JSON;
52
 
52
 
53
 
-
 
54
my $VERSION = "1.0.0";                      # Update this
53
my $VERSION = "1.0.0";                      # Update this
55
my $SCANDEPTH = 3;                          # Almost a constant
54
my $SCANDEPTH = 3;                          # Almost a constant
56
 
55
 
57
#
56
#
58
#   Options
57
#   Options
Line 93... Line 92...
93
 
92
 
94
#
93
#
95
#   Globals
94
#   Globals
96
#
95
#
97
my @stopped = ();                               # Stopped entries
96
my @stopped = ();                               # Stopped entries
98
my %packages;                                   # Hash of packages
-
 
99
my @build_order = ();                           # Build Ordered list of packages
97
my @build_order = ();                           # Build Ordered list of entries
100
my %extern_deps;                                # Hash of external dependencies
98
my %extern_deps;                                # Hash of external dependencies
-
 
99
my %packages;                                   # Hash of packages
101
my $currentPkgTag;                              # Tag of the current package - if any                                          
100
my $currentPkgTag;                              # Tag of the current package - if any                                          
102
my $scanDepth;                                  # Depth for build file scan
101
my $scanDepth;                                  # Depth for build file scan
103
my $maxDname = 0;                               # Pretty display
102
my $maxDname = 0;                               # Pretty display
104
 
103
 
105
#
104
#
Line 136... Line 135...
136
#
135
#
137
#   Reconfigure the options parser to allow subcommands to parse options
136
#   Reconfigure the options parser to allow subcommands to parse options
138
#
137
#
139
Getopt::Long::Configure('permute');
138
Getopt::Long::Configure('permute');
140
 
139
 
-
 
140
#   Flag to subcommands that the build is occuring within a SANDBOX
-
 
141
#   Example usage: Prevent gradle subproject inclusion
-
 
142
$ENV{'GBE_SANDBOX_BUILD'} = 1;
-
 
143
 
141
#
144
#
142
#   Parse the user command and decide what to do
145
#   Parse the user command and decide what to do
143
#
146
#
144
#   Remove user command from the command line. This will leave command options
147
#   Remove user command from the command line. This will leave command options
145
#   in @ARGV so that they can be parsed by the subcommand.
148
#   in @ARGV so that they can be parsed by the subcommand.
Line 347... Line 350...
347
 
350
 
348
#-------------------------------------------------------------------------------
351
#-------------------------------------------------------------------------------
349
# Function        : errorBuild 
352
# Function        : errorBuild 
350
#
353
#
351
# Description     : Mark the package as having a build error
354
# Description     : Mark the package as having a build error
352
#                   This inofrmation will be used in determining build info
355
#                   This information will be used in determining build info
353
#
356
#
354
# Inputs          : Mode -: Error, 1:UnError
357
# Inputs          : Mode -: Error, 1:UnError
355
#                   User commaand line 
358
#                   User commaand line 
356
#
359
#
357
# Returns         : Nothing
360
# Returns         : Nothing
Line 1093... Line 1096...
1093
                #   Scan the build files and extract dependancy information
1096
                #   Scan the build files and extract dependancy information
1094
                #
1097
                #
1095
                my $bscanner = BuildFileScanner( $pname, 'build.pl',
1098
                my $bscanner = BuildFileScanner( $pname, 'build.pl',
1096
                                                         '--LocateAll',
1099
                                                         '--LocateAll',
1097
                                                         '--LimitDepth=' . $scanDepth,
1100
                                                         '--LimitDepth=' . $scanDepth,
1098
                                                         '--ScanDependencies' );
1101
                                                         '--ScanDependencies', 
-
 
1102
                                                         '--Stop' );
1099
                unless ($bscanner->setLocation($_)) {
1103
                unless ($bscanner->setLocation($_)) {
1100
                    Verbose("Build file missing: Force full scan");
1104
                    Verbose("Build file missing: Force full scan");
1101
                    @build_list = ();
1105
                    @build_list = ();
1102
                    last;
1106
                    last;
1103
                }
1107
                }
Line 1145... Line 1149...
1145
            #   Scan the build files and extract dependancy information
1149
            #   Scan the build files and extract dependancy information
1146
            #
1150
            #
1147
            my $bscanner = BuildFileScanner( $pname, 'build.pl',
1151
            my $bscanner = BuildFileScanner( $pname, 'build.pl',
1148
                                                     '--LocateAll',
1152
                                                     '--LocateAll',
1149
                                                     '--LimitDepth=' . $scanDepth,
1153
                                                     '--LimitDepth=' . $scanDepth,
1150
                                                     '--ScanDependencies' );
1154
                                                     '--ScanDependencies',
-
 
1155
                                                     '--Stop' );
1151
            $bscanner->scan();
1156
            $bscanner->scan();
1152
            my @blist = $bscanner->getInfo();
1157
            my @blist = $bscanner->getInfo();
1153
            unless ($quiet) {
1158
            unless ($quiet) {
1154
                Warning ("Package does not have build files: $pname") unless ( @blist );
1159
                Warning ("Package does not have build files: $pname") unless ( @blist );
1155
                Warning ("Package has multiple build files: $pname") if ( $#blist > 0 );
1160
                Warning ("Package has multiple build files: $pname") if ( $#blist > 0 );
Line 2482... Line 2487...
2482
 
2487
 
2483
    #
2488
    #
2484
    #   Set the initial filter list
2489
    #   Set the initial filter list
2485
    #   This will have been parsed by JATS before we get here
2490
    #   This will have been parsed by JATS before we get here
2486
    #
2491
    #
2487
    @filter_list = split( /[,\s]+/, join(',', $GBE_BUILDFILTER));
2492
    UniquePush (\@filter_list, split( /[,\s]+/, join(',', $GBE_BUILDFILTER)));
2488
 
2493
 
2489
    #
2494
    #
2490
    #   Extract options for the jats extract utility
2495
    #   Extract options for the jats extract utility
2491
    #
2496
    #
2492
    foreach ( @cmd_opts )
2497
    foreach ( @cmd_opts )
Line 2509... Line 2514...
2509
    }
2514
    }
2510
 
2515
 
2511
    #
2516
    #
2512
    #   Display the results to the user
2517
    #   Display the results to the user
2513
    #
2518
    #
-
 
2519
    @filter_list = sort @filter_list;
2514
    Message('BuildFilter:', @filter_list);
2520
    Message('BuildFilter:', @filter_list);
2515
 
2521
 
2516
    #
2522
    #
2517
    #   Write out a new file
2523
    #   Write out a new file
2518
    #
2524
    #
2519
    if ($modified)
2525
    if ($modified)
2520
    {
2526
    {
-
 
2527
        Error ("Command must be executed from within a Sandbox") unless ( $GBE_SANDBOX );
2521
        FileCreate($filterFile, @filter_list);
2528
        FileCreate($filterFile, @filter_list);
2522
    }
2529
    }
2523
 
2530
 
2524
    #
2531
    #
2525
    # This command does not return
2532
    # This command does not return
Line 3065... Line 3072...
3065
            }
3072
            }
3066
 
3073
 
3067
        } else {
3074
        } else {
3068
            $data[8] = 0;               # atime - will change
3075
            $data[8] = 0;               # atime - will change
3069
            $data[12] = '-';            # blocks - seen to change for unknown reasons
3076
            $data[12] = '-';            # blocks - seen to change for unknown reasons
-
 
3077
            for my $ii ( 0 .. $#data) {
-
 
3078
                unless (defined $data[$ii]) {
-
 
3079
                    $data[$ii] = 'xx';
-
 
3080
                }
-
 
3081
            }
3070
            $text = "$item : @data";
3082
            $text = "$item : @data";
3071
        }
3083
        }
3072
        $genPkgFingerPrintCount++;
3084
        $genPkgFingerPrintCount++;
3073
        $genPkgFingerPrintSha1->add($text);
3085
        $genPkgFingerPrintSha1->add($text);
3074
#Debug0("genPkgFingerPrint: $text, ", $genPkgFingerPrintSha1->clone->hexdigest() );
3086
#Debug0("genPkgFingerPrint: $text, ", $genPkgFingerPrintSha1->clone->hexdigest() );
Line 3368... Line 3380...
3368
This option allow the error to be reported as a warning or to be ignored altogether. The named package will be 
3380
This option allow the error to be reported as a warning or to be ignored altogether. The named package will be 
3369
excluded from the build set.
3381
excluded from the build set.
3370
 
3382
 
3371
Valid values for 'mode' are: error, report and ignore.  The default mode is 'error'.
3383
Valid values for 'mode' are: error, report and ignore.  The default mode is 'error'.
3372
 
3384
 
-
 
3385
One workaround is to use a 'stop' file. Any directory that contains 'stop' file will not be scanned for
-
 
3386
build files. If a 'stop' file is added then it may defeat caching of build information. The information will 
-
 
3387
need to be refreshed with the '--rescan' option. The 'stop' file should not be version controlled.
-
 
3388
 
3373
=back
3389
=back
3374
 
3390
 
3375
=head1 DESCRIPTION
3391
=head1 DESCRIPTION
3376
 
3392
 
3377
This program is the primary tool for the maintenance of Development Sandboxes.
3393
This program is the primary tool for the maintenance of Development Sandboxes.
Line 3444... Line 3460...
3444
    -verbose[=n]            - Verbose operation
3460
    -verbose[=n]            - Verbose operation
3445
    -[no]force              - Force creation of nested sandbox
3461
    -[no]force              - Force creation of nested sandbox
3446
 
3462
 
3447
=head2 OPTIONS
3463
=head2 OPTIONS
3448
 
3464
 
3449
The 'create' command takes the following options.
3465
The 'create' command takes the following options:
3450
 
3466
 
3451
=item -[no]force
3467
=item -[no]force
3452
 
3468
 
3453
Normally a sandbox should not be created within another sandbox. 
3469
Normally a sandbox should not be created within another sandbox. 
3454
 
3470
 
Line 3819... Line 3835...
3819
 
3835
 
3820
=back
3836
=back
3821
 
3837
 
3822
=for comment ==================================================================
3838
=for comment ==================================================================
3823
 
3839
 
-
 
3840
The build infomation display will show the state of each package as a cryptic set of four characters within square brackets.
-
 
3841
 
-
 
3842
The first character may be one of:
-
 
3843
 
-
 
3844
=over 8
-
 
3845
 
-
 
3846
=item S - Build is being skipped
-
 
3847
 
-
 
3848
=item s - Build is being suppressed
-
 
3849
 
-
 
3850
=item blank - Build is active
-
 
3851
 
-
 
3852
=back
-
 
3853
 
-
 
3854
The second character may be one of:
-
 
3855
 
-
 
3856
=over 8
-
 
3857
 
-
 
3858
=item * - This is the current package
-
 
3859
 
-
 
3860
=item B - Has been build
-
 
3861
 
-
 
3862
=item - - A 'noBuild'. Will not be built due to build filters
-
 
3863
 
-
 
3864
=back
-
 
3865
 
-
 
3866
The third character may be one of:
-
 
3867
 
-
 
3868
=over 8
-
 
3869
 
-
 
3870
=item E - The package only exists in dpkg_archive
-
 
3871
 
-
 
3872
=item L - The package has been built and exists within the sandbox
-
 
3873
 
-
 
3874
=item M - The package has been built and exists in both the sandbox and dpkg_archive
-
 
3875
 
-
 
3876
=back
-
 
3877
 
-
 
3878
The fourth character may be one of (requires the -fingerprint option):
-
 
3879
 
-
 
3880
=over 8
-
 
3881
 
-
 
3882
=item G - A good fingerprint
-
 
3883
 
-
 
3884
=item B - A bad fingerprint. Files in the package have been modified since the last build.
-
 
3885
 
-
 
3886
=item blank - The package has not been built and no fingerprint has been calculated.
-
 
3887
 
-
 
3888
=back
-
 
3889
 
3824
=head1 Buildfilter
3890
=head1 Buildfilter
3825
 
3891
 
3826
=head2 NAME
3892
=head2 NAME
3827
 
3893
 
3828
Display and Modify Sandbox buildfilter
3894
Display and Modify Sandbox buildfilter