Deleted Added
full compact
rcconf.subr (256281) rcconf.subr (258420)
1if [ ! "$_STARTUP_RCCONF_SUBR" ]; then _STARTUP_RCCONF_SUBR=1
2#
3# Copyright (c) 2006-2013 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 [ ! "$_STARTUP_RCCONF_SUBR" ]; then _STARTUP_RCCONF_SUBR=1
2#
3# Copyright (c) 2006-2013 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/startup/share/rcconf.subr 256181 2013-10-09 08:12:26Z dteske $
27# $FreeBSD: stable/10/usr.sbin/bsdconfig/startup/share/rcconf.subr 258420 2013-11-21 03:38:47Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." startup/rcconf.subr
34f_include $BSDCFG_SHARE/sysrc.subr
35

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

114 setvar "$__var_to_set" "$STARTUP_RCCONF_MAP"
115 else
116 echo "$STARTUP_RCCONF_MAP"
117 fi
118 return $SUCCESS
119 fi
120
121 #
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." startup/rcconf.subr
34f_include $BSDCFG_SHARE/sysrc.subr
35

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

114 setvar "$__var_to_set" "$STARTUP_RCCONF_MAP"
115 else
116 echo "$STARTUP_RCCONF_MAP"
117 fi
118 return $SUCCESS
119 fi
120
121 #
122 # create the in-memory cache (potentially from validated on-disk cache)
122 # Create the in-memory cache (potentially from validated on-disk cache)
123 #
124
125 #
126 # Calculate digest used to determine if the on-disk global persistant
127 # cache file (containing this digest on the first line) is valid and
128 # can be used to quickly populate the cache value for immediate return.
129 #
130 local __rc_defaults_digest

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

135 #
136 if [ -f "$STARTUP_RCCONF_MAP_CACHEFILE" ]; then
137 #
138 # Attempt to populate the in-memory cache with the (soon to be)
139 # validated on-disk cache. If validation fails, fall-back to
140 # the current value and provide error exit status.
141 #
142 STARTUP_RCCONF_MAP=$(
123 #
124
125 #
126 # Calculate digest used to determine if the on-disk global persistant
127 # cache file (containing this digest on the first line) is valid and
128 # can be used to quickly populate the cache value for immediate return.
129 #
130 local __rc_defaults_digest

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

135 #
136 if [ -f "$STARTUP_RCCONF_MAP_CACHEFILE" ]; then
137 #
138 # Attempt to populate the in-memory cache with the (soon to be)
139 # validated on-disk cache. If validation fails, fall-back to
140 # the current value and provide error exit status.
141 #
142 STARTUP_RCCONF_MAP=$(
143 ( # Get digest as the first word on the first line
143 ( # Get digest as the first word on first line
144 read digest rest_ignored
145
146 #
147 # If the stored digest matches the calculated-
148 # one populate the in-memory cache from the on-
149 # disk cache and provide success exit status.
150 #
151 if [ "$digest" = "$__rc_defaults_digest" ]

--- 345 unchanged lines hidden ---
144 read digest rest_ignored
145
146 #
147 # If the stored digest matches the calculated-
148 # one populate the in-memory cache from the on-
149 # disk cache and provide success exit status.
150 #
151 if [ "$digest" = "$__rc_defaults_digest" ]

--- 345 unchanged lines hidden ---