summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-31 12:01:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-01 23:11:37 +0100
commit61c7c8f175d3ed1b14cb50ebeae6358dab69dbdf (patch)
treec8b54f4a6f7d6e4aba297df9eb1972170091dd97 /meta/classes/base.bbclass
parentee5f9d9fdd7d09aa3a86a19d07e3e64851ddc686 (diff)
downloadpoky-61c7c8f175d3ed1b14cb50ebeae6358dab69dbdf.tar.gz
base: Don't add duplicates to sys.path
We can re-trigger this code and there is little point in stacking a ton of duplicate paths which just waste time during searches for modules. This could in theory alter layer module search order but that seems unlikely in common use. (From OE-Core rev: dadce8468db1c0fd0e04801cdc6cf287c2808477) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index cc81461473..e51722d945 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -20,8 +20,8 @@ PACKAGECONFIG_CONFARGS ??= ""
20def oe_import(d): 20def oe_import(d):
21 import sys 21 import sys
22 22
23 bbpath = d.getVar("BBPATH").split(":") 23 bbpath = [os.path.join(dir, "lib") for dir in d.getVar("BBPATH").split(":")]
24 sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath] 24 sys.path[0:0] = [dir for dir in bbpath if dir not in sys.path]
25 25
26 def inject(name, value): 26 def inject(name, value):
27 """Make a python object accessible from the metadata""" 27 """Make a python object accessible from the metadata"""