From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D42C2138334 for ; Thu, 26 Jul 2018 11:36:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F3D67E0878; Thu, 26 Jul 2018 11:36:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 67194E083B for ; Thu, 26 Jul 2018 11:36:13 +0000 (UTC) Received: from localhost.localdomain (d202-252.icpnet.pl [109.173.202.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id A56AF335CC0; Thu, 26 Jul 2018 11:36:09 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 1/4] desktop.eclass: domenu, fix dying on non-existing files Date: Thu, 26 Jul 2018 13:35:50 +0200 Message-Id: <20180726113553.1387-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.18.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: 7c2c591b-7ff9-4c9d-b50a-5e426ee90614 X-Archives-Hash: 64d4f2bf2e1d463b5d09ddd23616d42b 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} -- 2.18.0