index.subr (251276) | index.subr (252738) |
---|---|
1if [ ! "$_PACKAGES_INDEX_SUBR" ]; then _PACKAGES_INDEX_SUBR=1 2# 3# Copyright (c) 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 (INLUDING, 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 [ ! "$_PACKAGES_INDEX_SUBR" ]; then _PACKAGES_INDEX_SUBR=1 2# 3# Copyright (c) 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 (INLUDING, 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: head/usr.sbin/bsdconfig/share/packages/index.subr 251276 2013-06-02 23:20:46Z dteske $ | 27# $FreeBSD: head/usr.sbin/bsdconfig/share/packages/index.subr 252738 2013-07-05 01:21:01Z dteske $ |
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." packages/index.subr 34f_include $BSDCFG_SHARE/device.subr 35f_include $BSDCFG_SHARE/media/common.subr --- 166 unchanged lines hidden (view full) --- 202 sub(/^ /, "", category_list) 203 print "PACKAGE_CATEGORIES=\"" category_list "\"" 204 205 }' )" # End-Quote 206} 207 208# f_index_extract_pages $var_to_get $var_basename $pagesize [$category] 209# | 28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." packages/index.subr 34f_include $BSDCFG_SHARE/device.subr 35f_include $BSDCFG_SHARE/media/common.subr --- 166 unchanged lines hidden (view full) --- 202 sub(/^ /, "", category_list) 203 print "PACKAGE_CATEGORIES=\"" category_list "\"" 204 205 }' )" # End-Quote 206} 207 208# f_index_extract_pages $var_to_get $var_basename $pagesize [$category] 209# |
210# Extracts the package INDEX into a series of sequential variables | 210# Extracts the package INDEX ($PACKAGE_INDEX by default if/when $var_to_get is 211# NULL; but should not be missing) into a series of sequential variables |
211# corresponding to "pages" containing up to $pagesize packages. The package 212# INDEX data must be contained in the variable $var_to_get. The extracted pages 213# are stored in variables ${var_basename}_# -- where "#" is a the page number. 214# If $category is set, only packages for that category are extracted. 215# Otherwise, if $category is "All", missing, or NULL, all packages are 216# extracted and no filtering is done. 217# 218f_index_extract_pages() 219{ | 212# corresponding to "pages" containing up to $pagesize packages. The package 213# INDEX data must be contained in the variable $var_to_get. The extracted pages 214# are stored in variables ${var_basename}_# -- where "#" is a the page number. 215# If $category is set, only packages for that category are extracted. 216# Otherwise, if $category is "All", missing, or NULL, all packages are 217# extracted and no filtering is done. 218# 219f_index_extract_pages() 220{ |
220 local var_to_get="$1" var_basename="$2" pagesize="$3" | 221 local var_to_get="${1:-PACKAGE_INDEX}" var_basename="$2" pagesize="$3" |
221 local category="$4" # Optional 222 223 eval "$( 224 debug= f_getvar "$var_to_get" | awk -F'|' \ 225 -v cat="$category" \ 226 -v pagesize="$pagesize" \ 227 -v var_basename="$var_basename" \ 228 -v i18n_all="$msg_all" ' --- 20 unchanged lines hidden --- | 222 local category="$4" # Optional 223 224 eval "$( 225 debug= f_getvar "$var_to_get" | awk -F'|' \ 226 -v cat="$category" \ 227 -v pagesize="$pagesize" \ 228 -v var_basename="$var_basename" \ 229 -v i18n_all="$msg_all" ' --- 20 unchanged lines hidden --- |