Skip to content

Commit ce079d1

Browse files
committed
Pull in provides from toltec-dev#600
1 parent ddf6500 commit ce079d1

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

docs/package.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,21 @@ A list of packages that the current package replaces.
404404
Setting this field allows the current package to overwrite and take ownership of files from other packages.
405405
Note that the replaced packages will not be automatically uninstalled unless you also declare a conflict with them using the [`conflicts` field](#conflicts-field).
406406

407+
#### `provides` field
408+
409+
<table>
410+
<tr>
411+
<th>Required?</th>
412+
<td>No, defaults to <code>()</code></th>
413+
</tr>
414+
<tr>
415+
<th>Type</th>
416+
<td>Array of strings</td>
417+
</tr>
418+
</table>
419+
420+
A list of virtual packages that the current package provides.
421+
407422
#### `package()` function
408423

409424
The `package()` function populates the `$pkgdir` directory with the files and directories that need to be installed using artifacts from the `$srcdir` directory.

scripts/toltec/recipe.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ class Package: # pylint:disable=too-many-instance-attributes
344344
installdepends: Set[Dependency]
345345
conflicts: Set[Dependency]
346346
replaces: Set[Dependency]
347+
provides: Set[Dependency]
347348

348349
functions: bash.Functions
349350
custom_functions: bash.Functions
@@ -391,7 +392,7 @@ def _load_fields(self, variables: bash.Variables) -> None:
391392
self.license = _pop_field_string(variables, "license")
392393
self.variables["license"] = self.license
393394

394-
for field in ("installdepends", "conflicts", "replaces"):
395+
for field in ("installdepends", "conflicts", "replaces", "provides"):
395396
field_raw = _pop_field_indexed(variables, field, [])
396397
self.variables[field] = field_raw
397398
setattr(self, field, set())
@@ -483,6 +484,7 @@ def control_fields(self) -> str:
483484
("Depends", self.installdepends),
484485
("Conflicts", self.conflicts),
485486
("Replaces", self.replaces),
487+
("Provides", self.provides),
486488
):
487489
if field:
488490
control += (

0 commit comments

Comments
 (0)