From 1d0fe07addbd3f0cd8c5d6d9d5b794bf62f570fc Mon Sep 17 00:00:00 2001 From: nazunalika Date: Thu, 11 Nov 2021 08:08:23 -0700 Subject: [PATCH 1/2] add checksum creator for isos (neil) --- sync/minor-release-sync-to-staging.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sync/minor-release-sync-to-staging.sh b/sync/minor-release-sync-to-staging.sh index 61818be..87c9599 100644 --- a/sync/minor-release-sync-to-staging.sh +++ b/sync/minor-release-sync-to-staging.sh @@ -59,10 +59,21 @@ for ARCH in "${ARCHES[@]}"; do # Copy the ISO and manifests into the main isos target cp "${SOURCE}"/*.iso "${TARGET}/" cp "${SOURCE}"/*.iso.manifest "${TARGET}/" - cat "${SOURCE}/CHECKSUM" >> "${TARGET}/CHECKSUM" done done +# call out for checksum creation on the ISOs +pushd "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" || { echo "Failed to change directory"; exit; } +for file in isos/**/*iso*; do + arch=$(echo $file | cut -d\/ -f 2); + printf "# %s: %s bytes\n%s\n" \ + "$(basename $file)" \ + "$(stat -c %s $file)" \ + "$(cd isos/${arch}/ && sha256sum --tag $(basename $file))" \ + | sudo tee -a isos/${arch}/CHECKSUM; +done +popd || { echo "Failed to change directory"; exit; } + # make a kickstart directory for ARCH in "${ARCHES[@]}"; do for REPO in "${MODS_REPOS[@]}"; do From e52eab3d4a8bade16f5d0c37974ed6002fd9ac6a Mon Sep 17 00:00:00 2001 From: nazunalika Date: Thu, 11 Nov 2021 08:22:34 -0700 Subject: [PATCH 2/2] fix up for shellcheck --- sync/minor-release-sync-to-staging.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sync/minor-release-sync-to-staging.sh b/sync/minor-release-sync-to-staging.sh index 87c9599..ec565a8 100644 --- a/sync/minor-release-sync-to-staging.sh +++ b/sync/minor-release-sync-to-staging.sh @@ -59,21 +59,18 @@ for ARCH in "${ARCHES[@]}"; do # Copy the ISO and manifests into the main isos target cp "${SOURCE}"/*.iso "${TARGET}/" cp "${SOURCE}"/*.iso.manifest "${TARGET}/" + pushd "${TARGET}" || exit + # shellcheck disable=SC2086 + for file in *.iso; do + printf "# %s: %s bytes\n%s\n" \ + "${file}" \ + "$(stat -c %s ${file})" \ + "$(sha256sum --tag ${file})" \ + | sudo tee -a CHECKSUM; + done done done -# call out for checksum creation on the ISOs -pushd "${STAGING_ROOT}/${CATEGORY_STUB}/${REV}" || { echo "Failed to change directory"; exit; } -for file in isos/**/*iso*; do - arch=$(echo $file | cut -d\/ -f 2); - printf "# %s: %s bytes\n%s\n" \ - "$(basename $file)" \ - "$(stat -c %s $file)" \ - "$(cd isos/${arch}/ && sha256sum --tag $(basename $file))" \ - | sudo tee -a isos/${arch}/CHECKSUM; -done -popd || { echo "Failed to change directory"; exit; } - # make a kickstart directory for ARCH in "${ARCHES[@]}"; do for REPO in "${MODS_REPOS[@]}"; do