logoalt Hacker News

arrakeenyesterday at 6:17 PM1 replyview on HN

i feel like using GNU stow to manage your dotfiles has always been a hack.. has it ever been a supported usecase?

stow is an indispensable tool for me to manage /usr/local for manually installed software. my workflow goes:

  ./configure --prefix=/usr/local/stow/myapp
  make && make install
  stow myapp
now, myapp and all its supporting files are in the right place in /usr/local. if i want to "uninstall", i just run

  stow -D myapp

Replies

WCSTombsyesterday at 9:44 PM

I like to use environment modules [1] (or lmod [2]) for that purpose. You can make each manually built software package available or not on a per-shell-session basis, just by running

    module load myapp
or

    module unload myapp
in the shell where you want it (or don't). The small downside is that it only works with software that actually uses the standard environment variables like PATH, CPATH, etc. for their intended purposes rather than hardcoding filesystem paths, but in my experience it's rare to find something that doesn't. Also, you have to write a modulefile for each package, but that's not a big deal.

[1]: https://modules.readthedocs.io/en/latest/ [2]: https://lmod.readthedocs.io/en/latest/