Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/GAP/pkg/packagemanager/doc/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 14.4.2025 mit Größe 15 kB image not shown  

Quelle  chap2_mj.html   Sprache: HTML

 
 products/sources/formale Sprachen/GAP/pkg/packagemanager/doc/chap2_mj.html


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script type="text/javascript"
  src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<title>GAP (PackageManager) - Chapter 2: Commands</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap2"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a>  <a href="chap1_mj.html">1</a>  <a href="chap2_mj.html">2</a>  <a href="chapInd_mj.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a>   <a href="chap0_mj.html#contents">[Contents]</a>    <a href="chap1_mj.html">[Previous Chapter]</a>    <a href="chapInd_mj.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap2.html">[MathJax off]</a></p>
<p><a id="X845671BB7CE6C298" name="X845671BB7CE6C298"></a></p>
<div class="ChapSects"><a href="chap2_mj.html#X845671BB7CE6C298">2 <span class="Heading">Commands</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2_mj.html#X7EB2B71979F3326F">2.1 <span class="Heading">Main commands</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2_mj.html#X81A6FF1B81D004BA">2.1-1 InstallPackage</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2_mj.html#X7A3A079387DAA79A">2.1-2 UpdatePackage</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2_mj.html#X8011AC33841B515C">2.1-3 RemovePackage</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2_mj.html#X7B70DED5806B72A7">2.1-4 InstallRequiredPackages</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2_mj.html#X7D64BEEB79C0168E">2.2 <span class="Heading">Info warnings</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2_mj.html#X847EF83681889E47">2.2-1 InfoPackageManager</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2_mj.html#X86D9E3897AB3DE25">2.3 <span class="Heading">Manual compilation</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2_mj.html#X84CA6E417D8FC84C">2.3-1 CompilePackage</a></span>
</div></div>
</div>

<h3>2 <span class="Heading">Commands</span></h3>

<p><a id="X7EB2B71979F3326F" name="X7EB2B71979F3326F"></a></p>

<h4>2.1 <span class="Heading">Main commands</span></h4>

<p><a id="X81A6FF1B81D004BA" name="X81A6FF1B81D004BA"></a></p>

