[colorgcc/f20] Allow using "color" prefix as well as "color-" prefix (bz1078180)
Martin Cermak
mcermak at fedoraproject.org
Thu Apr 17 12:10:23 UTC 2014
commit 022a5e925900f056ce8dc30e20ef0aeb47453326
Author: Martin Cermak <mcermak at redhat.com>
Date: Thu Apr 17 14:09:28 2014 +0200
Allow using "color" prefix as well as "color-" prefix (bz1078180)
README | 37 +++++++++++++++++++++++++++
colorgcc-1.3.2-bz1078180.patch | 17 ++++++++++++
colorgcc.spec | 27 +++++++++++++++++++-
colorgccrc.txt | 54 ++++++++++++++++++++++++++++++++++++++++
sampleconfig.patch | 24 +++++++++++++++++
5 files changed, 158 insertions(+), 1 deletions(-)
---
diff --git a/README b/README
new file mode 100644
index 0000000..50c7ff8
--- /dev/null
+++ b/README
@@ -0,0 +1,37 @@
+The colorgcc is a perl script written by Jamie Moyers to colorize the
+terminal output of C++, CC, CCACHE, G++, GCC so error messages can be
+found within longer compiler outputs.
+
+Homepage:
+
+ http://schlueters.de/colorgcc.html
+
+Usage:
+
+Call the compiler name with the 'color-' prefix, eg:
+
+ color-gcc
+ color-g++
+ color-cc
+ color-c++
+
+That's it. Alternatively you may want to create following handy aliases:
+
+ alias gcc='color-gcc'
+ alias g++='color-g++'
+ alias cc='color-cc'
+ alias c++='color-c++'
+
+The default settings can be overridden with ~/.colorgccrc. See the
+comments in the packaged sample config file for more information.
+
+Note:
+
+colorgcc will only emit color codes if:
+
+ (1) Its STDOUT is a tty and
+ (2) the value of $TERM is not listed in the "nocolor" option.
+
+If colorgcc colorizes the output, the compiler's STDERR will be combined
+with STDOUT. Otherwise, colorgcc just passes the output from the
+compiler through without modification.
diff --git a/colorgcc-1.3.2-bz1078180.patch b/colorgcc-1.3.2-bz1078180.patch
new file mode 100644
index 0000000..e6db007
--- /dev/null
+++ b/colorgcc-1.3.2-bz1078180.patch
@@ -0,0 +1,17 @@
+diff --git a/colorgcc.1.3.2.txt b/colorgcc.1.3.2.txt
+index 258ab97..f7c4a1e 100644
+--- a/colorgcc.1.3.2.txt
++++ b/colorgcc.1.3.2.txt
+@@ -95,6 +95,12 @@ sub initDefaults
+ $compilerPaths{"color-c++"} = "c++";
+ $compilerPaths{"color-ccache"} = "ccache";
+
++ $compilerPaths{"colorgcc"} = "gcc";
++ $compilerPaths{"colorg++"} = "g++";
++ $compilerPaths{"colorcc"} = "cc";
++ $compilerPaths{"colorc++"} = "c++";
++ $compilerPaths{"colorccache"} = "ccache";
++
+ $nocolor{"dumb"} = "true";
+
+ $colors{"srcColor"} = color("cyan");
diff --git a/colorgcc.spec b/colorgcc.spec
index bcb8b39..c9abae6 100644
--- a/colorgcc.spec
+++ b/colorgcc.spec
@@ -1,13 +1,17 @@
Summary: Script to colorize the compiler output
Name: colorgcc
Version: 1.3.2
-Release: 7%{?dist}
+Release: 8%{?dist}
License: GPL+
Group: Development/Tools
Url: http://schlueters.de/colorgcc.html
Source0: http://schlueters.de/colorgcc.%{version}.txt
+Source1: http://schlueters.de/colorgccrc.txt
+Source2: README
BuildArch: noarch
Patch0: colorgcc-1.3.2-invocation.patch
+Patch1: sampleconfig.patch
+Patch2: colorgcc-1.3.2-bz1078180.patch
Requires: perl
%description
@@ -17,7 +21,11 @@ CCACHE, G++, GCC so error messages can be found within longer compiler outputs.
%prep
%setup -q -c -T
cp -p %{SOURCE0} .
+cp -p %{SOURCE1} ./colorgccrc.sample
+cp -p %{SOURCE2} .
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%install
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
@@ -27,6 +35,12 @@ ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/color-cc
ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/color-c++
ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/color-ccache
+ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/colorgcc
+ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/colorg++
+ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/colorcc
+ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/colorc++
+ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/colorccache
+
%files
%defattr(-,root,root,-)
%{_bindir}/color-gcc
@@ -35,7 +49,18 @@ ln -s %{_bindir}/color-gcc $RPM_BUILD_ROOT/%{_bindir}/color-ccache
%{_bindir}/color-c++
%{_bindir}/color-ccache
+%{_bindir}/colorgcc
+%{_bindir}/colorg++
+%{_bindir}/colorcc
+%{_bindir}/colorc++
+%{_bindir}/colorccache
+%doc README colorgccrc.sample
+
%changelog
+* Thu Apr 17 2014 Martin Cermak <mcermak at redhat.com> 1.3.2-8
+- Allow using "color" prefix as well as "color-" prefix (bz1078180)
+- Added README and sample config file
+
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.3.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
diff --git a/colorgccrc.txt b/colorgccrc.txt
new file mode 100644
index 0000000..5ec5949
--- /dev/null
+++ b/colorgccrc.txt
@@ -0,0 +1,54 @@
+#
+# colorgcc configuration file
+#
+# $Id: colorgccrc,v 1.1.1.1 1999/04/25 15:24:03 jamoyers Exp $
+#
+# This file should be named $HOME/.colorgccrc
+#
+#
+# The following groups of attributes may be combined for a given color:
+#
+# clear black on_black
+# reset red on_red
+# bold green on_green
+# underline yellow on_yellow
+# underscore blue on_blue
+# blink magenta on_magenta
+# reverse cyan on_cyan
+# concealed white on_white
+#
+# For example, srcColor: bold cyan on_yellow
+#
+
+# Define the paths to the actual location of the various compilers.
+# (Currently, colorgcc only understands these: g++ gcc c++ cc)
+g++: /usr/bin/g++
+gcc: /usr/bin/gcc
+c++: /usr/bin/c++
+cc: /usr/bin/cc
+
+# Don't do color if our terminal type ($TERM) is one of these.
+# (List all terminal types on one line, seperated by whitespace.)
+nocolor: dumb
+
+# Text between ` and ' is usually source code.
+srcColor: bold cyan
+
+# Text other than a warning or error.
+introColor: reset
+
+# Warnings and errors both have similar formats:
+# filename:999:Message
+# Each field may be assigned a different color.
+
+# Warnings
+warningFileNameColor: reset
+warningNumberColor: white
+warningMessageColor: yellow
+
+# Errors
+errorFileNameColor: reset
+errorNumberColor: white
+errorMessageColor: bold red
+
+
diff --git a/sampleconfig.patch b/sampleconfig.patch
new file mode 100644
index 0000000..7263051
--- /dev/null
+++ b/sampleconfig.patch
@@ -0,0 +1,24 @@
+diff --git a/colorgccrc.sample b/colorgccrc.sample
+index 5ec5949..8e87f98 100644
+--- a/colorgccrc.sample
++++ b/colorgccrc.sample
+@@ -20,12 +20,14 @@
+ # For example, srcColor: bold cyan on_yellow
+ #
+
+-# Define the paths to the actual location of the various compilers.
++# Define the paths to the actual location of the various compilers. By default
++# colorgcc calls basenames (e.g. 'gcc') so that $PATH setting is important.
+ # (Currently, colorgcc only understands these: g++ gcc c++ cc)
+-g++: /usr/bin/g++
+-gcc: /usr/bin/gcc
+-c++: /usr/bin/c++
+-cc: /usr/bin/cc
++#
++# g++: /usr/bin/g++
++# gcc: /usr/bin/gcc
++# c++: /usr/bin/c++
++# cc: /usr/bin/cc
+
+ # Don't do color if our terminal type ($TERM) is one of these.
+ # (List all terminal types on one line, seperated by whitespace.)
More information about the scm-commits
mailing list