提交 c2c7336b 编写于 作者: T tuitang00 提交者: LINGuanRen

3.1.x_opensource_release support obd 3.1.x_opensource_release support obd...

3.1.x_opensource_release support obd 3.1.x_opensource_release support obd 3.1.x_opensource_release support obd
上级 21564ec6
......@@ -103,42 +103,78 @@ fi
mkdir "${PWD}/pkg" >/dev/null 2>&1
echo -e "check repository address in profile... \c"
REPO="$(grep -Po '(?<=repo=).*' "${DEP_FILE}" 2>/dev/null)"
if [[ $? -eq 0 ]]; then
echo "$REPO"
else
echo "NOT FOUND" 1>&2
exit 3
fi
echo "download dependencies..."
RPMS="$(grep '\.rpm' "${DEP_FILE}" | grep -Pv '^#')"
declare -A targets
declare -A packages
section="default"
content=""
function save_content {
if [[ "$content" != "" ]]
then
if [[ $(echo "$section" | grep -E "^target\-") != "" ]]
then
target_name=$(echo $section | sed 's|^target\-\(.*\)$|\1|g')
targets["$target_name"]="$(echo "${content["$section"]}" | grep -Eo "repo=.*" | awk -F '=' '{ print $2 }')"
echo "target: $target_name, repo: ${targets["$target_name"]}"
else
packages["$section"]=$content
fi
fi
}
echo -e "check repository address in profile..."
for pkg in $RPMS
while read -r line
do
if [[ -f "${PWD}/pkg/${pkg}" ]]; then
echo "find package <${pkg}> in cache"
else
echo -e "download package <${pkg}>... \c"
TEMP=$(mktemp -p "/" -u ".${pkg}.XXXX")
wget "$REPO/${pkg}" -q -O "${PWD}/pkg/${TEMP}"
if [[ $? -eq 0 ]]; then
mv -f "${PWD}/pkg/$TEMP" "${PWD}/pkg/${pkg}"
echo "SUCCESS"
if [[ $(echo "$line" | grep -E "\[.*\]") != "" ]]
then
save_content
content=""
# section=${line//\[\(.*\)\]/\1}
section=$(echo $line | sed 's|.*\[\(.*\)\].*|\1|g')
else
rm -rf "${PWD}/pkg/$TEMP"
echo "FAILED" 1>&2
exit 4
[[ "$line" != "" ]] && [[ "$line" != '\#*' ]] && content+=$'\n'"$line"
fi
fi
echo -e "unpack package <${pkg}>... \c"
rpm2cpio "${PWD}/pkg/${pkg}" | cpio -di -u --quiet
if [[ $? -eq 0 ]]; then
echo "SUCCESS"
else
echo "FAILED" 1>&2
exit 5
fi
done
done < oceanbase.el7.x86_64.deps
save_content
echo "download dependencies..."
for sect in "${!packages[@]}"
do
if [[ "$1" != "all" ]]
then
[[ "$sect" == "test-utils" ]] && continue
fi
echo "${packages["$sect"]}" | while read -r line
do
[[ "$line" == "" ]] && continue
pkg=${line%%\ *}
target_name="default"
temp=$(echo "$line" | grep -Eo "target=(\S*)")
[[ "$temp" != "" ]] && target_name=${temp#*=}
if [[ -f "${PWD}/pkg/${pkg}" ]]; then
echo "find package <${pkg}> in cache"
else
echo -e "download package <${pkg}>... \c"
repo=${targets["$target_name"]}
TEMP=$(mktemp -p "/" -u ".${pkg}.XXXX")
wget "$repo/${pkg}" -q -O "${PWD}/pkg/${TEMP}"
if (( $? == 0 )); then
mv -f "${PWD}/pkg/$TEMP" "${PWD}/pkg/${pkg}"
echo "SUCCESS"
else
rm -rf "${PWD}/pkg/$TEMP"
echo "FAILED" 1>&2
exit 4
fi
fi
echo -e "unpack package <${pkg}>... \c"
rpm2cpio "${PWD}/pkg/${pkg}" | cpio -di -u --quiet
if [[ $? -eq 0 ]]; then
echo "SUCCESS"
else
echo "FAILED" 1>&2
exit 5
fi
done
done
\ No newline at end of file
[target]
[target-default]
os=7
arch=aarch64
repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/7/aarch64/
......
[target]
[target-default]
os=7
arch=x86_64
repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/7/x86_64/
[deps]
devdeps-gtest-1.8.0-3.el7.x86_64.rpm
devdeps-gtest-1.8.0-3.el7.x86_64.rpm
devdeps-isa-l-static-2.22.0-3.el7.x86_64.rpm
devdeps-libcurl-static-7.29.0-3.el7.x86_64.rpm
devdeps-libunwind-static-1.5.0-3.el7.x86_64.rpm
devdeps-mariadb-connector-c-3.1.12-3.el7.x86_64.rpm
devdeps-openssl-static-1.0.1e-3.el7.x86_64.rpm
devdeps-openssl-static-1.0.1e-3.el7.x86_64.rpm
devdeps-libaio-0.3.112-3.el7.x86_64.rpm
devdeps-rapidjson-1.1.0-1.el7.x86_64.rpm
......@@ -21,3 +21,4 @@ obdevtools-cmake-3.20.2-3.el7.x86_64.rpm
obdevtools-flex-2.5.35-3.el7.x86_64.rpm
obdevtools-gcc-5.2.0-3.el7.x86_64.rpm
obdevtools-llvm-11.0.1-3.el7.x86_64.rpm
[target]
[target-default]
os=8
arch=x86_64
repo=http://mirrors.aliyun.com/oceanbase/development-kit/el/8/x86_64/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册