This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Remove trailing blank lines when generating INSTALL
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Fri, 28 Jun 2013 22:14:44 +0000
- Subject: Remove trailing blank lines when generating INSTALL
The Makefile rule to rebuild the INSTALL file leaves a trailing blank
line at the end of the file (at least, for some makeinfo versions),
causing git hooks to complain about bad whitespace if you try to check
in the regenerated file. This patch changes that rule to remove any
trailing blank lines. Tested x86_64.
2013-06-28 Joseph Myers <joseph@codesourcery.com>
* Makefile (INSTALL): Remove trailing blank lines from output of
makeinfo.
diff --git a/Makefile b/Makefile
index 7d8eccf..fe7dfc6 100644
--- a/Makefile
+++ b/Makefile
@@ -403,7 +403,12 @@ endif
INSTALL: manual/install.texi manual/macros.texi \
$(common-objpfx)manual/pkgvers.texi
makeinfo --no-validate --plaintext --no-number-sections \
- -I$(common-objpfx)manual $< -o $@
+ -I$(common-objpfx)manual $< -o $@-tmp
+ while tail -n 1 $@-tmp | grep '^$$'; do \
+ head -n -1 $@-tmp > $@-tmp2; \
+ mv $@-tmp2 $@-tmp; \
+ done
+ mv -f $@-tmp $@
-chmod a-w $@
$(common-objpfx)manual/%: FORCE
$(MAKE) $(PARALLELMFLAGS) -C manual $@
--
Joseph S. Myers
joseph@codesourcery.com