From: "Sebastian Pipping" <sping@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/betagarden:master commit in: sys-devel/make/files/, sys-devel/make/
Date: Mon, 26 Sep 2011 21:06:51 +0000 (UTC) [thread overview]
Message-ID: <4a2cc99d48cd6c30df3b95829f76d177f1870d6e.sping@gentoo> (raw)
commit: 4a2cc99d48cd6c30df3b95829f76d177f1870d6e
Author: Sebastian Pipping <sebastian <AT> pipping <DOT> org>
AuthorDate: Mon Sep 26 21:03:23 2011 +0000
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Mon Sep 26 21:06:23 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=4a2cc99d
sys-devel/make: Add colorization patch v1 (keeping revision on purpose)
---
sys-devel/make/files/make-3.82-color.patch | 141 ++++++++++++++++++++++++++++
sys-devel/make/make-3.82-r3.ebuild | 4 +-
2 files changed, 144 insertions(+), 1 deletions(-)
diff --git a/sys-devel/make/files/make-3.82-color.patch b/sys-devel/make/files/make-3.82-color.patch
new file mode 100644
index 0000000..d6fa0bf
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-color.patch
@@ -0,0 +1,141 @@
+From 9cb97d5705658f31ba3c4fb197d8800e3f77aec0 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Mon, 26 Sep 2011 22:54:04 +0200
+Subject: [PATCH] Colorize make output (v1)
+
+---
+ job.c | 2 +-
+ main.c | 2 ++
+ misc.c | 16 +++++++++-------
+ remake.c | 45 ++++++++++++++++++++++++++++++++++++++++-----
+ 4 files changed, 52 insertions(+), 13 deletions(-)
+
+diff --git a/job.c b/job.c
+index aacfb84..37017e0 100644
+--- a/job.c
++++ b/job.c
+@@ -1144,7 +1144,7 @@ start_job_command (struct child *child)
+ appear. */
+
+ message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
+- ? "%s" : (char *) 0, p);
++ ? "\033[1;35m%s\033[0m" : (char *) 0, p);
+
+ /* Tell update_goal_chain that a command has been started on behalf of
+ this target. It is important that this happens here and not in
+diff --git a/main.c b/main.c
+index c6989e3..5c6528d 100644
+--- a/main.c
++++ b/main.c
+@@ -3231,6 +3231,7 @@ log_working_directory (int entering)
+
+ /* Use entire sentences to give the translators a fighting chance. */
+
++ printf ("\033[0;36m");
+ if (makelevel == 0)
+ if (starting_directory == 0)
+ if (entering)
+@@ -3259,6 +3260,7 @@ log_working_directory (int entering)
+ else
+ printf (_("%s[%u]: Leaving directory `%s'\n"),
+ program, makelevel, starting_directory);
++ printf ("\033[0m");
+
+ /* Flush stdout to be sure this comes before any stderr output. */
+ fflush (stdout);
+diff --git a/misc.c b/misc.c
+index 7a6f773..ad31b83 100644
+--- a/misc.c
++++ b/misc.c
+@@ -236,16 +236,18 @@ message (prefix, fmt, va_alist)
+ if (fmt != 0)
+ {
+ if (prefix)
+- {
+- if (makelevel == 0)
+- printf ("%s: ", program);
+- else
+- printf ("%s[%u]: ", program, makelevel);
+- }
++ {
++ if (makelevel == 0)
++ printf ("\033[36m%s: ", program);
++ else
++ printf ("\033[36m%s[%u]: ", program, makelevel);
++ }
++ else
++ printf ("\033[36m");
+ VA_START (args, fmt);
+ VA_PRINTF (stdout, fmt, args);
+ VA_END (args);
+- putchar ('\n');
++ printf ("\n\033[0m");
+ }
+
+ fflush (stdout);
+diff --git a/remake.c b/remake.c
+index 27d2550..3babb7a 100644
+--- a/remake.c
++++ b/remake.c
+@@ -69,6 +69,38 @@ static void remake_file (struct file *file);
+ static FILE_TIMESTAMP name_mtime (const char *name);
+ static const char *library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr);
+
++/*
++ * Take string <text> and wrap it by <begin> and <end>
++ * The result is malloc'd and has to be free'd.
++ */
++static char * colorize(const char * begin, const char * text, const char * end) {
++ const char * const jobs[] = {begin, text, end};
++ const size_t job_count = sizeof(jobs) / sizeof(char *);
++ size_t job_lens[job_count];
++ size_t out_len = 1;
++ int i = 0;
++
++ /* Count */
++ for (; i < job_count; i++) {
++ job_lens[i] = strlen(jobs[i]);
++ out_len += job_lens[i];
++ }
++
++ /* Allocate */
++ char * const out = malloc(266);
++ assert(out);
++
++ /* Concat */
++ char * walker = out;
++ for (i = 0; i < job_count; i++) {
++ strcpy(walker, jobs[i]);
++ walker += job_lens[i];
++ }
++ walker[0] = '\0';
++
++ return out;
++}
++
+ \f
+ /* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
+ was done, 0 if all goals were updated successfully, or 1 if a goal failed.
+@@ -230,11 +262,14 @@ update_goal_chain (struct dep *goals)
+ && file->update_status == 0 && !g->changed
+ /* Never give a message under -s or -q. */
+ && !silent_flag && !question_flag)
+- message (1, ((file->phony || file->cmds == 0)
+- ? _("Nothing to be done for `%s'.")
+- : _("`%s' is up to date.")),
+- file->name);
+-
++ {
++ const char * const text = ((file->phony || file->cmds == 0)
++ ? _("Nothing to be done for `%s'.")
++ : _("`%s' is up to date."));
++ char * const colorized = colorize("\033[36m", text, "\033[0m");
++ message (1, colorized, file->name);
++ free (colorized);
++ }
+ /* This goal is finished. Remove it from the chain. */
+ if (lastgoal == 0)
+ goals = g->next;
+--
+1.7.6.1
+
diff --git a/sys-devel/make/make-3.82-r3.ebuild b/sys-devel/make/make-3.82-r3.ebuild
index b1de58f..905f4ac 100644
--- a/sys-devel/make/make-3.82-r3.ebuild
+++ b/sys-devel/make/make-3.82-r3.ebuild
@@ -12,7 +12,7 @@ SRC_URI="mirror://gnu//make/${P}.tar.bz2"
LICENSE="GPL-3"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+KEYWORDS="~amd64 ~x86"
IUSE="nls static"
DEPEND="nls? ( sys-devel/gettext )"
@@ -23,6 +23,8 @@ src_prepare() {
epatch "${FILESDIR}"/${P}-MAKEFLAGS-reexec.patch #31975
epatch "${FILESDIR}"/${P}-memory-corruption.patch #355907
epatch "${FILESDIR}"/${P}-glob-speedup.patch #382845
+
+ epatch "${FILESDIR}"/${P}-color.patch
}
src_configure() {
next reply other threads:[~2011-09-26 21:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-26 21:06 Sebastian Pipping [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-09-27 12:23 [gentoo-commits] proj/betagarden:master commit in: sys-devel/make/files/, sys-devel/make/ Sebastian Pipping
2011-09-26 21:06 Sebastian Pipping
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a2cc99d48cd6c30df3b95829f76d177f1870d6e.sping@gentoo \
--to=sping@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox