moonglum / exogenesis

Build your dotfile installer, updater and teardown
MIT License
19 stars 8 forks source link

Should `update` remove things that are not marked to be installed anymore? #9

Open moonglum opened 11 years ago

moonglum commented 11 years ago

@bitboxer asked:

In the Font and Dotfiles classes, what do we do with the update task? I think it should do the same as the install task to make it actually possible to add the new fonts. But I need to remember what fonts I have installed to check if the font directory had changes and remove the now missing fonts from the ~/Library/Fonts . Where do I store that?

This question is in my opinion way broader. Let's take Homebrew as an example: If the user decides to remove one of the brews from his list, should the update task now remove this brew? I'm not really sure about that. It is not trivial to detect (just comparing the installed brews and the brews that should be installed doesn't do the trick because of dependencies) – and for other tasks it is almost impossible (Font comes to mind).

For Font the question has another facet: If you teardown Font, what should happen? Should it remove all fonts it knows? Because it can't detect which fonts it installed by just looking at the files.

I think this question needs some thought, and I guess until we found a solution, update should not remove brews, fonts, rubies or anything else.

moonglum commented 10 years ago

I think there should be a exo diff command in the future. It compares the installed packages with the packages from the configuration file.

I think we should implement the diff method for those managers for which it makes sense. It should never remove packages automatically though IMHO. This should be done in the next milestone though. Moving it now.

bitboxer commented 10 years ago

If you can detect which NPM Package/Gem has an executable installed, it would make sense to show them. But listing all NPMs/Gems is not very helpful.

bitboxer commented 10 years ago

Btw: the rbenv version marked with a star is the current used one.

bitboxer commented 10 years ago

For npm bin files:

1) npm -g bin returns the bin dir where the executables are installed 2) List that directory and get the link targets of the symbolic links 3) Parse the package out of that directory name, eg ../lib/node_modules/bower/bin/bower is in the bower package

Could be little fragile but worth a shot.