From d6934c0bb66bdbcb11d8575e7354d78eda017161 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 | 8 +++++--- init.g | 8 ++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/PackageInfo.g b/PackageInfo.g index a291c37..a1a13b8 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -122,9 +122,11 @@ Dependencies := rec( ), AvailabilityTest := function() - if (not ("datastructures" in SHOW_STAT())) and - (Filename(DirectoriesPackagePrograms("datastructures"), "datastructures.so") = fail) then - return fail; + if not IsKernelExtensionAvailable("datastructures") then + LogPackageLoadingMessage(PACKAGE_WARNING, + ["the kernel module is not compiled, ", + "the package cannot be loaded."]); + 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