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 1DE12158094 for ; Sat, 1 Oct 2022 08:40:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E9BEDE0ACD; Sat, 1 Oct 2022 08:39:47 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 B53C9E0AC7 for ; Sat, 1 Oct 2022 08:39:47 +0000 (UTC) From: =?UTF-8?q?Ulrich=20M=C3=BCller?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Ulrich=20M=C3=BCller?= Subject: [gentoo-dev] [PATCH 1/2] desktop.eclass: Install files as foo.desktop rather than foo-foo.desktop Date: Sat, 1 Oct 2022 10:39:17 +0200 Message-Id: <20221001083918.30129-2-ulm@gentoo.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221001083918.30129-1-ulm@gentoo.org> References: <20221001083918.30129-1-ulm@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: f36f3037-59b5-4300-9b91-e8df058d97e5 X-Archives-Hash: 32424e9841d07f1e1519b9fa58e62408 Bug: https://bugs.gentoo.org/771708#c14 Signed-off-by: Ulrich Müller --- eclass/desktop.eclass | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass index de912bb80932..01de8b61ae1c 100644 --- a/eclass/desktop.eclass +++ b/eclass/desktop.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: desktop.eclass @@ -156,19 +156,18 @@ make_desktop_entry() { ;; esac fi - local slot=${SLOT%/*} - if [[ ${slot} == "0" ]] ; then - local desktop_name="${PN}" - else - local desktop_name="${PN}-${slot}" - fi + local desktop_exec="${exec%%[[:space:]]*}" desktop_exec="${desktop_exec##*/}" + local desktop_suffix="-${PN}" + [[ ${SLOT%/*} != 0 ]] && desktop_suffix+="-${SLOT%/*}" + # Replace foo-foo.desktop by foo.desktop + [[ ${desktop_suffix#-} == "${desktop_exec}" ]] && desktop_suffix="" # Prevent collisions if a file with the same name already exists #771708 - local desktop="${desktop_exec}-${desktop_name}" count=0 + local desktop="${desktop_exec}${desktop_suffix}" count=0 while [[ -e ${ED}/usr/share/applications/${desktop}.desktop ]]; do - desktop="${desktop_exec}-$((++count))-${desktop_name}" + desktop="${desktop_exec}-$((++count))${desktop_suffix}" done desktop="${T}/${desktop}.desktop" -- 2.37.3