Commit graph

4 commits

Author SHA1 Message Date
Brian C. Lane
f731ab53d0 dnfjson: Cleanup old distro cache dirs
This adds a function, CleanupOldCacheDirs, that checks the dirs under
/var/cache/osbuild-composer/rpmmd/ and removes files and directories
that don't match the current list of supported distros.

This will clean up the cache from old releases as the are retired, and
will also cleanup the old top level cache directory structure after an
upgrade.

NOTE: This function does not return errors, any real problems it
encounters will also be caught by the cache initialization code and
handled there.
2023-03-23 11:26:40 +01:00
Brian C. Lane
8f20b550ea dnfjson: Adjust cache size info for new layout
The repo id hash directories are now down one level, below a directory
named for the distribution.
2023-03-23 11:26:40 +01:00
Brian C. Lane
35059ca60e dnfjson: Add a cache of dnf-json results
This adds a cache structure with timeout handling and cache cleanup.
Also adds some testing of the new functions.
2022-09-15 11:34:39 +01:00
Achilleas Koutsou
bd2fbee48c dnfjson: add cache unit tests
Create cache-like directory trees on disk and check that the info is
read as expected and that the expected caches are removed by `shrink()`.
2022-06-10 12:45:41 +01:00