diff mbox series

[oe-layersetup,PATCHv2,14/16] oe-layertool-setup: add a path sanity check for oebase

Message ID 20230614034507.598391-15-res.sapp@gmail.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series Sacrifice your first born to the linter | expand

Commit Message

Res Sapp June 14, 2023, 3:45 a.m. UTC
OEBase can not have a space in it's name due to parsing limitations of
POSIX shell. Make sure to check this before doing anything.

Signed-off-by: Randolph Sapp <res.sapp@gmail.com>
---
 oe-layertool-setup.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/oe-layertool-setup.sh b/oe-layertool-setup.sh
index 0928959..8694abd 100755
--- a/oe-layertool-setup.sh
+++ b/oe-layertool-setup.sh
@@ -966,6 +966,14 @@  do
     esac
 done
 
+# add early sanity check
+if printf '%s\n' "$oebase" | grep -q '\s'
+then
+   printf '%s\n' "OE-Base path has whitespace characters in it's path!" \
+                 "This is currently unsupported." ;
+   exit 1
+fi
+
 # create passed in directory if it doesn't exist
 mkdir -p "$oebase"