Author: dteske
Date: Mon Feb  9 17:22:54 2015
New Revision: 278465
URL: https://svnweb.freebsd.org/changeset/base/278465

Log:
  Revert SVN r278464 -- fingers were in perforce mode (premature
  commit of future stuffs not yet ready).

Modified:
  head/usr.sbin/bsdconfig/console/INDEX
  head/usr.sbin/bsdconfig/includes/INDEX
  head/usr.sbin/bsdconfig/share/keymap.subr
  head/usr.sbin/bsdconfig/timezone/share/continents.subr
  head/usr.sbin/bsdconfig/timezone/share/countries.subr
  head/usr.sbin/bsdconfig/usermgmt/share/user.subr

Modified: head/usr.sbin/bsdconfig/console/INDEX
==============================================================================
--- head/usr.sbin/bsdconfig/console/INDEX       Mon Feb  9 17:18:10 2015        
(r278464)
+++ head/usr.sbin/bsdconfig/console/INDEX       Mon Feb  9 17:22:54 2015        
(r278465)
@@ -46,13 +46,6 @@ menu_help="Customize system console beha
 # can be i18n'ed but `command' is the name of a script.
 #
 menu_selection="console|console"
-menu_selection="vt_font|font"
-menu_selection="vt_keymap|keymap"
-menu_selection="vt_repeat|repeat"
-menu_selection="vt_saver|saver"
-menu_selection="vt_screenmap|screenmap"
-menu_selection="vt_ttys|ttys"
-# For backward compatibility
 menu_selection="syscons_font|font"
 menu_selection="syscons_keymap|keymap"
 menu_selection="syscons_repeat|repeat"

Modified: head/usr.sbin/bsdconfig/includes/INDEX
==============================================================================
--- head/usr.sbin/bsdconfig/includes/INDEX      Mon Feb  9 17:18:10 2015        
(r278464)
+++ head/usr.sbin/bsdconfig/includes/INDEX      Mon Feb  9 17:22:54 2015        
(r278465)
@@ -45,7 +45,6 @@ menu_help=""
 # can be i18n'ed but `command' is the name of a script.
 #
 menu_selection="includes|includes"
-menu_selection="api|includes"
 
 #
 # ------------ Items below this line do NOT need i18n translation ------------

Modified: head/usr.sbin/bsdconfig/share/keymap.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/keymap.subr   Mon Feb  9 17:18:10 2015        
(r278464)
+++ head/usr.sbin/bsdconfig/share/keymap.subr   Mon Feb  9 17:22:54 2015        
(r278465)
@@ -219,7 +219,7 @@ f_keymap_get_all()
                        echo -n "$k "
                        # NOTE: Translate '8x8' to '8x08' before sending to
                        # sort(1) so that things work out as we might expect.
-                       debug= keymap_$k get desc | awk 'gsub(/8x8/,"8x08")||1'
+                       debug= keymap_$k get desc | sed -e 's/8x8/8x08/g'
                done | sort -k2 | awk '{
                        printf "%s%s", (started ? " " : ""), $1; started = 1
                }'

Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr
==============================================================================
--- head/usr.sbin/bsdconfig/timezone/share/continents.subr      Mon Feb  9 
17:18:10 2015        (r278464)
+++ head/usr.sbin/bsdconfig/timezone/share/continents.subr      Mon Feb  9 
17:22:54 2015        (r278465)
@@ -1,6 +1,6 @@
 if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1
 #
-# Copyright (c) 2011-2014 Devin Teske
+# Copyright (c) 2011-2012 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -87,7 +87,7 @@ export continent_utc_title
 
 ############################################################ FUNCTIONS
 
-# f_continent $cont $property [$var_to_set]
+# f_continent $cont $property
 #
 # Returns a single property of a given continent. Available properties are:
 #
@@ -102,60 +102,37 @@ export continent_utc_title
 #                  (which appears after continent selection).
 #      menu_list   Menu-list of regions for this continent.
 #
-# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
-# standard output for capturing in a sub-shell (which is less-recommended
-# because of performance degredation; for example, when called in a loop).
-#
 f_continent()
 {
-       f_getvar "continent_${1}_$2" $3
+       local cont="$1" property="$2"
+       eval echo \"\${continent_${cont}_$property}\"
 }
 
-# f_find_continent $title [$var_to_set]
+# f_find_continent $title
 #
 # Returns continent identifier given continent title.
 #
-# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
-# standard output for capturing in a sub-shell (which is less-recommended
-# because of performance degredation; for example, when called in a loop).
-#
 f_find_continent()
 {
-       local __cont __title
-       for __cont in $CONTINENTS; do
-               f_continent $__cont title __title
-               if [ "$1" = "$__title" ]; then
-                       if [ "$2" ]; then
-                               setvar "$2" $__cont
-                       else
-                               echo "$__cont"
-                       fi
+       local cont
+       for cont in $CONTINENTS; do
+               if [ "$1" = "$( f_continent $cont title )" ]; then
+                       echo "$cont"
                        return $SUCCESS
                fi
        done
        return $FAILURE
 }
 
