Stand-alone Genesis rom dir
-
So, I suppose this is pretty "niche," but I imagine I'm not the only user who wants to maintain a stand-alone
genesis
rom dir that's distinct from themegadrive
.I've actually had this for some time without issue until now. The other day I re-installed a MD/Genesis emulator, and in making the romdir, it placed a symlink from "megadrive" to "megadrive" in
genesis/
:pi@retropie:~/RetroPie/roms/genesis $ ls -l megadrive lrwxrwxrwx 1 pi pi 9 Jan 11 13:37 megadrive -> megadrive
Solution: create link only if
genesis
doesn't already exist or, if is already a symlink, update the link (would it be better to just leave an existing link alone, and only make it if nothing exists?) -
Why not create a different folder - not named
genesis
- for this, if you wish to have it as a standalone folder ? -
@mitu yeah that works too, I suppose :)
-
Revisiting this because it happened to me again.
...yeah I could just use a different folder name for my
genesis
system, but I didn't want to do that, since I want the rom folder and the system name (and config folder, and gamelist folder, etc.) to all be the same name as each other.if [[ ! -e "$romdir/genesis" || -h "$romdir/genesis" ]]; then
(If not exist "genesis" OR is symlink "genesis," then...)
So this just, only makes the symlink if
genesis
doesn't already exist, or if it is there, but is already a symlink. Which for 99% of people, it will be, and nothing will change and it will be fine. But in the case wheregenesis
already exists and is not a symlink, then when I reinstall lr-genesis-plus-gx I won't end up a brokenmegadrive -> megadrive
link in my genesis folder.Thoughts?
-
@sleve_mcdichael My vote is to only create the symlink when the file (dir/symlink)
genesis
is absent. If it is present do nothing and do not rewrite the symlink, i.e. remove the suggested or clause on testing the existence of the symlink.FWIW, I had to lookup the
-h
test, I use-L
usually. But this is more a matter of taste I guess. -
@Lolonois yeah I don't know why you'd want to update an existing link actually, except for that's how it currently does (always creates/or updates an existing link) and I was working under a principle of least-deviation, and that writing over a symlink with another symlink was relatively "safe" (in that it can be undone simply by re-writing the old symlink), so I left it in.
Logically though yeah, if the user has a custom symlink there already, they probably want to keep it too.
(I'd used
-h
because it's already used that way elsewhere in the helpers script, where-L
is not. But I've removed it now, anyway.) -
@sleve_mcdichael said in Stand-alone Genesis rom dir:
I don't know why you'd want to update an existing link actually, except for that's how it currently does
Then it falls back to a design decision/principle of the inventors: Does RetroPie-Setup follow a "desired state" approach (=always recreate symlink) or does it have some tolerations (=if existing leave untouched)?
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.