[ovs-dev] [PATCHv3] ovsdb-doc: generate vswitch.[pic|gv] files only if dot tool is available

Ansis Atteka aatteka at nicira.com
Tue Oct 15 21:38:11 UTC 2013


These are auto-generated files, so it would be better not to keep them
inside Open vSwitch repository.

Behaviour before this patch was that if dot tool was not present on
the system, then ovs-vswitchd.conf.db.5 would have used pre-generated
vswitch.pic file that was already checked in the git repository. After
this patch ovs-vswitchd.conf.db.5 will simply not have a dot diagram,
if dot was not present at the time when Open vSwitch was built.

Signed-off-by: Ansis Atteka <aatteka at nicira.com>
---
 INSTALL              |  5 ++-
 INSTALL.RHEL         |  2 +-
 debian/control       |  2 +-
 vswitchd/.gitignore  |  2 ++
 vswitchd/automake.mk | 39 +++++++---------------
 vswitchd/vswitch.gv  | 40 ----------------------
 vswitchd/vswitch.pic | 94 ----------------------------------------------------
 7 files changed, 18 insertions(+), 166 deletions(-)
 delete mode 100644 vswitchd/vswitch.gv
 delete mode 100644 vswitchd/vswitch.pic

diff --git a/INSTALL b/INSTALL
index 4c54b59..c8b1aa7 100644
--- a/INSTALL
+++ b/INSTALL
@@ -93,9 +93,8 @@ To run the unit tests, you also need:
     - Perl.  Version 5.10.1 is known to work.  Earlier versions should
       also work.
 
