You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user/reference/config/overlays.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ These overlays modify `.spec` files using the structured spec parser, allowing p
22
22
|`spec-prepend-lines`| Prepends lines to the start of a section; **fails if section doesn't exist**|`lines`|
23
23
|`spec-append-lines`| Appends lines to the end of a section; **fails if section doesn't exist**|`lines`|
24
24
|`spec-search-replace`| Regex-based search and replace on spec content |`regex`|
25
+
|`spec-remove-section`| Removes an entire section from the spec; **fails if section doesn't exist**|`section`|
25
26
|`patch-add`| Adds a patch file and registers it in the spec (PatchN tag or %patchlist) |`source`|
26
27
|`patch-remove`| Removes patch files and their spec references matching a glob pattern |`file`|
27
28
@@ -53,7 +54,7 @@ successfully makes a replacement to at least one matching file.
53
54
| Description |`description`| Human-readable explanation documenting the need for the change; helps identify overlays in error messages | All (optional) |
54
55
| Tag |`tag`| The spec tag name (e.g., `BuildRequires`, `Requires`, `Version`) |`spec-add-tag`, `spec-insert-tag`, `spec-set-tag`, `spec-update-tag`, `spec-remove-tag`|
55
56
| Value |`value`| The tag value to set, or value to match for removal |`spec-add-tag`, `spec-insert-tag`, `spec-set-tag`, `spec-update-tag`, `spec-remove-tag` (optional for matching) |
56
-
| Section |`section`| The spec section to target (e.g., `%build`, `%install`, `%files`, `%description`) |`spec-prepend-lines`, `spec-append-lines`, `spec-search-replace` (optional) |
57
+
| Section |`section`| The spec section to target (e.g., `%build`, `%install`, `%files`, `%description`) |`spec-prepend-lines`, `spec-append-lines`, `spec-search-replace` (optional), `spec-remove-section`|
57
58
| Package |`package`| The sub-package name for multi-package specs; omit to target the main package | All spec overlays (optional) |
58
59
| Regex |`regex`| Regular expression pattern to match |`spec-search-replace`, `file-search-replace`|
59
60
| Replacement |`replacement`| Literal replacement text; capture group references like `$1` are **not** expanded. Omit or leave empty to delete matched text. |`spec-search-replace`, `file-search-replace`, `file-rename`|
@@ -272,6 +273,29 @@ description = "Remove CVE patches that are now upstream"
272
273
> `PatchN` tags. Macro-based tag numbering (e.g., `Patch%{n}`) is not expanded and may
273
274
> conflict with auto-assigned numbers.
274
275
276
+
### Removing a Section
277
+
278
+
The `spec-remove-section` overlay removes an entire section from the spec, including its
279
+
header and all body lines. The section is identified by `section` name and optionally
Copy file name to clipboardExpand all lines: internal/projectconfig/overlay.go
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ import (
15
15
// ComponentOverlay represents an overlay that may be applied to a component's spec and/or its sources.
16
16
typeComponentOverlaystruct {
17
17
// The type of overlay to apply.
18
-
TypeComponentOverlayType`toml:"type" json:"type" validate:"required" jsonschema:"enum=spec-add-tag,enum=spec-insert-tag,enum=spec-set-tag,enum=spec-update-tag,enum=spec-remove-tag,enum=spec-prepend-lines,enum=spec-append-lines,enum=spec-search-replace,enum=patch-add,enum=patch-remove,enum=file-prepend-lines,enum=file-search-replace,enum=file-add,enum=file-remove,enum=file-rename,title=Overlay type,description=The type of overlay to apply"`
18
+
TypeComponentOverlayType`toml:"type" json:"type" validate:"required" jsonschema:"enum=spec-add-tag,enum=spec-insert-tag,enum=spec-set-tag,enum=spec-update-tag,enum=spec-remove-tag,enum=spec-prepend-lines,enum=spec-append-lines,enum=spec-search-replace,enum=spec-remove-section,enum=patch-add,enum=patch-remove,enum=file-prepend-lines,enum=file-search-replace,enum=file-add,enum=file-remove,enum=file-rename,title=Overlay type,description=The type of overlay to apply"`
19
19
// Human readable description of overlay; primarily present to document the need for the change.
20
20
Descriptionstring`toml:"description,omitempty" json:"description,omitempty" jsonschema:"title=Description,description=Human readable description of overlay"`
0 commit comments