From 241e405c26ffa4f415358a23448ca7e57aab2ea9 Mon Sep 17 00:00:00 2001 From: "Anna (cybertailor) Vyalkova" Date: Wed, 13 Jul 2022 05:46:10 +0500 Subject: [PATCH] R-packages.eclass: simplify pkg_postinst optfeature already checks whether a package has been installed. Signed-off-by: Anna (cybertailor) Vyalkova --- eclass/R-packages.eclass | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/eclass/R-packages.eclass b/eclass/R-packages.eclass index 55febf2ba9..32bbce52d4 100644 --- a/eclass/R-packages.eclass +++ b/eclass/R-packages.eclass @@ -22,6 +22,13 @@ esac EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_postinst +# @ECLASS_VARIABLE: SUGGESTED_PACKAGES +# @DEPRECATED: none +# @DEFAULT_UNSET +# @DESCRIPTION: +# String variable containing the list of upstream suggested packages. Consider +# using optfeature directly instead for more concise descriptions. + CRAN_PV=${CRAN_PV:-$PV} CRAN_PN=${CRAN_PN:-${PN//_/.}} @@ -40,7 +47,6 @@ SLOT="0" DEPEND="dev-lang/R" RDEPEND="${DEPEND}" -BDEPEND="sys-apps/pkgcore" # @FUNCTION: _movelink # @INTERNAL @@ -146,17 +152,12 @@ R-packages_src_install() { } # @FUNCTION: R-packages_pkg_postinst +# @DEPRECATED: optfeature # @DESCRIPTION: -# function that will prompt to install the suggested packages if they exist +# Prompt to install the upstream suggested packages (if they exist). Consider +# calling "optfeature" directly instead for concise descriptions. R-packages_pkg_postinst() { - if [[ ${MERGE_TYPE} != binary ]]; then - if [[ -v SUGGESTED_PACKAGES ]]; then - for p in ${SUGGESTED_PACKAGES} ; do - pexist="$(pquery -n1 ${p} 2>/dev/null || die)" - if [[ -n "${pexist}" ]]; then - optfeature "having the upstream suggested package" "${p}" - fi - done - fi - fi + for p in ${SUGGESTED_PACKAGES}; do + optfeature "having the upstream suggested package" "${p}" + done }