diff options
Diffstat (limited to 'meta/classes-global/base.bbclass')
-rw-r--r-- | meta/classes-global/base.bbclass | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index e55a538e36..ac145d9fd6 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass | |||
@@ -154,6 +154,7 @@ do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}" | |||
154 | do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}" | 154 | do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}" |
155 | do_fetch[prefuncs] += "fetcher_hashes_dummyfunc" | 155 | do_fetch[prefuncs] += "fetcher_hashes_dummyfunc" |
156 | do_fetch[network] = "1" | 156 | do_fetch[network] = "1" |
157 | do_fetch[umask] = "${OE_SHARED_UMASK}" | ||
157 | python base_do_fetch() { | 158 | python base_do_fetch() { |
158 | 159 | ||
159 | src_uri = (d.getVar('SRC_URI') or "").split() | 160 | src_uri = (d.getVar('SRC_URI') or "").split() |
@@ -183,23 +184,16 @@ python base_do_unpack() { | |||
183 | 184 | ||
184 | basedir = None | 185 | basedir = None |
185 | unpackdir = d.getVar('UNPACKDIR') | 186 | unpackdir = d.getVar('UNPACKDIR') |
186 | workdir = d.getVar('WORKDIR') | 187 | if sourcedir.startswith(unpackdir): |
187 | if sourcedir.startswith(workdir) and not sourcedir.startswith(unpackdir): | 188 | basedir = sourcedir.replace(unpackdir, '').strip("/").split('/')[0] |
188 | basedir = sourcedir.replace(workdir, '').strip("/").split('/')[0] | ||
189 | if basedir: | 189 | if basedir: |
190 | bb.utils.remove(workdir + '/' + basedir, True) | 190 | d.setVar("SOURCE_BASEDIR", unpackdir + '/' + basedir) |
191 | d.setVar("SOURCE_BASEDIR", workdir + '/' + basedir) | ||
192 | 191 | ||
193 | try: | 192 | try: |
194 | fetcher = bb.fetch2.Fetch(src_uri, d) | 193 | fetcher = bb.fetch2.Fetch(src_uri, d) |
195 | fetcher.unpack(d.getVar('UNPACKDIR')) | 194 | fetcher.unpack(d.getVar('UNPACKDIR')) |
196 | except bb.fetch2.BBFetchException as e: | 195 | except bb.fetch2.BBFetchException as e: |
197 | bb.fatal("Bitbake Fetcher Error: " + repr(e)) | 196 | bb.fatal("Bitbake Fetcher Error: " + repr(e)) |
198 | |||
199 | if basedir and os.path.exists(unpackdir + '/' + basedir): | ||
200 | # Compatibility magic to ensure ${WORKDIR}/git and ${WORKDIR}/${BP} | ||
201 | # as often used in S work as expected. | ||
202 | shutil.move(unpackdir + '/' + basedir, workdir + '/' + basedir) | ||
203 | } | 197 | } |
204 | 198 | ||
205 | SSTATETASKS += "do_deploy_source_date_epoch" | 199 | SSTATETASKS += "do_deploy_source_date_epoch" |