-If you modify the vswitchd database schema, then the E-R diagram in
-the ovs-vswitchd.conf.db(5) manpage will be updated properly only if
-you have the following:
+The ovs-vswitchd.conf.db(5) manpage will include an E-R diagram, in
+formats other than plain text, only if you have the following:
 
     - "dot" from graphviz (http://www.graphviz.org/).
 
diff --git a/INSTALL.RHEL b/INSTALL.RHEL
index 26b47d9..9ab5384 100644
--- a/INSTALL.RHEL
+++ b/INSTALL.RHEL
@@ -34,7 +34,7 @@ RHEL.  On RHEL 5, the default RPM source directory is
 
 2. Install build prerequisites:
 
-   yum install gcc make python-devel openssl-devel kernel-devel \
+   yum install gcc make python-devel openssl-devel kernel-devel, graphviz \
        kernel-debug-devel autoconf automake rpm-build redhat-rpm-config
 
 3. Some versions of the RHEL 6 kernel-devel package contain a broken
diff --git a/debian/control b/debian/control
index 46b5630..713ebaf 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Open vSwitch developers <dev at openvswitch.org>
 Uploaders: Ben Pfaff <pfaffben at debian.org>, Simon Horman <horms at debian.org>
 Build-Depends:
  debhelper (>= 8), autoconf (>= 2.64), automake (>= 1.10) | automake1.10, 
- libssl-dev, bzip2, openssl,
+ libssl-dev, bzip2, openssl, graphviz,
  python-all (>= 2.6.6-3~), procps, python-qt4,
  python-zopeinterface, python-twisted-conch
 Standards-Version: 3.9.3
diff --git a/vswitchd/.gitignore b/vswitchd/.gitignore
index afdff20..04eaf9d 100644
--- a/vswitchd/.gitignore
+++ b/vswitchd/.gitignore
@@ -4,3 +4,5 @@
 /ovs-vswitchd.8
 /ovs-vswitchd.conf.db.5
 /vswitch.ovsschema.stamp
+/vswitch.gv
+/vswitch.pic
diff --git a/vswitchd/automake.mk b/vswitchd/automake.mk
index 6260a72..934a5c5 100644
--- a/vswitchd/automake.mk
+++ b/vswitchd/automake.mk
@@ -25,35 +25,20 @@ pkgdata_DATA += vswitchd/vswitch.ovsschema
 
 # vswitch E-R diagram
 #
-# There are two complications here.  First, if "python" or "dot" is not
-# available, then we have to just use the existing diagram.  Second, different
-# "dot" versions produce slightly different output for the same input, but we
-# don't want to gratuitously change vswitch.pic if someone tweaks the schema in
-# some minor way that doesn't affect the table structure.  To avoid that we
-# store a checksum of vswitch.gv in vswitch.pic and only regenerate vswitch.pic
-# if vswitch.gv actually changes.
-$(srcdir)/vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema
+# If "python" or "dot" is not available, then we do not add graphical diagram
+# to the documentation.
 if HAVE_PYTHON
+if HAVE_DOT
+$(srcdir)/vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema
 	$(OVSDB_DOT) $(srcdir)/vswitchd/vswitch.ovsschema > $@
-else
-	touch $@
-endif
 $(srcdir)/vswitchd/vswitch.pic: $(srcdir)/vswitchd/vswitch.gv ovsdb/dot2pic
-if HAVE_DOT
-	sum=`cksum < $(srcdir)/vswitchd/vswitch.gv`;			\
-	if grep "$$sum" $@ >/dev/null 2>&1; then			\
-	  echo "vswitch.gv unchanged, not regenerating vswitch.pic";	\
-	  touch $@;							\
-	else								\
-	  echo "regenerating vswitch.pic";				\
-	  (echo ".\\\" Generated from vswitch.gv with cksum \"$$sum\"";	\
-	   dot -T plain < $(srcdir)/vswitchd/vswitch.gv			\
-	    | $(srcdir)/ovsdb/dot2pic -f 3) > $@;			\
-	fi
-else
-	touch $@
+	(dot -T plain < $(srcdir)/vswitchd/vswitch.gv			\
+	  | $(srcdir)/ovsdb/dot2pic -f 3) > $@;
+VSWITCH_PIC=$(srcdir)/vswitchd/vswitch.pic
+OVSDB_DOT_DIAGRAM_ARG=--er-diagram=$(VSWITCH_PIC)
+CLEANFILES += vswitchd/vswitch.gv vswitchd/vswitch.pic
+endif
 endif
-EXTRA_DIST += vswitchd/vswitch.gv vswitchd/vswitch.pic
 
 # vswitch schema documentation
 EXTRA_DIST += vswitchd/vswitch.xml
@@ -61,10 +46,10 @@ DISTCLEANFILES += $(srcdir)/vswitchd/ovs-vswitchd.conf.db.5
 dist_man_MANS += vswitchd/ovs-vswitchd.conf.db.5
 $(srcdir)/vswitchd/ovs-vswitchd.conf.db.5: \
 	ovsdb/ovsdb-doc vswitchd/vswitch.xml vswitchd/vswitch.ovsschema \
-	$(srcdir)/vswitchd/vswitch.pic
+	$(VSWITCH_PIC)
 	$(OVSDB_DOC) \
 		--title="ovs-vswitchd.conf.db" \
-		--er-diagram=$(srcdir)/vswitchd/vswitch.pic \
+		$(OVSDB_DOT_DIAGRAM_ARG) \
 		--version=$(VERSION) \
 		$(srcdir)/vswitchd/vswitch.ovsschema \
 		$(srcdir)/vswitchd/vswitch.xml > $@.tmp
diff --git a/vswitchd/vswitch.gv b/vswitchd/vswitch.gv
deleted file mode 100644
index 51fdae1..0000000
--- a/vswitchd/vswitch.gv
+++ /dev/null
@@ -1,40 +0,0 @@
-digraph Open_vSwitch {
-	rankdir=LR;
-	size="6.5,4";
-	margin="0";
-	node [shape=box];
-	edge [dir=none, arrowhead=none, arrowtail=none];
-	Bridge [];
-	Bridge -> sFlow [label="sflow?"];
-	Bridge -> Mirror [label="mirrors*"];
-	Bridge -> IPFIX [label="ipfix?"];
-	Bridge -> Port [label="ports*"];
-	Bridge -> Controller [label="controller*"];
-	Bridge -> Flow_Table [label="flow_tables value*"];
-	Bridge -> NetFlow [label="netflow?"];
-	QoS [style=bold];
-	QoS -> Queue [label="queues value*"];
-	sFlow [];
-	Flow_Sample_Collector_Set [style=bold];
-	Flow_Sample_Collector_Set -> Bridge [label="bridge"];
-	Flow_Sample_Collector_Set -> IPFIX [label="ipfix?"];
-	IPFIX [];
-	Open_vSwitch [style=bold];
-	Open_vSwitch -> Bridge [label="bridges*"];
-	Open_vSwitch -> SSL [label="ssl?"];
-	Open_vSwitch -> Manager [label="manager_options*"];
-	Controller [];
-	Flow_Table [];
-	Queue [style=bold];
-	SSL [];
-	Manager [];
-	Mirror [];
-	Mirror -> Port [style=dotted, constraint=false, label="select_src_port*"];
-	Mirror -> Port [style=dotted, constraint=false, label="output_port?"];
-	Mirror -> Port [style=dotted, constraint=false, label="select_dst_port*"];
-	Interface [];
-	NetFlow [];
-	Port [];
-	Port -> QoS [label="qos?"];
-	Port -> Interface [label="interfaces+"];
-}
diff --git a/vswitchd/vswitch.pic b/vswitchd/vswitch.pic
deleted file mode 100644
index 3bd4e12..0000000
--- a/vswitchd/vswitch.pic
+++ /dev/null
@@ -1,94 +0,0 @@
-.\" Generated from vswitch.gv with cksum "813191710 1237"
-.ps -3
-.PS
-linethick = 1;
-linethick = 1;
-box at 2.421242138,1.420752459 wid 0.3611105806 height 0.213115 "Bridge"
-linethick = 1;
-box at 3.907122541,0.970866694 wid 0.3315131694 height 0.213115 "sFlow"
-linethick = 1;
-box at 3.907122541,0.651194194 wid 0.3492699112 height 0.213115 "Mirror"
-linethick = 1;
-box at 3.907122541,1.929884194 wid 0.3196725 height 0.213115 "IPFIX"
-linethick = 1;
-box at 3.907122541,0.2249556694 wid 0.3196725 height 0.213115 "Port"
-linethick = 1;
-box at 3.907122541,1.610211694 wid 0.509089112 height 0.213115 "Controller"
-linethick = 1;
-box at 3.907122541,1.290539194 wid 0.544636694 height 0.213115 "Flow_Table"
-linethick = 1;
-box at 3.907122541,2.249556694 wid 0.438079194 height 0.213115 "NetFlow"
-linethick = 0.5;
-box at 5.09685834,0.42623 wid 0.3196725 height 0.213115 "QoS"
-box at 5.09685834,0.42623 wid 0.264116944444444 height 0.157559444444444
-linethick = 0.5;
-box at 6.31630237,0.42623 wid 0.3670309153 height 0.213115 "Queue"
-box at 6.31630237,0.42623 wid 0.311475359744445 height 0.157559444444444
-linethick = 0.5;
-box at 0.609764638,2.113376209 wid 1.219486653 height 0.213115 "Flow_Sample_Collector_Set"
-box at 0.609764638,2.113376209 wid 1.16393109744444 height 0.157559444444444
-linethick = 0.5;
-box at 0.609764638,1.101079959 wid 0.686699153 height 0.213115 "Open_vSwitch"
-box at 0.609764638,1.101079959 wid 0.631143597444444 height 0.157559444444444
-linethick = 1;
-box at 2.421242138,0.781407459 wid 0.3196725 height 0.213115 "SSL"
-linethick = 1;
-box at 2.421242138,1.101079959 wid 0.455810362 height 0.213115 "Manager"
-linethick = 1;
-box at 5.09685834,0.1065575 wid 0.461734959 height 0.213115 "Interface"
-linethick = 1;
-spline -> from 2.585425934,1.312575285 to 2.585425934,1.312575285 to 2.608314485,1.295909692 to 2.63111779,1.278434262 to 2.652088306,1.260916209 to 2.703534267,1.217994848 to 2.699016229,1.184834154 to 2.758645806,1.154358709 to 3.077892076,0.991453603 to 3.506551587,0.966220787 to 3.739401036,0.966092918
-"sflow?" at 3.14344625,1.207637459
-linethick = 1;
-spline -> from 2.602048904,1.315686764 to 2.602048904,1.315686764 to 2.620845647,1.299234286 to 2.638150585,1.280949019 to 2.652088306,1.260916209 to 2.760819579,1.104916029 to 2.618714497,0.975299486 to 2.758645806,0.846535403 to 3.02580677,0.600728562 to 3.482938445,0.603584303 to 3.732325618,0.627240068
-"mirrors*" at 3.14344625,0.899814153
-linethick = 1;
-spline -> from 2.530911117,1.527523074 to 2.530911117,1.527523074 to 2.592927582,1.581867399 to 2.674721119,1.644139602 to 2.758645806,1.681221612 to 3.076357648,1.821664397 to 3.190203681,1.737569218 to 3.528246694,1.817402097 to 3.60036481,1.834408674 to 3.679046868,1.85708411 to 3.745964978,1.877628396
-"ipfix?" at 3.14344625,1.870680847
-linethick = 1;
-spline -> from 2.602091527,1.31918185 to 2.602091527,1.31918185 to 2.621399746,1.301919535 to 2.638832553,1.28252607 to 2.652088306,1.260916209 to 2.832980318,0.966817509 to 2.525753734,0.746286107 to 2.758645806,0.491357944 to 3.012678886,0.2132940166 to 3.494830262,0.1973231785 to 3.745964978,0.2103359804
-"ports*" at 3.14344625,0.544636694
-linethick = 1;
-spline -> from 2.60341284,1.443981994 to 2.60341284,1.443981994 to 2.866141012,1.477483672 to 3.352469442,1.539500137 to 3.651128803,1.577562476
-"controller*" at 3.14344625,1.616136291
-linethick = 1;
-spline -> from 2.601835789,1.365385182 to 2.601835789,1.365385182 to 2.652130929,1.352086806 to 2.707114599,1.339598267 to 2.758645806,1.33196875 to 3.055685493,1.28806706 to 3.400420317,1.281460495 to 3.634079603,1.283463776
-"flow_tables value*" at 3.14344625,1.3852475
-linethick = 1;
-spline -> from 2.465612681,1.527650943 to 2.465612681,1.527650943 to 2.518635693,1.642392059 to 2.618245644,1.821962758 to 2.758645806,1.923959597 to 3.037826456,2.126717208 to 3.4396761,2.203481231 to 3.686505893,2.232337002
-"netflow?" at 3.14344625,2.267287862
-linethick = 0.5;
-spline -> from 3.907122541,0.3339597296 to 3.907122541,0.3339597296 to 3.907122541,0.3983332465 to 3.907122541,0.47950875 to 3.907122541,0.543613742
-"select_src_port*" at 4.235660625,0.438079194
-linethick = 0.5;
-spline -> from 3.74485678,0.2306373153 to 3.74485678,0.2306373153 to 3.380984229,0.2450481516 to 2.525029143,0.2888859071 to 2.438973306,0.3847919194 to 2.40734704,0.4200454027 to 2.40734704,0.456108723 to 2.438973306,0.491357944 to 2.524176683,0.586279365 to 3.364062898,0.630223678 to 3.733817423,0.645056482
-"output_port?" at 2.708350666,0.438079194
-linethick = 0.5;
-spline -> from 3.746007601,0.232167481 to 3.746007601,0.232167481 to 3.499731907,0.2491570088 to 3.072905185,0.3055728116 to 3.220423388,0.491357944 to 3.283377559,0.570679347 to 3.551945082,0.614240053 to 3.733945292,0.635125323
-"select_dst_port*" at 3.551902459,0.438079194
-linethick = 1;
-spline -> from 4.067598136,0.2520979958 to 4.067598136,0.2520979958 to 4.29469348,0.2905141057 to 4.70728412,0.3603433666 to 4.93531717,0.3988702963
-"qos?" at 4.52272653,0.4203096653
-linethick = 1;
-spline -> from 4.068450596,0.186646117 to 4.068450596,0.186646117 to 4.135411329,0.1722054446 to 4.214050764,0.1570870665 to 4.28616888,0.1479955806 to 4.48052976,0.1234234211 to 4.70259559,0.1133175078 to 4.86541545,0.1092129129
-"interfaces+" at 4.52272653,0.2012743306
-linethick = 1;
-spline -> from 5.25882574,0.42623 to 5.25882574,0.42623 to 5.48515387,0.42623 to 5.89433467,0.42623 to 6.13174478,0.42623
-"queues value*" at 5.73023612,0.47950875
-linethick = 1;
-spline -> from 0.888817419,2.00669084 to 0.888817419,2.00669084 to 1.263985065,1.863264445 to 1.920421888,1.612257598 to 2.238346845,1.490696802
-"bridge" at 1.70492,1.882530041
-linethick = 1;
-spline -> from 1.117404568,2.220359939 to 1.117404568,2.220359939 to 1.711441319,2.323507599 to 2.716960512,2.428999524 to 3.528246694,2.166654959 to 3.583827086,2.148710676 to 3.58587299,2.121645071 to 3.634804194,2.089720444 to 3.670607514,2.06636304 to 3.709863297,2.042366291 to 3.747158422,2.0203302
-"ipfix?" at 2.421242138,2.385694556
-linethick = 1;
-spline -> from 0.953945363,1.164289868 to 0.953945363,1.164289868 to 1.071883204,1.18577186 to 1.204696472,1.209811232 to 1.326044153,1.231335847 to 1.647123212,1.288280175 to 2.021566267,1.352598282 to 2.23898619,1.389722915
-"bridges*" at 1.70492,1.420752459
-linethick = 1;
-spline -> from 0.953945363,1.037912673 to 0.953945363,1.037912673 to 1.071883204,1.016388058 to 1.204696472,0.992391309 to 1.326044153,0.970866694 to 1.657565847,0.912046954 to 2.045989246,0.845384582 to 2.259700968,0.808899294
-"ssl?" at 1.70492,1.024145444
-linethick = 1;
-spline -> from 0.9547552,1.101079959 to 0.9547552,1.101079959 to 1.318116275,1.101079959 to 1.880057907,1.101079959 to 2.192271382,1.101079959
-"manager_options*" at 1.70492,1.154358709
-.ps +3
-.PE
-- 
1.8.1.2




More information about the dev mailing list