desktop.eclass: Sanitize insopts
authorMichał Górny <mgorny@gentoo.org>
Fri, 8 Jun 2018 07:13:11 +0000 (09:13 +0200)
committerMichał Górny <mgorny@gentoo.org>
Wed, 13 Jun 2018 08:09:56 +0000 (10:09 +0200)
Sanitize insopts when calling doins, in order to avoid prior insopts
calls accidentally affecting do*/new* functions defined by the eclass.

eclass/desktop.eclass

index d65b0d0bf074a61c7fd60fac7b23bc414ffb10a7..91521b85a821ae1b3a208c2b586a70c4bbc998b1 100644 (file)
@@ -195,6 +195,7 @@ make_desktop_entry() {
        (
                # wrap the env here so that the 'insinto' call
                # doesn't corrupt the env of the caller
+               insopts -m 0644
                insinto /usr/share/applications
                doins "${desktop}"
        ) || die "installing desktop file failed"
@@ -228,6 +229,7 @@ make_session_desktop() {
        (
        # wrap the env here so that the 'insinto' call
        # doesn't corrupt the env of the caller
+       insopts -m 0644
        insinto /usr/share/xsessions
        doins "${desktop}"
        )
@@ -243,6 +245,7 @@ domenu() {
        # wrap the env here so that the 'insinto' call
        # doesn't corrupt the env of the caller
        local i j ret=0
+       insopts -m 0644
        insinto /usr/share/applications
        for i in "$@" ; do
                if [[ -f ${i} ]] ; then
@@ -269,6 +272,7 @@ newmenu() {
        (
        # wrap the env here so that the 'insinto' call
        # doesn't corrupt the env of the caller
+       insopts -m 0644
        insinto /usr/share/applications
        newins "$@"
        )
@@ -282,6 +286,7 @@ _iconins() {
        (
        # wrap the env here so that the 'insinto' call
        # doesn't corrupt the env of the caller
+       insopts -m 0644
        local funcname=$1; shift
        local size dir
        local context=apps