summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-07-26 13:03:37 +0200
committerMichał Górny <mgorny@gentoo.org>2018-08-09 16:08:38 +0200
commite773cbd5a30bfb72253aeb4c711c23362b686048 (patch)
treee512261d3e4b10ca0e877a202417fd80a0117241 /eclass/desktop.eclass
parentapp-i18n/skktools: drop old (diff)
downloadgentoo-e773cbd5a30bfb72253aeb4c711c23362b686048.tar.gz
gentoo-e773cbd5a30bfb72253aeb4c711c23362b686048.tar.bz2
gentoo-e773cbd5a30bfb72253aeb4c711c23362b686048.zip
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.
Diffstat (limited to 'eclass/desktop.eclass')
-rw-r--r--eclass/desktop.eclass10
1 files 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}