From ce079d1421609595dc086855bc6fa49fa25848b9 Mon Sep 17 00:00:00 2001 From: Salvatore Stella Date: Wed, 22 Nov 2023 00:44:47 +0100 Subject: [PATCH] Pull in provides from #600 --- docs/package.md | 15 +++++++++++++++ scripts/toltec/recipe.py | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/package.md b/docs/package.md index fcd9690a4..b49a1d134 100644 --- a/docs/package.md +++ b/docs/package.md @@ -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 + + + + + + + + + +
Required?No, defaults to () +
TypeArray of strings
+ +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. diff --git a/scripts/toltec/recipe.py b/scripts/toltec/recipe.py index fc1cf9ae0..de3844490 100644 --- a/scripts/toltec/recipe.py +++ b/scripts/toltec/recipe.py @@ -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 @@ -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()) @@ -483,6 +484,7 @@ def control_fields(self) -> str: ("Depends", self.installdepends), ("Conflicts", self.conflicts), ("Replaces", self.replaces), + ("Provides", self.provides), ): if field: control += (