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
This commit is contained in:
dteske 2014-07-23 21:08:04 +00:00
parent cc95000af6
commit ab887403e1
2 changed files with 31 additions and 35 deletions

View File

@ -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
@ -298,12 +299,6 @@ if [ "$SHOW_INCLUDES" ]; then
done
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
#
@ -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_bsdconfig"
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

View File

@ -28,3 +28,4 @@ msg_graph_label_with_command="bsdconfig(8)\\\ndot(1) output generated by \`\`%s'
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"