(shasums_path: Path)
| 89 | |
| 90 | |
| 91 | def parse_shasums(shasums_path: Path) -> list[str]: |
| 92 | if not shasums_path.exists(): |
| 93 | raise SystemExit(f"{shasums_path} not found") |
| 94 | |
| 95 | filenames: list[str] = [] |
| 96 | for line in shasums_path.read_text().splitlines(): |
| 97 | line = line.strip() |
| 98 | if not line: |
| 99 | continue |
| 100 | |
| 101 | try: |
| 102 | _digest, filename = line.split(maxsplit=1) |
| 103 | except ValueError as e: |
| 104 | raise SystemExit(f"malformed line in {shasums_path}: {line!r}") from e |
| 105 | |
| 106 | filenames.append(filename.lstrip("*")) |
| 107 | |
| 108 | return filenames |
| 109 | |
| 110 | |
| 111 | def destination_to_source_name(dest_name: str, tag: str, build_datetime: str) -> str: |
no outgoing calls
no test coverage detected