rpm-software-management / dnf5

Next-generation RPM package management system
Other
256 stars 86 forks source link

dnf clean: Do not report an error on a nonexistent cache directory #1707

Closed ppisar closed 2 months ago

ppisar commented 2 months ago

If /var/cache/libdnf5 directory did not exist, "dnf clean all" reported and error:

Cannot iterate the cache directory: "/var/cache/libdnf5"

This patch optimizes this case to no operation. If there is no cache, there is nothing to remove.

If the iterator fails for a different reason, the message is ammended with an operating system error message, explaining the cause.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2313032