toolkit/sync/sign-repos-only.sh

87 lines
3.3 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"
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"
2021-07-12 06:58:08 +00:00
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/source/tree/repodata/repomd.xml"
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"
2021-07-12 06:58:08 +00:00
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/${z}/repodata/repomd.xml"
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"
2021-07-12 06:58:08 +00:00
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/debug/tree/repodata/repomd.xml"
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"
2021-07-12 06:58:08 +00:00
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml"
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
test -f /root/bin/sign-repo.sh && /root/bin/sign-repo.sh \
"${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os/repodata/repomd.xml"
else
echo "${STAGING_ROOT}/${RELEASE_DIR}/${y}/${x}/os does not exist"
fi
done
done