summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2022-10-01 10:28:19 +0200
committerUlrich Müller <ulm@gentoo.org>2022-10-20 08:25:42 +0200
commit21e613fe5efe6cdee4b5f7fc0473de14ff880ed3 (patch)
tree0e675f649cbd484ab1dfd2bbf1215e75e21a9242 /eclass/desktop.eclass
parentwww-apache/passenger: add 6.0.15 (diff)
downloadgentoo-21e613fe5efe6cdee4b5f7fc0473de14ff880ed3.tar.gz
gentoo-21e613fe5efe6cdee4b5f7fc0473de14ff880ed3.tar.bz2
gentoo-21e613fe5efe6cdee4b5f7fc0473de14ff880ed3.zip
desktop.eclass: Install files as foo.desktop rather than foo-foo.desktop
Bug: https://bugs.gentoo.org/771708#c14 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'eclass/desktop.eclass')
-rw-r--r--eclass/desktop.eclass17
1 files 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"