rcconf.subr (3b8f08459569bf0faa21473e5cec2491e95c9349) | rcconf.subr (ec65e4f8d0654361df5e97d4de3518edebf76b46) |
---|---|
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: --- 110 unchanged lines hidden (view full) --- 119 return $SUCCESS 120 fi 121 122 # 123 # Create the in-memory cache (potentially from validated on-disk cache) 124 # 125 126 # | 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: --- 110 unchanged lines hidden (view full) --- 119 return $SUCCESS 120 fi 121 122 # 123 # Create the in-memory cache (potentially from validated on-disk cache) 124 # 125 126 # |
127 # Calculate digest used to determine if the on-disk global persistant | 127 # Calculate digest used to determine if the on-disk global persistent |
128 # cache file (containing this digest on the first line) is valid and 129 # can be used to quickly populate the cache value for immediate return. 130 # 131 local __rc_defaults_digest 132 __rc_defaults_digest=$( exec 2> /dev/null; md5 < "$RC_DEFAULTS" ) 133 134 # | 128 # cache file (containing this digest on the first line) is valid and 129 # can be used to quickly populate the cache value for immediate return. 130 # 131 local __rc_defaults_digest 132 __rc_defaults_digest=$( exec 2> /dev/null; md5 < "$RC_DEFAULTS" ) 133 134 # |
135 # Check to see if the global persistant cache file exists | 135 # Check to see if the global persistent cache file exists |
136 # 137 if [ -f "$STARTUP_RCCONF_MAP_CACHEFILE" ]; then 138 # 139 # Attempt to populate the in-memory cache with the (soon to be) 140 # validated on-disk cache. If validation fails, fall-back to 141 # the current value and provide error exit status. 142 # 143 STARTUP_RCCONF_MAP=$( --- 27 unchanged lines hidden (view full) --- 171 fi 172 return $SUCCESS 173 fi 174 # Otherwise, fall-thru to create in-memory cache from scratch 175 fi 176 177 # 178 # If we reach this point, we need to generate the data from scratch | 136 # 137 if [ -f "$STARTUP_RCCONF_MAP_CACHEFILE" ]; then 138 # 139 # Attempt to populate the in-memory cache with the (soon to be) 140 # validated on-disk cache. If validation fails, fall-back to 141 # the current value and provide error exit status. 142 # 143 STARTUP_RCCONF_MAP=$( --- 27 unchanged lines hidden (view full) --- 171 fi 172 return $SUCCESS 173 fi 174 # Otherwise, fall-thru to create in-memory cache from scratch 175 fi 176 177 # 178 # If we reach this point, we need to generate the data from scratch |
179 # (and after we do, we'll attempt to create the global persistant | 179 # (and after we do, we'll attempt to create the global persistent |
180 # cache file to speed up future executions). 181 # 182 183 STARTUP_RCCONF_MAP=$( 184 f_clean_env --except \ 185 PATH \ 186 RC_DEFAULTS \ 187 STARTUP_RCCONF_REGEX \ --- 22 unchanged lines hidden (view full) --- 210 export _STARTUP_RCCONF_MAP=1 211 if [ "$__var_to_set" ]; then 212 setvar "$__var_to_set" "$STARTUP_RCCONF_MAP" 213 else 214 echo "$STARTUP_RCCONF_MAP" 215 fi 216 217 # | 180 # cache file to speed up future executions). 181 # 182 183 STARTUP_RCCONF_MAP=$( 184 f_clean_env --except \ 185 PATH \ 186 RC_DEFAULTS \ 187 STARTUP_RCCONF_REGEX \ --- 22 unchanged lines hidden (view full) --- 210 export _STARTUP_RCCONF_MAP=1 211 if [ "$__var_to_set" ]; then 212 setvar "$__var_to_set" "$STARTUP_RCCONF_MAP" 213 else 214 echo "$STARTUP_RCCONF_MAP" 215 fi 216 217 # |
218 # Attempt to create the persistant global cache | 218 # Attempt to create the persistent global cache |
219 # 220 221 # Create a new temporary file to write to 222 local __tmpfile 223 f_eval_catch -dk __tmpfile $__funcname mktemp \ 224 'mktemp -t "%s"' "$pgm" || return $FAILURE 225 226 # Write the temporary file contents --- 274 unchanged lines hidden --- | 219 # 220 221 # Create a new temporary file to write to 222 local __tmpfile 223 f_eval_catch -dk __tmpfile $__funcname mktemp \ 224 'mktemp -t "%s"' "$pgm" || return $FAILURE 225 226 # Write the temporary file contents --- 274 unchanged lines hidden --- |