Skip to main content

migrated_get_version

Function migrated_get_version 

Source
pub fn migrated_get_version(component_id: &str) -> String
Expand description

Rust equivalent of up_get_version() from update_helper.sh.

Returns the version string for a component, matching the shell behavior:

  • ROCm: version from /opt/rocm/.info/version or rocminfo --version
  • Python modules: __version__ attribute or “not installed”
  • Git-based: git log -1 --format="%h %s" or “installed” or “not installed”
  • Command-based: first line of --version output or “not installed”
  • permanent-env: “installed” or “not installed”
  • Unknown: “unknown”

§Errors

Unknown component IDs return “unknown” (structured, not panic). This matches the shell’s *) echo "unknown" ;; default case.