Skip to content

Commit c7367e0

Browse files
committed
use case statements for rsync
1 parent 77a52fb commit c7367e0

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

sync/beta-release-sync-to-staging.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,21 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
121121
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"
122122
mkdir -p "${TARGET}"
123123
pushd "${SYNCSRC}" || { echo "${COMPOSE}: Failed to change directory"; break; }
124-
if [[ "${COMPOSE}" != "Rocky" ]]; then
125-
rsync_no_delete_staging_with_excludes "${TARGET}" "metadata"
126-
else
127-
echo "Begin syncing..."
128-
rsync_delete_staging_with_excludes "${TARGET}" "devel"
129-
fi
124+
echo "Begin syncing ${COMPOSE}..."
125+
case "${COMPOSE}" in
126+
"Rocky-devel")
127+
rsync_delete_subdirectory "devel" "${TARGET}/devel"
128+
;;
129+
"Extras")
130+
rsync_delete_generic "extras" "${TARGET}/extras"
131+
rsync_delete_generic "plus" "${TARGET}/plus"
132+
;;
133+
"Rocky")
134+
rsync_delete_staging_with_excludes "${TARGET}" "devel"
135+
;;
136+
*)
137+
echo "Unknown!" ;;
138+
esac
130139
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
131140
done
132141

sync/lh-release-sync-to-staging.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,21 @@ for COMPOSE in "${NONSIG_COMPOSE[@]}"; do
121121
TARGET="${STAGING_ROOT}/${CATEGORY_STUB}/${REV}"
122122
mkdir -p "${TARGET}"
123123
pushd "${SYNCSRC}" || { echo "${COMPOSE}: Failed to change directory"; break; }
124-
if [[ "${COMPOSE}" != "Rocky" ]]; then
125-
rsync_no_delete_staging_with_excludes "${TARGET}" "metadata"
126-
else
127-
echo "Begin syncing..."
128-
rsync_delete_staging_with_excludes "${TARGET}" "devel"
129-
fi
124+
echo "Begin syncing ${COMPOSE}..."
125+
case "${COMPOSE}" in
126+
"Rocky-devel")
127+
rsync_delete_subdirectory "devel" "${TARGET}/devel"
128+
;;
129+
"Extras")
130+
rsync_delete_generic "extras" "${TARGET}/extras"
131+
rsync_delete_generic "plus" "${TARGET}/plus"
132+
;;
133+
"Rocky")
134+
rsync_delete_staging_with_excludes "${TARGET}" "devel"
135+
;;
136+
*)
137+
echo "Unknown!" ;;
138+
esac
130139
popd || { echo "${COMPOSE}: Failed to change directory"; break; }
131140
done
132141

0 commit comments

Comments
 (0)