[ovs-dev] [PATCH 2/3] dot2pic: Use "> $@; mv $@.tmp $@" notation to make this reliably fail

YAMAMOTO Takashi yamamoto at valinux.co.jp
Thu May 8 03:09:11 UTC 2014


Signed-off-by: YAMAMOTO Takashi <yamamoto at valinux.co.jp>
---
 vswitchd/automake.mk | 3 ++-
 vtep/automake.mk     | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk
index c45d01d..b75322f 100644
--- a/vswitchd/automake.mk
+++ b/vswitchd/automake.mk
@@ -31,7 +31,8 @@ if HAVE_DOT
 vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema
 	$(OVSDB_DOT) --no-arrows $(srcdir)/vswitchd/vswitch.ovsschema > $@
 vswitchd/vswitch.pic: vswitchd/vswitch.gv ovsdb/dot2pic
-	(dot -T plain < vswitchd/vswitch.gv | $(srcdir)/ovsdb/dot2pic -f 3) > $@;
+	(dot -T plain < vswitchd/vswitch.gv | $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp;
+	mv $@.tmp $@
 VSWITCH_PIC = vswitchd/vswitch.pic
 VSWITCH_DOT_DIAGRAM_ARG = --er-diagram=$(VSWITCH_PIC)
 DISTCLEANFILES += vswitchd/vswitch.gv vswitchd/vswitch.pic
diff --git a/vtep/automake.mk b/vtep/automake.mk
index f06148a..4c4ecba 100644
--- a/vtep/automake.mk
+++ b/vtep/automake.mk
@@ -34,7 +34,8 @@ if HAVE_DOT
 vtep/vtep.gv: ovsdb/ovsdb-dot.in vtep/vtep.ovsschema
 	$(OVSDB_DOT) --no-arrows $(srcdir)/vtep/vtep.ovsschema > $@
 vtep/vtep.pic: vtep/vtep.gv ovsdb/dot2pic
-	(dot -T plain < vtep/vtep.gv | $(srcdir)/ovsdb/dot2pic -f 3) > $@;
+	(dot -T plain < vtep/vtep.gv | $(srcdir)/ovsdb/dot2pic -f 3) > $@.tmp;
+	mv $@.tmp $@
 VTEP_PIC = vtep/vtep.pic
 VTEP_DOT_DIAGRAM_ARG = --er-diagram=$(VTEP_PIC)
 DISTCLEANFILES += vtep/vtep.gv vtep/vtep.pic
-- 
1.8.3.1




More information about the dev mailing list