Subversion Repositories DevTools

Rev

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

Rev 7320 Rev 7322
Line 158... Line 158...
158
#
158
#
159
# Inputs          : A hash of option,value pairs
159
# Inputs          : A hash of option,value pairs
160
#                   Valid options
160
#                   Valid options
161
#                       name        - Name to report in error
161
#                       name        - Name to report in error
162
#                       function    - Name of enclosing function
162
#                       function    - Name of enclosing function
163
#                       prefix      - 1st line prefix
-
 
164
#                       verbose     - vebosity level
163
#                       verbose     - vebosity level
165
#                       debug       - debug level
164
#                       debug       - debug level
166
#                       on_exit     - Register on-exit function
165
#                       on_exit     - Register on-exit function
167
#                       delay_exit  - Delay exit on error
166
#                       delay_exit  - Delay exit on error
168
#                       prefix      - Optional prefix. First line only
167
#                       prefix      - Optional prefix. First line only
Line 578... Line 577...
578
        $ScmExitCode = $1 || 1;
577
        $ScmExitCode = $1 || 1;
579
        shift @_;
578
        shift @_;
580
    }
579
    }
581
    _Message '(E)', @_;
580
    _Message '(E)', @_;
582
    $ScmErrorCount++;
581
    $ScmErrorCount++;
583
    #DebugTraceBack();
582
#    DebugTraceBack();
584
    ErrorDoExit() unless ( $ScmDelayExit );
583
    ErrorDoExit() unless ( $ScmDelayExit );
585
}
584
}
586
 
585
 
587
#-------------------------------------------------------------------------------
586
#-------------------------------------------------------------------------------
588
# Function        : ReportError
587
# Function        : ReportError
Line 632... Line 631...
632
# Function        : ArgsToString
631
# Function        : ArgsToString
633
#
632
#
634
# Description     : Convert an array of arguments to a string
633
# Description     : Convert an array of arguments to a string
635
#                   Main purpose is to allow Debug and Verbose
634
#                   Main purpose is to allow Debug and Verbose
636
#                   calls to pass undef values without causing warnings
635
#                   calls to pass undef values without causing warnings
-
 
636
#                   
-
 
637
#                   Put all args on one line, unless '++' is encountered
-
 
638
#                   This will force one arg per line mode
637
#
639
#
638
# Inputs          : REF to a list of scalar values
640
# Inputs          : REF to a list of scalar values
639
#                   Passing a REF is faster
641
#                   Passing a REF is faster
640
#
642
#
641
# Returns         : A string
643
# Returns         : A string. May be empty, but will be defined
642
#
644
#
643
sub ArgsToString
645
sub ArgsToString
644
{
646
{
645
    my $result = '';
647
    my @result;
-
 
648
    my $mode;
-
 
649
    foreach ( @{$_[0]} ) {
-
 
650
        my $item = defined($_) ? $_ : '\'undef\'';
-
 
651
        if ( $item eq '++' ) {
-
 
652
            @result = join (' ', @result);
-
 
653
            $mode = 1;
-
 
654
        } else {
-
 
655
            push @result, $item;
-
 
656
        }
-
 
657
    }
-
 
658
 
-
 
659
    unless ($mode) {
-
 
660
        @result = join (' ', @result);
-
 
661
    }
646
 
662
 
647
    $result .= (defined ($_) ? $_ : '\'undef\'') . ' ' foreach  ( @{$_[0]} );
663
    push @result, '' unless @result;
648
    return $result;
664
    return @result;
649
}
665
}
650
 
666
 
651
#-------------------------------------------------------------------------------
667
#-------------------------------------------------------------------------------
652
# Function        : Verbose0
668
# Function        : Verbose0
653
#                   Verbose
669
#                   Verbose
Line 656... Line 672...
656
#
672
#
657
# Description     : Various levels of progress reporting
673
# Description     : Various levels of progress reporting
658
#                   By default none are displayed
674
#                   By default none are displayed
659
#
675
#
660
# Inputs          : A single line string
676
# Inputs          : A single line string
661
#                   Multi-line output is not supported
677
#                   Multi-line output is supported after arg that is '++'
662
#                   Arguments will be processed such that undef is handled well
678
#                   Arguments will be processed such that undef is handled well
663
#
679
#
664
sub Verbose0
680
sub Verbose0
665
{
681
{
666
    _Message '------', ArgsToString (\@_);
682
    _Message '------', ArgsToString (\@_);
Line 695... Line 711...
695
#
711
#
696
# Description     : Various levels of debug reporting
712
# Description     : Various levels of debug reporting
697
#                   By default none are displayed
713
#                   By default none are displayed
698
#
714
#
699
# Inputs          : A single line string
715
# Inputs          : A single line string
700
#                   Multi-line output is not supported
716
#                   Multi-line output is supported after arg that is '++'
701
#                   Arguments will be processed such that undef is handled well
717
#                   Arguments will be processed such that undef is handled well
702
#
718
#
703
sub Debug0
719
sub Debug0
704
{
720
{
705
    _Message '------', ArgsToString (\@_);
721
    _Message '------', ArgsToString (\@_);