]> code.ossystems Code Review - openembedded-core.git/commit
chrpath: Improve crazy code
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 Nov 2013 22:14:47 +0000 (22:14 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 27 Nov 2013 12:03:18 +0000 (12:03 +0000)
commitfeea54df6768036649ca6c57524e2a1f480ad249
tree4eb8a88090375f72489871b74a6d02cc26e47723
parenta956f9d91c8128e43b55c6bc01337472e47fe43a
chrpath: Improve crazy code

The current code is a little bit overcomplicated, deficient and also
possibly broken.

Issues include:

a) Not maximally optisming rpaths (e.g. a lib in usr/lib might get an
   rpath of $ORIGIN/../../usr/lib)
b) The return in the middle of the for loop look suspiciously like
   it might break on some binaries
c) The depth function, loops of "../" prepending and so on can
   be replaced with a call to os.path.relpath

This patch cleans up the above issues.

Running binaries should result in less "../" resolutions which can't
hurt performance either.

[YOCTO #3989]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/chrpath.bbclass