get_installed_version

Function get_installed_version 

Source
pub fn get_installed_version(name: &str) -> Result<String, String>
Expand description

What: Retrieve the locally installed version of a package.

Inputs:

  • name: Package to query via pacman -Q.

Output:

  • Returns the installed version string on success; otherwise an error message.

ยงErrors

  • Returns Err when pacman -Q command execution fails (I/O error)
  • Returns Err when the package is not found or not installed
  • Returns Err when the version string cannot be parsed from command output

Details:

  • Normalizes versions by removing revision suffixes to facilitate requirement comparisons.