From bdb20e73f4cfbd8ea246734dda3197b49f2a7c4e Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Wed, 3 Jul 2024 00:28:11 +0200 Subject: [PATCH] avoid calling `GAP.Packages.install` if possible --- src/Oscar.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Oscar.jl b/src/Oscar.jl index 0a758fd0445c..282a1d516578 100644 --- a/src/Oscar.jl +++ b/src/Oscar.jl @@ -94,7 +94,13 @@ function __init__() ("recog", "1.4.2"), ("repsn", "3.1.1"), ] - GAP.Packages.install(pkg, version, interactive = false, quiet = true) + # Avoid downloading something if the requested version is already loaded. +#TODO: Remove this check as soon as GAP.jl contains it, +# see https://github.com/oscar-system/GAP.jl/pull/1019. + info = GAP.Globals.GAPInfo.PackagesLoaded + if !(hasproperty(info, pkg) && version == string(getproperty(info, pkg)[2])) + GAP.Packages.install(pkg, version, interactive = false, quiet = true) + end end withenv("TERMINFO_DIRS" => joinpath(GAP.GAP_jll.Readline_jll.Ncurses_jll.find_artifact_dir(), "share", "terminfo")) do