1 Star 0 Fork 0

Whoisxiang/mysql

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
versions.sh 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env bash
set -Eeuo pipefail
defaultDebianSuite='buster'
declare -A debianSuites=(
[5.6]='stretch'
)
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then
versions=( *.*/ )
json='{}'
else
json="$(< versions.json)"
fi
versions=( "${versions[@]%/}" )
for version in "${versions[@]}"; do
export version
debianSuite="${debianSuites[$version]:-$defaultDebianSuite}"
debianVersion="$(
curl -fsSL "https://repo.mysql.com/apt/debian/dists/$debianSuite/mysql-$version/binary-amd64/Packages.gz" \
| gunzip \
| awk -F ': ' '
$1 == "Package" {
pkg = $2
next
}
pkg == "mysql-server" && $1 == "Version" {
print $2
}
'
)"
# example 8.0.22-1debian10 => 8.0.22
baseVersion="${debianVersion%-*}"
export baseVersion debianSuite debianVersion
json="$(
jq <<<"$json" -c \
'.[env.version] = {
version: env.baseVersion,
debian: {
architectures: [ "amd64" ],
suite: env.debianSuite,
version: env.debianVersion,
},
}'
)"
done
jq <<<"$json" -S . > versions.json
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiang1/mysql.git
git@gitee.com:xiang1/mysql.git
xiang1
mysql
mysql
master

搜索帮助