From 44bc6314b630a5fbf31e48dc14da0bd4edc7f2ac Mon Sep 17 00:00:00 2001 From: wangchong1995924 <15229716099@163.com> Date: Wed, 18 Jan 2023 15:26:21 +0800 Subject: [PATCH] support obs master more projects --- script/common_function.sh | 2 +- script/setup_env.sh | 56 ++++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/script/common_function.sh b/script/common_function.sh index 4aa6aa2..98aa1f0 100644 --- a/script/common_function.sh +++ b/script/common_function.sh @@ -85,7 +85,7 @@ function run_srcipt_all() done } -source "${BUILD_SCRIPT_DIR}"/setup_env.sh +#source "${BUILD_SCRIPT_DIR}"/setup_env.sh source "${BUILD_SCRIPT_DIR}"/make_tools/init.sh source "${BUILD_SCRIPT_DIR}"/make_tools/common.sh #source "${BUILD_SCRIPT_DIR}"/make_tools/container_tools.sh diff --git a/script/setup_env.sh b/script/setup_env.sh index 4ed8356..c7a5c8d 100644 --- a/script/setup_env.sh +++ b/script/setup_env.sh @@ -32,6 +32,16 @@ export OBS_EXTRAS_REPO_URL="http://${OBS_SERVER_IP}:82/${SUB_EXTRAS_REPO_URL}/st export OBS_BRINGINRELY_URL= export OBS_STANDARD_THIRD_REPO_URL= +obs_master_project=(openEuler:BaseTools openEuler:C openEuler:Common_Languages_Dependent_Tools openEuler:Erlang openEuler:Golang openEuler:Java openEuler:KernelSpace openEuler:Lua openEuler:Meson openEuler:MultiLanguage openEuler:Nodejs openEuler:Ocaml openEuler:Perl openEuler:Python openEuler:Qt openEuler:Ruby) +if [[ ${OBS_STANDARD_PROJECT} == "openEuler:Mainline" ]];then + for p in ${obs_master_project[@]} + do + tmp="$(echo ${p//:/:\/})" + tmp_url="http://${OBS_SERVER_IP}:82/${tmp}/standard_${ARCH}" + TMP_STANDARD_REPO_URL="${tmp_url} ${TMP_STANDARD_REPO_URL}" + done + export OBS_STANDARD_REPO_URL="${TMP_STANDARD_REPO_URL}${OBS_STANDARD_REPO_URL}" +fi export RELEASE_ROOT_PATH="/repo/openeuler/dailybuild" export RELEASE_VERSION_DIR="${OS_NAME}-${OS_VERSION}" @@ -53,7 +63,7 @@ export jenkins_build="1" export checkdep=true OBS_REPO_CONF=$(find -iname "obs-repo.conf") -cat>${OBS_REPO_CONF}<${OBS_REPO_CONF}<<-EOF [main] cachedir=/var/cache/yum/xxx keepcache=0 @@ -66,24 +76,6 @@ plugins=1 installonly_limit=3 reposdir=/xxx -# This is the default, if you make this bigger yum won't see if the metadata -# is newer on the remote and so you'll "gain" the bandwidth of not having to -# download the new metadata and "pay" for it by yum not having correct -# information. -# It is esp. important, to have correct metadata, for distributions like -# Fedora which don't keep old packages around. If you don't like this checking -# interupting your command line usage, it's much better to have something -# manually check the metadata once an hour (yum-updatesd will do this). -# metadata_expire=90m - -# PUT YOUR REPOS HERE OR IN separate files named file.repo -# in /etc/yum.repos.d -[obs-standard] -name=obs-standard -baseurl=${OBS_STANDARD_REPO_URL}/ -enabled=1 -gpgcheck=0 - [obs-Extras] name=obs-Extras baseurl=${OBS_EXTRAS_REPO_URL}/ @@ -97,6 +89,28 @@ enabled=1 gpgcheck=0 EOF - +if [[ ${OBS_STANDARD_PROJECT} == "openEuler:Mainline" ]];then + i=1 + for repo_url in ${OBS_STANDARD_REPO_URL[@]} + do + repo_name="obs_standard_${i}" + cat>>${OBS_REPO_CONF}<<-EOF + [${repo_name}] + name=${repo_name} + baseurl=${repo_url}/ + enabled=1 + gpgcheck=0 + + EOF + let i+=1 + done +else + cat>>${OBS_REPO_CONF}<<-EOF + [obs-standard] + name=obs-standard + baseurl=${OBS_STANDARD_REPO_URL}/ + enabled=1 + gpgcheck=0 + EOF +fi cat ${OBS_REPO_CONF} - -- Gitee