Skip to contentSkip to conversation

insane.bbclass: add QA check: file-rdeps

PATCH Superseded Robert Yang 1 participant 3 messages Aug 11, 2014 – Aug 13, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover insane.bbclass: add QA check: file-rdeps

* Changes of V2:
Refer build-deps to check all the files' rdepends rather than only check bash, perl and python as RP suggested.

Next:
* Fix the issues one by one:
- Remove the depends is possible (such as bash)
- Split the packages for perl and python depends when needed.

// Robert

The following changes since commit 63cbed337241191f33fe951662a39ce59dce6774:

oeqa/runtime: add new cpp test and file (2014-08-11 12:30:16 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/file-rdeps
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/file-rdeps

Robert Yang (1):
insane.bbclass: add QA check: file-rdeps

 meta/classes/insane.bbclass |   37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/1 insane.bbclass: add QA check: file-rdeps

The ipk or deb can't depend on file such as "/bin/bash" or "/usr/bin/perl", so it knows nothing about the pkg depends bash or perl, thus there would be dependencies problems when we run "apt-get install/remove <pkg>" on the target, this check can help us find the issues and then fix them manually.

* Basic designs:
- Get the pkg's FILERPROVIDES from oe.packagedata.read_subpkgdata() and save to set filerdepends.

- Get the each RPDEPENDS' FILERPROVIDES, RPROVIDES and FILERPROVIDESFLIST, and save to set rdep_rprovides.

- Do the set "filerdepends -= rdep_rprovides" and QA Issue if filerdepends is not null.

[YOCTO #1662]

---
 meta/classes/insane.bbclass |   37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)
meta/classes/insane.bbclass +36 -1
index 3dd2e7f..f2e9626 100644
@@ -29,7 +29,7 @@ QA_SANE = "True"
 WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
             textrel already-stripped incompatible-license files-invalid \
             installed-vs-shipped compile-host-path install-host-path \
-            pn-overrides infodir build-deps \
+            pn-overrides infodir build-deps file-rdeps \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -797,6 +797,41 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
                 error_msg = "%s rdepends on %s, but it isn't a build dependency?" % (pkg, rdepend)
                 sane = package_qa_handle_error("build-deps", error_msg, d)
 
+        if "file-rdeps" not in skip:
+            ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env'])
+            # For Saving the FILERDEPENDS
+            filerdepends = set()
+            rdep_data = oe.packagedata.read_subpkgdata(pkg, d)
+            for key in rdep_data:
+                if key.startswith("FILERDEPENDS_"):
+                    for subkey in rdep_data[key].split():
+                        filerdepends.add(subkey)
+            filerdepends -= ignored_file_rdeps
+            if filerdepends:
+                # Check the rprovides of itself
+                if pkg not in rdepends:
+                    rdepends.insert(0, pkg)
+                for rdepend in rdepends:
+                    # For Saving the FILERPROVIDES and RPROVIDES
+                    rdep_rprovides = set()
+                    rdep_data = oe.packagedata.read_subpkgdata(rdepend, d)
+                    for key in rdep_data:
+                        if key.startswith("FILERPROVIDES_") or key.startswith("RPROVIDES_") \
+                                or key.startswith("FILERPROVIDESFLIST_"):
+                            for subkey in rdep_data[key].split():
+                                rdep_rprovides.add(subkey)
+                    filerdepends -= rdep_rprovides
+                    if not filerdepends:
+                            # Break if all the file rdepends are met.
+                            break
+                    else:
+                            # Clear it for the next loop
+                            rdep_rprovides.clear()
+            if filerdepends:
+                error_msg = "%s requires %s, but no providers in its RDEPENDS" % \
+                            (pkg, ', '.join(str(e) for e in filerdepends))
+                sane = package_qa_handle_error("file-rdeps", error_msg, d)
+
     return sane
 
 def package_qa_check_deps(pkg, pkgdest, skip, d):
Signature · 1 line
1.7.9.5
#2 lore raw
In reply to Robert Yang

Talked with RP, we need check all the deps on the dependencies chain, I will update it sooner.

// Robert

Quoted 26 lines · Robert Yang

* Changes of V2:
Refer build-deps to check all the files' rdepends rather than only check bash, perl and python as RP suggested.

Next:
* Fix the issues one by one:
- Remove the depends is possible (such as bash)
- Split the packages for perl and python depends when needed.

// Robert

The following changes since commit 63cbed337241191f33fe951662a39ce59dce6774:

oeqa/runtime: add new cpp test and file (2014-08-11 12:30:16 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib rbt/file-rdeps
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/file-rdeps

Robert Yang (1):
insane.bbclass: add QA check: file-rdeps

  meta/classes/insane.bbclass |   37 ++++++++++++++++++++++++++++++++++++-
  1 file changed, 36 insertions(+), 1 deletion(-)