summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 17:02:36 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 17:02:36 (EDT)
commit2ddb616b87a2a4684d03c9b54e95f800e73017d9 (patch)
tree7412948f42899345c0a64d84867e1b6674bae6c7 /lib
parenteb39158e933a3f84a39b1aae4deaaae7ccde9f6b (diff)
ob_parse_package_metadata(): Eliminate caching
Cf. commit da45b6d.
Diffstat (limited to 'lib')
-rw-r--r--lib/package.sh55
1 files changed, 0 insertions, 55 deletions
diff --git a/lib/package.sh b/lib/package.sh
index aa1a9a3..eab9709 100644
--- a/lib/package.sh
+++ b/lib/package.sh
@@ -60,63 +60,8 @@ _ob_package_do()
ob_parse_package_metadata()
{
- local opt=
- local cache_file=
- local pkg=
- local pkg_clean=
- local param_name=
- local param_value=
-
- OPTIND=1
- while getopts 'c:' opt; do
- case "${opt}" in
- c)
- cache_file="${OPTARG}"
- ;;
- ?)
- _ob_abort
- ;;
- esac
- done
- shift $(($OPTIND - 1))
-
- # Load a previously saved cache file, if any.
- if [ -n "${cache_file}" -a -r "${cache_file}" ]; then
- if [ "${cache_file#*/}" != "${cache_file}" ]; then
- . "${cache_file}"
- else
- . "./${cache_file}"
- fi
- return 0
- fi
-
_ob_package_do 'parse_package_metadata'
- if [ -n "${cache_file}" ]; then
- >"${cache_file}"
- for param_name in ${_OB_SOURCE_PARAMETERS}; do
- param_value="$(ob_get_source_parameter \
- "${param_name}" | sed "s/'/'\\\\''/g")"
- printf "%s='%s'\n" \
- "_OB_SRCFIELD_${param_name}" "${param_value}" \
- >>"${cache_file}"
- done
- for pkg in $(ob_get_binary_packages); do
- pkg_clean="$({ tr 'a-z' 'A-Z' | tr -dC 'A-Z0-9';} <<-EOF
- "${pkg}"
- EOF
- )"
- for param_name in ${_OB_BINARY_PARAMETERS}; do
- param_value="$(ob_get_binary_parameter "${pkg}" \
- "${param_name}" | sed "s/'/'\\\\''/g")"
- printf "%s='%s'\n" \
- "_OB_BINFIELD_${pkg_clean}_${param_name}" \
- "${param_value}" \
- >>"${cache_file}"
- done
- done
- fi
-
return 0
}