From 90de501005537b8d8164316dc6116c9431d58a53 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 28 Sep 2012 19:38:03 -0400 Subject: Write cache file in ob_parse_package_metadata(). --- diff --git a/lib/package.sh b/lib/package.sh index 833bbc7..5f21449 100644 --- a/lib/package.sh +++ b/lib/package.sh @@ -66,7 +66,8 @@ ob_init_package() ob_parse_package_metadata() { - _ob_local _obppm_opt _obppm_cache_file _obppm_param + _ob_local _obppm_opt _obppm_cache_file _obppm_pkg \ + _obppm_param_name _obppm_param_value while getopts 'c:' _obppm_opt; do case "${_obppm_opt}" in @@ -89,13 +90,22 @@ ob_parse_package_metadata() _ob_package_do 'parse_package_metadata' if [ -n "${_obppm_cache_file}" ]; then - # FIXME: Finish. - for _obppm_param in ${_OB_SOURCE_PARAMETERS}; do - foo="$(echo "${foo}" | sed "s/'/'\\\\''/g")" - >>"${_obppm_cache_file}" + >"${_obppm_cache_file}" + for _obppm_param_name in ${_OB_SOURCE_PARAMETERS}; do + _obppm_param_value="$(ob_get_source_parameter \ + "${_obppm_param_name}" | sed "s/'/'\\\\''/g")" + printf "%s='%s'" \ + "${_obppm_param_name}" "${_obppm_param_value}" \ + >>"${_obppm_cache_file}" done - for _obppm_param in ${_OB_SOURCE_PARAMETERS}; do - : + for _obppm_pkg in $(ob_get_binary_packages); do + for _obppm_param_name in ${_OB_BINARY_PARAMETERS}; do + _obppm_param_value="$(ob_get_binary_parameter "${_obppm_pkg}" \ + "${_obppm_param_name}" | sed "s/'/'\\\\''/g")" + printf "%s='%s'" \ + "${_obppm_param_name}" "${_obppm_param_value}" \ + >>"${_obppm_cache_file}" + done done fi -- cgit v0.9.1