Weow! .debs are hard!

Thankfully, snaps are pretty easy, so I’ve moved to releasing Stimmtausch via the snap store. The cool parts of this are that not only do I not have to go through the horrific process of packaging a .deb (seriously, what the hell, dh_golang?), but I can release individual fixes as they land in the edge channel, so you can get much faster updates as branches land, or you can stick with the beta or stable channels as they come up (when they come up).

All you need to do to install stimmtausch now is run

sudo snap install --channel=edge stimmtausch

This took a little bit of bureaucracy, as snaps have some very fine-grained security policies. This is fine-grained enough that one has to specify the ability to access hidden files and directories down to the path.

As it stood before, Stimmtausch used four hidden files and folders, three of which required changes:

  • ~/.config/stimmtausch — no changes
  • ~/.strc — this has been removed. Please move this file to ~/.config/stimmtausch. Stimmtausch looks for files named *.st.*, so maybe something like ~/.config/stimmtausch/base.st.yaml
  • ~/.local/log/stimmtausch — now moved to ~/snap/stimmtausch/common/logs
  • ~/.local/share/stimmtausch — now moved to ~/snap/stimmtausch/common/worlds (for anyone using stimmtausch.vim, which I think is Just Maddy™, this is where you’ll put your config variables)

Please note that this only applies to a snap install. If you are using the install from source or are still planning on using the .deb — and maybe I’ll take another stab at that — you will continue to use the .local directory. Here is the logic:

HomeDir, err := homedir.Dir()
if err != nil {
    panic(fmt.Sprintf("could not find home dir: %v", err))
}
startDir := os.Getenv("SNAP_USER_COMMON")
if startDir == "" {
    WorkingDir = filepath.Join(HomeDir, ".local", "share", "stimmtausch")
    LogDir = filepath.Join(startDir, ".local", "log", "stimmtausch")
} else {
    WorkingDir = filepath.Join(startDir, "worlds")
    LogDir = filepath.Join(startDir, "logs")
}
ConfigDir = filepath.Join(HomeDir, ".config", "stimmtausch")