Context constructor.
Context
pkgxx’ main class.
The Context is a shared environment in which packages are built with a specific configuration and for a given package manager.
Its most-used method is probably newRecipe.
Loads the system-wide pkg++ configuration, usually stored in /etc/pkg++.conf
.
Argument | Type | Description |
---|---|---|
filename | string | Path to a configuration file to load instead of the default one. |
Type | Description | |
---|---|---|
nil |
Loads the default pkg++ modules, installed in the system directories.
Those directories are usually /usr/share/pkgxx
and its /usr/local
variant.
Type | Description | |
---|---|---|
nil |
Creates a module and loads it into the Context.
This methods allows the dynamic creation of modules in pkg++.
Argument | Type | Description |
---|---|---|
content | table | Module content. |
Type | Description | |
---|---|---|
nil |
Module |
Prints warnings on stderr if important configuration elements are missing.
Type | Description | |
---|---|---|
nil |
Creates a new empty Recipe object.
The only difference with the default Recipe constructor is that the current Context is provided.
Type | Description | |
---|---|---|
Recipe |
Creates a Recipe object from a package.toml file.
Argument | Type | Description |
---|---|---|
filename | string | Filename of the package.toml to read and parse into a Recipe. |
Recipe |
Updates the context’s packages repository.
It can be used to register several new packages at once.
Argument | Type | Description |
---|---|---|
opt | table | Options to provide to the repository manager’s module. |
Type | Description | |
---|---|---|
boolean | Value returned by the repository manager’s module. | |
nil | No module could be used to update the repository. |
Adds a package to the context’s repository.
Argument | Type | Description |
---|---|---|
target | string | Filename of the package to add to the repository. |
opt | table | Options to provide to the repository manager’s module. |
Type | Description | |
---|---|---|
boolean | Value returned by the repository manager’s module. | |
nil | No module could be used to update the repository. |
Closes the context.
Array of prefix names. Used for macro substitutions and for some auto-configuration within modules.
[1]: | "prefix" |
[2]: | "bindir" |
[3]: | "sharedir" |
[4]: | "infodir" |
[5]: | "mandir" |
[6]: | "docdir" |
[7]: | "libdir" |
[8]: | "libexecdir" |
[9]: | "includedir" |
[10]: | "confdir" |
[11]: | "statedir" |
[12]: | "opt" |
Gets the current path for a specific prefix.
Argument | Type | Description |
---|---|---|
name | string | One of the values in @prefixes. |