From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../colorgcc/files/colorgcc-1.3.2-gentoo-two.patch | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch (limited to 'dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch') diff --git a/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch b/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch new file mode 100644 index 000000000000..911a31b21bf3 --- /dev/null +++ b/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch @@ -0,0 +1,75 @@ +--- colorgcc.r9 2003-09-21 12:14:48.000000000 -0700 ++++ colorgcc 2003-09-21 13:11:22.000000000 -0700 +@@ -95,6 +95,7 @@ + use Cwd 'abs_path'; + + my(%nocolor, %colors, %compilerPaths); ++my($unfinishedQuote, $previousColor); + + sub initDefaults + { +@@ -159,14 +160,37 @@ + + my($line, $normalColor) = @_; + ++ if (defined $normalColor) ++ { ++ $previousColor = $normalColor; ++ } ++ else ++ { ++ $normalColor = $previousColor; ++ } ++ + my($srcon) = color("reset") . $colors{"srcColor"}; + my($srcoff) = color("reset") . $normalColor; + +- $line = $normalColor . $line; ++ $line = ($unfinishedQuote? $srcon : $normalColor) . $line; + +- # This substitute replaces `foo' with `AfooB' where A is the escape ++ # These substitutions replaces `foo' with `AfooB' where A is the escape + # sequence that turns on the the desired source color, and B is the + # escape sequence that returns to $normalColor. ++ ++ # Handle multi-line quotes. ++ if ($unfinishedQuote) { ++ if ($line =~ s/^([^\`]*?)\'/$1$srcoff\'/) ++ { ++ $unfinishedQuote = 0; ++ } ++ } ++ if ($line =~ s/\`([^\']*?)$/\`$srcon$1/) ++ { ++ $unfinishedQuote = 1; ++ } ++ ++ # Single line quoting. + $line =~ s/\`(.*?)\'/\`$srcon$1$srcoff\'/g; + + print($line, color("reset")); +@@ -190,6 +214,10 @@ + loadPreferences('/etc/colorgcc/colorgccrc'); + } + ++# Set our default output color. This presumes that any unrecognized output ++# is an error. ++$previousColor = $colors{"errorMessageColor"}; ++ + # Figure out which compiler to invoke based on our program name. + $0 =~ m%.*/(.*)$%; + my $progName = $1 || $0; +@@ -281,10 +309,9 @@ + # No line number, treat as an "introductory" line of text. + srcscan($_, $colors{"introColor"}); + } +- else # Anything else. ++ else # Anything else. + { +- # Doesn't seem to be a warning or an error. Print normally. +- print(color("reset"), $_); ++ srcscan($_, undef); + } + } + + -- cgit v1.2.3