Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jun 2013 00:30:05 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251353 - head/usr.sbin/bsdconfig/share
Message-ID:  <201306040030.r540U5CU044541@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Tue Jun  4 00:30:05 2013
New Revision: 251353
URL: http://svnweb.freebsd.org/changeset/base/251353

Log:
  Improve debugging for f_dialog_*_constrain() to print constrained rather
  than unconstrained values.

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/dialog.subr	Mon Jun  3 23:51:46 2013	(r251352)
+++ head/usr.sbin/bsdconfig/share/dialog.subr	Tue Jun  4 00:30:05 2013	(r251353)
@@ -328,7 +328,7 @@ f_dialog_size_constrain()
 	for __arg in height width; do
 		debug= f_getvar __var_$__arg __cp
 		[ "$__cp" ] || continue
-		if ! f_getvar "$__cp" __$__arg; then
+		if ! debug= f_getvar "$__cp" __$__arg; then
 			f_dprintf "%s: var_%s variable \`%s' not set" \
 			          $__fname $__arg "$__cp"
 			__retval=$FAILURE
@@ -377,6 +377,12 @@ f_dialog_size_constrain()
 		fi
 	fi
 
+	if [ "$debug" ]; then
+		# Print final constrained values to debuggin
+		f_quietly f_getvar "$__var_height"
+		f_quietly f_getvar "$__var_width"
+	fi
+
 	return $__retval # success if no debug warnings were printed
 }
 
@@ -419,7 +425,7 @@ f_dialog_menu_constrain()
 	for __arg in height width rows; do
 		debug= f_getvar __var_$__arg __cp
 		[ "$__cp" ] || continue
-		if ! f_getvar "$__cp" __$__arg; then
+		if ! debug= f_getvar "$__cp" __$__arg; then
 			f_dprintf "%s: var_%s variable \`%s' not set" \
 			          $__fname $__arg "$__cp"
 			__retval=$FAILURE
@@ -489,6 +495,13 @@ f_dialog_menu_constrain()
 		fi
 	fi
 
+	if [ "$debug" ]; then
+		# Print final constrained values to debuggin
+		f_quietly f_getvar "$__var_height"
+		f_quietly f_getvar "$__var_width"
+		f_quietly f_getvar "$__var_rows"
+	fi
+
 	return $__retval # success if no debug warnings were printed
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306040030.r540U5CU044541>