Validate that *source* has the ``distro/release/section/name.section.gz`` format. Raises ``errors.InvalidSourcePath`` on failure.
(source: str)
| 21 | |
| 22 | |
| 23 | def validate_source_path(source: str) -> None: |
| 24 | """Validate that *source* has the ``distro/release/section/name.section.gz`` format. |
| 25 | |
| 26 | Raises ``errors.InvalidSourcePath`` on failure. |
| 27 | """ |
| 28 | if not _SOURCE_RE.match(source): |
| 29 | raise errors.InvalidSourcePath( |
| 30 | f"source path {source!r} does not match the required " |
| 31 | f"'distro/release/section/name.section.gz' format " |
| 32 | f"(e.g. 'ubuntu/26.04/1/tar.1.gz')" |
| 33 | ) |
| 34 | |
| 35 | |
| 36 | _CREATE_SCHEMA = """ |