From 54e55f26efbf146b6f301327c5db8ef109b1b080 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 6 Nov 2024 23:21:04 +0100 Subject: [PATCH] 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. --- pmb/config/init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pmb/config/init.py b/pmb/config/init.py index 2b364f4b..5ab748f1 100644 --- a/pmb/config/init.py +++ b/pmb/config/init.py @@ -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