package-manager icon indicating copy to clipboard operation
package-manager copied to clipboard

Clean up `scratch` space and provide cleanup helper

Open ckreibich opened this issue 2 years ago • 6 comments

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.

ckreibich avatar Jan 23 '24 18:01 ckreibich

How would one know what to clean? can this be expanded to have that information? Or is it just scratch?

ottobackwards avatar Apr 15 '24 13:04 ottobackwards

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 ]

bbannier avatar Apr 15 '24 15:04 bbannier

Is rebuild a consideration? Did that ever make it in?

ottobackwards avatar Apr 15 '24 16:04 ottobackwards

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?

ottobackwards avatar Apr 15 '24 16:04 ottobackwards

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.

bbannier avatar Apr 15 '24 18:04 bbannier

@ckreibich ?

ottobackwards avatar May 01 '24 22:05 ottobackwards