Clean up `scratch` space and provide cleanup helper
zkg generally does not clean up after itself when it puts stuff in its scratch directory. For users going through a lot of packages this can add up (since zkg may place a clone for each package in the scratch space). It would also be nice to add a cleanup function to tidy on demand, a bit like dnf clean / apt clean.
How would one know what to clean? can this be expanded to have that information? Or is it just scratch?
AFAICT the following directories under zkg's statedir do not contain information required at runtime:
-
clones -
logs -
scratch -
testing
Even compiled plugins should be contained in plugin_dir so that removing any of the above dirs shouldn't e.g., cause debug symbols to become unavailable.
We might want to have separate cleanups for each directory, e.g.,
zkg prune [ --clones | --logs | --scratch | --testing | --all ]
Is rebuild a consideration? Did that ever make it in?
Would a good scope limitation be splitting automatic cleanup and explict commands into two different issues?
Also, would the commands be as @bbannier listed, for ALL things or for specific plugins?
IE>
zig prune [ --clones | --logs | --scratch | --testing | --all ] [plugin]
Would it be plugin@version? or the same specifier acceptance and the install command?
Is rebuild a consideration? Did that ever make it in?
That's #38. I believe we would refetch in that case anyway and the stuff mentioned above would be pure leftovers.
Would it be plugin@version? or the same specifier acceptance and the install command?
IMO these should be global, not package-specific (mirroring what e.g., apt/dnf mentioned in the original issue do), but maybe @ckreibich has other ideas.
@ckreibich ?