]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
insane: Improve patch-status layer filtering
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Jun 2023 13:40:55 +0000 (14:40 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 20 Jun 2023 22:21:18 +0000 (23:21 +0100)
Now that we have layer overrides, we can easily enable patch-status in
ERROR_QA without the hardcoded code making it easier for other layers
to opt into the checks.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/insane.bbclass
meta/lib/oeqa/selftest/cases/devtool.py
meta/lib/oeqa/selftest/cases/kerneldevelopment.py

index 8788f58fc5b0ce67451a9afe1d3eee309c7025b9..a4dbc9a1238e88ac6bc91340526c270637269e48 100644 (file)
@@ -44,10 +44,11 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             already-stripped installed-vs-shipped ldflags compile-host-path \
             install-host-path pn-overrides unknown-configure-option \
             useless-rpaths rpaths staticdev empty-dirs \
-            patch-fuzz patch-status-core\
+            patch-fuzz \
             "
 # Add usrmerge QA check based on distro feature
 ERROR_QA:append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}"
+ERROR_QA:append:layer-core = " patch-status"
 
 FAKEROOT_QA = "host-user-contaminated"
 FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
@@ -1334,24 +1335,13 @@ python do_qa_patch() {
     import re
     from oe import patch
 
-    allpatches = False
-    if bb.utils.filter('ERROR_QA', 'patch-status-noncore', d) or bb.utils.filter('WARN_QA', 'patch-status-noncore', d):
-        allpatches = True
-
     coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '')
     for url in patch.src_patches(d):
         (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
-        # skip patches not in oe-core
-        patchtype = "patch-status-core"
-        if not os.path.abspath(fullpath).startswith(coremeta_path):
-            patchtype = "patch-status-noncore"
-            if not allpatches:
-                continue
-
         msg = oe.qa.check_upstream_status(fullpath)
         if msg:
-            oe.qa.handle_error(patchtype, msg, d)
+            oe.qa.handle_error("patch-status", msg, d)
 
     oe.qa.exit_if_errors(d)
 }
index 397895c9367d393fc8ee9a04757e4d7df27c6ad4..4c8e375d007756db513cb1b914abd04c29f567bd 100644 (file)
@@ -1469,6 +1469,7 @@ class DevtoolUpdateTests(DevtoolBase):
     def test_devtool_finish_modify_git_subdir(self):
         # Check preconditions
         testrecipe = 'dos2unix'
+        self.append_config('ERROR_QA:remove:pn-dos2unix = "patch-status"\n')
         bb_vars = get_bb_vars(['SRC_URI', 'S', 'WORKDIR', 'FILE'], testrecipe)
         self.assertIn('git://', bb_vars['SRC_URI'], 'This test expects the %s recipe to be a git recipe' % testrecipe)
         workdir_git = '%s/git/' % bb_vars['WORKDIR']
index 4325f3859875408a111dbaa17096b351c4e53045..b1f78a0cd1777e1e6d6517dada48ef1c24eb28cd 100644 (file)
@@ -64,6 +64,7 @@ class KernelDev(OESelftestTestCase):
         recipe_append = os.path.join(self.recipeskernel_dir, 'linux-yocto_%.bbappend')
         with open(recipe_append, 'w+') as fh:
             fh.write('SRC_URI += "file://%s"\n' % patch_name)
+            fh.write('ERROR_QA:remove:pn-linux-yocto = "patch-status"\n')
             fh.write('FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"')
 
         runCmd('bitbake virtual/kernel -c clean')