]> code.ossystems Code Review - openembedded-core.git/commitdiff
perf: fix python scripts QA errors
authorBruce Ashfield <bruce.ashfield@windriver.com>
Wed, 23 Mar 2016 15:09:03 +0000 (11:09 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 24 Mar 2016 21:44:43 +0000 (21:44 +0000)
Two QA warnings were being generated from perf, due to the location of
python scripts changing in the kernel build:

WARNING: perf-1.0-r9 do_package_qa: QA Issue:
  /usr/libexec/perf-core/scripts/python/call-graph-from-postgresql.py contained
  in package perf-python requires /usr/bin/python2, but no providers found in RDEPENDS_perf-python? [file-rdeps]

WARNING: QA Issue: /usr/libexec/perf-core/tests/attr.py_perf contained in package
  perf requires /usr/bin/python, but no providers found in its RDEPENDS [file-rdeps]

By adding libexec dir to both the tests and scripts packaging, we get the
appropriate RDEPENDS on the packages that actually contain the python scripts
(without making perf-core depend on python).

We also tweak any python scripts to use '/usr/bin/env python', rather than a
version specific python, since it won't be provided and generate a QA error.

[YOCTO #8991]

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/perf/perf.bb

index 8b862902011d5e8731206c2723e445991cd51afd..e9c5c0c9f30e14fe29b4b0f75766712b8590f454 100644 (file)
@@ -183,6 +183,11 @@ do_configure_prepend () {
         sed -i 's,#include "tests/tests.h",#include "tests/tests.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/tests/dwarf-unwind.c
         sed -i 's,#include "perf_regs.h",#include "perf_regs.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/util/unwind-libunwind.c
     fi
+
+    # use /usr/bin/env instead of version specific python
+    for s in `find ${S}/tools/perf/scripts/python/ -name '*.py'`; do
+        sed -i 's,/usr/bin/python2,/usr/bin/env python,' "${s}"
+    done
 }
 
 python do_package_prepend() {
@@ -205,8 +210,9 @@ RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
 
 FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent"
 FILES_${PN}-archive = "${libdir}/perf/perf-core/perf-archive"
-FILES_${PN}-tests = "${libdir}/perf/perf-core/tests"
+FILES_${PN}-tests = "${libdir}/perf/perf-core/tests ${libexecdir}/perf-core/tests"
 FILES_${PN}-python = "${libdir}/python*/site-packages ${libdir}/perf/perf-core/scripts/python"
+FILES_${PN}-python += "${libexecdir}/perf-core/scripts/python/*"
 FILES_${PN}-perl = "${libdir}/perf/perf-core/scripts/perl"