Remove trailing blank lines when generating INSTALL
Joseph S. Myers
joseph@codesourcery.com
Fri Jun 28 22:35:00 GMT 2013
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
More information about the Libc-alpha
mailing list