desktop.eclass: Add missing ||die when writing to files
authorMichał Górny <mgorny@gentoo.org>
Thu, 26 Jul 2018 11:34:39 +0000 (13:34 +0200)
committerMichał Górny <mgorny@gentoo.org>
Thu, 9 Aug 2018 14:08:40 +0000 (16:08 +0200)
eclass/desktop.eclass

index 08899b4a4607e57a7671c7dfc730ead8db835eb4..6fc72ab8ec0357351530a0067983720a016682cf 100644 (file)
@@ -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}