diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/base.bbclass | 8 | ||||
-rw-r--r-- | classes/package.bbclass | 6 | ||||
-rw-r--r-- | classes/package_ipk.bbclass | 3 | ||||
-rw-r--r-- | classes/package_rpm.bbclass | 3 | ||||
-rw-r--r-- | classes/package_tar.bbclass | 3 | ||||
-rw-r--r-- | classes/src_distribute.bbclass | 40 |
6 files changed, 50 insertions, 13 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index 4c2c58e8d2..1ce9918cb8 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -314,9 +314,9 @@ addtask fetch do_fetch[dirs] = "${DL_DIR}" do_fetch[nostamp] = "1" python base_do_fetch() { - import sys, copy + import sys - localdata = copy.deepcopy(d) + localdata = bb.data.createCopy(d) bb.data.update_data(localdata) src_uri = bb.data.getVar('SRC_URI', localdata, 1) @@ -393,9 +393,9 @@ def oe_unpack_file(file, data, url = None): addtask unpack after do_fetch do_unpack[dirs] = "${WORKDIR}" python base_do_unpack() { - import re, copy, os + import re, os - localdata = copy.deepcopy(d) + localdata = bb.data.createCopy(d) bb.data.update_data(localdata) src_uri = bb.data.getVar('SRC_URI', localdata) diff --git a/classes/package.bbclass b/classes/package.bbclass index 9abecd5550..d6a2193404 100644 --- a/classes/package.bbclass +++ b/classes/package.bbclass @@ -82,7 +82,7 @@ def do_split_packages(d, root, file_regex, output_pattern, description, postinst bb.data.setVar('PACKAGES', ' '.join(packages), d) python populate_packages () { - import glob, stat, errno, re, copy + import glob, stat, errno, re workdir = bb.data.getVar('WORKDIR', d, 1) if not workdir: @@ -122,7 +122,7 @@ python populate_packages () { return (s[stat.ST_MODE] & stat.S_IEXEC) for pkg in packages.split(): - localdata = copy.deepcopy(d) + localdata = bb.data.createCopy(d) root = os.path.join(workdir, "install", pkg) os.system('rm -rf %s' % root) @@ -457,7 +457,7 @@ python package_do_pkgconfig () { for file in files: m = pc_re.match(file) if m: - pd = {} + pd = bb.data.init() name = m.group(1) pkgconfig_provided[pkg].append(name) path = os.path.join(root, file) diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass index e1d87f6d9f..3c6125d9e3 100644 --- a/classes/package_ipk.bbclass +++ b/classes/package_ipk.bbclass @@ -98,8 +98,7 @@ python do_package_ipk () { return for pkg in packages.split(): - from copy import deepcopy - localdata = deepcopy(d) + localdata = bb.data.createCopy(d) root = "%s/install/%s" % (workdir, pkg) bb.data.setVar('ROOT', '', localdata) diff --git a/classes/package_rpm.bbclass b/classes/package_rpm.bbclass index ff5e4ee3a8..c29ab5f423 100644 --- a/classes/package_rpm.bbclass +++ b/classes/package_rpm.bbclass @@ -108,8 +108,7 @@ python do_package_rpm () { packages = bb.data.expand(packages, d) for pkg in packages.split(): - from copy import copy, deepcopy - localdata = deepcopy(d) + localdata = bb.data.createCopy(d) root = "%s/install/%s" % (workdir, pkg) bb.data.setVar('ROOT', '', localdata) diff --git a/classes/package_tar.bbclass b/classes/package_tar.bbclass index 2d169c7491..359e35f113 100644 --- a/classes/package_tar.bbclass +++ b/classes/package_tar.bbclass @@ -61,8 +61,7 @@ python do_package_tar () { return for pkg in packages.split(): - from copy import copy, deepcopy - localdata = deepcopy(d) + localdata = bb.data.createCopy(d) root = "%s/install/%s" % (workdir, pkg) bb.data.setVar('ROOT', '', localdata) diff --git a/classes/src_distribute.bbclass b/classes/src_distribute.bbclass index e69de29bb2..5daf526018 100644 --- a/classes/src_distribute.bbclass +++ b/classes/src_distribute.bbclass @@ -0,0 +1,40 @@ +include conf/licenses.conf + +SRC_DISTRIBUTECOMMAND[func] = "1" +python do_distribute_sources () { + l = bb.data.createCopy(d) + bb.data.update_data(l) + licenses = (bb.data.getVar('LICENSE', d, 1) or "").split() + if not licenses: + bb.note("LICENSE not defined") + src_distribute_licenses = (bb.data.getVar('SRC_DISTRIBUTE_LICENSES', d, 1) or "").split() + # Explanation: + # Space seperated items in LICENSE must *all* be distributable + # Each space seperated item may be used under any number of | seperated licenses. + # If any of those | seperated licenses are distributable, then that component is. + # i.e. LICENSE = "GPL LGPL" + # In this case, both components are distributable. + # LICENSE = "GPL|QPL|Proprietary" + # In this case, GPL is distributable, so the component is. + valid = 1 + for l in licenses: + lvalid = 0 + for i in l.split("|"): + if i in src_distribute_licenses: + lvalid = 1 + if lvalid != 1: + valid = 0 + if valid == 0: + bb.note("Licenses (%s) are not all listed in SRC_DISTRIBUTE_LICENSES, skipping source distribution" % licenses) + return + import re + for s in (bb.data.getVar('A', d, 1) or "").split(): + s = re.sub(';.*$', '', s) + cmd = bb.data.getVar('SRC_DISTRIBUTECOMMAND', d, 1) + if not cmd: + raise bb.build.FuncFailed("Unable to distribute sources, SRC_DISTRIBUTECOMMAND not defined") + bb.data.setVar('SRC', s, d) + bb.build.exec_func('SRC_DISTRIBUTECOMMAND', d) +} + +addtask distribute_sources before do_build after do_fetch |