summaryrefslogtreecommitdiff
path: root/poky/scripts/oe-setup-builddir
diff options
context:
space:
mode:
Diffstat (limited to 'poky/scripts/oe-setup-builddir')
-rwxr-xr-xpoky/scripts/oe-setup-builddir21
1 files changed, 16 insertions, 5 deletions
diff --git a/poky/scripts/oe-setup-builddir b/poky/scripts/oe-setup-builddir
index 5d644168cb..d3c7f943e7 100755
--- a/poky/scripts/oe-setup-builddir
+++ b/poky/scripts/oe-setup-builddir
@@ -38,16 +38,18 @@ chmod -st "$BUILDDIR/conf" 2>/dev/null || echo "WARNING: unable to chmod $BUILDD
cd "$BUILDDIR"
-if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
+if [ -f "$BUILDDIR/conf/templateconf.cfg" -a -z "$TEMPLATECONF" ]; then
TEMPLATECONF=$(cat "$BUILDDIR/conf/templateconf.cfg")
+ # The following two are no longer valid; unsetting them will automatically get them replaced
+ # with correct ones.
+ if [ $TEMPLATECONF = "meta/conf" -o $TEMPLATECONF = "meta-poky/conf" ]; then
+ unset TEMPLATECONF
+ rm $BUILDDIR/conf/templateconf.cfg
+ fi
fi
. "$OEROOT"/.templateconf
-if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
- echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
-fi
-
#
# $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf
#
@@ -61,6 +63,11 @@ if [ -n "$TEMPLATECONF" ]; then
echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
exit 1
fi
+ templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" $TEMPLATECONF)
+ if [ ! -f "$TEMPLATECONF/../../layer.conf" -o $templatesdir != "templates" ]; then
+ echo >&2 "Error: TEMPLATECONF value (which is $TEMPLATECONF) must point to meta-some-layer/conf/templates/template-name"
+ exit 1
+ fi
fi
OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"
@@ -129,3 +136,7 @@ if [ -z "$OECORENOTESCONF" ]; then
fi
[ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF"
unset OECORENOTESCONF
+
+if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
+ echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
+fi