mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 19:31:51 +02:00
integrate squashfs test
This commit is contained in:
@@ -136,14 +136,16 @@ def build_snap(target: str, arch: str) -> None:
|
|||||||
|
|
||||||
# Check if the snap file just contains html
|
# Check if the snap file just contains html
|
||||||
if not failed:
|
if not failed:
|
||||||
with open(snap_path_list[0], 'r') as f:
|
with open(snap_path_list[0], 'rb') as f:
|
||||||
try:
|
first_block = f.read(10)
|
||||||
first_line = f.readline().rstrip()
|
# 'hsqs' is the magic number that SquashFS files start with
|
||||||
except UnicodeDecodeError:
|
if not first_block.startswith(b'hsqs'):
|
||||||
first_line = ''
|
|
||||||
if first_line == "<!DOCTYPE html>":
|
|
||||||
failed = True
|
failed = True
|
||||||
print(f'The {target} {arch} snap file contains html instead of a snap')
|
try:
|
||||||
|
first_block_str = first_block.decode()
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
first_block_str = first_block.hex(sep=',')
|
||||||
|
print(f'The {target} {arch} snap file began with invalid data: {first_block_str}')
|
||||||
|
|
||||||
if failed:
|
if failed:
|
||||||
print('Dumping snapcraft remote-build logs:')
|
print('Dumping snapcraft remote-build logs:')
|
||||||
|
|||||||
Reference in New Issue
Block a user