From e773cbd5a30bfb72253aeb4c711c23362b686048 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 26 Jul 2018 13:03:37 +0200 Subject: desktop.eclass: domenu, fix dying on non-existing files The weird logic in domenu had an explicit separate clause for unsuccessful return on non-existing files. This worked fine before EAPI 4 since '|| die' was mandatory. However, since 'doins' started dying on its own, developers have assumed the same for 'domenu' and stopped checking the exit status. As a result, missing files are now silently ignored. Change the logic to explicitly die when the file does not exist. To provide the best interoperability and avoid code duplication, just let 'doins' die on its own. --- eclass/desktop.eclass | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass index 91521b85a821..1684a21d21f7 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 @@ -248,16 +248,14 @@ domenu() { insopts -m 0644 insinto /usr/share/applications for i in "$@" ; do - if [[ -f ${i} ]] ; then - doins "${i}" - ((ret+=$?)) - elif [[ -d ${i} ]] ; then + if [[ -d ${i} ]] ; then for j in "${i}"/*.desktop ; do doins "${j}" ((ret+=$?)) done else - ((++ret)) + doins "${i}" + ((ret+=$?)) fi done exit ${ret} -- cgit v1.2.3-65-gdbad