Subversion Repositories DevTools

Rev

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

Rev 4889 Rev 5708
Line 89... Line 89...
89
    $self->{DEFINE}         = 0;
89
    $self->{DEFINE}         = 0;
90
    $self->{RAW}            = 0;
90
    $self->{RAW}            = 0;
91
    $self->{FH}             = $handle;
91
    $self->{FH}             = $handle;
92
    $self->{FH_inmemory}    = 0;
92
    $self->{FH_inmemory}    = 0;
93
    $self->{RECIPE_PREFIX}  = '';
93
    $self->{RECIPE_PREFIX}  = '';
-
 
94
    $self->{RECIPE_WRAPPER}  = ['(', ')'];
94
    $self->{RECIPE_COMMENT} = '';
95
    $self->{RECIPE_COMMENT} = '';
95
    $self->{STACK}          = [];
96
    $self->{STACK}          = [];
96
    $self->{SDEF}           = '';
97
    $self->{SDEF}           = '';
97
 
98
 
98
    push @{$self->{NAME}}, split(/,/,$name) if ( $name );
99
    push @{$self->{NAME}}, split(/,/,$name) if ( $name );
Line 310... Line 311...
310
    my $self = shift;
311
    my $self = shift;
311
    $self->{RECIPE_COMMENT} = join( ' ', @_);
312
    $self->{RECIPE_COMMENT} = join( ' ', @_);
312
}
313
}
313
 
314
 
314
 
315
 
-
 
316
#-------------------------------------------------------------------------------
-
 
317
# Function        : RecipeWrapper
-
 
318
#
-
 
319
# Description     : Add a wrapper around the recipe
-
 
320
#
-
 
321
# Inputs          : begin   - Start of wrapper
-
 
322
#                   end     - End of wrapper
-
 
323
#
-
 
324
# Returns         :
-
 
325
#
-
 
326
sub RecipeWrapper
-
 
327
{
-
 
328
    my $self = shift;
-
 
329
    Error("RecipeWrapper requires exacly two arguments") unless scalar @_ == 2;
-
 
330
    my ($begin, $end) = @_;
-
 
331
    $self->{RECIPE_WRAPPER}[0] = $begin;
-
 
332
    $self->{RECIPE_WRAPPER}[1] = $end;
-
 
333
}
315
 
334
 
316
#-------------------------------------------------------------------------------
335
#-------------------------------------------------------------------------------
317
# Function        : AddRecipe
336
# Function        : AddRecipe
318
#
337
#
319
# Description     : Add a line to the line-by-line recipe
338
# Description     : Add a line to the line-by-line recipe
Line 384... Line 403...
384
 
403
 
385
    $data{RECIPE}           = $self->{RECIPE};
404
    $data{RECIPE}           = $self->{RECIPE};
386
    $data{SHELL}            = $self->{SHELL};
405
    $data{SHELL}            = $self->{SHELL};
387
    $data{RECIPE_PREFIX}    = $self->{RECIPE_PREFIX};
406
    $data{RECIPE_PREFIX}    = $self->{RECIPE_PREFIX};
388
    $data{RECIPE_COMMENT}   = $self->{RECIPE_COMMENT};
407
    $data{RECIPE_COMMENT}   = $self->{RECIPE_COMMENT};
-
 
408
    $data{RECIPE_WRAPPER}   = $self->{RECIPE_WRAPPER};
389
    $data{SDEF}             = $self->{SDEF};
409
    $data{SDEF}             = $self->{SDEF};
390
    
410
    
391
 
411
 
392
    push @{$self->{STACK}}, \%data;
412
    push @{$self->{STACK}}, \%data;
393
 
413
 
394
    $self->{RECIPE}         = []; 
414
    $self->{RECIPE}         = []; 
395
    $self->{SHELL}          = [];
415
    $self->{SHELL}          = [];
396
    $self->{RECIPE_PREFIX}  = '';
416
    $self->{RECIPE_PREFIX}  = '';
397
    $self->{RECIPE_COMMENT} = '';
417
    $self->{RECIPE_COMMENT} = '';
-
 
418
    $self->{RECIPE_WRAPPER} = ['(', ')'];
398
    $self->{SDEF}           = '';
419
    $self->{SDEF}           = '';
399
}
420
}
400
 
421
 
401
#-------------------------------------------------------------------------------
422
#-------------------------------------------------------------------------------
402
# Function        : SectionIfDef 
423
# Function        : SectionIfDef 
Line 520... Line 541...
520
        #
541
        #
521
        $self->NewSection();
542
        $self->NewSection();
522
        foreach my $recipeEntry (@{$self->{STACK}})
543
        foreach my $recipeEntry (@{$self->{STACK}})
523
        {
544
        {
524
            my $comment = $recipeEntry->{RECIPE_COMMENT};
545
            my $comment = $recipeEntry->{RECIPE_COMMENT};
-
 
546
            my $wrapper = $recipeEntry->{RECIPE_WRAPPER};
525
            my $prefix =  $recipeEntry->{RECIPE_PREFIX};
547
            my $prefix =  $recipeEntry->{RECIPE_PREFIX};
526
            my $recipe =  $recipeEntry->{RECIPE};
548
            my $recipe =  $recipeEntry->{RECIPE};
527
            my $shell =   $recipeEntry->{SHELL};
549
            my $shell =   $recipeEntry->{SHELL};
528
            my $sdef =    $recipeEntry->{SDEF};
550
            my $sdef =    $recipeEntry->{SDEF};
529
 
551
 
Line 548... Line 570...
548
            #
570
            #
549
            #   Print the recipe as a shell command
571
            #   Print the recipe as a shell command
550
            #   Bracket the recipes with ( .. ) and place semi colons between lines
572
            #   Bracket the recipes with ( .. ) and place semi colons between lines
551
            #   Use the current recipe prefix
573
            #   Use the current recipe prefix
552
            #
574
            #
553
            print_list ( $prefix . '(', ';\\', $shell, ')');
575
            print_list ( $prefix . $wrapper->[0], ';\\', $shell, $wrapper->[1]);
554
 
576
 
555
            if ($sdef)
577
            if ($sdef)
556
            {
578
            {
557
                print "\nendif";
579
                print "\nendif";
558
            }
580
            }