Patchwork [6/6] insane.bbclass: Make ldd exec_prefix error reporting easier to read

login
register
mail settings
Submitter Mark Hatle
Date June 6, 2012, 2:53 p.m.
Message ID <8d70e60114dace932ce1f205758593c931f59ed2.1338994308.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/29303/
State New
Headers show

Comments

Mark Hatle - June 6, 2012, 2:53 p.m.
Sorry please ignore this one, I sent it by accident.. The patch wasn't finished.

--Mark

On 6/6/12 9:53 AM, Mark Hatle wrote:
> Remove the long obtuse sysroot path from the ldd output, making the error
> message significantly easier to read and understand.
>
> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
> ---
>   meta/classes/insane.bbclass |    9 ++++++++-
>   1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 4d139e8..e845250 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -251,7 +251,14 @@ def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages)
>   			return False
>
>   		if sysroot_path_usr in ldd_output:
> -			error_msg = pn + ": %s links to something under exec_prefix" % path
> +			ldd_output = ldd_output.replace(sysroot_path, "")
> +
> +			pkgdest = d.getVar('PKGDEST', True)
> +			packages = d.getVar('PACKAGES', True)
> +
> +			short_path = path.replace('%s/%s' % (pkgdest, packages), "", 1)
> +
> +			error_msg = pn + ": %s links to something under exec_prefix (%s)" % (short_path, exec_prefix)
>   			package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
>   			error_msg = "ldd reports: %s" % ldd_output
>   			package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
Mark Hatle - June 6, 2012, 2:53 p.m.
Remove the long obtuse sysroot path from the ldd output, making the error
message significantly easier to read and understand.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/insane.bbclass |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 4d139e8..e845250 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -251,7 +251,14 @@  def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages)
 			return False
 
 		if sysroot_path_usr in ldd_output:
-			error_msg = pn + ": %s links to something under exec_prefix" % path
+			ldd_output = ldd_output.replace(sysroot_path, "")
+
+			pkgdest = d.getVar('PKGDEST', True)
+			packages = d.getVar('PACKAGES', True)
+
+			short_path = path.replace('%s/%s' % (pkgdest, packages), "", 1)
+
+			error_msg = pn + ": %s links to something under exec_prefix (%s)" % (short_path, exec_prefix)
 			package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
 			error_msg = "ldd reports: %s" % ldd_output
 			package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)