This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Remove trailing blank lines when generating INSTALL


On Fri, 28 Jun 2013, Roland McGrath wrote:

> awk 'NF == 0 { ++n; next } NF != 0 { while (n-- > 0) print ""; n = 0; print }'

Here is a patch using that command for the blank line removal.

2013-07-01  Joseph Myers  <joseph@codesourcery.com>
	    Roland McGrath  <roland@hack.frob.com>

	* Makefile (INSTALL): Remove trailing blank lines from output of
	makeinfo.

diff --git a/Makefile b/Makefile
index 7d8eccf..9f0f26c 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
+	awk 'NF == 0 { ++n; next } \
+	     NF != 0 { while (n-- > 0) print ""; n = 0; print }' \
+	  < $@-tmp > $@-tmp2
+	mv -f $@-tmp2 $@
+	rm -f $@-tmp
 	-chmod a-w $@
 $(common-objpfx)manual/%: FORCE
 	$(MAKE) $(PARALLELMFLAGS) -C manual $@

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]