]> code.ossystems Code Review - openembedded-core.git/commitdiff
spdx.bbclass: Add SPDX-specific source tree variable.
authorleimaohui <leimaohui@cn.fujitsu.com>
Tue, 23 Sep 2014 09:48:12 +0000 (17:48 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 29 Sep 2014 16:49:11 +0000 (17:49 +0100)
Add SPDX-specific source tree variable for recipes where $S is a subdirectory of
the source tree.

[ RB - add a comment for SPDX_S ]

Signed-off-by: leimaohui <leimaohui@cn.fujitsu.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/spdx.bbclass

index 55ce3aff4f3e98285c92e9aaf8aee6365aa8e978..bccc230d8c4a8bee3478fafd3f754b59c46f588b 100644 (file)
 SPDXOUTPUTDIR = "${WORKDIR}/spdx_output_dir"
 SPDXSSTATEDIR = "${WORKDIR}/spdx_sstate_dir"
 
+# If ${S} isn't actually the top-level source directory, set SPDX_S to point at
+# the real top-level directory.
+SPDX_S ?= "${S}"
+
 python do_spdx () {
     import os, sys
     import json
 
     info = {} 
     info['workdir'] = (d.getVar('WORKDIR', True) or "")
-    info['sourcedir'] = (d.getVar('S', True) or "")
+    info['sourcedir'] = (d.getVar('SPDX_S', True) or "")
     info['pn'] = (d.getVar( 'PN', True ) or "")
     info['pv'] = (d.getVar( 'PV', True ) or "")
     info['src_uri'] = (d.getVar( 'SRC_URI', True ) or "")