Managing GAP packages
The following functions allow one to load/install/update/remove/locate GAP packages.
GAP.Packages.load
— Functionload(spec::String, version::String = ""; install::Union{Bool, String} = false, quiet::Bool = true)
Try to load the GAP package given by spec
, which can be either the name of the package or a local path where the package is installed (a directory that contains the package's PackageInfo.g
file).
If version
is specified then try to load a version of the package that is compatible with version
, in the sense of GAP's CompareVersionNumbers function, otherwise try to load the newest installed version. Return true
if this is successful, and false
otherwise.
If install
is set to true
or to a string and (the desired version of) the required GAP package is not yet installed and spec
is the package name then install
is called first, in order to install the package; if no version is prescribed then the newest released version of the package will be installed. A string value of install
can be the URL of an archive or repository containing a package, or the URL of a PackageInfo.g
file, like the first argument of install
.
The function calls GAP's LoadPackage
function. If quiet
is set to false
then package banners are shown for all packages being loaded. The quiet
value is also passed on to install
.
GAP.Packages.install
— Functioninstall(spec::String, version::String = "";
interactive::Bool = true, quiet::Bool = false,
debug::Bool = false,
pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])
Download and install the GAP package given by spec
into the pkgdir
directory.
spec
can be either the name of a package or the URL of an archive or repository containing a package, or the URL of a PackageInfo.g
file.
If spec
is the name of a package then the package version can be specified by version
, in the format described for GAP's CompareVersionNumbers function. In all other cases the newest released version of the package will get installed.
Return true
if the installation is successful or if (a version compatible with version
) of the package was already installed, and false
otherwise.
The function uses the function InstallPackage
from GAP's package PackageManager
. The info messages shown by this function can be suppressed by passing true
as the value of quiet
. Specifying interactive = false
will prevent PackageManager
from prompting the user for input interactively. For details, please refer to its documentation.
GAP.Packages.update
— Functionupdate(spec::String; interactive::Bool = true, quiet::Bool = false,
debug::Bool = false,
pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])
Update the GAP package given by spec
that is installed in the pkgdir
directory, to the latest version. Return true
if a newer version was installed successfully, or if no newer version is available, and false
otherwise.
spec
can be either the name of a package or the URL of an archive or repository containing a package, or the URL of a PackageInfo.g
file.
The function uses the function UpdatePackage
from GAP's package PackageManager
. The info messages shown by this function can be suppressed by passing true
as the value of quiet
. Specifying interactive = false
will prevent PackageManager
from prompting the user for input interactively. For details, please refer to its documentation.
GAP.Packages.remove
— Functionremove(spec::String; interactive::Bool = true, quiet::Bool = false,
debug::Bool = false,
pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])
Remove the GAP package with name spec
that is installed in the pkgdir
directory. Return true
if the removal was successful, and false
otherwise.
The function uses the function RemovePackage
from GAP's package PackageManager
. The info messages shown by this function can be suppressed by passing true
as the value of quiet
. Specifying interactive = false
will prevent PackageManager
from prompting the user for input interactively. For details, please refer to its documentation.
GAP.Packages.build
— Functionbuild(name::String; quiet::Bool = false,
debug::Bool = false,
pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])
Build the GAP package with name name
that is installed in the pkgdir
directory.
If no package with name name
is installed in pkgdir
but there is a version of name
bundled with the GAP package distro, this version is copied to pkgdir
and built.
Return true
if the build was successful or the package was already built, and false
otherwise.
The function uses the function CompilePackage
from GAP's package PackageManager
. The info messages shown by this function can be suppressed by passing true
as the value of quiet
.
GAP.Packages.build_recursive
— Functionbuild_recursive(name::String; quiet::Bool = false,
debug::Bool = false,
pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])
Build the GAP package with name name
that is installed in the pkgdir
directory, as well as all of its (transitive) dependencies.
This is achieved by calling build
for the package name
and then all of its NeededOtherPackages
, recursively. All keyword arguments are passed on to build
.
GAP.Packages.locate_package
— Functionlocate_package(name::String)
Return the path where the GAP package with name name
is installed if this package is loaded, and ""
otherwise.