<h5>2.1-1 InstallPackage</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InstallPackage</code>( <var class="Arg">string</var>[, <var class="Arg">version</var>][, <var class="Arg">interactive</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code></p>

<p>Attempts to download and install a package. The argument <var class="Arg">string</var> should be a string containing one of the following:</p>


<ul>
<li><p>the name of a package;</p>

</li>
<li><p>the URL of a package archive, ending in <code class="code">.tar.gz</code> or <code class="code">.tar.bz2</code>;</p>

</li>
<li><p>the URL of a git repository, ending in <code class="code">.git</code>;</p>

</li>
<li><p>the URL of a valid <code class="code">PackageInfo.g</code> file.</p>

</li>
</ul>
<p>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 this installation is successful, or if this package is already installed, <code class="keyw">true</code> is returned; otherwise, <code class="keyw">false</code> is returned.</p>

<p>By default, packages will be installed in the <code class="code">pkg</code> subdirectory of <code class="code">GAPInfo.UserGapRoot</code> (see <a href="../../../doc/ref/chap9_mj.html#X7A4973627A5DB27D"><span class="RefLink">Reference: GAP Root Directories</span></a>). 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 <strong class="pkg">GAP</strong> with the <code class="code">-r</code> flag will cause all packages in this directory to be ignored.</p>

<p>Certain decisions, such as installing newer versions of packages, will be confirmed by the user via an interactive shell – to avoid this interactivity and use sane defaults instead, the optional argument <var class="Arg">interactive</var> can be set to <code class="keyw">false</code>.</p>

<p>To see more information about this process while it is ongoing, see <code class="func">InfoPackageManager</code> (<a href="chap2_mj.html#X847EF83681889E47"><span class="RefLink">2.2-1</span></a>).</p>

<p>If <var class="Arg">string</var> is the name of the package in question then one can specify a required package version via a string as value of the optional argument <var class="Arg">version</var>, which is interpreted as described in Section <a href="../../../doc/ref/chap76_mj.html#X8180BCDA82587F41"><span class="RefLink">Reference: Version Numbers</span></a>. In particular, if <var class="Arg">version</var> starts with <code class="code">=</code> 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 <code class="keyw">true</code> 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 <strong class="pkg">GAP</strong> 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.)</p>

<p>If installation fails, then any new directories that were created will be removed. To override this behaviour, the option <code class="keyw">keepDirectory</code> can be set to <code class="keyw">true</code> using, for example, <code class="code">InstallPackage("example" : keepDirectory)</code>, in which case such directories will be preserved for debugging.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">InstallPackage("digraphs");</span>
true
</pre></div>

<p><a id="X7A3A079387DAA79A" name="X7A3A079387DAA79A"></a></p>

<h5>2.1-2 UpdatePackage</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ UpdatePackage</code>( <var class="Arg">name</var>[, <var class="Arg">interactive</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code></p>

<p>Attempts to update an installed package to the latest version. The first argument <var class="Arg">name</var> should be a string specifying the name of a package installed in the user <strong class="pkg">GAP</strong> root (for example, one installed using <code class="func">InstallPackage</code> (<a href="chap2_mj.html#X81A6FF1B81D004BA"><span class="RefLink">2.1-1</span></a>)), see <a href="../../../doc/ref/chap9_mj.html#X7A4973627A5DB27D"><span class="RefLink">Reference: GAP Root Directories</span></a>. The second argument <var class="Arg">interactive</var> is optional, and should be a boolean specifying whether to confirm interactively before any directories are deleted (default value <code class="keyw">true</code>).</p>

<p>If the package was installed via archive, the new version will be installed in a new directory, and the old version will be deleted. If installed via git, it will be updated using <code class="code">git pull</code>, so long as there are no outstanding changes. If no newer version is available, no changes will be made.</p>

<p>This process will also attempt to fix the package if it is broken, for example if it needs to be recompiled or if one of its dependencies is missing or broken.</p>

<p>Returns <code class="keyw">true</code> if a newer version was installed successfully, or if no newer version is available. Returns <code class="keyw">false</code> otherwise.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">UpdatePackage("io");</span>
#I  io version 4.6.0 will be installed, replacing 4.5.4
#I  Saved archive to /tmp/tm7r5Ug7/io-4.6.0.tar.gz
Remove old version of io at /home/user/.gap/pkg/io-4.5.4 ? [y/N] y
true
</pre></div>

<p><a id="X8011AC33841B515C" name="X8011AC33841B515C"></a></p>

<h5>2.1-3 RemovePackage</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RemovePackage</code>( <var class="Arg">name</var>[, <var class="Arg">interactive</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code></p>

<p>Attempts to remove an installed package using its name. The first argument <var class="Arg">name</var> should be a string specifying the name of a package installed in the user <strong class="pkg">GAP</strong> root, see <a href="../../../doc/ref/chap9_mj.html#X7A4973627A5DB27D"><span class="RefLink">Reference: GAP Root Directories</span></a>. The second argument <var class="Arg">interactive</var> is optional, and should be a boolean specifying whether to confirm certain decisions interactively (default value <code class="keyw">true</code>).</p>

<p>Returns <code class="keyw">true</code> if the removal was successful, and <code class="keyw">false</code> otherwise.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">RemovePackage("digraphs");</span>
Really delete directory /home/user/.gap/pkg/digraphs-0.13.0 ? [y/N] y
true
</pre></div>

<p><a id="X7B70DED5806B72A7" name="X7B70DED5806B72A7"></a></p>

<h5>2.1-4 InstallRequiredPackages</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InstallRequiredPackages</code>(  )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code></p>

<p>Attempts to download and install the latest versions of all packages required for <strong class="pkg">GAP</strong> to run. Currently these packages are <strong class="pkg">GAPDoc</strong>, <strong class="pkg">primgrp</strong>, <strong class="pkg">SmallGrp</strong>, and <strong class="pkg">transgrp</strong>. Returns <code class="keyw">false</code> if something went wrong, and <code class="keyw">true</code> otherwise.</p>

<p>Clearly, since these packages are required for <strong class="pkg">GAP</strong> to run, they must be loaded before this function can be executed. However, this function installs the packages in the <code class="code">~/.gap/pkg</code> directory, so that they can be managed by <strong class="pkg">PackageManager</strong> in the future, and are available for other <strong class="pkg">GAP</strong> installations on the machine.</p>

<p><a id="X7D64BEEB79C0168E" name="X7D64BEEB79C0168E"></a></p>

<h4>2.2 <span class="Heading">Info warnings</span></h4>

<p><a id="X847EF83681889E47" name="X847EF83681889E47"></a></p>

<h5>2.2-1 InfoPackageManager</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ InfoPackageManager</code></td><td class="tdright">( info class )</td></tr></table></div>
<p>Info class for the <strong class="pkg">PackageManager</strong> package. Set this to the following levels for different levels of information:</p>


<ul>
<li><p>0 - No messages</p>

</li>
<li><p>1 - Problems only: messages describing what went wrong, with no messages if an operation is successful</p>

</li>
<li><p>2 - Directories and versions: also displays informations about package versions and installation directories</p>

</li>
<li><p>3 - Progress: also shows step-by-step progress of operations</p>

</li>
<li><p>4 - All: includes extra information such as whether curlInterface is being used, and package info validation</p>

</li>
</ul>
<p>Set this using, for example <code class="code">SetInfoLevel(InfoPackageManager, 1)</code>. Default value is 3.</p>

<p><a id="X86D9E3897AB3DE25" name="X86D9E3897AB3DE25"></a></p>

<h4>2.3 <span class="Heading">Manual compilation</span></h4>

<p><a id="X84CA6E417D8FC84C" name="X84CA6E417D8FC84C"></a></p>

<h5>2.3-1 CompilePackage</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CompilePackage</code>( <var class="Arg">name</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code></p>

<p>Attempts to compile an installed package. Takes one argument <var class="Arg">name</var>, which should be a string specifying the name of a package installed in the user <strong class="pkg">GAP</strong> root (for example, one installed using <code class="func">InstallPackage</code> (<a href="chap2_mj.html#X81A6FF1B81D004BA"><span class="RefLink">2.1-1</span></a>)), see <a href="../../../doc/ref/chap9_mj.html#X7A4973627A5DB27D"><span class="RefLink">Reference: GAP Root Directories</span></a>. 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 <strong class="pkg">GAP</strong> installation.</p>

<p>Compilation is done using the <code class="code">etc/BuildPackages.sh</codescript bundled with <strong class="pkg">PackageManager</strong>. If the specified package does not have a compiled component, this function should have no effect.</p>

<p>Returns <code class="keyw">true</code> if compilation was successful or if no compilation was necessary. Returns <code class="keyw">false</code> otherwise.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">CompilePackage("orb");</span>
#I  Running compilation script on /home/user/.gap/pkg/orb-4.8.3 ...
true
</pre></div>


<div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a>   <a href="chap0_mj.html#contents">[Contents]</a>    <a href="chap1_mj.html">[Previous Chapter]</a>    <a href="chapInd_mj.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a>  <a href="chap1_mj.html">1</a>  <a href="chap2_mj.html">2</a>  <a href="chapInd_mj.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

100%


¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.