diff --git a/meta-openeuler/classes/oebridge.bbclass b/meta-openeuler/classes/oebridge.bbclass index 607b4b4b96f22bab0c303484e65127e8df3c1aa7..3f6df5dd4cfb9f5da00ef33ec63add00ca7bf2b4 100644 --- a/meta-openeuler/classes/oebridge.bbclass +++ b/meta-openeuler/classes/oebridge.bbclass @@ -2,7 +2,7 @@ python(){ import os import subprocess - repo_name = d.getVar('OPENEULER_LOCAL_NAME') + repo_name = d.getVar('OPENEULER_LOCAL_DIR') src_dir = d.getVar('OPENEULER_SP_DIR') repo_dir = os.path.join(src_dir, repo_name) diff --git a/meta-openeuler/classes/oee-archive.bbclass b/meta-openeuler/classes/oee-archive.bbclass index 4984d2168ee55b39ca9b4ff0e64b18b5e1488c33..14c76fa9e9e2ed7416e589154c32f8a78a2ccfc7 100644 --- a/meta-openeuler/classes/oee-archive.bbclass +++ b/meta-openeuler/classes/oee-archive.bbclass @@ -7,7 +7,7 @@ OPENEULER_LOCAL_NAME = "oee_archive" OEE_ARCHIVE_SUB_DIR ?= "${BPN}" # for real file path to search is ${OPENEULER_LOCAL_NAME}/${OEE_ARCHIVE_SUB_DIR}, # not OPENEULER_LOCAL_NAME. -OPENEULER_DL_DIR = "${OPENEULER_SP_DIR}/${OPENEULER_LOCAL_NAME}/${OEE_ARCHIVE_SUB_DIR}" +OPENEULER_LOCAL_DIR = "${OPENEULER_LOCAL_NAME}/${OEE_ARCHIVE_SUB_DIR}" # oee-archive.bbclass is always inherited in .bbappend file, # this will cause the waring of QA "native-last" diff --git a/meta-openeuler/classes/openeuler.bbclass b/meta-openeuler/classes/openeuler.bbclass index 888377f415656d03529b6449ba7862db8d48d138..df103b3f574d7f5465754f84ffbf0ae1f18bb6dd 100644 --- a/meta-openeuler/classes/openeuler.bbclass +++ b/meta-openeuler/classes/openeuler.bbclass @@ -26,12 +26,12 @@ LDFLAGS:toolchain-clang:class-native = "${BUILD_LDFLAGS}" TOOLCHAIN:class-native = "gcc" # for openeuler embedded it is no need to create DL_DIR, here we use -# ${OPENEULER_SP_DIR}/${OPENEULER_LOCAL_NAME} to represent download +# ${OPENEULER_SP_DIR}/${OPENEULER_LOCAL_DIR} to represent download # directory for each software package. OPENEULER_SP_DIR -# is already created, and OPENEULER_LOCAL_NAME will be created +# is already created, and OPENEULER_LOCAL_DIR will be created # in openeuler_fetch or fetch # Thus, overrides the definition in base.bbclass -do_fetch[dirs] = "${OPENEULER_SP_DIR}" +do_fetch[dirs] = "${OPENEULER_DL_DIR}" # we can't use poky's original get_checksum_file_list in base.bbclass # because of the src repo organization and special handling of DL_DIR @@ -47,6 +47,9 @@ def openeuler_get_checksum_file_list(d): fetch = bb.fetch2.Fetch([], d, cache = False, localonly = True) dl_dir = d.getVar('OPENEULER_DL_DIR') + local_name = d.getVar('OPENEULER_LOCAL_DIR') + dl_path = os.path.join(dl_dir, local_name) + filelist = [] for u in fetch.urls: if u.startswith("file://"): @@ -54,7 +57,7 @@ def openeuler_get_checksum_file_list(d): if ud: paths = ud.method.localpaths(ud, d) for f in paths: - if os.path.exists(f) and not f.startswith(dl_dir): + if os.path.exists(f) and not f.startswith(dl_path): filelist.append(f + ":True") return " ".join(filelist) @@ -197,7 +200,7 @@ python do_openeuler_fetch() { def openeuler_fetch(d, repo_name): # get source directory where to download - src_dir = d.getVar('OPENEULER_SP_DIR') + src_dir = d.getVar('OPENEULER_DL_DIR') # local download path repo_dir = os.path.join(src_dir, repo_name) @@ -213,11 +216,11 @@ python do_openeuler_fetch() { except GitError as e: bb.fatal("could not find or init gitee repository %s because %s" % (repo_name, str(e))) except Exception as e: - bb.fatal("do_openeuler_fetch failed: OPENEULER_SP_DIR %s OPENEULER_LOCAL_NAME %s exception %s" % (src_dir, repo_name, str(e))) + bb.fatal("do_openeuler_fetch failed: OPENEULER_DL_DIR %s OPENEULER_LOCAL_NAME %s exception %s" % (src_dir, repo_name, str(e))) repo_list = d.getVar("OPENEULER_REPO_NAMES").split() - if d.getVar("OPENEULER_LOCAL_NAME"): - repo_list.append(d.getVar("OPENEULER_LOCAL_NAME")) + if d.getVar("OPENEULER_LOCAL_DIR"): + repo_list.append(d.getVar("OPENEULER_LOCAL_DIR")) for repo_name in repo_list: # download code from openEuler openeuler_fetch(d, repo_name) @@ -362,8 +365,8 @@ python do_openeuler_clean() { except: return False - src_dir = d.getVar('OPENEULER_SP_DIR') - repo_name = d.getVar("OPENEULER_LOCAL_NAME") + src_dir = d.getVar('OPENEULER_DL_DIR') + repo_name = d.getVar('OPENEULER_LOCAL_DIR') repo_dir = os.path.join(src_dir, repo_name) remove_lock(repo_dir) } diff --git a/meta-openeuler/classes/openeuler_source.bbclass b/meta-openeuler/classes/openeuler_source.bbclass index 7d9f176c1194442ccdf40a940b1ffcd4fa2bc53e..e8243d73cf0603146b160ff7a536fefbf6130455 100644 --- a/meta-openeuler/classes/openeuler_source.bbclass +++ b/meta-openeuler/classes/openeuler_source.bbclass @@ -17,7 +17,7 @@ def openeuler_set_version(d): def openeuler_set_localname(d): new_localname = openeuler_get_item(d, 'localname', "") if new_localname: - d.setVar('OPENEULER_LOCAL_NAME', '%s' % new_localname) + d.setVar('OPENEULER_LOCAL_DIR', '%s' % new_localname) def openeuler_get_item(d, key, default_value): pkg_name = d.getVar('BPN') diff --git a/meta-openeuler/conf/distro/openeuler.conf b/meta-openeuler/conf/distro/openeuler.conf index 1b8cdc8ce795931d7c1174c9137153a5ba800e4a..ebd09d58f33e75564f745a98b6c86ee3dcef36a6 100644 --- a/meta-openeuler/conf/distro/openeuler.conf +++ b/meta-openeuler/conf/distro/openeuler.conf @@ -105,9 +105,10 @@ do_fetch[number_threads] = "4" OPENEULER_SRC_URI_REMOVE ?= "https git http" # do not use default download dir, use openeuler's configuration OPENEULER_LOCAL_NAME ?= "${BPN}" +OPENEULER_LOCAL_DIR ?= "${OPENEULER_LOCAL_NAME}" # use OPENEULER_REPO_NAMES to match the content of the manifest.yaml file for downloading the code OPENEULER_REPO_NAMES ?= "${OPENEULER_LOCAL_NAME}" -OPENEULER_DL_DIR ?= "${OPENEULER_SP_DIR}/${OPENEULER_LOCAL_NAME}" +OPENEULER_DL_DIR ?= "${OPENEULER_SP_DIR}/oedownloads" DL_DIR ?= "${OPENEULER_SP_DIR}/downloads" # for all .bb file, OPENEULER_SP_DIR will be included # in file path. @@ -127,8 +128,8 @@ DL_DIR ?= "${OPENEULER_SP_DIR}/downloads" # if you want yocto's path has a higher priority # than openeuler's path, then comment FILESEXTRAPATHS lines, # and use FILEPATH lines +FILESEXTRAPATHS:prepend = "${OPENEULER_DL_DIR}/${OPENEULER_LOCAL_DIR}:" FILESEXTRAPATHS:prepend = "${OPENEULER_DL_DIR}:" -FILESEXTRAPATHS:prepend = "${OPENEULER_SP_DIR}:" # cache SRCREV during parsing, so the SRCREV will not be affected by the # changes in manifest.yaml, this will save some parsing time when bitbake runs # if you need SRCREV to always follow changes in manifest.yaml, pls set