Skip to content

Commit 0eae3e8

Browse files
committed
Add "special" bare libc feature as element for the graph parser
Signed-off-by: Tobias Wolf <[email protected]>
1 parent f5b1131 commit 0eae3e8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/gardenlinux/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# GardenLinux "bare" feature
44
BARE_FLAVOR_FEATURE_CONTENT = { "description": "Bare flavor", "type": "platform" }
5+
BARE_FLAVOR_LIBC_FEATURE_CONTENT = { "description": "Bare libc feature", "type": "element" }
56

67
# GardenLinux flavors schema for validation
78
GL_FLAVORS_SCHEMA = {

src/gardenlinux/features/parser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import subprocess
1010
import yaml
1111

12-
from ..constants import BARE_FLAVOR_FEATURE_CONTENT
12+
from ..constants import BARE_FLAVOR_FEATURE_CONTENT, BARE_FLAVOR_LIBC_FEATURE_CONTENT
1313
from ..logger import LoggerSetup
1414

1515

@@ -75,7 +75,11 @@ def filter(
7575
for feature in input_features:
7676
# @TODO: Remove "special" handling once "bare" is a first-class citizen of the feature graph
7777
if feature == "bare":
78-
self.graph.add_node("bare", content=BARE_FLAVOR_FEATURE_CONTENT)
78+
if not self.graph.has_node("bare"):
79+
self.graph.add_node("bare", content=BARE_FLAVOR_FEATURE_CONTENT)
80+
if not self.graph.has_node("libc"):
81+
self.graph.add_node("libc", content=BARE_FLAVOR_LIBC_FEATURE_CONTENT)
82+
7983
continue
8084

8185
filter_set.update(networkx.descendants(Parser._get_graph_view_for_attr(self.graph, "include"), feature))

0 commit comments

Comments
 (0)