[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] [PATCH 4/4] desktop.eclass: Add missing ||die when writing to files
From:       Michał Górny <mgorny () gentoo ! org>
Date:       2018-07-26 11:35:53
Message-ID: 20180726113553.1387-4-mgorny () gentoo ! org
[Download RAW message or body]

---
 eclass/desktop.eclass | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass
index 08899b4a4607..6fc72ab8ec03 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}
-- 
2.18.0


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic