repoman.config_io#
Save and load .repoman state files (pure JSON, no GTK, fully unit-testable).
File format v1: JSON with version, saved_at, and a repos list. Each entry captures enough to reconstruct a Repository and detect drift when the same config is loaded on a different machine or after a reinstall.
- save_config(repos)[source]#
Serialise repo list to a JSON string for writing to a .repoman file.
- Parameters:
repos (list[Repository])
- Return type:
- load_config(path)[source]#
Parse a .repoman JSON file and return the list of repo entries.
- Parameters:
path (Path) – Path to the .repoman file to read.
- Returns:
List of raw repo dicts from the
reposkey.- Return type:
- Raises:
json.JSONDecodeError – File is not valid JSON.
ValueError –
versionfield is missing or not1.KeyError – Required top-level key is absent.
- match_repos(saved, live)[source]#
Match saved config entries to live repos by primary URI.
- Parameters:
saved (list[dict]) – List of raw repo dicts from a loaded .repoman file.
live (list[Repository]) – Currently loaded repositories from the system.
- Returns:
A 2-tuple of
(matched, missing), wherematchedis a list of(saved_entry, live_repo)pairs for repos found on the system, andmissingis a list of saved entries whose URI was not found.- Return type: