Add a final grep to log for "FAILED" (RLBT#0000138)

Add a final grep if exit code of reposync is 0. There are cases where
dnf reposync will say the sync succeeded despite not downloading a
package due to a failed mirror. It is a failure when a GPG key can't be
verified or some other unforeseen cirumstance... but not when a package
can't be downloaded because of "all mirrors tried"

Also added "time" to the fpsync commands for RL9 syncing.
This commit is contained in:
Louis Abel 2022-07-12 00:59:19 -07:00
parent 3207fd4ad0
commit 8017026bc8
Signed by: label
GPG Key ID: B37E62D143879B36
4 changed files with 36 additions and 2 deletions

View File

@ -5,4 +5,21 @@ set -o pipefail
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/*.repo
{{ sync_cmd }} | tee -a {{ sync_log }}
# Yes this is a bit hacky. Can't think of a better way to do this.
ret_val=$?
if [ "$ret_val" -ne 0 ]; then
echo "SYNCING FAILED" | tee -a {{ sync_log }}
exit 1
fi
if [ "$ret_val" -eq 0 ]; then
recs=$(grep '\[FAILED\]' {{ sync_log }})
if [[ -n "${recs}" ]]; then
echo "SOME PACKAGES DID NOT DOWNLOAD" | tee -a {{ sync_log }}
exit 1
else
exit 0
fi
fi
# {{ check_cmd }} | tee -a {{ sync_log }}

View File

@ -6,4 +6,21 @@ set -o pipefail
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/*.repo
{{ sync_cmd }} | tee -a {{ sync_log }}
# Yes this is a bit hacky. Can't think of a better way to do this.
ret_val=$?
if [ "$ret_val" -ne 0 ]; then
echo "SYNCING FAILED" | tee -a {{ sync_log }}
exit 1
fi
if [ "$ret_val" -eq 0 ]; then
recs=$(grep '\[FAILED\]' {{ sync_log }})
if [[ -n "${recs}" ]]; then
echo "SOME PACKAGES DID NOT DOWNLOAD" | tee -a {{ sync_log }}
exit 1
else
exit 0
fi
fi
# {{ check_cmd }} | tee -a {{ sync_log }}

View File

@ -13,7 +13,7 @@ ret_val=$?
if [ $ret_val -eq "0" ]; then
TARGET="${PRODUCTION_ROOT}/${CATEGORY_STUB}/${REV:0:3}"
mkdir -p "${TARGET}"
sudo -l && fpsync -o '-av --numeric-ids --no-compress --chown=10004:10005' -n 18 -t /mnt/compose/partitions "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/" "${TARGET}/"
sudo -l && time fpsync -o '-av --numeric-ids --no-compress --chown=10004:10005' -n 18 -t /mnt/compose/partitions "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}/" "${TARGET}/"
# Full file list update
cd "${PRODUCTION_ROOT}/${CATEGORY_STUB}/" || { echo "Failed to change directory"; exit 1; }

View File

@ -26,7 +26,7 @@ if [ $ret_val -eq "0" ]; then
# shellcheck disable=SC2035
#sudo -l && find **/* -maxdepth 0 -type d | parallel --will-cite -j 18 sudo rsync -av --chown=10004:10005 --progress --relative --human-readable \
# {} "${TARGET}"
sudo -l && fpsync -o '-av --numeric-ids --no-compress --chown=10004:10005' -n 18 -t /mnt/compose/partitions "/mnt/compose/${MAJ}/latest-${SHORT}-${MAJ}${PROFILE}/compose/" "${TARGET}/"
sudo -l && time fpsync -o '-av --numeric-ids --no-compress --chown=10004:10005' -n 18 -t /mnt/compose/partitions "/mnt/compose/${MAJ}/latest-${SHORT}-${MAJ}${PROFILE}/compose/" "${TARGET}/"
# This is temporary until we implement rsync into empanadas
#if [ -f "COMPOSE_ID" ]; then