svn commit: r54081 - in head/share: mk pgpkeys

Marc Fonvieille <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
Author: blackend
Date: Wed Apr 29 08:30:56 2020
New Revision: 54081
URL: https://svnweb.freebsd.org/changeset/doc/54081

Log:
  - Tidy up .ps.eps target to make sure the build really fails when a
    problem occurs during conversion.  Currently the build doesn't stop on
    failures and runs to its end;
  - Add some .DELETE_ON_ERROR targets to remove broken target files on
    failures.
  
  Submitted by:	mandree
  Reviewed by:	blackend
  Differential Revision:	https://reviews.freebsd.org/D24560

Modified:
  head/share/mk/doc.images.mk
  head/share/pgpkeys/Makefile

Modified: head/share/mk/doc.images.mk
==============================================================================
--- head/share/mk/doc.images.mk	Wed Apr 29 07:48:03 2020	(r54080)
+++ head/share/mk/doc.images.mk	Wed Apr 29 08:30:56 2020	(r54081)
@@ -96,6 +96,13 @@ EPS2PNM_RES?=	100
 # Use suffix rules to convert .scr files to other formats
 .SUFFIXES:	.scr .pic .png .ps .eps .txt
 
+#
+# There are many rules around here that use > ${.TARGET}
+# so that on failure, may leave corrupt files behind.
+# Make sure to remove them.
+#
+.DELETE_ON_ERROR:
+
 .scr.png:
 	${SCR2PNG} ${SCR2PNGOPTS} < ${.IMPSRC} > ${.TARGET}
 
@@ -145,8 +152,8 @@ EPS2PNM_RES?=	100
 # (the older versions calculated BBox directly in ps2epsi.ps).
 .ps.eps:
 	tmpfile=$$(mktemp ${.TARGET}.XXXXXXXX); \
-	${PS2BBOX} ${PS2BBOXOPTS} ${.ALLSRC} > $$tmpfile 2>&1; \
-	${SETENV} outfile=$$tmpfile ${PS2EPS} ${PS2EPSOPTS} < ${.ALLSRC} 1>&2; \
+	${PS2BBOX} ${PS2BBOXOPTS} ${.ALLSRC} 2> $$tmpfile >$$tmpfile.err && \
+	${SETENV} outfile=$$tmpfile ${PS2EPS} ${PS2EPSOPTS} < ${.ALLSRC} >>$$tmpfile.err 2>&1 && \
 	(echo "save countdictstack mark newpath /showpage {} def /setpagedevice {pop} def";\
 		echo "%%EndProlog";\
 		echo "%%Page: 1 1";\
@@ -161,7 +168,9 @@ EPS2PNM_RES?=	100
 		echo "cleartomark countdictstack exch sub { end } repeat restore";\
 		echo "%%EOF";\
 	) >> $$tmpfile; \
-	${MV} -f $$tmpfile ${.TARGET}
+	test ! -s $$tmpfile.err && \
+	{ ${MV} -f $$tmpfile ${.TARGET} ; ${RM} -f $$tmpfile.err ; } \
+	|| { ${CAT} $$tmpfile.err ; ${RM} -f $$tmpfile.err $$tmpfile ; false ; }
 
 # We can't use suffix rules to generate the rules to convert EPS to PNG and
 # PNG to EPS.  This is because a .png file can depend on a .eps file, and

Modified: head/share/pgpkeys/Makefile
==============================================================================
--- head/share/pgpkeys/Makefile	Wed Apr 29 07:48:03 2020	(r54080)
+++ head/share/pgpkeys/Makefile	Wed Apr 29 08:30:56 2020	(r54081)
@@ -10,6 +10,8 @@ CLEANFILES=	pgpkeyring.txt keyring.xml
 .ORDER:	pgpkeyring pgpkeyring.txt
 .ORDER:	keyring.xml pgpkeyring.txt
 
+.DELETE_ON_ERROR:
+
 all:	keyring.xml pgpkeyring pgpkeyring.txt
 
 keyring.xml:	.PHONY
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.