Repository navigation
base: Add VendorChangeManager::ensure_vendor_conf_dir_exists() - #3005
Conversation
save_policy_from_toml()/save_policy_from_compact() write directly into the vendor configuration directory (/etc/dnf/vendors.d/ or installroot equivalent) and fail if it does not exist. The directory is normally created by the libdnf5 package, but may be missing on a minimal --installroot or a from-source build. Add ensure_vendor_conf_dir_exists(), which creates the directory (and any missing parents) if needed.
PR Summary by QodoAdd vendor configuration directory creation helper
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR Powered by Qodo |
kontura
left a comment
There was a problem hiding this comment.
Can I ask why is this a separate new API?
I was just thinking that if the vendor conf dir was automatically ensured on each save_policy_from_toml()/save_policy_from_compact() the API would be a bit more user friendly.
|
Good question. In On the other hand, my PR #3004 for the copr plugin automatically allows creating missing directories using this new API. The copr plugin already displays prominent warnings about the security risks of enabling third-party repositories. Once the user explicitly confirms and accepts that risk, bothering them with an extra prompt just for a creating missing directory would only degrade the UX. |
4f20219
save_policy_from_toml()/save_policy_from_compact()write directly into the vendor configuration directory ("/etc/dnf/vendors.d/" or installroot equivalent) and fail if it does not exist. The directory is normally created by thelibdnf5package, but may be missing on a minimal--installrootor a from-source build.Add
ensure_vendor_conf_dir_exists(), which creates the directory (and any missing parents) if needed.