svn commit: r252833 - in head/usr.sbin/bsdconfig: . share

Devin Teske dteske at FreeBSD.org
Fri Jul 5 19:57:41 UTC 2013


Author: dteske
Date: Fri Jul  5 19:57:40 2013
New Revision: 252833
URL: http://svnweb.freebsd.org/changeset/base/252833

Log:
  Don't calculate the tag until we know that we're going to make a new menu
  item entry. Also join simple NULL assignments into a single line.

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

Modified: head/usr.sbin/bsdconfig/bsdconfig
==============================================================================
--- head/usr.sbin/bsdconfig/bsdconfig	Fri Jul  5 19:45:16 2013	(r252832)
+++ head/usr.sbin/bsdconfig/bsdconfig	Fri Jul  5 19:57:40 2013	(r252833)
@@ -170,11 +170,8 @@ dialog_menu_main()
 	local menuitem menu_title menu_help menu_selection index=2
 	for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do
 		[ $index -lt ${#DIALOG_MENU_TAGS} ] || break
-		tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 )
 
-		menu_program=
-		menu_title=
-		menu_help=
+		menu_program= menu_title= menu_help=
 		f_include_lang $BSDCFG_LIBE/$menuitem/INDEX
 		[ "$menu_program" ] || continue
 
@@ -183,9 +180,11 @@ dialog_menu_main()
 		 *) menu_program="$menuitem/$menu_program"
 		esac
 
+		tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 )
+		setvar "menu_program$tag" "$menu_program"
+
 		f_shell_escape "$menu_title" menu_title
 		f_shell_escape "$menu_help" menu_help
-		setvar "menu_program$tag" "$menu_program"
 		menu_list="$menu_list '$tag' '$menu_title' '$menu_help'"
 
 		index=$(( $index + 1 ))

Modified: head/usr.sbin/bsdconfig/share/common.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/common.subr	Fri Jul  5 19:45:16 2013	(r252832)
+++ head/usr.sbin/bsdconfig/share/common.subr	Fri Jul  5 19:57:40 2013	(r252833)
@@ -531,12 +531,22 @@ f_index_file()
 
 	if [ "$lang" ]; then
 		awk -v keyword="$keyword" "$f_index_file_awk" \
-			$BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang &&
-			return
+			$BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && return
 		# No match, fall-thru to non-i18n sources
 	fi
 	awk -v keyword="$keyword" "$f_index_file_awk" \
-		$BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX
+		$BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX && return
+
+	# No match? Fall-thru to `local' libexec sources (add-on modules)
+
+	[ "$BSDCFG_LOCAL_LIBE" ] || return $FAILURE
+	if [ "$lang" ]; then
+		awk -v keyword="$keyword" "$f_index_file_awk" \
+			$BSDCFG_LOCAL_LIBE/*/INDEX.$lang && return
+		# No match, fall-thru to non-i18n sources
+	fi
+	awk -v keyword="$keyword" "$f_index_file_awk" \
+		$BSDCFG_LOCAL_LIBE/*/INDEX
 }
 
 # f_index_menusel_keyword $indexfile $pgm


More information about the svn-src-all mailing list