require_programs: run losetup with absolute path (MR 2475)

Use the absolute path for it, so it works in Debian too as we run it
without sudo here to just check if the argument is supported.
This commit is contained in:
Oliver Smith 2024-11-06 23:21:04 +01:00
parent 765ba770dd
commit 54e55f26ef
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -48,9 +48,10 @@ def require_programs() -> None:
losetup_missing_json = False
if "losetup" not in missing:
# Check if losetup supports the --json argument.
# Check if losetup supports the --json argument. Use the absolute path
# here, so it works in Debian too without using sudo.
try:
pmb.helpers.run.user(["losetup", "--json"], check=True)
pmb.helpers.run.user([pmb.config.required_programs["losetup"], "--json"], check=True)
except RuntimeError:
losetup_missing_json = True