From 2ddb616b87a2a4684d03c9b54e95f800e73017d9 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 13 Mar 2019 17:02:36 -0400 Subject: ob_parse_package_metadata(): Eliminate caching Cf. commit da45b6d. --- (limited to 'lib') 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 } -- cgit v0.9.1