From 4f85b60383e1a15ecdbbb8f691761db041c7f77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Mon, 28 Nov 2022 10:47:00 -0500 Subject: [PATCH] Add provides/conflicts for perf packages --- docs/package.md | 15 +++++++++++++++ package/linux-mainline/package | 2 ++ package/linux-stracciatella/package | 2 ++ scripts/toltec/recipe.py | 4 +++- 4 files changed, 22 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/package/linux-mainline/package b/package/linux-mainline/package index 133ad7f3f..21d44e9de 100644 --- a/package/linux-mainline/package +++ b/package/linux-mainline/package @@ -63,6 +63,8 @@ linux-mainline-perf() { pkgdesc="Linux profiling with performance counters" url=https://perf.wiki.kernel.org section=devel + provides=(perf) + conflicts=(perf) package() { install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/tools/perf/perf diff --git a/package/linux-stracciatella/package b/package/linux-stracciatella/package index 6aae8b2b6..882b5e4f0 100644 --- a/package/linux-stracciatella/package +++ b/package/linux-stracciatella/package @@ -67,6 +67,8 @@ linux-stracciatella-perf() { pkgdesc="Linux profiling with performance counters" url=https://perf.wiki.kernel.org section=devel + provides=(perf) + conflicts=(perf) package() { install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/tools/perf/perf diff --git a/scripts/toltec/recipe.py b/scripts/toltec/recipe.py index e462be5ec..f7efd4bc6 100644 --- a/scripts/toltec/recipe.py +++ b/scripts/toltec/recipe.py @@ -343,6 +343,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 @@ -390,7 +391,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()) @@ -482,6 +483,7 @@ def control_fields(self) -> str: ("Depends", self.installdepends), ("Conflicts", self.conflicts), ("Replaces", self.replaces), + ("Provides", self.provides), ): if field: control += (