public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-dev] [PATCH 1/4] desktop.eclass: domenu, fix dying on non-existing files
@ 2018-07-26 11:35 99% Michał Górny
  0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2018-07-26 11:35 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

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



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2018-07-26 11:35 99% [gentoo-dev] [PATCH 1/4] desktop.eclass: domenu, fix dying on non-existing files Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox