Deleted Added
full compact
menus.subr (256281) menus.subr (263980)
1if [ ! "$_TIMEZONE_MENUS_SUBR" ]; then _TIMEZONE_MENUS_SUBR=1
2#
3# Copyright (c) 2011-2012 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
1if [ ! "$_TIMEZONE_MENUS_SUBR" ]; then _TIMEZONE_MENUS_SUBR=1
2#
3# Copyright (c) 2011-2012 Devin Teske
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: stable/10/usr.sbin/bsdconfig/timezone/share/menus.subr 252987 2013-07-07 18:51:44Z dteske $
27# $FreeBSD: stable/10/usr.sbin/bsdconfig/timezone/share/menus.subr 263980 2014-04-01 00:19:13Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." timezone/menus.subr
34f_include $BSDCFG_SHARE/dialog.subr
35

--- 63 unchanged lines hidden (view full) ---

99#
100# This function is a two-parter. Below is the awk(1) portion of the function,
101# afterward is the sh(1) function which utilizes the below awk script.
102#
103f_make_menus_awk='
104function add_zone_n_to_country_menu(tlc, n)
105{
106 zone_title = ENVIRON["country_" tlc "_descr_" n]
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." timezone/menus.subr
34f_include $BSDCFG_SHARE/dialog.subr
35

--- 63 unchanged lines hidden (view full) ---

99#
100# This function is a two-parter. Below is the awk(1) portion of the function,
101# afterward is the sh(1) function which utilizes the below awk script.
102#
103f_make_menus_awk='
104function add_zone_n_to_country_menu(tlc, n)
105{
106 zone_title = ENVIRON["country_" tlc "_descr_" n]
107 gsub(/'\''/, "'\''\\'\'''\''", zone_title)
107 gsub(/'\''/, "'\''\\'\'\''", zone_title)
108 country_menu_list[tlc] = country_menu_list[tlc] \
109 ( length(country_menu_list[tlc]) > 0 ? "\n" : "" ) \
110 n " '\''" zone_title "'\''"
111}
112BEGIN {
113 #
114 # First, count up all the countries in each continent/ocean.
115 # Be careful to count those countries which have multiple zones
116 # only once for each. NB: some countries are in multiple
117 # continents/oceans.
118 #
119 i = split(ENVIRON["COUNTRIES"], countries, /[[:space:]]+/)
120 for (cp = 1; cp <= i; cp++)
121 {
122 tlc = countries[cp]
123 title = ENVIRON["country_" tlc "_name"]
108 country_menu_list[tlc] = country_menu_list[tlc] \
109 ( length(country_menu_list[tlc]) > 0 ? "\n" : "" ) \
110 n " '\''" zone_title "'\''"
111}
112BEGIN {
113 #
114 # First, count up all the countries in each continent/ocean.
115 # Be careful to count those countries which have multiple zones
116 # only once for each. NB: some countries are in multiple
117 # continents/oceans.
118 #
119 i = split(ENVIRON["COUNTRIES"], countries, /[[:space:]]+/)
120 for (cp = 1; cp <= i; cp++)
121 {
122 tlc = countries[cp]
123 title = ENVIRON["country_" tlc "_name"]
124 gsub(/'\''/, "'\''\\'\'''\''", title)
124 gsub(/'\''/, "'\''\\'\'\''", title)
125 nzones = ENVIRON["country_" tlc "_nzones"]
126 if (!nzones)
127 {
128 # Country has no zones
129 continue
130 }
131 else if (nzones < 0)
132 {

--- 93 unchanged lines hidden ---
125 nzones = ENVIRON["country_" tlc "_nzones"]
126 if (!nzones)
127 {
128 # Country has no zones
129 continue
130 }
131 else if (nzones < 0)
132 {

--- 93 unchanged lines hidden ---