pub fn toggle_repo_enabled_for_section_in_file(
path: &Path,
section_name: &str,
) -> Result<(), String>Expand description
What: Toggle enabled for the [[repo]] whose name matches section_name and save the file.
Inputs:
path:repos.confpath.section_name: Pacman[repo]name (case-insensitive trim).
Output:
Ok(())or an error (read/parse/write).
Details:
- When the row is currently enabled (
enabledabsent ortrue), setsenabled = false. - When currently disabled (
enabled = false), clearsenabled(treat as enabled again). - Requires a validated row with
nameandresults_filteras inload_resolve_repos_from_str.
ยงErrors
- Read/parse failures, missing matching
[[repo]], or write errors surface asErr(String).