-# f_OCEANP $cont [$var_to_set]
+# f_OCEANP $cont
 #
 # Returns "1" if the first argument is an ocean, otherwise NULL.
 #
-# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
-# standard output for capturing in a sub-shell (which is less-recommended
-# because of performance degredation; for example, when called in a loop).
-#
 f_OCEANP()
 {
        case "$1" in
        arctic|atlantic|indian|pacific)
-               if [ "$2" ]; then
-                       setvar "$2" 1
-               else
-                       echo 1
-               fi
-               ;;
-       *)
-               [ "$2" ] && setvar "$2" ""
+               echo 1
        esac
 }
 

Modified: head/usr.sbin/bsdconfig/timezone/share/countries.subr
==============================================================================
--- head/usr.sbin/bsdconfig/timezone/share/countries.subr       Mon Feb  9 
17:18:10 2015        (r278464)
+++ head/usr.sbin/bsdconfig/timezone/share/countries.subr       Mon Feb  9 
17:22:54 2015        (r278465)
@@ -1,6 +1,6 @@
 if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; then _TIMEZONE_COUNTRIES_SUBR=1
 #
-# Copyright (c) 2011-2014 Devin Teske
+# Copyright (c) 2011-2012 Devin Teske
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -25,10 +25,8 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th
 # SUCH DAMAGE.
 #
 # $FreeBSD$
-#
-############################################################ FUNCTIONS
 
-# f_country $code $property [$var_to_set]
+# f_country $code $property
 #
 # Returns a single property of a given country. Available properties are:
 #
@@ -46,13 +44,10 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; th
 #      descr_N      Like name, but for the Nth zone when the country has
 #                   multiple zones (nzones > 0)
 #
-# If $var_to_set is missing or NULL, the value of $var_to_get is printed to
-# standard output for capturing in a sub-shell (which is less-recommended
-# because of performance degredation; for example, when called in a loop).
-#
 f_country()
 {
-       f_getvar "country_${1}_$2" $3
+       local code="$1" property="$2"
+       eval echo \"\${country_${code}_$property}\"
 }
 
 # f_sort_countries
@@ -64,42 +59,22 @@ f_country()
 # afterward is the sh(1) function which utilizes the below awk script.
 #
 f_sort_countries_awk='
-function _asorti(src, dest)
 {
-       k = nitems = 0
-       for (i in src) dest[++nitems] = i
-       for (i = 1; i <= nitems; k = i++) {
-               idx = dest[i]
-               while ((k > 0) && (dest[k] > idx)) {
-                       dest[k+1] = dest[k]; k--
-               }
-               dest[k+1] = idx
-       }
-       return nitems
-}
-BEGIN {
-       split(ENVIRON["COUNTRIES"], array, /[[:space:]]+/)
+       split($0, array, /[[:space:]]+/)
        for (item in array)
        {
                tlc = array[item]
-               name = ENVIRON["country_" tlc "_name"]
-               countries[name] = tlc
+               print ENVIRON["country_" tlc "_name"] " " tlc
        }
-       n = _asorti(countries, sorted_countries)
-       for (i = 1, i <= n; i++)
-               print countries[sorted_countries[i]]
-       exit
 }
 '
 f_sort_countries()
 {
-       export COUNTRIES # for awk(1) ENVIRON[] visibility
-       COUNTRIES=$( awk "$f_sort_countries_awk" )
-       export COUNTRIES # Pedantic
+       COUNTRIES=$( echo "$COUNTRIES" | awk "$f_sort_countries_awk" |
+                       sort | awk '{print $NF}' )
+       export COUNTRIES
 }
 
-############################################################ MAIN
-
 f_dprintf "%s: Successfully loaded." timezone/countries.subr
 
 fi # ! $_TIMEZONE_COUNTRIES_SUBR

Modified: head/usr.sbin/bsdconfig/usermgmt/share/user.subr
==============================================================================
--- head/usr.sbin/bsdconfig/usermgmt/share/user.subr    Mon Feb  9 17:18:10 
2015        (r278464)
+++ head/usr.sbin/bsdconfig/usermgmt/share/user.subr    Mon Feb  9 17:22:54 
2015        (r278465)
@@ -830,7 +830,8 @@ f_user_delete()
                                        f_eval_catch $funcname \
                                                pw '%s -H 0' "$cmd"
                        else
-                               f_eval_catch $funcname pw '%s -h -' "$cmd"
+                               f_eval_catch $funcname \
+                                       pw '%s -h -' "$cmd"
                        fi
                fi
        fi
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to