RetroPie / RetroPie/RetroPie-Setup

runcommand.sh: do not replace %ROM% tokens when empty

Open
#3,550 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
10.4k
Forks
1.4k
Avg merge
2d 12h
Merged PRs (30d)
11

Description

%ROM% appears to be quoted for no reason when empty.

I'm creating custom ports as follows:

addPort "${md_id}-${part}" "${md_id}-${part}" "Default game ${part}" "pushd $datadir; $bindir/binary %ROM%; popd"
...
addPort "${md_id}-${part}" "${md_id}-${part}" "Game ${part} level ${file}" "pushd $datadir; $bindir/binary %ROM%; popd" "$file"

The binary is treating the quoting as input and fails to run. runcommand.log output:

pushd <datadir> /usr/bin/binary ""; popd
<datadir> /
error loading file ""

If there isn't a ROM provided, it makes no sense to quote it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in runcommand.sh and trace how the %ROM% token is replaced for the two addPort command forms shown. Reproduce the empty-ROM case from the issue and compare it with the populated-ROM case. Done means an empty ROM is not passed as a quoted empty argument, while a provided ROM still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.