diff mbox

externalsrc: verify that EXTERNALSRC/EXTERNALSRC_BUILD are absolute paths

Message ID 1497372294-21326-1-git-send-email-ross.burton@intel.com
State Accepted
Commit 946b6623154e748a0d75ff498802a720aeec27a6
Headers show

Commit Message

Ross Burton June 13, 2017, 4:44 p.m. UTC
If these are set to URLs then the errors produced are not helpful.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/classes/externalsrc.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.8.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox

Patch

diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index d64af6a..529be49 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -29,6 +29,12 @@  EXTERNALSRC_SYMLINKS ?= "oe-workdir:${WORKDIR} oe-logs:${T}"
 
 python () {
     externalsrc = d.getVar('EXTERNALSRC')
+    externalsrcbuild = d.getVar('EXTERNALSRC_BUILD')
+
+    if externalsrc and not externalsrc.startswith("/"):
+        bb.error("EXTERNALSRC must be an absolute path")
+    if externalsrcbuild and not externalsrcbuild.startswith("/"):
+        bb.error("EXTERNALSRC_BUILD must be an absolute path")
 
     # If this is the base recipe and EXTERNALSRC is set for it or any of its
     # derivatives, then enable BB_DONT_CACHE to force the recipe to always be
@@ -48,7 +54,6 @@  python () {
 
     if externalsrc:
         d.setVar('S', externalsrc)
-        externalsrcbuild = d.getVar('EXTERNALSRC_BUILD')
         if externalsrcbuild:
             d.setVar('B', externalsrcbuild)
         else: