Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156882 - MOD_MAP for games-mods.eclass
Summary: MOD_MAP for games-mods.eclass
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks: 177006
  Show dependency tree
 
Reported: 2006-12-02 02:21 UTC by Paul Bredbury
Modified: 2021-03-10 05:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
games-mods.eclass.diff (games-mods.eclass.diff,7.00 KB, patch)
2006-12-02 02:22 UTC, Paul Bredbury
Details | Diff
games-mods.patch (games-mods.patch,3.85 KB, patch)
2007-04-03 17:32 UTC, Paul Bredbury
Details | Diff
games-mods.patch (games-mods.patch,2.30 KB, patch)
2007-10-09 14:35 UTC, Paul Bredbury
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Bredbury 2006-12-02 02:21:14 UTC
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
Comment 1 Paul Bredbury 2006-12-02 02:22:02 UTC
Created attachment 103178 [details, diff]
games-mods.eclass.diff
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2006-12-02 07:35:06 UTC
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.
Comment 3 Paul Bredbury 2006-12-03 02:26:03 UTC
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 :)
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2006-12-03 06:55:17 UTC
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.
Comment 5 Paul Bredbury 2006-12-03 07:19:18 UTC
(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.
Comment 6 Tristan Heaven (RETIRED) gentoo-dev 2006-12-03 09:18:06 UTC
That doesn't need to be quoted at all because [[ is used and not [.
Comment 7 Paul Bredbury 2007-04-03 17:32:43 UTC
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.
Comment 8 Paul Bredbury 2007-10-09 14:35:42 UTC
Created attachment 132990 [details, diff]
games-mods.patch

Simpler.
Comment 9 Larry the Git Cow gentoo-dev 2019-12-10 00:59:40 UTC
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(+)