mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00

This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
98 lines
3.5 KiB
Python
98 lines
3.5 KiB
Python
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
import os
|
|
|
|
from oeqa.selftest.case import OESelftestTestCase
|
|
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
|
|
import oeqa.utils.ftools as ftools
|
|
|
|
class LayerAppendTests(OESelftestTestCase):
|
|
layerconf = """
|
|
# We have a conf and classes directory, append to BBPATH
|
|
BBPATH .= ":${LAYERDIR}"
|
|
|
|
# We have a recipes directory, add to BBFILES
|
|
BBFILES += "${LAYERDIR}/recipes*/*.bb ${LAYERDIR}/recipes*/*.bbappend"
|
|
|
|
BBFILE_COLLECTIONS += "meta-layerINT"
|
|
BBFILE_PATTERN_meta-layerINT := "^${LAYERDIR}/"
|
|
BBFILE_PRIORITY_meta-layerINT = "6"
|
|
"""
|
|
recipe = """
|
|
LICENSE="CLOSED"
|
|
INHIBIT_DEFAULT_DEPS = "1"
|
|
|
|
python do_build() {
|
|
bb.plain('Building ...')
|
|
}
|
|
addtask build
|
|
"""
|
|
append = """
|
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
|
|
|
SRC_URI_append = " file://appendtest.txt"
|
|
|
|
sysroot_stage_all_append() {
|
|
install -m 644 ${WORKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/
|
|
}
|
|
|
|
"""
|
|
|
|
append2 = """
|
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
|
|
|
SRC_URI_append = " file://appendtest.txt"
|
|
"""
|
|
layerappend = ''
|
|
|
|
def tearDownLocal(self):
|
|
if self.layerappend:
|
|
ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
|
|
super(LayerAppendTests, self).tearDownLocal()
|
|
|
|
def test_layer_appends(self):
|
|
corebase = get_bb_var("COREBASE")
|
|
|
|
for l in ["0", "1", "2"]:
|
|
layer = os.path.join(corebase, "meta-layertest" + l)
|
|
self.assertFalse(os.path.exists(layer))
|
|
os.mkdir(layer)
|
|
os.mkdir(layer + "/conf")
|
|
with open(layer + "/conf/layer.conf", "w") as f:
|
|
f.write(self.layerconf.replace("INT", l))
|
|
os.mkdir(layer + "/recipes-test")
|
|
if l == "0":
|
|
with open(layer + "/recipes-test/layerappendtest.bb", "w") as f:
|
|
f.write(self.recipe)
|
|
elif l == "1":
|
|
with open(layer + "/recipes-test/layerappendtest.bbappend", "w") as f:
|
|
f.write(self.append)
|
|
os.mkdir(layer + "/recipes-test/layerappendtest")
|
|
with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
|
|
f.write("Layer 1 test")
|
|
elif l == "2":
|
|
with open(layer + "/recipes-test/layerappendtest.bbappend", "w") as f:
|
|
f.write(self.append2)
|
|
os.mkdir(layer + "/recipes-test/layerappendtest")
|
|
with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
|
|
f.write("Layer 2 test")
|
|
self.track_for_cleanup(layer)
|
|
|
|
self.layerappend = "BBLAYERS += \"{0}/meta-layertest0 {0}/meta-layertest1 {0}/meta-layertest2\"".format(corebase)
|
|
ftools.append_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
|
|
stagingdir = get_bb_var("SYSROOT_DESTDIR", "layerappendtest")
|
|
bitbake("layerappendtest")
|
|
data = ftools.read_file(stagingdir + "/appendtest.txt")
|
|
self.assertEqual(data, "Layer 2 test")
|
|
os.remove(corebase + "/meta-layertest2/recipes-test/layerappendtest/appendtest.txt")
|
|
bitbake("layerappendtest")
|
|
data = ftools.read_file(stagingdir + "/appendtest.txt")
|
|
self.assertEqual(data, "Layer 1 test")
|
|
with open(corebase + "/meta-layertest2/recipes-test/layerappendtest/appendtest.txt", "w") as f:
|
|
f.write("Layer 2 test")
|
|
bitbake("layerappendtest")
|
|
data = ftools.read_file(stagingdir + "/appendtest.txt")
|
|
self.assertEqual(data, "Layer 2 test")
|