Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 94759 - g-cpan's "usage" message prints several warning due to uninitialized color variables
Summary: g-cpan's "usage" message prints several warning due to uninitialized color va...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: x86 Linux
: High trivial (vote)
Assignee: Michael Cummings (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-01 11:13 UTC by Gustavo M. Gama
Modified: 2005-06-01 13:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo M. Gama 2005-06-01 11:13:42 UTC
when invoking g-cpan with invalid parameters (i.e., "g-cpan --help"), the
"Usage" message is displayed, as usual. However, in version 0.13-r1, the
definion of the color variables (${white}, ${green}, etc) is done after the
"exit_usage()" method is called, thus causing several warning messages --
complaining about uninitialized variables -- to be printed before the usage
message itself -- and, as a side effect, the usage message has no colors.

Reproducible: Always
Steps to Reproduce:
1. emerge g-cpan
2. g-cpan --help

Actual Results:  
Before the usuage message was displayed, several "warnings" were printed, and
the usage message itself had no colors, as it was supposed to.

Expected Results:  
See above.

The following patch should fix it:

62,67d61
< # Set colors here so we can use them at will anywhere :)
< my $green = color("bold green");
< my $white = color ("bold white");
< my $cyan = color("bold cyan");
< my $reset = color("reset");
< 
81a76,81
> # Set colors here so we can use them at will anywhere :)
> my $green = color("bold green");
> my $white = color ("bold white");
> my $cyan = color("bold cyan");
> my $reset = color("reset");
>
Comment 1 Michael Cummings (RETIRED) gentoo-dev 2005-06-01 11:28:56 UTC
ack, i had this fixed at one point. expect in 13.01 (so i can avoid the whole 
mess i started with -r1). 
Comment 2 Michael Cummings (RETIRED) gentoo-dev 2005-06-01 13:40:04 UTC
0.13.01 is in the tree now :)