| 23 | == Functionalities == |
| 24 | |
| 25 | !TolPackage has different versions linked to the package design evolution and requirements (see [wiki:TolPackage#History History]). |
| 26 | |
| 27 | The main functionalities described below are available from !TolPackage version 2 onwards. |
| 28 | |
| 29 | === Package installation === |
| 30 | |
| 31 | A package is automatically installed the first time it is required ({{{#Require}}}). |
| 32 | |
| 33 | {{{ |
| 34 | #!cpp |
| 35 | #Require <package>; |
| 36 | }}} |
| 37 | |
| 38 | However, an installation can be carried out manually via the {{{InstallPackage}}} function, indicating the |
| 39 | identifier (name and version) of the package desired for installation: |
| 40 | |
| 41 | {{{ |
| 42 | #!cpp |
| 43 | Real TolPackage:InstallPackage(<packageIdentifier>); |
| 44 | }}} |
| 45 | |
| 46 | If you don't know the most recent version we can use the {{{InstallLastCompatible}}} function |
| 47 | and simply indicate the package name: |
| 48 | |
| 49 | {{{ |
| 50 | #!cpp |
| 51 | Real TolPackage:InstallLastCompatible(<packageName>); |
| 52 | }}} |
| 53 | |
| 54 | === Update and upgrade === |
| 55 | |
| 56 | Periodically, new versions of a package are created. So, you need update and upgrade your packages to stay up to date. |
| 57 | |
| 58 | !TolPackage identifies two replacement mechanisms: |
| 59 | |
| 60 | * A package update, consisting of the substitution of the package for another more recent one, which has the same version numbers. |
| 61 | |
| 62 | * A package upgrade, consisting of the installation of a new version of the package. |
| 63 | Note that the previous version is not uninstalled. |
| 64 | |
| 65 | A package update usually includes important corrections, since the reconstruction of a |
| 66 | package with the same version discards the previous one. |
| 67 | |
| 68 | To update a package we can use the {{{Update}}} function, indicating the package name: |
| 69 | {{{ |
| 70 | #!cpp |
| 71 | Real TolPackage::Update(<packageName>); |
| 72 | }}} |
| 73 | |
| 74 | We can also update all the packages we have installed using the {{{UpdateAll}}} function: |
| 75 | {{{ |
| 76 | #!cpp |
| 77 | Real TolPackage::UpdateAll(?); |
| 78 | }}} |
| 79 | |
| 80 | A package upgrade is equally recommendable, as in many cases they include important advances |
| 81 | in the implemented procedures and algorithms. |
| 82 | |
| 83 | To improve a unique package we can use the Upgrade function: |
| 84 | {{{ |
| 85 | #!cpp |
| 86 | Real TolPackage::Upgrade(<packageName>); |
| 87 | }}} |
| 88 | |
| 89 | And in a similar way, the {{{UpgradeAll}}} function, to improve all of the installed packages: |
| 90 | {{{ |
| 91 | #!cpp |
| 92 | Real TolPackage::UpgradeAll(?); |
| 93 | }}} |
| 94 | |
| 95 | === Low version upgrade === |
| 96 | |
| 97 | In case of you wish to upgrade the low-version (second version number) of a package maintaining the high-version as it is, you have {{{the LowUpgrade}}} function. It is called using the package name and the first version number (high-version number): |
| 98 | {{{ |
| 99 | #!cpp |
| 100 | Real TolPackage::LowUpgrade(<packageName.highVersion>); |
| 101 | }}} |
| 102 | |
| 103 | Bear in mind that if you do not indicate a high-version when use {{{LowUpgrade}}}, an attempt would be made to upgrade |
| 104 | the low-version of all of the installed high-versions. |
| 105 | |
| 106 | If you wish to obtain all of the upgrades for a package, you have the function {{{FullUpgrade}}} which joins calls to {{{Upgrade}}} and {{{LowUpgrade}}}: |
| 107 | {{{ |
| 108 | #!cpp |
| 109 | Real TolPackage::FullUpgrade(<packageName>); |
| 110 | }}} |
| 111 | |
| 112 | You also have functions for low- or full-upgrade all installed packages: {{{LowUpgradeAll}}} and {{{FullUpgradeAll}}}. |