commit: 03cc71a6dc5dd5e0af302bacd3ef1a17e3c5d8f0
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 26 11:34:39 2018 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 9 14:08:40 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03cc71a6
desktop.eclass: Add missing ||die when writing to files
eclass/desktop.eclass | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass
index 08899b4a460..6fc72ab8ec0 100644
--- a/eclass/desktop.eclass
+++ b/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}