summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbongwa Amahnui Bonalais <abongwabonalais@gmail.com>2022-04-05 11:47:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-05 22:22:41 +0100
commitb07a70fbf78f2beba639580e37dffbc0a73bc99f (patch)
treeabe7a25cf5b139598d225b094e1ed672cdf03a30
parent7d6f4b1373e4dfafc63702ef2426cd45100f18a3 (diff)
downloadopenembedded-core-contrib-b07a70fbf78f2beba639580e37dffbc0a73bc99f.tar.gz
oe-init-build-env: add quotes around variables to prevent word splitting
Used shellcheck to add quotes to the variables. This is to make sure that directories with names that have space between, such as "Desktop/projects/test repo/poky" will not be considered as 2 separate words. With this modification, running the command "source oe-init-build-env" will not give the error "bash: oe-init-build-env: No such file or directory" Signed-off-by: Abongwa Bonalais Amahnui <abongwabonalais@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xoe-init-build-env4
-rwxr-xr-xscripts/oe-setup-builddir8
2 files changed, 6 insertions, 6 deletions
diff --git a/oe-init-build-env b/oe-init-build-env
index 8c1bd54e57..38333ab858 100755
--- a/oe-init-build-env
+++ b/oe-init-build-env
@@ -42,8 +42,8 @@ fi
unset THIS_SCRIPT
export OEROOT
-. $OEROOT/scripts/oe-buildenv-internal &&
- TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir || {
+. "$OEROOT"/scripts/oe-buildenv-internal &&
+ TEMPLATECONF="$TEMPLATECONF" "$OEROOT"/scripts/oe-setup-builddir || {
unset OEROOT
return 1
}
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index d4ac074ad9..54048e62ec 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -42,7 +42,7 @@ if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
TEMPLATECONF=$(cat "$BUILDDIR/conf/templateconf.cfg")
fi
-. $OEROOT/.templateconf
+. "$OEROOT"/.templateconf
if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
@@ -79,7 +79,7 @@ example, select a different MACHINE (target hardware). See conf/local.conf
for more information as common configuration options are commented.
EOM
- cp -f $OECORELOCALCONF "$BUILDDIR/conf/local.conf"
+ cp -f "$OECORELOCALCONF" "$BUILDDIR/conf/local.conf"
SHOWYPDOC=yes
fi
@@ -100,7 +100,7 @@ EOM
# to replace it for compatibility.
sed -e "s|##OEROOT##|$OEROOT|g" \
-e "s|##COREBASE##|$OEROOT|g" \
- $OECORELAYERCONF > "$BUILDDIR/conf/bblayers.conf"
+ "$OECORELAYERCONF" > "$BUILDDIR/conf/bblayers.conf"
SHOWYPDOC=yes
fi
@@ -125,5 +125,5 @@ fi
if [ -z "$OECORENOTESCONF" ]; then
OECORENOTESCONF="$OEROOT/meta/conf/conf-notes.txt"
fi
-[ ! -r "$OECORENOTESCONF" ] || cat $OECORENOTESCONF
+[ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF"
unset OECORENOTESCONF