Skip to content

Commit 4f85b60

Browse files
committed
Add provides/conflicts for perf packages
1 parent c1d12e7 commit 4f85b60

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-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.

package/linux-mainline/package

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ linux-mainline-perf() {
6363
pkgdesc="Linux profiling with performance counters"
6464
url=https://perf.wiki.kernel.org
6565
section=devel
66+
provides=(perf)
67+
conflicts=(perf)
6668

6769
package() {
6870
install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/tools/perf/perf

package/linux-stracciatella/package

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ linux-stracciatella-perf() {
6767
pkgdesc="Linux profiling with performance counters"
6868
url=https://perf.wiki.kernel.org
6969
section=devel
70+
provides=(perf)
71+
conflicts=(perf)
7072

7173
package() {
7274
install -D -m 755 -t "$pkgdir"/opt/bin "$srcdir"/tools/perf/perf

scripts/toltec/recipe.py

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

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

393-
for field in ("installdepends", "conflicts", "replaces"):
394+
for field in ("installdepends", "conflicts", "replaces", "provides"):
394395
field_raw = _pop_field_indexed(variables, field, [])
395396
self.variables[field] = field_raw
396397
setattr(self, field, set())
@@ -482,6 +483,7 @@ def control_fields(self) -> str:
482483
("Depends", self.installdepends),
483484
("Conflicts", self.conflicts),
484485
("Replaces", self.replaces),
486+
("Provides", self.provides),
485487
):
486488
if field:
487489
control += (

0 commit comments

Comments
 (0)