Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1 V2] package.bbclass: add QA check: file-depends
@ 2014-07-15 14:10 Robert Yang
  2014-07-15 14:10 ` [PATCH 1/1] " Robert Yang
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Yang @ 2014-07-15 14:10 UTC (permalink / raw)
  To: openembedded-core

V2:
* Only print warnings when enabled, let the user fix the RDEPENDS by
  hand as Mark suggested.
* Use ${bindir}/perl rather than /usr/bin/perl as Ross suggested, also
  fix for nativesdk.

V1:
* Initial version.

// Robert

The following changes since commit fa325e44f5b429b4038022b31285af9c94672943:

  insane: Ensure do_package_qa happens after do_packagedata (2014-07-11 23:19:18 +0100)

are available in the git repository at:

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

Robert Yang (1):
  package.bbclass: add QA check: file-depends

 meta/classes/insane.bbclass  |    2 +-
 meta/classes/package.bbclass |   25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] package.bbclass: add QA check: file-depends
  2014-07-15 14:10 [PATCH 0/1 V2] package.bbclass: add QA check: file-depends Robert Yang
@ 2014-07-15 14:10 ` Robert Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Yang @ 2014-07-15 14:10 UTC (permalink / raw)
  To: openembedded-core

The ipk or deb can't depend on file such as "/usr/bin/perl", so it would
know nothing about perl, and there would be dependencies problems when
we run "apt-get install" on the target, this check can help us figure
out the depends, and the user can fix it manually.

[YOCTO #1662]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/insane.bbclass  |    2 +-
 meta/classes/package.bbclass |   25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 106ace7..1a136b7 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -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 \
+            pn-overrides infodir file-depends \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 26a20d1..eaf7ddf 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -52,6 +52,10 @@ LOCALE_SECTION ?= ''
 
 ALL_MULTILIB_PACKAGE_ARCHS = "${@all_multilib_tune_values(d, 'PACKAGE_ARCHS')}"
 
+BASH_PATH ?= "${base_bindir}/bash"
+PERL_PATH ?= "${bindir}/perl"
+PYTHON_PATH ?= "${bindir}/python"
+
 # rpm is used for the per-file dependency identification
 PACKAGE_DEPENDS += "rpm-native"
 
@@ -1318,6 +1322,11 @@ python package_do_filedeps() {
     pool.close()
     pool.join()
 
+    # Used for converting file depends into pkg depends
+    prog_maps = {d.getVar("BASH_PATH", True): "bash",
+            d.getVar("PERL_PATH", True): "perl",
+            d.getVar("PYTHON_PATH", True): "python"}
+
     provides_files = {}
     requires_files = {}
 
@@ -1334,10 +1343,26 @@ python package_do_filedeps() {
             key = "FILERPROVIDES_" + file + "_" + pkg
             d.setVar(key, " ".join(provides[file]))
 
+        req_file_pkgs = []
         for file in requires:
             requires_files[pkg].append(file)
             key = "FILERDEPENDS_" + file + "_" + pkg
             d.setVar(key, " ".join(requires[file]))
+            for req_file in requires[file]:
+                if req_file in prog_maps and prog_maps[req_file] not in req_file_pkgs:
+                    if bb.data.inherits_class("nativesdk", d):
+                        req_file_pkgs.append("nativesdk-" + prog_maps[req_file])
+                    else:
+                        req_file_pkgs.append(prog_maps[req_file])
+
+        if req_file_pkgs:
+            rdepends = bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg, True) or "")
+            for p in req_file_pkgs:
+                if p not in rdepends:
+                    if p == "python" and "python3" in rdepends:
+                        continue
+                    msg = "RDEPENDS_%s should contain %s, please consider fixing it" %  (pkg, p)
+                    package_qa_handle_error("file-depends", msg, d)
 
     for pkg in requires_files:
         d.setVar("FILERDEPENDSFLIST_" + pkg, " ".join(requires_files[pkg]))
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-15 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-15 14:10 [PATCH 0/1 V2] package.bbclass: add QA check: file-depends Robert Yang
2014-07-15 14:10 ` [PATCH 1/1] " Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox