git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix spurious compile error

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 16, 2007, 21:10 UTC
Message-ID
<Pine.LNX.4.63.0701162210060.22628@wbgn013.biozentrum.uni-wuerzburg.de>
>From time to time, I would get this error:

[...] sed: -e expression #8, char 41: Unterminated `s' command make: *** [git-add--interactive] Error 1

Turns out that the function WriteMakefile() called in Makefile.PL outputs the message "Writing perl.mak for Git" to stdout! Thus, the output of "make -C perl -s --no-print-directory instlibdir" would be prefixed by that message whenever Makefile.PL was newer than perl.mak.

This is fixed by redirecting stdout to stderr in Makefile.PL.
Signed-off-by: Johannes E. Schindelin <johannes.schindelin@gmx.de>
---
 perl/Makefile.PL |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 4168775..9b117fd 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -20,6 +20,10 @@ if ($@) {
 my %extra;
 $extra{DESTDIR} = $ENV{DESTDIR} if $ENV{DESTDIR};
 
+# redirect stdout, otherwise the message "Writing perl.mak for Git"
+# disrupts the output for the target 'instlibdir'
+open STDOUT, ">&STDERR";
+
 WriteMakefile(
 	NAME            => 'Git',
 	VERSION_FROM    => 'Git.pm',
-- 
1.3.3.g79f3
Message 1 of 1 in “Fix spurious compile error”
  1. Fix spurious compile errorJohannes Schindelin, Jan 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.