toolkit/sync/sign-repos-only.sh

83 lines
3.1 KiB
Bash
Raw Normal View History

2021-07-12 06:58:08 +00:00
#!/bin/bash
# Signs repo metadata only
# shellcheck disable=SC2046,1091,1090
source "$(dirname "$0")/common"
2024-12-19 10:37:23 +00:00
MAJ=${RLVER}
2021-07-12 06:58:08 +00:00
echo "** Signing source repos"
for y in "${ALL_REPOS[@]}"; do
test -d "${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree"
ret_val=$?
if [ "$ret_val" -eq 0 ]; then
2021-08-05 17:17:39 +00:00
sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree/repodata/repomd.xml"
2024-12-18 06:03:45 +00:00
sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree/repodata/repomd.xml" "${MAJ}"
2021-07-12 06:58:08 +00:00
else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree does not exist"
fi
done
# Sync up some stuff
echo "** Signing arch repos as necessary **"
for x in "${ARCHES[@]}"; do
# regular repos, no comps
for y in "${NONMODS_REPOS[@]}"; do
# os and debug/tree directories
2021-09-14 15:52:12 +00:00
for z in os debug/tree kickstart; do
2021-07-12 06:58:08 +00:00
test -d "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z}"
ret_val=$?
if [ "$ret_val" -eq 0 ]; then
2021-08-05 17:17:39 +00:00
sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z}/repodata/repomd.xml"
2024-12-18 06:03:45 +00:00
sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z}/repodata/repomd.xml" "${MAJ}"
2021-07-12 06:58:08 +00:00
else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z} does not exist"
fi
done
done
# repos with comps/groups involved, but only debug
for y in "${MODS_REPOS[@]}"; do
test -d "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree"
ret_val=$?
if [ "$ret_val" -eq 0 ]; then
2021-08-05 17:17:39 +00:00
sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree/repodata/repomd.xml"
2024-12-18 06:03:45 +00:00
sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree/repodata/repomd.xml" "${MAJ}"
2021-07-12 06:58:08 +00:00
else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree does not exist"
fi
done
echo "** Sign all repos with comps/groups"
for y in "${MODS_REPOS[@]}"; do
echo "${y}: ${x}"
test -d "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os"
ret_val=$?
if [ "$ret_val" -eq 0 ]; then
2021-08-05 17:17:39 +00:00
sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml"
2021-09-14 15:52:12 +00:00
sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/kickstart/repodata/repomd.xml"
2024-12-18 06:03:45 +00:00
sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml" "${MAJ}"
2021-07-12 06:58:08 +00:00
else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os does not exist"
fi
done
echo "** Sign module repos"
for y in "${MODS[@]}"; do
test -d "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os"
ret_val=$?
if [ "$ret_val" -eq 0 ]; then
2021-08-05 17:17:39 +00:00
sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml"
2021-09-14 15:52:12 +00:00
sed -i '/<open-size><\/open-size>/d' \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/kickstart/repodata/repomd.xml"
2021-07-12 06:58:08 +00:00
# This might not be necessary, but it does not hurt incase repomd is modified
2024-12-18 06:03:45 +00:00
sign_data "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml" "${MAJ}"
2021-07-12 06:58:08 +00:00
else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os does not exist"
fi
done
done