diff mbox series

[oe-layersetup,1/2] kas: fetch bitbake as part of the setup

Message ID 20250814232955.1559040-2-rs@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series kas: pull bitbake repository during setup | expand

Commit Message

Randolph Sapp Aug. 14, 2025, 11:29 p.m. UTC
From: Randolph Sapp <rs@ti.com>

We can get kas to fetch it's own version of bitbake with a little
coercion. Adjust the template to populate the appropriate repo section
for bitbake.

This behaves like any other repo definition, with the key difference
being it has no enabled layers. This means you must explicitly set the
root layer "." to disabled.

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

Patch

diff --git a/src/xslt/kas.xslt b/src/xslt/kas.xslt
index 7e1dea4..17c9f1d 100644
--- a/src/xslt/kas.xslt
+++ b/src/xslt/kas.xslt
@@ -13,12 +13,32 @@ 
 </xsl:text>
 <xsl:text>
 </xsl:text>
-<xsl:apply-templates select='config/repos'/>
+<xsl:if test='config/bitbake|config/repos'>
+<xsl:call-template name='repos'/>
+</xsl:if>
 <xsl:apply-templates select='config/local-conf'/>
 </xsl:template>
 
-<xsl:template match='config/repos'>repos:
-<xsl:apply-templates select='repo[not(@disabled) or @disabled="no"]'/>
+<xsl:template name='repos'>repos:
+<xsl:apply-templates select='config/bitbake'/>
+<xsl:apply-templates select='config/repos/repo[not(@disabled) or @disabled="no"]'/>
+</xsl:template>
+
+<xsl:template match='config/bitbake'>  bitbake:
+<xsl:text>    url: "</xsl:text><xsl:value-of select='@url'/><xsl:text>"
+</xsl:text>
+<xsl:text>    branch: "</xsl:text><xsl:value-of select='@branch'/><xsl:text>"
+</xsl:text>
+<xsl:if test='@commit != "HEAD"'>
+<xsl:text>    commit: "</xsl:text><xsl:value-of select='@commit'/><xsl:text>"
+</xsl:text>
+</xsl:if>
+<xsl:text>    layers:
+</xsl:text>
+<xsl:text>      .: disabled
+</xsl:text>
+<xsl:text>
+</xsl:text>
 </xsl:template>
 
 <xsl:template match='config/repos/repo'>