public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH 1/2] oe-setup-builddir: Keep templateconf.cfg relative if $TEMPLATECONF is
@ 2022-09-06 16:43 Peter Kjellerstedt
  2022-09-06 16:43 ` [PATCH 2/2] oe-setup-builddir: Always update templateconf.cfg Peter Kjellerstedt
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Kjellerstedt @ 2022-09-06 16:43 UTC (permalink / raw)
  To: openembedded-core

Before commit 7b96dc80 (scripts/oe-setup-builddir: write to
conf/templateconf.cfg after the build is set up), the path written to
templateconf.cfg was relative if $TEMPLATECONF was relative, but
afterwards it became absolute.

Restore the original behavior of saving the relative path to
templateconf.cfg.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---

These two patches are intended to be applied on top of the three I
sent earlier today.

And in case anyone wonders, yes, I occasionally move entire build
trees (typically from my SSD to my HDD) so I would prefer the path in
templateconf.cfg to remain relative.

 scripts/oe-setup-builddir | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index b06880c9cb..201cea30bf 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -46,7 +46,10 @@ fi
 
 . "$OEROOT/.templateconf"
 
-# 
+# Keep the original TEMPLATECONF before possibly prefixing it with $OEROOT below.
+ORG_TEMPLATECONF=$TEMPLATECONF
+
+#
 # $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf
 #
 if [ -n "$TEMPLATECONF" ]; then
@@ -131,5 +134,5 @@ fi
 unset OECORENOTESCONF
 
 if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
-    echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
+    echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
 fi


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] oe-setup-builddir: Always update templateconf.cfg
  2022-09-06 16:43 [PATCH 1/2] oe-setup-builddir: Keep templateconf.cfg relative if $TEMPLATECONF is Peter Kjellerstedt
@ 2022-09-06 16:43 ` Peter Kjellerstedt
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Kjellerstedt @ 2022-09-06 16:43 UTC (permalink / raw)
  To: openembedded-core

The intent of the templateconf.cfg file is to cache the value of
$TEMPLATECONF. To do this, it needs to be updated in case TEMPLATECONF
is manually specified.

Before, the following commands:

  TEMPLATECONF=foo . oe-init-build-env
  TEMPLATECONF=bar . oe-init-build-env
  . oe-init-build-env

would cause the templates in foo to be used for the last source of
oe-init-build-env, while afterwards, bar is used as expected.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---

Of course, re-sourcing oe-init-build-env with different values for
TEMPLATECONF only has a real effect if any of the generated files have
been removed, but that is a different story.

 scripts/oe-setup-builddir | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index 201cea30bf..72113c37b8 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -133,6 +133,4 @@ fi
 [ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF"
 unset OECORENOTESCONF
 
-if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
-    echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
-fi
+echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-06 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-06 16:43 [PATCH 1/2] oe-setup-builddir: Keep templateconf.cfg relative if $TEMPLATECONF is Peter Kjellerstedt
2022-09-06 16:43 ` [PATCH 2/2] oe-setup-builddir: Always update templateconf.cfg Peter Kjellerstedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox