Skip to content

Commit

Permalink
Pull in provides from toltec-dev#600
Browse files Browse the repository at this point in the history
  • Loading branch information
Etn40ff committed Nov 21, 2023
1 parent ddf6500 commit ce079d1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions docs/package.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,21 @@ A list of packages that the current package replaces.
Setting this field allows the current package to overwrite and take ownership of files from other packages.
Note that the replaced packages will not be automatically uninstalled unless you also declare a conflict with them using the [`conflicts` field](#conflicts-field).

#### `provides` field

<table>
<tr>
<th>Required?</th>
<td>No, defaults to <code>()</code></th>
</tr>
<tr>
<th>Type</th>
<td>Array of strings</td>
</tr>
</table>

A list of virtual packages that the current package provides.

#### `package()` function

The `package()` function populates the `$pkgdir` directory with the files and directories that need to be installed using artifacts from the `$srcdir` directory.
Expand Down
4 changes: 3 additions & 1 deletion scripts/toltec/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ class Package: # pylint:disable=too-many-instance-attributes
installdepends: Set[Dependency]
conflicts: Set[Dependency]
replaces: Set[Dependency]
provides: Set[Dependency]

functions: bash.Functions
custom_functions: bash.Functions
Expand Down Expand Up @@ -391,7 +392,7 @@ def _load_fields(self, variables: bash.Variables) -> None:
self.license = _pop_field_string(variables, "license")
self.variables["license"] = self.license

for field in ("installdepends", "conflicts", "replaces"):
for field in ("installdepends", "conflicts", "replaces", "provides"):
field_raw = _pop_field_indexed(variables, field, [])
self.variables[field] = field_raw
setattr(self, field, set())
Expand Down Expand Up @@ -483,6 +484,7 @@ def control_fields(self) -> str:
("Depends", self.installdepends),
("Conflicts", self.conflicts),
("Replaces", self.replaces),
("Provides", self.provides),
):
if field:
control += (
Expand Down

0 comments on commit ce079d1

Please sign in to comment.