From b5058d409b701bf5083ee4e7d7c43b4c9a7cd93b Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Thu, 12 Sep 2024 23:23:19 +0200 Subject: [PATCH 1/2] fix the availability check in `Packages.install` --- Project.toml | 2 +- src/packages.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index b171107a1..bac21e190 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GAP" uuid = "c863536a-3901-11e9-33e7-d5cd0df7b904" authors = ["Thomas Breuer ", "Sebastian Gutsche ", "Max Horn "] -version = "0.11.2" +version = "0.11.3" [deps] AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" diff --git a/src/packages.jl b/src/packages.jl index 2eb70bec7..7c592bf2c 100644 --- a/src/packages.jl +++ b/src/packages.jl @@ -274,8 +274,8 @@ function install(spec::String, version::String = ""; # then nothing is to do. for inforec in getproperty(info, spec) if version == string(getproperty(inforec, :Version)) - fun = getproperty(inforec, :AvailabilityTest) - fun() && return true + res = Globals.TestPackageAvailability(GapObj(spec), GapObj(version)) + res !== Globals.fail && return true end end end From 50f7f454f278557cc2a8fb9f1a48b0ce9382b129 Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Fri, 13 Sep 2024 13:33:12 +0200 Subject: [PATCH 2/2] remove now unnecessary code lines --- src/packages.jl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/packages.jl b/src/packages.jl index 7c592bf2c..615a6d2c7 100644 --- a/src/packages.jl +++ b/src/packages.jl @@ -272,12 +272,8 @@ function install(spec::String, version::String = ""; # The package is not yet loaded but may be available. # If an available version has the required version number # then nothing is to do. - for inforec in getproperty(info, spec) - if version == string(getproperty(inforec, :Version)) - res = Globals.TestPackageAvailability(GapObj(spec), GapObj(version)) - res !== Globals.fail && return true - end - end + res = Globals.TestPackageAvailability(GapObj(spec), GapObj(version)) + res !== Globals.fail && return true end res = Globals.InstallPackage(GapObj(spec), GapObj(version), interactive; debug) end