Update Dockerfile

This commit is contained in:
Kroese
2026-07-28 14:47:57 +02:00
committed by GitHub
parent 18d4ae4613
commit 6afa31961e
+15 -15
View File
@@ -54,24 +54,20 @@ RUN python3 -m pip install --break-system-packages --no-cache-dir "pycdlib==${VE
RUN python3 - <<'PY'
from pathlib import Path
import pycdlib
path = Path(
"/usr/local/lib/python3.13/dist-packages/pycdlib/pycdlib.py"
)
path = Path(pycdlib.__file__).with_name("pycdlib.py")
text = path.read_text()
old = """\
num_bytes_to_remove = child.parent.remove_child(
child, index, self.logical_block_size
)
if child.parent.remove_child(child, index, self.logical_block_size):
"""
new = """\
if (
index < 0
or index >= len(child.parent.children)
or child.parent.children[index] is not child
index < 0
or index >= len(child.parent.children)
or child.parent.children[index] is not child
):
for actual_index, candidate in enumerate(child.parent.children):
if candidate is child:
@@ -82,15 +78,19 @@ new = """\
'Child is not present in its recorded parent'
)
num_bytes_to_remove = child.parent.remove_child(
child, index, self.logical_block_size
)
if child.parent.remove_child(child, index, self.logical_block_size):
"""
if old not in text:
raise SystemExit("Expected PyCdlib source block not found")
matches = text.count(old)
if matches != 1:
raise SystemExit(
f"Expected exactly one PyCdlib source block, found {matches} in {path}"
)
path.write_text(text.replace(old, new, 1))
print(f"Patched {path}")
PY
ARG VERSION_ARG="0.00"