diff options
Diffstat (limited to 'meta/classes-global')
-rw-r--r-- | meta/classes-global/base.bbclass | 14 | ||||
-rw-r--r-- | meta/classes-global/insane.bbclass | 8 | ||||
-rw-r--r-- | meta/classes-global/sstate.bbclass | 32 |
3 files changed, 30 insertions, 24 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" |
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 | } |
diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass index 1d7b033b80..53bc2e3940 100644 --- a/meta/classes-global/sstate.bbclass +++ b/meta/classes-global/sstate.bbclass | |||
@@ -726,7 +726,6 @@ def pstaging_fetch(sstatefetch, d): | |||
726 | localdata = bb.data.createCopy(d) | 726 | localdata = bb.data.createCopy(d) |
727 | 727 | ||
728 | dldir = localdata.expand("${SSTATE_DIR}") | 728 | dldir = localdata.expand("${SSTATE_DIR}") |
729 | bb.utils.mkdirhier(dldir) | ||
730 | 729 | ||
731 | localdata.delVar('MIRRORS') | 730 | localdata.delVar('MIRRORS') |
732 | localdata.setVar('FILESPATH', dldir) | 731 | localdata.setVar('FILESPATH', dldir) |
@@ -746,16 +745,19 @@ def pstaging_fetch(sstatefetch, d): | |||
746 | if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False): | 745 | if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False): |
747 | uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)] | 746 | uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)] |
748 | 747 | ||
749 | for srcuri in uris: | 748 | with bb.utils.umask(bb.utils.to_filemode(d.getVar("OE_SHARED_UMASK"))): |
750 | localdata.delVar('SRC_URI') | 749 | bb.utils.mkdirhier(dldir) |
751 | localdata.setVar('SRC_URI', srcuri) | ||
752 | try: | ||
753 | fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) | ||
754 | fetcher.checkstatus() | ||
755 | fetcher.download() | ||
756 | 750 | ||
757 | except bb.fetch2.BBFetchException: | 751 | for srcuri in uris: |
758 | pass | 752 | localdata.delVar('SRC_URI') |
753 | localdata.setVar('SRC_URI', srcuri) | ||
754 | try: | ||
755 | fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) | ||
756 | fetcher.checkstatus() | ||
757 | fetcher.download() | ||
758 | |||
759 | except bb.fetch2.BBFetchException: | ||
760 | pass | ||
759 | 761 | ||
760 | def sstate_setscene(d): | 762 | def sstate_setscene(d): |
761 | shared_state = sstate_state_fromvars(d) | 763 | shared_state = sstate_state_fromvars(d) |
@@ -774,9 +776,10 @@ sstate_task_prefunc[dirs] = "${WORKDIR}" | |||
774 | python sstate_task_postfunc () { | 776 | python sstate_task_postfunc () { |
775 | shared_state = sstate_state_fromvars(d) | 777 | shared_state = sstate_state_fromvars(d) |
776 | 778 | ||
777 | omask = os.umask(0o002) | 779 | shared_umask = bb.utils.to_filemode(d.getVar("OE_SHARED_UMASK")) |
778 | if omask != 0o002: | 780 | omask = os.umask(shared_umask) |
779 | bb.note("Using umask 0o002 (not %0o) for sstate packaging" % omask) | 781 | if omask != shared_umask: |
782 | bb.note("Using umask %0o (not %0o) for sstate packaging" % (shared_umask, omask)) | ||
780 | sstate_package(shared_state, d) | 783 | sstate_package(shared_state, d) |
781 | os.umask(omask) | 784 | os.umask(omask) |
782 | 785 | ||
@@ -841,7 +844,8 @@ python sstate_create_and_sign_package () { | |||
841 | 844 | ||
842 | # Create the required sstate directory if it is not present. | 845 | # Create the required sstate directory if it is not present. |
843 | if not sstate_pkg.parent.is_dir(): | 846 | if not sstate_pkg.parent.is_dir(): |
844 | with bb.utils.umask(0o002): | 847 | shared_umask = bb.utils.to_filemode(d.getVar("OE_SHARED_UMASK")) |
848 | with bb.utils.umask(shared_umask): | ||
845 | bb.utils.mkdirhier(str(sstate_pkg.parent)) | 849 | bb.utils.mkdirhier(str(sstate_pkg.parent)) |
846 | 850 | ||
847 | if sign_pkg: | 851 | if sign_pkg: |