Skip to main content

disable_repo_section_in_repos_conf_if_enabled

Function disable_repo_section_in_repos_conf_if_enabled 

Source
pub fn disable_repo_section_in_repos_conf_if_enabled(
    path: &Path,
    section_name: &str,
) -> Result<bool, String>
Expand description

What: Persist enabled = false for a [[repo]] row only while it is currently enabled.

Inputs:

  • path: repos.conf path.
  • section_name: Pacman [repo] name (case-insensitive trim).

Output:

  • Ok(true) when the file was updated; Ok(false) when the row is already disabled or equivalent.

Details:

  • Does not toggle back to enabled when the row is already enabled = false (unlike toggle_repo_enabled_for_section_in_file).
  • Returns an error when no matching [[repo]] exists or read/parse/write fails.

ยงErrors