pub fn get_installed_packages() -> Result<HashSet<String>>Expand description
What: Query pacman directly for all installed packages without caching.
Inputs:
- None: Invokes
pacman -Qqto query the local database.
Output:
- Returns
Ok(HashSet<String>)containing all installed package names. - Returns
Ok(HashSet::new())on failure (graceful degradation).
Details:
- Direct query to pacman, no caching involved.
- Reuses the same logic as
refresh_installed_cachebut without cache parameter. - Sets
LC_ALL=CandLANG=Cfor consistent locale-independent output.
§Errors
This function does not return errors - it gracefully degrades by returning an empty set.
Errors are logged using tracing::error for diagnostics.
§Example
use arch_toolkit::index::get_installed_packages;
let packages = get_installed_packages().unwrap();
println!("Found {} installed packages", packages.len());