From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B43561581C1 for ; Sun, 14 Jul 2024 07:27:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D05F1E2AE7; Sun, 14 Jul 2024 07:27:32 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AEF0FE2AE7 for ; Sun, 14 Jul 2024 07:27:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AE74A340BEF for ; Sun, 14 Jul 2024 07:27:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E95F21D13 for ; Sun, 14 Jul 2024 07:27:29 +0000 (UTC) From: "Anna Vyalkova" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anna Vyalkova" Message-ID: <1720941738.dd9d541bf216715f4a3bbc426c38231db375717d.cybertailor@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/boinc-app.eclass X-VCS-Directories: eclass/ X-VCS-Committer: cybertailor X-VCS-Committer-Name: Anna Vyalkova X-VCS-Revision: dd9d541bf216715f4a3bbc426c38231db375717d X-VCS-Branch: dev Date: Sun, 14 Jul 2024 07:27:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b53895ff-4077-44a1-a6b2-3f0ad5accdcc X-Archives-Hash: b46582273a03221ea4c61fc86245054d commit: dd9d541bf216715f4a3bbc426c38231db375717d Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Tue Jul 9 15:19:31 2024 +0000 Commit: Anna Vyalkova sysrq in> CommitDate: Sun Jul 14 07:22:18 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=dd9d541b boinc-app.eclass: better wrapper install function "dowrapper" had too much magic: it relied on specifically files being present in ${FILESDIR}, which is just… wrong. It will burn in flames without any backwards compatibility. New "boinc_install_wrapper" function replaces it. Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> eclass/boinc-app.eclass | 62 +++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/eclass/boinc-app.eclass b/eclass/boinc-app.eclass index 540fc8ea0..6a386bf2f 100644 --- a/eclass/boinc-app.eclass +++ b/eclass/boinc-app.eclass @@ -236,61 +236,67 @@ boinc-wrapper_foreach_wrapper_job() { || die "$(basename "$1") sed failed" } -# @FUNCTION: dowrapper -# @USAGE: [more apps...] +# @FUNCTION: boinc_install_wrapper +# @USAGE: [new name] # @DESCRIPTION: # This function provides a uniform way to install wrapper applications # for BOINC projects. It makes symlinks to the BOINC wrapper and also # installs respective job.xml files. # -# When sci-misc/boinc-example-1.0 calls `dowrapper boinc-example` it: +# When `dowrapper boinc-example_wrapper A.xml B.xml` is called, it: # -# 1. Installs boinc-example_job_1.0.xml from ebuild's files/ directory -# to project's root directory +# 1. Installs A.xml in the project's root directory, renaming it to B.xml # -# 2. Installs boinc-example_wrapper_1.0 symlink, which points -# to /usr/bin/boinc-wrapper, to project's root directory +# 2. Installs boinc-example_wrapper symlink, which points +# to /usr/bin/boinc-wrapper, in the project's root directory # # Example: # @CODE # src_install() { # meson_src_install # -# dowrapper boinc-example boinc-sample +# boinc_install_wrapper boinc-example_wrapper "${FILESDIR}"/job.xml # doappinfo "${FILESDIR}"/app_info_${PV}.xml # } # @CODE # # Keep your job.xml files in sync with app_info.xml! -dowrapper() { +boinc_install_wrapper() { debug-print-function ${FUNCNAME} "${@}" - for app in "$@"; do - local wrapperjob="${app}_job_${PV}.xml" - local wrapperexe="${app}_wrapper_${PV}" + (( $# >= 2 && $# <= 3 )) || \ + die "${FUNCNAME} got wrong number of arguments" - [[ -f "${FILESDIR}/${wrapperjob}" ]] || \ - die "${wrapperjob} not found in ebuild's files/ directory" + local exe="${1:?}" + local job="${2:?}" + local job_dest="${3:-$(basename "${job:?}")}" - cp "${FILESDIR}/${wrapperjob}" "${T}" || die - - if declare -f foreach_wrapper_job >/dev/null; then - foreach_wrapper_job "${T}/${wrapperjob}" - else - boinc-wrapper_foreach_wrapper_job "${T}/${wrapperjob}" - fi + cp "${job:?}" "${T:?}/${job_dest:?}" || die + if declare -f foreach_wrapper_job >/dev/null; then + foreach_wrapper_job "${T:?}/${job_dest:?}" + else + boinc-wrapper_foreach_wrapper_job "${T:?}/${job_dest:?}" + fi - ( # subshell to avoid pollution of calling environment - insinto $(get_project_root) - insopts -m 0644 --owner root --group boinc - doins "${T}/${wrapperjob}" - dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${wrapperexe}" - ) || die "failed to install '${app}' wrapper app" - done + ( # subshell to avoid pollution of calling environment + insinto "$(get_project_root)" + insopts -m 0644 --owner root --group boinc + doins "${T:?}/${job_dest:?}" + ) || die "failed to install ${exe:?} wrapper job" + rm -f "${T:?}/${job_dest:?}" + dosym -r /usr/bin/boinc-wrapper "$(get_project_root)/${exe:?}" _boinc-app_fix_permissions } +# @FUNCTION: dowrapper +# @DEPRECATED: boinc_install_wrapper +# @DESCRIPTION: +# Install BOINC wrappers and job definitions. +dowrapper() { + die "${FUNCNAME} has been removed, please use boinc_install_wrapper instead" +} + # @FUNCTION: boinc-app_pkg_postinst # @DESCRIPTION: # Display helpful instructions on how to make the BOINC client use installed