Bash scripts were untestable and duplicated device/LUKS/mount logic; the lim/ package centralizes it behind one subprocess wrapper and a YAML image catalog (single point of truth). BREAKING CHANGE: scripts/*.sh removed. Use `lim --type <cmd>`; new types mount/umount/single-boot/raid1-boot/lock/unlock/import/export replace direct script calls. --extra is deprecated and ignored. - distributions.yml + lim/catalog.py hold the image catalog (PyYAML) - pytest suite: 102 tests with mocked subprocess (tests/unit) and a 250-line max file-length guard (tests/lint) - ruff strict (select ALL), GitHub Actions CI, Dependabot; Travis gone - Makefile: install (symlink ~/.local/bin/lim) and test targets - fixes over bash: SUDO_USER-aware chown, mmcblk/nvme partition paths, sha512 checksum support, whole-pipeline failure detection, blkid UUID fallback for pre-mounted images, conditional fstab seeding for PARTUUID/LABEL images, clean errors for missing binaries
32 lines
708 B
Python
32 lines
708 B
Python
"""Read-only access to the image catalog (distributions.yml in the repo root)."""
|
|
|
|
from functools import cache
|
|
|
|
import yaml
|
|
|
|
from lim import config
|
|
|
|
CATALOG_PATH = config.REPOSITORY_PATH / "distributions.yml"
|
|
|
|
|
|
@cache
|
|
def _load() -> dict:
|
|
with CATALOG_PATH.open() as handle:
|
|
return yaml.safe_load(handle)
|
|
|
|
|
|
def arch_rpi_images() -> dict[str, dict[str, str]]:
|
|
return _load()["arch_rpi_images"]
|
|
|
|
|
|
def manjaro_gnome_releases() -> dict[str, dict[str, str]]:
|
|
return _load()["manjaro_gnome_releases"]
|
|
|
|
|
|
def retropie_images() -> dict[str, dict[str, str]]:
|
|
return _load()["retropie_images"]
|
|
|
|
|
|
def mkinitcpio_modules_by_rpi() -> dict[str, str]:
|
|
return _load()["mkinitcpio_modules_by_rpi"]
|