‣ InstallPackage( string[, prefs] ) | ( operation ) |
Returns: true or false
Attempts to download and install a package. The argument string should be a string containing one of the following:
the name of a package;
the URL of a package archive, ending in .tar.gz or .tar.bz2;
the URL of a git repository, ending in .git;
the URL of a valid PackageInfo.g file.
The package will then be downloaded and installed, along with any additional packages that are required in order for it to be loaded. Its documentation will also be built if necessary. If the installation is completed successfully, or if this package is already installed, true is returned; otherwise, false is returned.
By default, packages will be installed in the pkg subdirectory of GAPInfo.UserGapRoot (see Reference: GAP Root Directories). Note that this location is not the default user pkg location on Mac OSX, but it will be created on any system if not already present. Note also that starting GAP with the -r flag will cause all packages in this directory to be ignored.
This command's behaviour is affected by the user preferences that have been set for the PackageManager package. These can be updated using, for example, SetUserPreference("PackageManager", "compile", true); but these can also be overridden for this call by passing a record to this function, for example InstallPackage(name, rec(compile := false));
The available preferences are as follows:
dependencies - whether to install the package's dependencies as well
suggested - whether to include suggested as well as required dependencies
compile - whether to attempt to compile newly installed packages
compileDeps - whether to attempt to compile the dependencies of newly installed packages
upgrade - whether to upgrade already installed packages if an upgrade is available
git - whether to attempt to pull from Git repos when upgrading
proceed - whether to proceed with the installation at all (after printing the installation plan)
interactive - set this to false to disable all interactive prompting (preferences set to "ask" are instead treated as true)
distroLocation - the URL to download the GAP package distribution info from
distroVersion - the version of the package distribution info to use (choose a version of GAP, or just "latest")
version - the version of a particular package to attempt to install
All boolean preferences above (those described as "whether to...") can be set to true, false, or "ask" which will prompt the user interactively. This is the default setting for many of them.
To see more information about the install process while it is ongoing, see InfoPackageManager (2.2-1).
If the version preference is specified, then it is interpreted as described in Section Reference: Version Numbers. In particular, if version starts with = then the function will try to install exactly the given version, and otherwise it will try to install a version that is not smaller than the given one. If an installed version satisfies the condition on the version then true is returned without an attempt to upgrade the package. If the package is not yet installed or if no installed version satisfies the version condition then an upgrade is tried only if the package version that is listed on the GAP webpages satisfies the condition. (The function will not update a dev version of the package if a version number is prescribed; otherwise it could happen that one updates the installation and afterwards notices that the version condition is still not satisfied.)
If installation fails, then any new directories that were created will be preserved. To remove them, the RemovePackage (2.1-2) operation can be used.
gap> InstallPackage("digraphs"); #I The following packages will be installed: #I Digraphs 1.15.0 #I orb 5.1.0 #I datastructures 0.4.3 Continue? [Y/n] y true gap> InstallPackage("profiling", rec(interactive := false, > suggested := true, > compileDeps := false)); #I The following packages will be installed: #I profiling 2.6.3 true
‣ RemovePackage( name[, prefs] ) | ( operation ) |
Returns: true or false
Attempts to remove an installed package using its name. The first argument name should be a string specifying the name of a package installed in the user GAP root, see Reference: GAP Root Directories.
This command's behaviour is affected by the user preferences that have been set for the PackageManager package. These can be set globally, or overridden for this command using the optional prefs argument, in the same way as for the InstallPackage (2.1-1) command.
Returns true if the removal was successful, and false otherwise.
gap> RemovePackage("digraphs"); Really delete directory /home/user/.gap/pkg/digraphs-0.13.0 ? [y/N] y true
‣ InstallRequiredPackages( ) | ( operation ) |
Returns: true or false
Attempts to download and install the latest versions of all packages required for GAP to run. Currently these packages are GAPDoc, PerfGrp, PrimGrp, SmallGrp, and TransGrp. Returns false if something went wrong, and true otherwise.
Clearly, since these packages are required for GAP to run, they must be loaded before this function can be executed. However, this function installs the packages in the ~/.gap/pkg directory, so that they can be managed by PackageManager in the future, and are available for other GAP installations on the machine.
This command's behaviour is affected by the user preferences that have been set for the PackageManager package. These can be set globally, or overridden for this command using the optional prefs argument, in the same way as for the InstallPackage (2.1-1) command.
‣ InfoPackageManager | ( info class ) |
Info class for the PackageManager package. Set this to the following levels for different levels of information:
0 - No messages
1 - Problems only: messages describing what went wrong, with no messages if an operation is successful
2 - Directories and versions: also displays informations about package versions and installation directories
3 - Progress: also shows step-by-step progress of operations
4 - All: includes extra information such as whether curlInterface is being used, package info validation and compilation output
Set this using, for example SetInfoLevel(InfoPackageManager, 1). Default value is 3.
‣ CompilePackage( name[, prefs] ) | ( operation ) |
Returns: true or false
Attempts to compile an installed package. Takes one argument name, which should be a string specifying the name of a package installed in the user GAP root (for example, one installed using InstallPackage (2.1-1)), see Reference: GAP Root Directories. Compilation is done automatically when a package is installed or updated, so in most cases this command is not needed. However, it may sometimes be necessary to recompile some packages if you update or move your GAP installation.
Compilation is done using the etc/BuildPackages.sh script bundled with PackageManager. If the specified package does not have a compiled component, this function should have no effect.
This command's behaviour is affected by the user preferences that have been set for the PackageManager package. These can be set globally, or overridden for this command using the optional prefs argument, in the same way as for the InstallPackage (2.1-1) command.
Returns true if compilation was successful or if no compilation was necessary. Returns false otherwise.
gap> CompilePackage("digraphs"); #I Running compilation script on /home/mtorpey/.gap/pkg/datastructures-0.4.3/ ... #I Running compilation script on /home/mtorpey/.gap/pkg/orb-5.1.0/ ... #I Running compilation script on /home/mtorpey/.gap/pkg/io-4.10.0/ ... #I Running compilation script on /home/mtorpey/.gap/pkg/digraphs-1.15.0/ ... true gap> CompilePackage("profiling", rec(compileDeps := false)); #I Running compilation script on /home/mtorpey/.gap/pkg/profiling-2.6.3/ ... true
generated by GAPDoc2HTML