Skip to content

Detecting manually added entries in openmw.cfg

This is feasible, but subtly difficult, as we'll need to be able to tell the difference between an entry from a package which configtool previously added, but was removed, and an entry which the user added manually. Paths may not be useful since manually installed packages could be installed anywhere, including in a path which looks like an automatically installed path.

One possibility would be to use semantic comments. I.e. prefix every automatically added line with a comment describing its providence. Obviously a user could fake such a comment, but they shouldn't then be surprised if this breaks things.

E.g.

# portmod:base/morrowind
data=/home/user/.local/share/Steam/steamapps/common/Morrowind/Data Files

Note that for data= entry detecting this will also require that Portmod's VFS is decoupled from portmod itself (otherwise packages like assets-misc/project-atlas won't be able to see those files in the VFS). The idea is that we would instead define the VFS repo-side using openmw.cfg itself. Detection of plugins could be done immediately, but is not particularly useful, as portmod should be adding all plugins for manually installed mods if you're using the "Local mods" feature anyway.(done).

Manual ordering might be possible, but is a lot more work and wouldn't work well. E.g. scanning the initial file, we could track the position of the manual entries relative to the other entries, and try to match that as close as possible (which in a lot of cases won't be very closely).

Edited by Benjamin Winger