From abb13b216f7e8f7639d7dc0233046f9e7f1a924c Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 04 Oct 2012 13:39:43 -0400 Subject: Implement ob_get_doc_{package,files}(). --- (limited to 'lib') diff --git a/lib/package.sh b/lib/package.sh index 7bfec63..d4c9c5d 100644 --- a/lib/package.sh +++ b/lib/package.sh @@ -271,6 +271,36 @@ ob_get_binary_parameter() return ${?} } +ob_get_doc_package() +{ + _ob_local + + if [ ${#} -gt 0 ]; then + _ob_return 125 + return ${?} + fi + + _ob_package_do 'get_doc_package' + + _ob_return ${?} + return ${?} +} + +ob_get_doc_files() +{ + _ob_local + + if [ ${#} -gt 0 ]; then + _ob_return 125 + return ${?} + fi + + _ob_package_do 'get_doc_files' + + _ob_return ${?} + return ${?} +} + ob_summarize_package_arch() { _ob_local diff --git a/lib/package/2.sh b/lib/package/2.sh index 7569bc7..775a4dd 100644 --- a/lib/package/2.sh +++ b/lib/package/2.sh @@ -106,3 +106,45 @@ _ob_binfield_2() _ob_return 0 return ${?} } + +_ob_get_doc_package_2() +{ + _ob_local _obgdp2_pkg _obgdp2_doc_pkg + + for _obgdp2_pkg in $(ob_get_binary_packages); do + if [ -r "${_OB_PACKAGE_DIR}/${_obgdp2_pkg}.pkg/docs" ]; then + if [ -n "${_obgdp2_doc_pkg}" ]; then + _ob_return 1 + return ${?} + fi + _obgdp2_doc_pkg="${_obgdp2_pkg}" + fi + done + + echo "${_obgdp2_pkg}" + + _ob_return 0 + return ${?} +} + +_ob_get_doc_files_2() +{ + _ob_local _obgdf2_doc_pkg + + _obgdf2_doc_pkg="$(_ob_get_doc_package_2)" + + if [ ${?} -ne 0 ]; then + _ob_return 1 + return ${?} + fi + + cat <