Automatic cleanup at uninstall with an environmental variable like HOMEBREW_UNINSTALL_CLEANUP


(Rcmdnk) #1

Recently, HOMEBREW_UPGRADE_CLEANUP was implemented to clean up at upgrade command.

It is useful if there is a similar variable like HOMEBREW_UNINSTALL_CLEANUP
to clean up the package files at uninstall command.

Currently, it can be done with –force option, but I always use it (or do cleanup manually when I forgot to do –force).

Is there any plan to implement such variable?

Although the following might be a different topic,
here, I want to use cleanup in the variable while the option is –force.
Maybe, force was named by historically reason, but I think –cleanup is more proper for this function.
It is easy to understand if –cleanup option can be used in parallel with –force.


(Mike McQuaid) #2

I don’t think this is quite the same as HOMEBREW_UPGRADE_CLEANUP so I think --force may be a better option. What do you think?


(Rcmdnk) #3

uninstall's main function is uninstalling (unlinking) a package.
If force means to force this function,
it is rather similar to --ignore-dependencies,
which forces to uninstall even if there are dependencies.

Cleaning up remaining files is an additional function of uninstall,
like upgrade + cleanup.

Anyway, they are just my feelings and I’m used to using these options for now, so it may be not a big deal.

But if such new HOMEBREW_UNINSTALL_CLEANUP variable can be implemented,
I want to push cleanup which is clearer for the function.