Add OpenBSD support with pkg_add package manager #25
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.
Summary
This PR adds full support for OpenBSD systems to miniupdate, enabling automatic detection, update checking, and package updates via OpenBSD's native
pkg_addpackage manager. Additionally, it improves the display for Arch-based rolling release distributions.Changes
OS Detection (
miniupdate/os_detector.py)OS_PATTERNSdictionary withpkg_addas its package manager/usr/sbin/pkg_addtoPACKAGE_MANAGERSdetection paths_parse_os_info()to detect OpenBSD via uname kernel name_normalize_distribution_name()Package Manager (
miniupdate/package_managers.py)PkgAddPackageManagerclass with full OpenBSD support:check_updates(): Usesdoas pkg_add -u -n(dry-run mode) to check for available updatesapply_updates(): Applies all updates usingdoas pkg_add -u_parse_pkg_add_output(): Robust parsing supporting multiple output formats:package-1.0 -> package-1.1Update to package-1.1gtk+3-3.24.38)pkg_addto theget_package_manager()mappingDocumentation (
README.md)Technical Details
OpenBSD uses
doasfor privilege escalation instead ofsudo, which is correctly handled by the implementation. The package manager properly detects and parses various output formats frompkg_add, handles edge cases like empty output and complex package names, and gracefully handles permission errors.Arch-based distributions (Arch Linux and Manjaro) are rolling release distributions that don't include version numbers in their
/etc/os-releasefiles. This PR sets their version to 'rolling' instead of 'unknown' for better UI presentation.Testing
Comprehensive testing performed:
Usage Example
After this PR, OpenBSD hosts can be added to the inventory:
And will be automatically detected and updated:
Arch-based hosts will display version as 'rolling':
Fixes #64
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.