Skip to content

feat(dnf5): Add a plugin to support virtual snapshots#18016

Open
mbearup wants to merge 3 commits into
microsoft:4.0from
mbearup:4.0
Open

feat(dnf5): Add a plugin to support virtual snapshots#18016
mbearup wants to merge 3 commits into
microsoft:4.0from
mbearup:4.0

Conversation

@mbearup

@mbearup mbearup commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Add a dnf5 plugin to support virtual snapshots

@mbearup mbearup requested a review from a team as a code owner July 14, 2026 22:27
Copilot AI review requested due to automatic review settings July 14, 2026 22:27
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a downstream dnf5 plugin for virtual repository snapshots based on package publication time.

Changes:

  • Adds CLI snapshot options and package filtering hooks.
  • Packages the new plugins and configuration.
  • Refreshes rendered specs and component lock data.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
base/comps/dnf5/dnf5.comp.toml Defines plugin and packaging overlays.
base/comps/dnf5/0001-Add-a-plugin-to-support-virtual-snapshots-using-package-file-time.patch Implements snapshot functionality.
specs/d/dnf5/dnf5.spec Packages the rendered plugin artifacts.
specs/d/dnf5/0001-Add-a-plugin-to-support-virtual-snapshots-using-package-file-time.patch Contains the rendered downstream patch.
locks/dnf5.lock Refreshes the component fingerprint.

Comment on lines +471 to +477
+unsigned long long Package::get_file_time() const {
+#ifdef SOLVABLE_FILETIME
+ return get_rpm_pool(p_impl->base).lookup_num(p_impl->id.id, SOLVABLE_FILETIME);
+#else
+ return 0;
+#endif
+}
Comment on lines +9 to +11
# Add the repo_snapshot plugin (a dnf5 command plugin plus a libdnf5 hook
# plugin) that implements virtual repository snapshots by filtering packages
# on their file time. Depends on the libsolv solvable:filetime prerequisite.
+ errno = 0;
+ char * end = nullptr;
+ snapshot_time = static_cast<time_t>(std::strtoll(time_str.c_str(), &end, 10));
+ if (errno || end == time_str.c_str() || snapshot_time <= 0) {
Comment on lines +410 to +412
+ // Prefer file_time (repo publish time) over build_time.
+ auto file_time = static_cast<time_t>(pkg.get_file_time());
+ if (file_time > snapshot_time) {
Comment on lines +383 to +385
+void RepoSnapshotPlugin::repos_loaded() {
+ if (snapshot_time <= 0) {
+ return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants