diff options
author | 2020-11-02 11:07:33 +0900 | |
---|---|---|
committer | 2020-11-02 11:07:33 +0900 | |
commit | 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch) | |
tree | cd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-openembedded/meta-oe/classes | |
parent | 4204309872da5cb401cbb2729d9e2d4869a87f42 (diff) |
basesystem-jjsandbox/ToshikazuOhiwa/master-jj
recipes
Diffstat (limited to 'external/meta-openembedded/meta-oe/classes')
5 files changed, 30 insertions, 19 deletions
diff --git a/external/meta-openembedded/meta-oe/classes/breakpad.bbclass b/external/meta-openembedded/meta-oe/classes/breakpad.bbclass index 36f11ff4..cebe559a 100644 --- a/external/meta-openembedded/meta-oe/classes/breakpad.bbclass +++ b/external/meta-openembedded/meta-oe/classes/breakpad.bbclass @@ -25,6 +25,9 @@ PACKAGE_PREPROCESS_FUNCS += "breakpad_package_preprocess" breakpad_package_preprocess () { mkdir -p ${PKGD}/usr/share/breakpad-syms find ${D} -name ${BREAKPAD_BIN} -exec sh -c "dump_syms {} > ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym" \; + HASH=$(head -n1 ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym | rev | cut -d ' ' -f2 | rev) + mkdir -p ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH} + mv ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}.sym ${PKGD}/usr/share/breakpad-syms/${BREAKPAD_BIN}/${HASH} } PACKAGES =+ "${PN}-breakpad" diff --git a/external/meta-openembedded/meta-oe/classes/gitpkgv.bbclass b/external/meta-openembedded/meta-oe/classes/gitpkgv.bbclass index 2d9680a3..180421ed 100644 --- a/external/meta-openembedded/meta-oe/classes/gitpkgv.bbclass +++ b/external/meta-openembedded/meta-oe/classes/gitpkgv.bbclass @@ -7,8 +7,8 @@ # NN equals the total number of revs up to SRCREV # GITHASH is SRCREV's (full) hash # -# - GITPKGVTAG which is the output of 'git describe' allowing for -# automatic versioning +# - GITPKGVTAG which is the output of 'git describe --tags --exact-match' +# allowing for automatic versioning # # gitpkgv.bbclass assumes the git repository has been cloned, and # contains SRCREV. So ${GITPKGV} and ${GITPKGVTAG} should never be @@ -40,10 +40,16 @@ GITPKGV = "${@get_git_pkgv(d, False)}" GITPKGVTAG = "${@get_git_pkgv(d, True)}" -def gitpkgv_drop_tag_prefix(version): +# This regexp is used to drop unwanted parts of the found tags. Any matching +# groups will be concatenated to yield the final version. +GITPKGV_TAG_REGEXP ??= "v(\d.*)" + +def gitpkgv_drop_tag_prefix(d, version): import re - if re.match("v\d", version): - return version[1:] + + m = re.match(d.getVar('GITPKGV_TAG_REGEXP'), version) + if m: + return ''.join(group for group in m.groups() if group) else: return version @@ -87,10 +93,8 @@ def get_git_pkgv(d, use_tags): if not os.path.exists(rev_file) or os.path.getsize(rev_file)==0: commits = bb.fetch2.runfetchcmd( - "cd %(repodir)s && " - "git rev-list %(rev)s -- 2> /dev/null " - "| wc -l" % vars, - d, quiet=True).strip().lstrip('0') + "git --git-dir=%(repodir)s rev-list %(rev)s -- 2>/dev/null | wc -l" + % vars, d, quiet=True).strip().lstrip('0') if commits != "": oe.path.remove(rev_file, recurse=False) @@ -105,10 +109,9 @@ def get_git_pkgv(d, use_tags): if use_tags: try: output = bb.fetch2.runfetchcmd( - "cd %(repodir)s && " - "git describe %(rev)s 2>/dev/null" % vars, - d, quiet=True).strip() - ver = gitpkgv_drop_tag_prefix(output) + "git --git-dir=%(repodir)s describe %(rev)s --tags --exact-match 2>/dev/null" + % vars, d, quiet=True).strip() + ver = gitpkgv_drop_tag_prefix(d, output) except Exception: ver = "0.0-%s-g%s" % (commits, vars['rev'][:7]) else: diff --git a/external/meta-openembedded/meta-oe/classes/gitver.bbclass b/external/meta-openembedded/meta-oe/classes/gitver.bbclass index 07f44c34..cab850c7 100644 --- a/external/meta-openembedded/meta-oe/classes/gitver.bbclass +++ b/external/meta-openembedded/meta-oe/classes/gitver.bbclass @@ -48,7 +48,7 @@ def get_git_hash(d): srcdir = d.getVar("EXTERNALSRC") or d.getVar("S") gitdir = os.path.abspath(os.path.join(srcdir, ".git")) try: - rev = gitrev_run("git rev-list HEAD -1") + rev = gitrev_run("git rev-list HEAD -1", gitdir) return rev[:7] except Exception as exc: bb.fatal(str(exc)) diff --git a/external/meta-openembedded/meta-oe/classes/itstool.bbclass b/external/meta-openembedded/meta-oe/classes/itstool.bbclass new file mode 100644 index 00000000..45e3fb83 --- /dev/null +++ b/external/meta-openembedded/meta-oe/classes/itstool.bbclass @@ -0,0 +1,5 @@ +# helper class to prepare correct environment for native itstool + +inherit python3native + +DEPENDS_append = " itstool-native" diff --git a/external/meta-openembedded/meta-oe/classes/scancode.bbclass b/external/meta-openembedded/meta-oe/classes/scancode.bbclass index 701660f5..e0f0dbca 100644 --- a/external/meta-openembedded/meta-oe/classes/scancode.bbclass +++ b/external/meta-openembedded/meta-oe/classes/scancode.bbclass @@ -3,18 +3,18 @@ # For more informaiton https://github.com/nexB/scancode-toolkit SCANCODE_FORMAT ?= "html-app" -EXT = "${@'html' if d.getVar('SCANCODE_FORMAT', True) == 'html-app' else 'json'}" +EXT = "${@'html' if d.getVar('SCANCODE_FORMAT') == 'html-app' else 'json'}" SCANCODE_TOOLKIT = "${@get_scancode_toolkit(d)}" SCANCODE_TAG = "v2.2.1" SCANCODE_GIT_LOCATION ?= "https://github.com/nexB/scancode-toolkit.git" SCANCODE_SRC_LOCATION ?= "${DL_DIR}/scancode" def get_scancode_toolkit(d): - lf = bb.utils.lockfile(d.getVar('SCANCODE_SRC_LOCATION', True) + ".lock") - if (not os.path.exists(d.getVar('SCANCODE_SRC_LOCATION', True))): - os.system("git clone %s %s -b %s" % (d.getVar('SCANCODE_GIT_LOCATION', True), d.getVar('SCANCODE_SRC_LOCATION', True), d.getVar('SCANCODE_TAG', True))) + lf = bb.utils.lockfile(d.getVar('SCANCODE_SRC_LOCATION') + ".lock") + if (not os.path.exists(d.getVar('SCANCODE_SRC_LOCATION'))): + os.system("git clone %s %s -b %s" % (d.getVar('SCANCODE_GIT_LOCATION'), d.getVar('SCANCODE_SRC_LOCATION'), d.getVar('SCANCODE_TAG'))) bb.utils.unlockfile(lf) - return (d.getVar('SCANCODE_SRC_LOCATION', True)) + return (d.getVar('SCANCODE_SRC_LOCATION')) do_scancode() { mkdir -p ${DEPLOY_DIR_IMAGE}/scancode |