Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cachedir relative to installroot #1148

Conversation

evan-goode
Copy link
Member

Like logdir, the cachedir configuration option should be treated as relative to the installroot, unless it is specified on the command line via --setopt=cachedir=/path/to/cachedir. This is the behavior of the cachedir with DNF 4.

Currently, the host cache directory is used by default, conflicting with what our docs say (man 7 dnf5-installroot):

cachedir, log files, releasever, and gpgkey are taken from or stored in the installroot.

After this change, the default cachedir is $installroot/var/cache/libdnf5, which is consistent with the docs.

For https://bugzilla.redhat.com/show_bug.cgi?id=2256945.

@evan-goode evan-goode marked this pull request as draft January 8, 2024 19:17
Like `logdir`, the `cachedir` and `system_cachedir` configuration
options should be treated as relative to the installroot, unless
specified is specified on the command line, e.g. via
--setopt=cachedir=/path/to/cachedir. This is the behavior of the
cachedir with DNF 4.

Currently, the host cache directory is used by default, conflicting with
what our docs say (man 7 dnf5-installroot):
    "cachedir, log files, releasever, and gpgkey are taken from or stored
    in the installroot."
After this change, the default system_cachedir is
$installroot/var/cache/libdnf5, which is consistent with the docs.

For https://bugzilla.redhat.com/show_bug.cgi?id=2256945
@evan-goode evan-goode force-pushed the evan-goode/installroot-cachedir branch from 1fb6350 to 834718c Compare January 8, 2024 19:55
@evan-goode evan-goode marked this pull request as ready for review January 8, 2024 19:55
@evan-goode evan-goode self-assigned this Jan 8, 2024
@evan-goode
Copy link
Member Author

Related: #754

@praiskup
Copy link
Member

praiskup commented Jan 9, 2024

Works fine. Tested with:

$ cat /tmp/mock-config.cfg
include('/etc/mock/fedora-rawhide-x86_64.cfg')

config_opts['root'] = 'packit-rpm-software-management-dnf5-1148_fedora-rawhide-x86_64'
config_opts['isolation'] = 'unchanged'

config_opts['dnf.conf'] += """

[copr_base]
name="Copr repository"
baseurl=https://download.copr.fedorainfracloud.org/results/packit/rpm-software-management-dnf5-1148/fedora-rawhide-x86_64/
gpgcheck=0
enabled=1
skip_if_unavailable=1
metadata_expire=0
cost=1
best=1
priority=10
"""

@praiskup
Copy link
Member

praiskup commented Jan 9, 2024

I mean, together with mock-core-configs from: rpm-software-management/mock#1282

Copy link
Member

@jan-kolarik jan-kolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please add also CI tests or at least create and link an issue for that.

@evan-goode
Copy link
Member Author

LGTM. Please add also CI tests or at least create and link an issue for that.

Alright, I created rpm-software-management/ci-dnf-stack#1436 since I think this should be merged quickly.

@evan-goode evan-goode added this pull request to the merge queue Jan 9, 2024
Merged via the queue into rpm-software-management:main with commit 58e0f11 Jan 9, 2024
5 of 9 checks passed
@evan-goode evan-goode deleted the evan-goode/installroot-cachedir branch January 9, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants