require_programs: losetup --json: set output=null (MR 2475)

We don't care about the output of "losetup --json" here, we just want to
make sure that the argument exists. If it does not exist, we already
give an error to the user.

Set the output to null so it does not clutter the log since it runs with
every pmbootstrap command now.
This commit is contained in:
Oliver Smith 2024-11-06 23:31:41 +01:00
parent 54e55f26ef
commit ee154ccdf9
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -51,7 +51,9 @@ def require_programs() -> None:
# 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([pmb.config.required_programs["losetup"], "--json"], check=True)
pmb.helpers.run.user(
[pmb.config.required_programs["losetup"], "--json"], check=True, output="null"
)
except RuntimeError:
losetup_missing_json = True