diff mbox series

[oe-layersetup,4/5] kas: do not add a default target if one is not given

Message ID 20250816003620.2112669-5-rs@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series kas: yamllint cleanup effort | expand

Commit Message

Randolph Sapp Aug. 16, 2025, 12:36 a.m. UTC
From: Randolph Sapp <rs@ti.com>

There are configs, such as the distroless configs, that may not specify
a default target. In those cases we should not have a "target" key in
our kas config. An unspecified target is fine, but an empty target is a
violation of their schema.

Detected through the use of yamllint's trailing whitespace check.

Signed-off-by: Randolph Sapp <rs@ti.com>
---
 src/xslt/kas.xslt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/xslt/kas.xslt b/src/xslt/kas.xslt
index cb0b9a4..4a9fe62 100644
--- a/src/xslt/kas.xslt
+++ b/src/xslt/kas.xslt
@@ -8,10 +8,7 @@  header:
 </xsl:text>
 <xsl:apply-templates select='config/bblayers-conf-template'/>
 <xsl:apply-templates select='config/local-conf-template'/>
-<xsl:text>
-</xsl:text>
-<xsl:text>target: </xsl:text><xsl:value-of select='config/targets/default/text()'/><xsl:text>
-</xsl:text>
+<xsl:apply-templates select='config/targets/default'/>
 <xsl:if test='config/bitbake|config/repos'>
 <xsl:text>
 </xsl:text>
@@ -20,6 +17,12 @@  header:
 <xsl:apply-templates select='config/local-conf'/>
 </xsl:template>
 
+<xsl:template match='config/targets/default'>
+<xsl:text>
+target: </xsl:text><xsl:value-of select='text()'/><xsl:text>
+</xsl:text>
+</xsl:template>
+
 <xsl:template name='repos'>repos:
 <xsl:apply-templates select='config/bitbake'/>
 <xsl:apply-templates select='config/repos/repo[not(@disabled) or @disabled="no"]'/>