summaryrefslogtreecommitdiff
path: root/eclass/desktop.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-08-12 06:32:46 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-08-12 06:32:46 +0100
commit28e3d252dc8ac8a5635206dfefe1cfe05058d1db (patch)
treee75bce604750fb72e53ed3684059e2e5d2094509 /eclass/desktop.eclass
parentf625b9919a60a30f1bd860f7d1b2eac183ced593 (diff)
gentoo resync : 12.08.2018
Diffstat (limited to 'eclass/desktop.eclass')
-rw-r--r--eclass/desktop.eclass26
1 files changed, 12 insertions, 14 deletions
diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass
index 91521b85a821..6fc72ab8ec03 100644
--- a/eclass/desktop.eclass
+++ b/eclass/desktop.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: desktop.eclass
@@ -174,7 +174,7 @@ make_desktop_entry() {
icon=${icon%.*}
fi
- cat <<-EOF > "${desktop}"
+ cat <<-EOF > "${desktop}" || die
[Desktop Entry]
Name=${name}
Type=Application
@@ -190,7 +190,9 @@ make_desktop_entry() {
ewarn "make_desktop_entry: update your 5th arg to read Path=${fields}"
fields="Path=${fields}"
fi
- [[ -n ${fields} ]] && printf '%b\n' "${fields}" >> "${desktop}"
+ if [[ -n ${fields} ]]; then
+ printf '%b\n' "${fields}" >> "${desktop}" || die
+ fi
(
# wrap the env here so that the 'insinto' call
@@ -217,7 +219,7 @@ make_session_desktop() {
local desktop=${T}/${wm:-${PN}}.desktop
shift 2
- cat <<-EOF > "${desktop}"
+ cat <<-EOF > "${desktop}" || die
[Desktop Entry]
Name=${title}
Comment=This session logs you into ${title}
@@ -244,20 +246,16 @@ domenu() {
(
# wrap the env here so that the 'insinto' call
# doesn't corrupt the env of the caller
- local i j ret=0
+ local i ret=0
insopts -m 0644
insinto /usr/share/applications
for i in "$@" ; do
- if [[ -f ${i} ]] ; then
- doins "${i}"
- ((ret+=$?))
- elif [[ -d ${i} ]] ; then
- for j in "${i}"/*.desktop ; do
- doins "${j}"
- ((ret+=$?))
- done
+ if [[ -d ${i} ]] ; then
+ doins "${i}"/*.desktop
+ ((ret|=$?))
else
- ((++ret))
+ doins "${i}"
+ ((ret|=$?))
fi
done
exit ${ret}