mock-rocky-configs/deploy.sh

74 lines
1.7 KiB
Bash
Raw Normal View History

2024-04-15 08:31:51 +00:00
#!/bin/bash
# Deploys mock config files to a user's config directory
# Latest Versions
2024-05-22 06:29:07 +00:00
GREEN_OBSIDIAN=10
2024-04-30 16:20:02 +00:00
BLUE_ONYX=4
2024-04-15 08:31:51 +00:00
#RED_QUARTZ=0
GREEN_OBSIDIAN_ARCH=(x86_64 aarch64 i686)
BLUE_ONYX_ARCH=(x86_64 aarch64 i686 ppc64le s390x)
RED_QUARTZ_ARCH=(x86_64 aarch64 ppc64le s390x)
# vars
MOCK_DIR="${HOME}/.config/mock"
# funcs
function is_in_path() {
builtin type -P "${1}"
}
is_in_path mock &> /dev/null
ret_val=$?
if [ "$ret_val" -ne "0" ]; then
echo "Mock was not found. Is it installed?"
echo "Please install using your package manager."
exit 34
fi
2024-04-15 08:31:51 +00:00
mkdir -p "${MOCK_DIR}/templates"
cp etc/mock/templates/*.tpl "${MOCK_DIR}/templates"
# green obsidian
number=4
while [[ $number -le $(( GREEN_OBSIDIAN - 1 )) ]]; do
for arch in "${GREEN_OBSIDIAN_ARCH[@]}"; do
2024-04-30 16:20:02 +00:00
sed "s|8\.X|8.$number|g" "etc/mock/rl-8.X-${arch}.cfg" > "${MOCK_DIR}/rl-8.$number-${arch}.cfg"
2024-04-15 08:31:51 +00:00
done
(( number = number + 1 ))
done
for arch in "${GREEN_OBSIDIAN_ARCH[@]}"; do
2024-04-30 16:20:02 +00:00
cp "etc/mock/rl-8-${arch}.cfg" "${MOCK_DIR}"
cp "etc/mock/rl-8-koji-${arch}.cfg" "${MOCK_DIR}"
2024-04-15 08:31:51 +00:00
done
# blue onyx
number=0
while [[ $number -le $(( BLUE_ONYX - 1 )) ]]; do
for arch in "${BLUE_ONYX_ARCH[@]}"; do
2024-04-30 16:20:02 +00:00
sed "s|9\.X|9.$number|g" "etc/mock/rl-9.X-${arch}.cfg" > "${MOCK_DIR}/rl-9.$number-${arch}.cfg"
2024-04-15 08:31:51 +00:00
done
(( number = number + 1 ))
done
for arch in "${BLUE_ONYX_ARCH[@]}"; do
2024-04-30 16:20:02 +00:00
cp "etc/mock/rl-9-${arch}.cfg" "${MOCK_DIR}"
2024-04-15 08:31:51 +00:00
done
2024-04-23 22:02:25 +00:00
# core infra repos
for arch in "${BLUE_ONYX_ARCH[@]}"; do
2024-04-30 16:20:02 +00:00
if [[ "${arch}" == "i686" ]]; then
2024-04-23 22:03:11 +00:00
continue
fi
2024-04-30 16:20:02 +00:00
cp "etc/mock/rl-9-${arch}-core-infra.cfg" "${MOCK_DIR}"
2024-04-23 22:02:25 +00:00
done
2024-04-15 08:31:51 +00:00
# red quartz
for arch in "${RED_QUARTZ_ARCH[@]}"; do
2024-04-30 16:20:02 +00:00
cp "etc/mock/rl-10-lookahead-${arch}.cfg" "${MOCK_DIR}"
2024-04-15 08:31:51 +00:00
done
sed -i "s|templates/|${MOCK_DIR}/templates/|g" "${MOCK_DIR}/"*.cfg