RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Stand-alone Genesis rom dir

    Scheduled Pinned Locked Moved Help and Support
    genesismegadrivestand-aloneromdirhelpers
    7 Posts 3 Posters 649 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sleve_mcdichael
      last edited by

      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 the megadrive.

      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?)

      https://github.com/RetroPie/RetroPie-Setup/compare/master...s1eve-mcdichae1:RetroPie-Setup:genesis-standalone

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        Why not create a different folder - not named genesis - for this, if you wish to have it as a standalone folder ?

        S 1 Reply Last reply Reply Quote 0
        • S
          sleve_mcdichael @mitu
          last edited by

          @mitu yeah that works too, I suppose :)

          S 1 Reply Last reply Reply Quote 0
          • S
            sleve_mcdichael @sleve_mcdichael
            last edited by

            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 where genesis already exists and is not a symlink, then when I reinstall lr-genesis-plus-gx I won't end up a broken megadrive -> megadrive link in my genesis folder.

            https://github.com/RetroPie/RetroPie-Setup/compare/master...s1eve-mcdichae1:RetroPie-Setup:genesis-standalone

            Thoughts?

            LolonoisL 1 Reply Last reply Reply Quote 0
            • LolonoisL
              Lolonois @sleve_mcdichael
              last edited by

              @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.

              S 1 Reply Last reply Reply Quote 0
              • S
                sleve_mcdichael @Lolonois
                last edited by

                @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.)

                LolonoisL 1 Reply Last reply Reply Quote 0
                • LolonoisL
                  Lolonois @sleve_mcdichael
                  last edited by

                  @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)?

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  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.