#19 Use temporary DNF cache directory
Merged by praiskup. Opened by praiskup.
praiskup/prunerepo cachedir  into  main

Download 19.patch

By default, in Koji build system, dnf.conf says
cachedir=/var/cache/yum. At %check time, we run in mock under the
mockbuilder user and we have no rights to write into /var/cache/yum.

This fixes Mock build in Koji, though it eventually relates to:
https://github.com/fedora-copr/copr/issues/2756

rebased onto 53510f54cf0c625234edd90502a4a3b7b9bfd7c7

Hmm, I did not tried this, but at this moment cachedir should/can be garbage collected and cease to exist thefore context of TempraryDirectory closes and directory is removed. All before dnf-3 command is called. Or am I mistaken?

That shouldn't happen; the context is held for the whole _get_rpms_to_remove_internal() run and only after that exits. Both dnf-3 calls should be done with context entered.

The resulting object can be used as a context manager (see Examples). On completion of the context or destruction of the file object the temporary file will be removed from the filesystem.

But this function is called from within the context, so IMHO it should be fine

Pull-Request has been merged by praiskup

This PR has been migrated to GitHub as a placeholder issue:
https://github.com/fedora-copr/prunerepo/issues/19

Metadata