svn commit: r269027 - in head/usr.sbin/bsdconfig/dot: . include

Devin Teske dteske at FreeBSD.org
Wed Jul 23 21:08:05 UTC 2014


Author: dteske
Date: Wed Jul 23 21:08:04 2014
New Revision: 269027
URL: http://svnweb.freebsd.org/changeset/base/269027

Log:
  Fix a bug where include file `networking/services.subr' was not being
  properly clustered.
  
  Change `fixedsize' to `fixedsize = true' to satisfy newer versions of dot(1)
  generating error "Warning: <stdin>: syntax error in line 27 near ','".
  
  Remove bounding cluster surrounding various include-groupings, allowing
  groups of include files to float freely to the greatest consumer (reducing
  the density of rendered diagrams).
  
  While here, change the bgcolor of include clusters from white to X11 color
  `thistle' (a light purple).
  
  Also, add the word "Subroutines" after include cluster labels.
  
  Do not terminate the digraph definition with a semi-colon [;] after the
  ending brace to satisfy newer versions of dot(1) generating error "Warning:
  <stdin>: syntax error in line 940 near ';'".
  
  MFC after:	3 days
  X-MFC-to:	stable/10, stable/9

Modified:
  head/usr.sbin/bsdconfig/dot/dot
  head/usr.sbin/bsdconfig/dot/include/messages.subr

Modified: head/usr.sbin/bsdconfig/dot/dot
==============================================================================
--- head/usr.sbin/bsdconfig/dot/dot	Wed Jul 23 19:38:29 2014	(r269026)
+++ head/usr.sbin/bsdconfig/dot/dot	Wed Jul 23 21:08:04 2014	(r269027)
@@ -249,6 +249,7 @@ if [ "$SHOW_INCLUDES" ]; then
 			$menu_program_list \
 			$submenu_program_list \
 			$cmd_program_list \
+			$BSDCFG_SHARE/script.subr \
 		; do
 			[ -e "$file" ] && echo $file
 		done | sort -u
@@ -299,12 +300,6 @@ if [ "$SHOW_INCLUDES" ]; then
 fi
 
 #
-# Add script.subr to includes if it exists
-#
-[ -f $BSDCFG_SHARE/script.subr ] &&
-	include_file_list="$include_file_list script.subr"
-
-#
 # Start the directional-graph (digraph) output
 #
 printf 'strict digraph "" { // Empty name to prevent SVG Auto-Tooltip\n'
@@ -352,7 +347,7 @@ printf '\tnode [\n'
 printf '\t\tfontname = "Times-Roman",\n'
 printf '\t\tfontsize = 12,\n'
 printf '\t\twidth = 2.5, // arbitrary minimum width for all nodes\n'
-printf '\t\tfixedsize,   // turn minimum width into exact width\n'
+printf '\t\tfixedsize = true, // turn minimum width into exact width\n'
 printf '\t];\n'
 
 #
@@ -546,34 +541,36 @@ printf '\t\tbgcolor = "%s";\n' "$bgcolor
 printf '\t\tlabel = "bsdconfig(8)";\n'
 printf '\t\ttooltip = "bsdconfig(8)";\n'
 print_node "bsdconfig"
+end_nodelist
 if [ "$SHOW_INCLUDES" ]; then
-	printf '\t\tsubgraph "cluster_includes" {\n'
-	printf '\t\t\tbgcolor = "%s";\n' "$bgcolor_includes"
-	printf '\t\t\tlabel = "%s";\n' "$msg_includes"
-
 	for include_file in $include_file_list; do
 		echo $include_file
-	done | awk -v bgcolor="$bgcolor_bsdconfig" '
-	BEGIN { created = 0 }
-	function end_subgraph() { printf "\t\t\t};\n" }
-	( $0 !~ "/" ) {
-		if ( ! created )
-		{
-			printf "\t\t\tsubgraph \"%s\" {\n",
-			       "cluster_bsdconfig_includes"
-			printf "\t\t\t\tbgcolor = \"%s\";\n", bgcolor
-			printf "\t\t\t\tlabel = \"bsdconfig\";\n"
-			created++
+	done | awk \
+		-v bgcolor="$bgcolor_bsdconfig" \
+		-v msg_subroutines="$msg_subroutines" \
+	'
+		BEGIN { created = 0 }
+		function end_subgraph() { printf "\t};\n" }
+		( $0 !~ "/" ) {
+			if ( ! created )
+			{
+				printf "\tsubgraph \"%s\" {\n",
+				       "cluster_bsdconfig_includes"
+				printf "\t\tbgcolor = \"%s\";\n", bgcolor
+				printf "\t\tlabel = \"bsdconfig %s\";\n",
+				       msg_subroutines
+				created++
+			}
+			printf "\t\t\"%s\";\n", $1
 		}
-		printf "\t\t\t\t\"%s\";\n", $1
-	}
-	END { created && end_subgraph() }'
+		END { created && end_subgraph() }
+	' # END-QUOTE
 
 	for include_file in $include_file_list; do
 		echo $include_file
-	done | awk '
+	done | awk -v msg_subroutines="$msg_subroutines" '
 	BEGIN { created = 0 }
-	function end_subgraph() { printf "\t\t\t};\n" }
+	function end_subgraph() { printf "\t};\n" }
 	( $0 ~ "/" ) {
 		include_dir_tmp = $1
 		sub("/[^/]*$", "", include_dir_tmp)
@@ -588,20 +585,18 @@ if [ "$SHOW_INCLUDES" ]; then
 		if ( ! created )
 		{
 			include_dir = include_dir_tmp
-			printf "\t\t\tsubgraph \"cluster_%s_includes\" {\n",
+			printf "\tsubgraph \"cluster_%s_includes\" {\n",
 			       include_dir
-			printf "\t\t\t\tbgcolor = \"white\";\n"
-			printf "\t\t\t\tlabel = \"%s\";\n", include_dir
+			printf "\t\tbgcolor = \"thistle\";\n"
+			printf "\t\tlabel = \"%s %s\";\n", include_dir,
+			       msg_subroutines
 			created++
 		}
 
-		printf "\t\t\t\t\"%s\";\n", $1
+		printf "\t\t\"%s\";\n", $1
 	}
 	END { created && end_subgraph() }'
-
-	printf '\t\t};\n'
 fi
-end_nodelist
 for INDEX in */INDEX; do
 	menu_title=
 	menu_help=
@@ -676,7 +671,7 @@ for INDEX in */INDEX; do
 	end_nodelist
 done
 
-printf '\n};\n'
+printf '\n}\n'
 
 ################################################################################
 # END

Modified: head/usr.sbin/bsdconfig/dot/include/messages.subr
==============================================================================
--- head/usr.sbin/bsdconfig/dot/include/messages.subr	Wed Jul 23 19:38:29 2014	(r269026)
+++ head/usr.sbin/bsdconfig/dot/include/messages.subr	Wed Jul 23 21:08:04 2014	(r269027)
@@ -28,3 +28,4 @@ msg_graph_label_with_command="bsdconfig(
 msg_graph_label_with_command_and_date="bsdconfig(8)\\\ndot(1) output generated by \`\`%s'' on\\\n%s"
 msg_includes="Includes"
 msg_shortcuts="Shortcuts"
+msg_subroutines="Subroutines"


More information about the svn-src-all mailing list