Release 1.12.3#1650
Conversation
Return empty RefStatistics when building against ostree versions that do not provide ostree_commit_get_object_sizes. (cherry picked from commit 20644c8)
- Make OSTreeRepo::loadFromPath read repo config only - Make OSTreeRepo::create prefer repo config and persist fallback config when absent - Add repo and repo cache tests Signed-off-by: reddevillg <reddevillg@gmail.com>
Work around Qt 6 D-Bus bug where unregistered meta types cause runtime failures. This issue affects various distributions shipping affected Qt 6 versions (e.g., Ubuntu 24.04). Link: https://qt-project.atlassian.net/browse/QTBUG-108822 Signed-off-by: ComixHe <ComixHe1895@outlook.com>
Refactor getRunningAppContainers to return Result type for better error handling Add container ID prefix matching for more flexible container selection Improve error messages for multiple matching containers Update all callers to handle the new Result type properly The changes enhance container management by: 1. Changing getRunningAppContainers to return utils::error::Result for proper error propagation 2. Adding container ID prefix matching in addition to package ID matching 3. Providing clearer error messages when multiple containers match 4. Updating enter, kill, and getBundleDir methods to handle the new error handling pattern 5. Fixing path output in getLayerDir to use string() method This improves user experience by allowing partial container ID matching and providing more specific error messages when multiple containers are found. Log: Improved container selection with better error messages and partial ID matching Influence: 1. Test container enter command with partial container ID 2. Verify error messages when multiple containers match a prefix 3. Test kill command with different container identification methods 4. Verify bundle and layer directory inspection commands work correctly 5. Test edge cases with no containers found or multiple matches 6. Validate error handling for invalid container references
- Add URL encode/decode utilities for D-Bus address options - Refactor D-Bus address parsing to follow specification - Update trim/split to return string_view for efficiency Signed-off-by: ComixHe <ComixHe1895@outlook.com>
The `<climits>` header is required for PATH_MAX constants.
* i18n: Translate policy.ts in pt_BR 100% translated source file: 'policy.ts' on 'pt_BR'. * i18n: Translate po/en_US.po in pt_BR 83% of minimum 50% translated source file: 'po/en_US.po' on 'pt_BR'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * i18n: Translate po/en_US.po in pt_BR 87% of minimum 50% translated source file: 'po/en_US.po' on 'pt_BR'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * i18n: Translate po/en_US.po in pt_BR 90% of minimum 50% translated source file: 'po/en_US.po' on 'pt_BR'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * i18n: Translate po/en_US.po in pt_BR 92% of minimum 50% translated source file: 'po/en_US.po' on 'pt_BR'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * i18n: Translate po/en_US.po in pt_BR 98% of minimum 50% translated source file: 'po/en_US.po' on 'pt_BR'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * i18n: Translate po/en_US.po in pt_BR 100% translated source file: 'po/en_US.po' on 'pt_BR'. --------- Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
This reverts commit 65b19c1.
- Centralize third-party library target generation in gen_library_target() - Support static/in-box builder utility linking for all deps Signed-off-by: reddevillg <reddevillg@gmail.com>
Extract the fallback mechanism for pulling binary modules info reusable helper functions. When pulling a binary module fails with "No such branch", the code now falls back to the runtime ref. Signed-off-by: reddevillg <reddevillg@gmail.com>
1. Add systemd sandboxing directives to enhance service security isolation 2. Implement ProtectSystem=full with specific ReadWritePaths for necessary data access 3. Enable kernel and control group protection mechanisms pressure 4. Remove explicit Restart policy, likely relying on D-Bus activation behavior Influence: 1. Verify ll-package-manager service starts successfully with new security constraints 2. Test package installation, removal, and update operations to ensure file system access is preserved 3. Confirm service isolation prevents unauthorized access to /home and system directories 4. Verify D-Bus activation works correctly for the PackageManager service 5. Check system behavior and service status if the process encounters a failure (verify no auto-restart)
1. Added trailing newline to policy_pt_BR.ts Brazilian Portuguese translation file 2. The file previously ended without a newline character 3. This follows POSIX standards where text files should end with a newline 4. Prevents "No newline at end of file" warnings in git diffs and editor messages Influence: 1. Verify the XML translation file is still valid and well-formed 2. Confirm polkit policy translations load correctly for Brazilian Portuguese locale 3. Check that the file displays correctly in text editors without warnings
1. Add QDirIterator::FollowSymlinks flag to directory iterator in Cli::content method 2. This enables proper resolution of desktop files from symlinked entries/share directories 3. Previously, symlinks in the entries directory were not being followed, causing desktop files pointed to by symbolic links to be missed 4. Add two test cases to verify symlink resolution works correctly: - contentResolvesDesktopFromSymlinkedEntriesShareDir: tests resolving desktop from symlinked entries - contentResolvesOverlayDesktopFromSymlinkedEntriesShareDir: tests overlay desktop resolution with symlinks Influence: 1. Test content command with applications that have symlinked entries/ share directories 2. Verify desktop file discovery works correctly when entries/share is a symlink to files/share 3. Test both default directory fallback and overlay directory scenarios with symlinked paths 4. Verify no regression in normal (non-symlinked) directory traversal 5. Test that symlinked directories pointing outside expected paths are handled safely
This reverts commit 8b49ea0.
1. Removed MemoryMax=8G directive to allow the package manager service to utilize available system memory without artificial constraints 2. Removed Restart=on-failure and RestartSec=10 directives to rely on default system service supervision behavior Influence: 1. Verify the ll-package-manager service starts successfully without the removed directives 2. Monitor memory usage during large package operations to ensure system stability without the 8G cap 3. Test service behavior under failure conditions to verify default restart policies are appropriate 4. Confirm service functionality remains unchanged after configuration modification
1. Prune when uninstalling an app. 2. Remove all refs/objects in ostree if they are not referenced by any app. Signed-off-by: reddevillg <reddevillg@gmail.com>
1. Removed the check that prevented root users from writing to states.json during cache rebuild 2. The previous workaround was needed when ll-cli could make states.json owned by root, causing permission issues 3. This restriction is no longer necessary as the underlying ownership issue has been addressed 4. Root users can now fully rebuild the repository cache without skipping the write operation Log: Root users can now rebuild the repository cache and persist changes to states.json Influence: 1. Test RepoCache rebuild functionality when running as root user 2. Verify states.json is correctly written and readable by both root and non-root users 3. Test cache rebuild in scenarios where ll-cli initializes the repository as root 4. Verify file ownership and permissions of states.json after root- initiated rebuilds 5. Test cache persistence across multiple rebuild operations as root 6. Verify no permission denied errors occur during cache writes as root
release 1.12.3.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengbo11 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
eb48f94
into
OpenAtom-Linyaps:release/1.12
There was a problem hiding this comment.
Code Review
This pull request refactors the project to use std::filesystem::path instead of QDir for repository management, updates the OSTreeRepo and RepoCache APIs for better initialization and error handling, and improves D-Bus address parsing for container configuration. It also includes a version bump to 1.12.3, updated translations, and various cleanups in the build system and service files. Feedback focuses on the OSTreeRepo implementation, specifically recommending the replacement of assert with proper error handling for memory allocations, correcting the handling of "local" remotes and empty remote strings in ostree API calls, and fixing the incorrect use of ostree_parse_refspec when iterating over repository references.
| g_autoptr(GError) parseErr = nullptr; | ||
| g_autofree char *remote = nullptr; | ||
| g_autofree char *ref = nullptr; | ||
| if (ostree_parse_refspec(entry.refspec.c_str(), &remote, &ref, &parseErr) == FALSE) { | ||
| return LINGLONG_ERR(fmt::format("ostree_parse_refspec {}", ptr_view(parseErr))); | ||
| } | ||
|
|
||
| auto removedRef = this->removeOstreeRef(remote ? remote : "", ref ? ref : "", entry.commit); | ||
| if (!removedRef) { | ||
| return LINGLONG_ERR(removedRef); | ||
| } |
There was a problem hiding this comment.
Using ostree_parse_refspec on the keys returned by ostree_repo_list_refs is incorrect. ostree_repo_list_refs returns ref names relative to refs/ (e.g., heads/master or remotes/origin/master). ostree_parse_refspec expects a format like REMOTE:REF. For the keys from list_refs, you should treat them as the full ref name and pass an empty remote to removeOstreeRef, which will correctly resolve and delete them relative to refs/.
auto removedRef = this->removeOstreeRef("", entry.refspec, entry.commit);
if (!removedRef) {
return LINGLONG_ERR(removedRef);
}| ostreeRepo = ostree_repo_new(repoPath); | ||
| Q_ASSERT(ostreeRepo != nullptr); | ||
| assert(ostreeRepo != nullptr); |
There was a problem hiding this comment.
Using assert for checking the result of ostree_repo_new is not suitable for production code, as it is typically disabled in release builds. If ostree_repo_new fails (e.g., due to memory allocation issues), the program will crash on the subsequent ostree_repo_create call. It is better to check for nullptr and return a LINGLONG_ERR.
ostreeRepo = ostree_repo_new(repoPath);
if (ostreeRepo == nullptr) {
return LINGLONG_ERR("failed to allocate ostree repo");
}|
|
||
| std::string refspec = ostreeRefSpecFromLayerItem(layer); | ||
| std::string ref = ostreeRefFromLayerItem(layer); | ||
| auto refspec = remote.empty() ? ref : remote + ":" + ref; |
There was a problem hiding this comment.
The string "local" is used in this project to represent a local repository (e.g., in importLayerDir). However, ostree does not recognize "local" as a special remote name. If remote is "local", it should be treated as an empty string so that the ref is resolved correctly as a local ref.
auto refspec = (remote.empty() || remote == "local") ? ref : remote + ":" + ref;| if (ostree_repo_set_ref_immediate(this->ostreeRepo.get(), | ||
| layer.repo.c_str(), | ||
| remote.c_str(), | ||
| ref.c_str(), |
There was a problem hiding this comment.
The ostree_repo_set_ref_immediate function expects NULL for the remote argument when dealing with local refs. Passing an empty string ("") may not be handled the same way by the underlying GLib/Ostree implementation. It is safer to pass nullptr if the remote name is empty or "local".
if (ostree_repo_set_ref_immediate(this->ostreeRepo.get(),
(remote.empty() || remote == "local") ? nullptr : remote.c_str(),
ref.c_str(),
No description provided.