Subversion Repositories DevTools

Rev

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

Rev 361 Rev 379
Line 42... Line 42...
42
my $opt_check;
42
my $opt_check;
43
my $opt_generate;
43
my $opt_generate;
44
my @opt_exclude;
44
my @opt_exclude;
45
my @opt_rewrite;
45
my @opt_rewrite;
46
my %opt_rewrite;
46
my %opt_rewrite;
-
 
47
my $opt_quiet;
47
 
48
 
48
my @num_excluded;
49
my @num_excluded;
49
my @num_rewrite;
50
my @num_rewrite;
50
 
51
 
51
#-------------------------------------------------------------------------------
52
#-------------------------------------------------------------------------------
Line 56... Line 57...
56
# Inputs          :
57
# Inputs          :
57
#
58
#
58
my $result = GetOptions (
59
my $result = GetOptions (
59
                "help+"         => \$opt_help,              # flag, multiple use allowed
60
                "help+"         => \$opt_help,              # flag, multiple use allowed
60
                "manual|man"    => \$opt_manual,            # flag
61
                "manual|man"    => \$opt_manual,            # flag
61
                "verbose+"      => \$opt_verbose,           # flag, multiple use allowed
62
                "verbose:+"     => \$opt_verbose,           # flag, multiple use allowed
-
 
63
                "quiet:+"       => \$opt_quiet,             # flag, multiple use allowed
62
                "buildsystem"   => \$opt_buildsystem,       # Flag,
64
                "buildsystem"   => \$opt_buildsystem,       # Flag,
63
                "rootdir=s"     => \$opt_rootdir,           # String
65
                "rootdir=s"     => \$opt_rootdir,           # String
64
                "manifest=s"    => \$opt_manifest_file,     # String
66
                "manifest=s"    => \$opt_manifest_file,     # String
65
                "check"         => \$opt_check,             # Flag
67
                "check"         => \$opt_check,             # Flag
66
                "generate"      => \$opt_generate,          # Flag
68
                "generate"      => \$opt_generate,          # Flag
Line 186... Line 188...
186
        #   Some file are excluded ( build.pl )
188
        #   Some file are excluded ( build.pl )
187
        #
189
        #
188
        my $rewrite;
190
        my $rewrite;
189
        my $fileonly = $file;
191
        my $fileonly = $file;
190
        $fileonly =~ s~.*/~~;
192
        $fileonly =~ s~.*/~~;
-
 
193
        Verbose2("Processing: $file");
191
        if ( exists $opt_rewrite{$fileonly} )
194
        if ( exists $opt_rewrite{$fileonly} )
192
        {
195
        {
193
            $rewrite = $opt_rewrite{$fileonly};
196
            $rewrite = $opt_rewrite{$fileonly};
194
            unless ( $rewrite )
197
            unless ( $rewrite )
195
            {
198
            {
Line 209... Line 212...
209
            push @list, '"' . $file . '"';
212
            push @list, '"' . $file . '"';
210
        }
213
        }
211
 
214
 
212
        if ( $#list >= 10 || $rewrite )
215
        if ( $#list >= 10 || $rewrite )
213
        {
216
        {
214
            print "." unless ($opt_verbose > 1);
217
            print '.' unless ( ($opt_verbose > 1) || $opt_quiet);
215
            process_list( @list );
218
            process_list( @list );
216
            @list = "";
219
            @list = "";
217
        }
220
        }
218
 
221
 
219
        #
222
        #
Line 223... Line 226...
223
        if ( $rewrite )
226
        if ( $rewrite )
224
        {
227
        {
225
            #
228
            #
226
            #   Generate the MD5SUM info
229
            #   Generate the MD5SUM info
227
            #
230
            #
228
            print "." unless ($opt_verbose > 1);
231
            print '.' unless ( ($opt_verbose > 1) || $opt_quiet);
229
            my $data = qx(md5sum "$file");
232
            my $data = qx(md5sum "$file");
230
 
233
 
231
            #
234
            #
232
            #   Rewrite any required file name
235
            #   Rewrite any required file name
233
            #
236
            #
Line 248... Line 251...
248
    #
251
    #
249
    #   Informational warnings
252
    #   Informational warnings
250
    #
253
    #
251
    Message("Number of files excluded : " . (1 + $#num_excluded), @num_excluded) if ( $#num_excluded >= 0);
254
    Message("Number of files excluded : " . (1 + $#num_excluded), @num_excluded) if ( $#num_excluded >= 0);
252
    Message("Number of files rewritten: " . (1 + $#num_rewrite), @num_rewrite) if ( $#num_rewrite >= 0 );
255
    Message("Number of files rewritten: " . (1 + $#num_rewrite), @num_rewrite) if ( $#num_rewrite >= 0 );
-
 
256
    Message("Files scanned: " . (1 + $#files) );
253
 
257
 
254
}
258
}
255
 
259
 
256
sub process_list
260
sub process_list
257
{
261
{
258
    my @list = @_;
262
    my @list = @_;
259
 
263
 
260
    #
264
    #
261
    #   Anything to do
265
    #   Anything to do
262
    #
266
    #
-
 
267
    Verbose3 ("process_list", @list, $#list);
263
    return if ( $#list < 0 );
268
    return if ( $#list < 1 );
264
 
269
 
265
#    print ".";
270
#    print ".";
266
    open(CMD, "md5sum @list |") || Error "Can't run command: $!";
271
    open(CMD, "md5sum @list |") || Error "Can't run command: $!";
267
    while (<CMD>)
272
    while (<CMD>)
268
    {
273
    {
Line 353... Line 358...
353
 
358
 
354
 Options:
359
 Options:
355
    -help              - brief help message
360
    -help              - brief help message
356
    -help -help        - Detailed help message
361
    -help -help        - Detailed help message
357
    -man               - Full documentation
362
    -man               - Full documentation
-
 
363
    -verbose[=n]       - Verbose operation
-
 
364
    -quiet             - Supress progress messages
358
    -generate          - Generate the manifest(default)
365
    -generate          - Generate the manifest(default)
359
    -check             - Check the provided manifest
366
    -check             - Check the provided manifest
360
    -manifest=file     - Path of the manifest file to use
367
    -manifest=file     - Path of the manifest file to use
361
    -rootdir=path      - Root of the file tree to process (default=.)
368
    -rootdir=path      - Root of the file tree to process (default=.)
362
    -exclude=file      - File to excluded during generation
369
    -exclude=file      - File to excluded during generation
Line 376... Line 383...
376
 
383
 
377
=item B<-man>
384
=item B<-man>
378
 
385
 
379
Prints the manual page and exits.
386
Prints the manual page and exits.
380
 
387
 
-
 
388
=item B<-verbose[=n]>
-
 
389
 
-
 
390
This option will increase the level of verbosity of the command.
-
 
391
 
-
 
392
If an argument is provided, then it will be used to set the level, otherwise the
-
 
393
existing level will be incremented. This option may be specified multiple times.
-
 
394
 
-
 
395
=item B<-quiet>
-
 
396
 
-
 
397
This option will supress the '.' progress messages that are created as the manifest
-
 
398
is generated.
-
 
399
 
381
=item B<-generate>
400
=item B<-generate>
382
 
401
 
383
Generate the  manifest file. This is the default operation.
402
Generate the  manifest file. This is the default operation.
384
 
403
 
385
This option may be used in conjunction with B<-check> to generate and check the
404
This option may be used in conjunction with B<-check> to generate and check the