Hi, here is a patch for games-mods.eclass which: * Tidies up duplicate identical lines of variable assignations * Fixes a load of lazy/weird quoting * Fixes "q4" to "quake4" as the Quake 4 executable * Adds support for MOD_MAP, to be able to select a particular start map
Created attachment 103178 [details, diff] games-mods.eclass.diff
No. It mostly looks like you've added a lot of unneeded quoting. There wasn't anything too unusual or lazy about the stuff you replaced. Looked like it was quoting the minimum needed.
As an example from the patch: if [[ -h "${GAMES_PREFIX_OPT}"/"${GAME}"/${i} ]] Should be: if [[ -h "${GAMES_PREFIX_OPT}/${GAME}/${i}" ]] 'Cos there's no reason to add a load of quotes but exclude $i. *All* variables should be considered quotable, in this dinosaur bash language :)
You should only quote what needs to be quoted. In that case, there doesn't seem to be a need to quote ${i} so it's not quoted. Have bash do the least amount of work necessary.
(In reply to comment #4) > In that case, there doesn't seem to be a need to quote ${i} so it's not quoted. Which is a *bad* programming style, because it's far simpler and safer to just quote it. That code might be tweaked in the future to *make* the quoting of $i necessary in order to be safe.
That doesn't need to be quoted at all because [[ is used and not [.
Created attachment 115376 [details, diff] games-mods.patch OK, I give up with the quoting (for now). Here's an up-to-date diff without the quoting, which also fixes some bad make_desktop_entry logic with quake3.
Created attachment 132990 [details, diff] games-mods.patch Simpler.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7be77b11963037d72959a734f2cf8729385ab29c commit 7be77b11963037d72959a734f2cf8729385ab29c Author: David Seifert <soap@gentoo.org> AuthorDate: 2019-12-10 00:59:14 +0000 Commit: David Seifert <soap@gentoo.org> CommitDate: 2019-12-10 00:59:14 +0000 games-mods.eclass: Last rite Bug: https://bugs.gentoo.org/156882 Signed-off-by: David Seifert <soap@gentoo.org> eclass/games-mods.eclass | 4 ++++ 1 file changed, 4 insertions(+)