Skip to content

Commit 1012595

Browse files
DilumAluthgestaticfloat
authored andcommitted
When registering binfmt_misc entries, print an @info message about sudo even if verbose is false
1 parent acf0d35 commit 1012595

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/binfmt_misc.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function BinFmtRegistration(file::String)
135135
if !enabled
136136
return nothing
137137
end
138-
138+
139139
return BinFmtRegistration(basename(file), interpreter, flags, offset, magic, mask)
140140
end
141141

@@ -242,9 +242,12 @@ function register_requested_formats!(formats::Vector{BinFmtRegistration}; verbos
242242

243243
# Notify the user if we have any formats to register, then register them.
244244
if !isempty(formats_to_register)
245+
format_names = sort([f.name for f in formats_to_register])
246+
msg = "Registering $(length(formats_to_register)) binfmt_misc entries, this may ask for your `sudo` password."
245247
if verbose
246-
format_names = sort([f.name for f in formats_to_register])
247-
@info("Registering $(length(formats_to_register)) binfmt_misc entries, this may ask for your `sudo` password.", formats=format_names)
248+
@info(msg, formats=format_names)
249+
else
250+
@info(msg)
248251
end
249252
write_binfmt_misc_registration!.(formats_to_register)
250253
end
@@ -311,7 +314,7 @@ const platform_qemu_registrations = Dict(
311314
Platform("ppc64le", "linux"; libc="musl") => qemu_ppc64le,
312315
)
313316

314-
# Define what is a natively-runnable
317+
# Define what is a natively-runnable
315318
const host_arch = arch(HostPlatform())
316319
function natively_runnable(p::Platform)
317320
if host_arch == "x86_64"

0 commit comments

Comments
 (0)