[OE-core] [PATCH] insane.bbclass: Fix RPATH warning in the face of funny path strings
Chris Larson
clarson at kergoth.com
Thu Aug 16 00:14:29 UTC 2012
On Wed, Aug 15, 2012 at 3:46 PM, Andy Ross <andy.ross at windriver.com> wrote:
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 556a176..ade0616 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -161,6 +161,17 @@ def package_qa_check_rpath(file,name, d, elf, messages):
> if dir in line:
> messages.append("package %s contains bad RPATH %s in file %s" % (name, line, file))
>
> +def rpath_norm(s):
> + import re
> + s = re.sub('[^/]+/\.\.(/|$)', '/', s) # snip ".." components
> + s = re.sub('/\.(/|$)', '/', s) # snip "." components
> + s = re.sub('/+', '/', s) # snip repeated slashes
> + s = re.sub('/
> , '', s) # snip trailing slash
> + return s
> +
> +def rpath_eq(a, b):
> + return rpath_norm(a) == rpath_norm(b)
> +
Please just use os.path.normpath() rather than reinventing the wheel here.
--
Christopher Larson
More information about the Openembedded-core
mailing list