]> code.ossystems Code Review - openembedded-core.git/commitdiff
insane: consolidate skipping of temporary do_package files
authorRoss Burton <ross.burton@arm.com>
Tue, 7 Jul 2020 20:37:42 +0000 (21:37 +0100)
committerSteve Sakoman <steve@sakoman.com>
Tue, 14 Jul 2020 03:16:12 +0000 (17:16 -1000)
During the course of do_package_rpm and friends the tools create a
top-level CONTROL or DEBIAN directory in the package directory.
do_package_qa needs to be aware of these files and ignore them, this was
previously done in just one check but instead should be done once when
building the file list so all the checks don't see the temporary files.

[ YOCTO #13804 ]

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 4b2f45c47a5c8c800626f12c14f216a5ab923512)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/insane.bbclass

index 3a0efa3ad6a58d7020208d68b944138b435e8f9c..1d76ae7c1d5224a054c7c09f83c6a99133ba46f0 100644 (file)
@@ -458,10 +458,6 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
     if os.path.islink(path):
         return
 
-    # Ignore ipk and deb's CONTROL dir
-    if path.find(name + "/CONTROL/") != -1 or path.find(name + "/DEBIAN/") != -1:
-        return
-
     tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8")
     with open(path, 'rb') as f:
         file_content = f.read()
@@ -1023,7 +1019,14 @@ python do_package_qa () {
     pkgfiles = {}
     for pkg in packages:
         pkgfiles[pkg] = []
-        for walkroot, dirs, files in os.walk(os.path.join(pkgdest, pkg)):
+        pkgdir = os.path.join(pkgdest, pkg)
+        for walkroot, dirs, files in os.walk(pkgdir):
+            # Don't walk into top-level CONTROL or DEBIAN directories as these
+            # are temporary directories created by do_package.
+            if walkroot == pkgdir:
+                for control in ("CONTROL", "DEBIAN"):
+                    if control in dirs:
+                        dirs.remove(control)
             for file in files:
                 pkgfiles[pkg].append(os.path.join(walkroot, file))