[Git][reproducible-builds/diffoscope][master] uki: Fix crash when objdump is missing
Chris Lamb (@lamby)
gitlab at salsa.debian.org
Fri Nov 8 20:04:07 UTC 2024
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
534fc2aa by Martin Abente Lahaye at 2024-11-08T07:22:47-03:00
uki: Fix crash when objdump is missing
UKIFile.recognizes relies on objdump, but it doesn't account for
the scenario where binutils is not available. This results in a
crash with an unhandled error.
Therefore, handle this scenario more gracefully.
- - - - -
1 changed file:
- diffoscope/comparators/uki.py
Changes:
=====================================
diffoscope/comparators/uki.py
=====================================
@@ -21,7 +21,7 @@ import subprocess
import re
import logging
-from diffoscope.tools import tool_required
+from diffoscope.tools import tool_required, tool_check_installed
from diffoscope.difference import Difference
from .utils.file import File
@@ -46,6 +46,9 @@ class UKIFile(File):
if not super().recognizes(file):
return False
+ if not tool_check_installed("objdump"):
+ return False
+
try:
our_check_output(
["objdump", "-h", "--section", ".linux", file.path],
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/534fc2aa2f513801c1f55ce8712f4ac7be42c598
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/534fc2aa2f513801c1f55ce8712f4ac7be42c598
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20241108/eb106ff1/attachment.htm>
More information about the rb-commits
mailing list