Display a warning if a modern distribution URL doesn't end in .wsl (#12463)

This commit is contained in:
Blue 2025-01-14 14:37:08 -08:00 committed by GitHub
parent 8eb7d8c3df
commit 52d1e510ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -403,6 +403,8 @@ def read_tar(flavor: str, name: str, file, elf_magic: str):
def read_url(flavor: str, name: str, url: dict, elf_magic):
hash = hashlib.sha256()
if not url['Url'].endswith('.wsl'):
warning(flavor, name, f'Url does not point to a .wsl file: {url["Url"]}')
if url['Url'].startswith('file://'):
with open(url['Url'].replace('file:///', '').replace('file://', ''), 'rb') as fd: