summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass18
1 files changed, 11 insertions, 7 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 8a1b5f79c1..3cae577a0e 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -122,6 +122,10 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
122 tools = d.getVar(toolsvar).split() 122 tools = d.getVar(toolsvar).split()
123 origbbenv = d.getVar("BB_ORIGENV", False) 123 origbbenv = d.getVar("BB_ORIGENV", False)
124 path = origbbenv.getVar("PATH") 124 path = origbbenv.getVar("PATH")
125 # Need to ignore our own scripts directories to avoid circular links
126 for p in path.split(":"):
127 if p.endswith("/scripts"):
128 path = path.replace(p, "/ignoreme")
125 bb.utils.mkdirhier(dest) 129 bb.utils.mkdirhier(dest)
126 notfound = [] 130 notfound = []
127 for tool in tools: 131 for tool in tools:
@@ -135,7 +139,7 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True):
135 # /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc) 139 # /usr/local/bin/ccache/gcc -> /usr/bin/ccache, then which(gcc)
136 # would return /usr/local/bin/ccache/gcc, but what we need is 140 # would return /usr/local/bin/ccache/gcc, but what we need is
137 # /usr/bin/gcc, this code can check and fix that. 141 # /usr/bin/gcc, this code can check and fix that.
138 if "ccache" in srctool: 142 if os.path.islink(srctool) and os.path.basename(os.readlink(srctool)) == 'ccache':
139 srctool = bb.utils.which(path, tool, executable=True, direction=1) 143 srctool = bb.utils.which(path, tool, executable=True, direction=1)
140 if srctool: 144 if srctool:
141 os.symlink(srctool, desttool) 145 os.symlink(srctool, desttool)
@@ -153,14 +157,14 @@ do_fetch[vardeps] += "SRCREV"
153python base_do_fetch() { 157python base_do_fetch() {
154 158
155 src_uri = (d.getVar('SRC_URI') or "").split() 159 src_uri = (d.getVar('SRC_URI') or "").split()
156 if len(src_uri) == 0: 160 if not src_uri:
157 return 161 return
158 162
159 try: 163 try:
160 fetcher = bb.fetch2.Fetch(src_uri, d) 164 fetcher = bb.fetch2.Fetch(src_uri, d)
161 fetcher.download() 165 fetcher.download()
162 except bb.fetch2.BBFetchException as e: 166 except bb.fetch2.BBFetchException as e:
163 bb.fatal(str(e)) 167 bb.fatal("Bitbake Fetcher Error: " + repr(e))
164} 168}
165 169
166addtask unpack after do_fetch 170addtask unpack after do_fetch
@@ -170,14 +174,14 @@ do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) != o
170 174
171python base_do_unpack() { 175python base_do_unpack() {
172 src_uri = (d.getVar('SRC_URI') or "").split() 176 src_uri = (d.getVar('SRC_URI') or "").split()
173 if len(src_uri) == 0: 177 if not src_uri:
174 return 178 return
175 179
176 try: 180 try:
177 fetcher = bb.fetch2.Fetch(src_uri, d) 181 fetcher = bb.fetch2.Fetch(src_uri, d)
178 fetcher.unpack(d.getVar('WORKDIR')) 182 fetcher.unpack(d.getVar('WORKDIR'))
179 except bb.fetch2.BBFetchException as e: 183 except bb.fetch2.BBFetchException as e:
180 bb.fatal(str(e)) 184 bb.fatal("Bitbake Fetcher Error: " + repr(e))
181} 185}
182 186
183def get_layers_branch_rev(d): 187def get_layers_branch_rev(d):
@@ -688,7 +692,7 @@ python () {
688 if os.path.basename(p) == machine and os.path.isdir(p): 692 if os.path.basename(p) == machine and os.path.isdir(p):
689 paths.append(p) 693 paths.append(p)
690 694
691 if len(paths) != 0: 695 if paths:
692 for s in srcuri.split(): 696 for s in srcuri.split():
693 if not s.startswith("file://"): 697 if not s.startswith("file://"):
694 continue 698 continue
@@ -721,7 +725,7 @@ do_cleansstate[nostamp] = "1"
721 725
722python do_cleanall() { 726python do_cleanall() {
723 src_uri = (d.getVar('SRC_URI') or "").split() 727 src_uri = (d.getVar('SRC_URI') or "").split()
724 if len(src_uri) == 0: 728 if not src_uri:
725 return 729 return
726 730
727 try: 731 try: