From 82cbed32fa262d2be66d99dde43a8b040d1df51f Mon Sep 17 00:00:00 2001 From: alichinese Date: Fri, 27 Oct 2023 11:27:22 +0800 Subject: [PATCH] openeuler_fetch: optimize openeuler fetch logic * the param OPENEULER_FETCH is to controller download from gitee, but we used it in base_do_fetch, thus the linux-openeuler's fetch that used openeuler_fetch direct will not be affected by OPENEULER_FETCH, so we move it in openeuler_fetch function, and let OPENEULER_FETCH can be used in any where Signed-off-by: alichinese --- meta-openeuler/classes/openeuler.bbclass | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meta-openeuler/classes/openeuler.bbclass b/meta-openeuler/classes/openeuler.bbclass index 2dca6721e1c..c96987a4d1a 100644 --- a/meta-openeuler/classes/openeuler.bbclass +++ b/meta-openeuler/classes/openeuler.bbclass @@ -130,6 +130,11 @@ python do_openeuler_fetch() { import git from git import GitError + # if we set OPENEULER_FETCH to disable in local.conf or bb file, + # we will do nothing + if d.getVar('OPENEULER_FETCH') == "disable": + return + # get source directory where to download srcDir = d.getVar('OPENEULER_SP_DIR') repoName = d.getVar('OPENEULER_REPO_NAME') @@ -229,8 +234,7 @@ def get_manifest(manifest_dir): # if success, other part of base_do_fetch will skip download as # files are already downloaded by do_openeuler_fetch python base_do_fetch:prepend() { - if not d.getVar('OPENEULER_FETCH') or d.getVar('OPENEULER_FETCH') == "enable": - bb.build.exec_func("do_openeuler_fetch", d) + bb.build.exec_func("do_openeuler_fetch", d) } python do_openeuler_clean() { -- Gitee