Skip to content

Commit d8f99f4

Browse files
authored
Check license file in the wizard (#692)
1 parent 2ba10a2 commit d8f99f4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/wizard/interactive_build.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function step3_audit(state::WizardState, platform::Platform, destdir::String)
134134
printstyled(state.outs, "\n\t\t\tAnalyzing...\n\n", bold=true)
135135

136136
audit(Prefix(destdir); io=state.outs, platform=platform,
137-
verbose=true, autofix=true, require_license=false)
137+
verbose=true, autofix=true, require_license=true)
138138

139139
println(state.outs)
140140
end
@@ -242,6 +242,9 @@ function interactive_build(state::WizardState, prefix::Prefix,
242242
String(read(histfile))))
243243
rm(histfile)
244244
end
245+
if !run(ur, `/bin/bash -lc "auto_install_license -c"`, devnull)
246+
@warn "License file not found, install it with the `install_license` command"
247+
end
245248

246249
if !script_successful
247250
warn = """
@@ -321,8 +324,9 @@ function step3_retry(state::WizardState)
321324
preferred_gcc_version=state.preferred_gcc_version,
322325
preferred_llvm_version=state.preferred_llvm_version,
323326
)
327+
full_script = state.history * "\n/bin/bash -lc auto_install_license"
324328
with_logfile(joinpath(build_path, "out.log")) do io
325-
run(ur, `/bin/bash -c $(state.history)`, io; verbose=true, tee_stream=state.outs)
329+
run(ur, `/bin/bash -c $(full_script)`, io; verbose=true, tee_stream=state.outs)
326330
end
327331
step3_audit(state, platform, joinpath(prefix, "destdir"))
328332
# Unsymlink all the deps from the dest_prefix before moving to the next step
@@ -451,8 +455,9 @@ function step5_internal(state::WizardState, platform::Platform)
451455
preferred_gcc_version=state.preferred_gcc_version,
452456
preferred_llvm_version=state.preferred_llvm_version,
453457
)
458+
full_script = state.history * "\n/bin/bash -lc auto_install_license"
454459
with_logfile(joinpath(build_path, "out.log")) do io
455-
ok = run(ur, `/bin/bash -c $(state.history)`, io; verbose=true, tee_stream=state.outs)
460+
ok = run(ur, `/bin/bash -c $(full_script)`, io; verbose=true, tee_stream=state.outs)
456461
end
457462

458463
while true
@@ -466,7 +471,7 @@ function step5_internal(state::WizardState, platform::Platform)
466471
println(state.outs, msg)
467472
else
468473
audit(Prefix(joinpath(prefix, "destdir")); io=state.outs,
469-
platform=platform, verbose=true, autofix=true, require_license=false)
474+
platform=platform, verbose=true, autofix=true, require_license=true)
470475

471476
ok = isempty(match_files(state, prefix, platform, state.files))
472477
if !ok
@@ -654,8 +659,9 @@ function step5c(state::WizardState)
654659
preferred_gcc_version=state.preferred_gcc_version,
655660
preferred_llvm_version=state.preferred_llvm_version,
656661
)
662+
full_script = state.history * "\n/bin/bash -lc auto_install_license"
657663
with_logfile(joinpath(build_path, "out.log")) do io
658-
ok = run(ur, `/bin/bash -c $(state.history)`, io; verbose=false, tee_stream=state.outs)
664+
ok = run(ur, `/bin/bash -c $(full_script)`, io; verbose=false, tee_stream=state.outs)
659665
end
660666

661667
if ok
@@ -665,7 +671,7 @@ function step5c(state::WizardState)
665671
verbose=false,
666672
silent=true,
667673
autofix=true,
668-
require_license=false,
674+
require_license=true,
669675
)
670676

671677
ok = isempty(match_files(

0 commit comments

Comments
 (0)