sidplayfp icon indicating copy to clipboard operation
sidplayfp copied to clipboard

Default Songlength Database path should be within $HOME, not the install prefix

Open multiplealiases opened this issue 10 months ago • 0 comments

On Unix-likes, the default path that sidplayfp looks for a Songlengths.txt is $PREFIX/share/sidplay/Songlengths.txt, so on a "typical" Unix-like system, this would be something like /usr/share/sidplayfp/Songlengths.txt.

I feel this is a weird default, since

  • By convention and by FHS, everything under /usr is typically the package manager's job to manage. The administrator is not meant to poke around under there manually.
  • No Linux distribution I checked (Debian, Ubuntu, Fedora, OpenSuSE) that packages sidplayfp places a Songlengths.txt (or .md5, for that matter) in /usr/share/sidplayfp, so the default path is essentially useless. The user is forced to edit sidplayfp.ini to have it point to a convenient location, or worse, to (attempt to) copy a file into a directory that could very well be read-only for the current user.

What I would like to suggest instead is the following:

  • Follow precedent established by the Kernal, Basic, and Chargen ROMs by searching for either $XDG_DATA_HOME/sidplayfp/Songlengths.txt or $HOME/.local/share/sidplayfp/Songlengths.txt. This makes it so that the user can easily install the database without poking around in essential system files.
  • Display a warning if the Songlength Database option in sidplayfp.ini is unset and there is no Songlengths.txt in the default location. As it stands, the only indication that the Songlength DB is absent is that every SID file displays an UNKNOWN length.

multiplealiases avatar Apr 02 '24 13:04 multiplealiases