commit: e773cbd5a30bfb72253aeb4c711c23362b686048
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 26 11:03:37 2018 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Aug 9 14:08:38 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e773cbd5
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 91521b85a82..1684a21d21f 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}