feat(dnf5): Add a plugin to support virtual snapshots#18016
Open
mbearup wants to merge 3 commits into
Open
Conversation
…rerequisite for supporting virtual snapshots
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a dnf5 plugin to support virtual snapshots