From e35649467b819b1a3e00bc6bb94858486e835ad9 Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Mon, 26 Aug 2024 12:54:22 +0100 Subject: [PATCH] Resolve https://github.com/gap-system/gap/issues/5761 --- PackageInfo.g | 6 +++--- init.g | 8 ++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/PackageInfo.g b/PackageInfo.g index a291c37..0fe9e52 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -122,9 +122,9 @@ Dependencies := rec( ), AvailabilityTest := function() - if (not ("datastructures" in SHOW_STAT())) and - (Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so") = fail) then - return fail; + if not LoadKernelExtension("datastructures") then + Error("failed to load the datastructures package kernel extension"); + return fail; fi; return true; end, diff --git a/init.g b/init.g index 3030159..30d0f7a 100644 --- a/init.g +++ b/init.g @@ -12,12 +12,8 @@ #R Read the declaration files. ## -if (not IsBound(__DATASTRUCTURES_C)) and ("datastructures" in SHOW_STAT()) then - LoadStaticModule("datastructures"); -fi; -if (not IsBound(__DATASTRUCTURES_C)) and - (Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so") <> fail) then - LoadDynamicModule(Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so")); +if not LoadKernelExtension("datastructures") then + Error("failed to load the datastructures package kernel extension"); fi; # interface definitions