mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 13:04:15 -04:00
Fix extract_blocks.py
This commit is contained in:
parent
0b060a57f3
commit
8ed2fceba3
@ -50,13 +50,13 @@ with open(image, "rb") as image:
|
|||||||
"<6sBB32s8sLHHQ", header
|
"<6sBB32s8sLHHQ", header
|
||||||
)
|
)
|
||||||
if ident != b"DWARFS":
|
if ident != b"DWARFS":
|
||||||
printf(f"error: expected dwarfs header")
|
print(f"error: expected dwarfs header")
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
if sectype not in sectypes:
|
if sectype not in sectypes:
|
||||||
printf(f"error: unexpected section type ({sectype})")
|
print(f"error: unexpected section type ({sectype})")
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
if compalg not in compalgs:
|
if compalg not in compalgs:
|
||||||
printf(f"error: unexpected compression algorithm ({compalg})")
|
print(f"error: unexpected compression algorithm ({compalg})")
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
print(
|
print(
|
||||||
f"{ident.decode('ascii')} v{major}.{minor} [{secno}] {sectypes[sectype]} ({compalgs[compalg]}) {blocklen} bytes"
|
f"{ident.decode('ascii')} v{major}.{minor} [{secno}] {sectypes[sectype]} ({compalgs[compalg]}) {blocklen} bytes"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user