816ff27123
To avoid hardcoding repository names and make the code more easily extendable, we now use the keys from the config file as the repository names instead of hardcoding the fixed set of names. This means most config will require updating.
44 lines
1015 B
Bash
Executable File
44 lines
1015 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eux
|
|
|
|
BASE_BASES="$(pwd)/bases"
|
|
|
|
function get_base() {
|
|
local name="$1" remote="$2" arch="$3"
|
|
local dst="$BASE_BASES/$name/$arch"
|
|
|
|
mkdir -p "$dst"
|
|
rsync -yavP --delete-after \
|
|
--exclude contents_index --exclude '*debuginfo*' \
|
|
"$remote/$arch/base" "$dst/"
|
|
}
|
|
|
|
get_base x86_64 rsync://ftp.altlinux.org/ALTLinux/Sisyphus x86_64
|
|
get_base x86_64 rsync://ftp.altlinux.org/ALTLinux/Sisyphus noarch
|
|
|
|
|
|
get_base riscv64 rsync://ftp.altlinux.org/ALTLinux/ports/riscv64/Sisyphus riscv64
|
|
get_base riscv64 rsync://ftp.altlinux.org/ALTLinux/ports/riscv64/Sisyphus noarch
|
|
|
|
|
|
cat > "$BASE_BASES/config.json" << EOF
|
|
{
|
|
"description": "Configuration for reports-secondary.office.basealt.ru",
|
|
"repos": {
|
|
"x86_64": {
|
|
"path": "$BASE_BASES/x86_64",
|
|
"arch": ["x86_64", "noarch"],
|
|
"bits": 64
|
|
},
|
|
"riscv64": {
|
|
"path": "$BASE_BASES/riscv64",
|
|
"arch": ["riscv64", "noarch"],
|
|
"bits": 64
|
|
}
|
|
}
|
|
}
|
|
EOF
|
|
|
|
python3 -im repos_cmp.repos "$BASE_BASES/config.json"
|