Repository navigation
refactor: flatten package managers into plain functions - #6
Merged
Merged
Conversation
- Replace the PackageManager trait/structs with src/packages/, one count() function per manager - Show every detected package manager instead of picking one by distro: a single one prints just the count, several print "xbps(632), apk(251)" - Print "Unknown" instead of panicking when none is found - Drop the package manager list from README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tcei1A4L5TW8AskmMbjWFQ
Package entries are named like bash-5.2.026-2, so the all-lowercase filter skipped almost all of them. Count directories instead, which leaves out only the ALPM_DB_VERSION file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tcei1A4L5TW8AskmMbjWFQ
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.
Summary
PackageManagertrait and structs withsrc/packages/: onecount()function per manager (xbps,apk,pacman,emerge) andpackages::get()inmod.rs./etc/os-release. One manager prints just the count (632); several printxbps(632), apk(251).Unknowninstead of panicking when no supported manager is found (and when xbps has nopkgdb-*file).bash-5.2.026-2were skipped. It now counts package directories, which excludes only theALPM_DB_VERSIONfile.Testing
cargo fmt --checkandcargo clippy --all-targets -- -D warningspass.pkgs Unknown. With fake apk + emerge databases:apk(2), emerge(1); with apk only:2.ALPM_DB_VERSION:3.🤖 Generated with Claude Code
https://claude.ai/code/session_01Tcei1A4L5TW8AskmMbjWFQ