diff options
Diffstat (limited to 'meta/classes-global')
-rw-r--r-- | meta/classes-global/base.bbclass | 13 | ||||
-rw-r--r-- | meta/classes-global/insane.bbclass | 8 |
2 files changed, 11 insertions, 10 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index e55a538e36..b86f50e283 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass | |||
@@ -183,23 +183,16 @@ python base_do_unpack() { | |||
183 | 183 | ||
184 | basedir = None | 184 | basedir = None |
185 | unpackdir = d.getVar('UNPACKDIR') | 185 | unpackdir = d.getVar('UNPACKDIR') |
186 | workdir = d.getVar('WORKDIR') | 186 | if sourcedir.startswith(unpackdir): |
187 | if sourcedir.startswith(workdir) and not sourcedir.startswith(unpackdir): | 187 | basedir = sourcedir.replace(unpackdir, '').strip("/").split('/')[0] |
188 | basedir = sourcedir.replace(workdir, '').strip("/").split('/')[0] | ||
189 | if basedir: | 188 | if basedir: |
190 | bb.utils.remove(workdir + '/' + basedir, True) | 189 | d.setVar("SOURCE_BASEDIR", unpackdir + '/' + basedir) |
191 | d.setVar("SOURCE_BASEDIR", workdir + '/' + basedir) | ||
192 | 190 | ||
193 | try: | 191 | try: |
194 | fetcher = bb.fetch2.Fetch(src_uri, d) | 192 | fetcher = bb.fetch2.Fetch(src_uri, d) |
195 | fetcher.unpack(d.getVar('UNPACKDIR')) | 193 | fetcher.unpack(d.getVar('UNPACKDIR')) |
196 | except bb.fetch2.BBFetchException as e: | 194 | except bb.fetch2.BBFetchException as e: |
197 | bb.fatal("Bitbake Fetcher Error: " + repr(e)) | 195 | 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 | } | 196 | } |
204 | 197 | ||
205 | SSTATETASKS += "do_deploy_source_date_epoch" | 198 | SSTATETASKS += "do_deploy_source_date_epoch" |
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index c45650291f..4ef664b3ce 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass | |||
@@ -1431,6 +1431,14 @@ Rerun configure task after fixing this.""" | |||
1431 | python do_qa_unpack() { | 1431 | python do_qa_unpack() { |
1432 | src_uri = d.getVar('SRC_URI') | 1432 | src_uri = d.getVar('SRC_URI') |
1433 | s_dir = d.getVar('S') | 1433 | s_dir = d.getVar('S') |
1434 | s_dir_orig = d.getVar('S', False) | ||
1435 | |||
1436 | if s_dir_orig == '${WORKDIR}/git' or s_dir_orig == '${UNPACKDIR}/git': | ||
1437 | bb.fatal('Recipes that set S = "${WORKDIR}/git" or S = "${UNPACKDIR}/git" should remove that assignment, as S set by bitbake.conf in oe-core now works.') | ||
1438 | |||
1439 | if '${WORKDIR}' in s_dir_orig: | ||
1440 | bb.fatal('S should be set relative to UNPACKDIR, e.g. replace WORKDIR with UNPACKDIR in "S = {}"'.format(s_dir_orig)) | ||
1441 | |||
1434 | if src_uri and not os.path.exists(s_dir): | 1442 | if src_uri and not os.path.exists(s_dir): |
1435 | bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir)) | 1443 | bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN'), d.getVar('S', False), s_dir)) |
1436 | } | 1444 | } |