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 47FEF159C96 for ; Fri, 26 Jul 2024 07:47:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 72E26E29C0; Fri, 26 Jul 2024 07:47:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E99F1E29C0 for ; Fri, 26 Jul 2024 07:47:21 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 15E2433FE60 for ; Fri, 26 Jul 2024 07:47:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A62241E64 for ; Fri, 26 Jul 2024 07:47:19 +0000 (UTC) From: "Florian Schmaus" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Florian Schmaus" Message-ID: <1721122363.4c0966cbf858a4cfa2c38b767571b948f8dc11a5.flow@gentoo> Subject: [gentoo-commits] proj/tex-overlay:main commit in: eclass/ X-VCS-Repository: proj/tex-overlay X-VCS-Files: eclass/texlive-common.eclass X-VCS-Directories: eclass/ X-VCS-Committer: flow X-VCS-Committer-Name: Florian Schmaus X-VCS-Revision: 4c0966cbf858a4cfa2c38b767571b948f8dc11a5 X-VCS-Branch: main Date: Fri, 26 Jul 2024 07:47:19 +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: 64eb6e13-91b4-4ec9-a0a1-9dd19eb778aa X-Archives-Hash: 9e268348b21bfda428dddba5702af34f commit: 4c0966cbf858a4cfa2c38b767571b948f8dc11a5 Author: Florian Schmaus gentoo org> AuthorDate: Mon Jul 15 19:55:13 2024 +0000 Commit: Florian Schmaus gentoo org> CommitDate: Tue Jul 16 09:32:43 2024 +0000 URL: https://gitweb.gentoo.org/proj/tex-overlay.git/commit/?id=4c0966cb texlive-common.eclass: Add TEXLIVE_SCRIPTS_W_FILE_EXT variable Some scripts are supposed to be installed with file extensions [1, 2]. Add support for declaring those scripts in a new elcass variable TEXLIVE_SCRIPTS_W_FILE_EXT. Also use pure-bash functions to retrieve the basename and strip the file extensions. And use "declare -l" to lowercase the value of 'trg', instead of 'tr' [3]. 1: https://tug.org/pipermail/tldistro/2024q3/000485.html 2: https://github.com/TeX-Live/texlive-source/blob/c087bab35570b1d5cb0afd272611a7a4ec3c9e38/texk/texlive/linked_scripts/Makefile.am#L332-L333 3: https://github.com/TeX-Live/texlive-source/blob/c087bab35570b1d5cb0afd272611a7a4ec3c9e38/texk/texlive/linked_scripts/Makefile.am#L330 Bug: https://bugs.gentoo.org/934975 Signed-off-by: Florian Schmaus gentoo.org> eclass/texlive-common.eclass | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass index 072581d..36b90a3 100644 --- a/eclass/texlive-common.eclass +++ b/eclass/texlive-common.eclass @@ -42,6 +42,13 @@ _TEXLIVE_COMMON_ECLASS=1 # @CODE : "${CTAN_MIRROR_URL:="https://mirrors.ctan.org"}" +# @ECLASS_VARIABLE: TEXLIVE_SCRIPTS_W_FILE_EXT +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set, contains a space separated list of script names that should be +# linked including their file extensions, i.e., without stripping +# potentially existing filename extensions from the link's name. + # @FUNCTION: texlive-common_handle_config_files # @DESCRIPTION: # Has to be called in src_install after having installed the files in ${D} @@ -160,8 +167,17 @@ etexlinks() { # Called by app-text/epspdf and texlive-module.eclass. dobin_texmf_scripts() { while [[ ${#} -gt 0 ]] ; do - local trg - trg=$(basename "${1}" | sed 's,\.[^/]*$,,' | tr '[:upper:]' '[:lower:]') + # -l: TexLive target links are always lowercase. + local -l trg + + # Get the basename of the script. + trg="${1##*/}" + + # Only strip the filename extensions if trg is not listed in TEXLIVE_SCRIPTS_W_FILE_EXT. + if ! has "${trg}" ${TEXLIVE_SCRIPTS_W_FILE_EXT}; then + trg="${trg%.*}" + fi + einfo "Installing ${1} as ${trg} bin wrapper" [[ -x ${ED}/usr/share/${1} ]] || die "Trying to install a non existing or non executable symlink to /usr/bin: ${1}" dosym "../share/${1}" "/usr/bin/${trg}"