From f54cdca4567078b03f5fd76ef8dc6a9ab7489394 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Sep 10 2024 18:53:27 +0000 Subject: Run shellcheck and correct various things it noted. Review very welcome. Without this the pungi command is failing with: ./release-candidate.sh: line 98: pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification --notification-script=pungi-wait-for-signed-ostree-handler --config=fedora-beta.conf --old-composes=/mnt/koji/compose/41 --skip-phase=productimg --label=Beta-1.1 --target-dir=/mnt/koji/compose/41: No such file or directory ======================================== RUN THE COMPOSE. EXIT IF THE EXIT STATUS IS NOT ZERO. usage: pungi-koji [-h] (--target-dir PATH | --compose-dir PATH) [--label LABEL] [--no-label] [--supported] [--old-composes PATH] --config CONFIG [--skip-phase PHASE] [--just-phase PHASE] [--nightly] [--test] [--ci] [--production] [--development] [--koji-event ID] [--version] [--notification-script NOTIFICATION_SCRIPT] [--no-latest-link] [--latest-link-status STATUS] [--latest-link-components LATEST_LINK_COMPONENTS] [--parent-compose-id PARENT_COMPOSE_ID] [--respin-of RESPIN_OF] [--print-output-dir] [--quiet] pungi-koji: error: one of the arguments --target-dir --compose-dir is required I think this should fix it, but more eyes welcome. Signed-off-by: Kevin Fenzi --- diff --git a/release-candidate.sh b/release-candidate.sh index 0ac05f0..0f19c3c 100755 --- a/release-candidate.sh +++ b/release-candidate.sh @@ -86,7 +86,7 @@ echo "" fedora_message_json_start=$(printf '{"log": "start", "branch": "%s", "short": "%s"}' \ "$RELEASE" "$SHORT") -$CMD_PREFIX send_fedora_message "${fedora_message_json_start}" ${RELEASE} start +$CMD_PREFIX send_fedora_message "${fedora_message_json_start}" "${RELEASE}" start echo "" CMD="pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification \ @@ -95,16 +95,16 @@ CMD="pungi-koji --notification-script=/usr/bin/pungi-fedmsg-notification \ --label=${LABEL}" if [ -z "${COMPOSE_ID}" ]; then - CMD=${CMD_PREFIX} "${CMD} --target-dir=${TARGET_DIR}" + CMD="${CMD} --target-dir=${TARGET_DIR}" else - CMD=${CMD_PREFIX} "${CMD} --debug-mode --compose-dir=${TARGET_DIR}/${COMPOSE_ID}" + CMD="${CMD} --debug-mode --compose-dir=${TARGET_DIR}/${COMPOSE_ID}" fi echo "========================================" echo "RUN THE COMPOSE. EXIT IF THE EXIT STATUS IS NOT ZERO." echo "" -if ! time ${CMD}; then +if ! time ${CMD_PREFIX} ${CMD}; then echo "ERROR: Command failed with a non-zero exit status." $CMD_PREFIX exit 1 echo "" @@ -159,20 +159,20 @@ fedora_message_json_done=$(printf '{"log": "done", "branch": "%s", "short": "%s" echo "========================================" echo "LET INTERESTED PERSONS KNOW ABOUT THE COMPOSE." echo "" -$CMD_PREFIX send_fedora_message "${fedora_message_json_done}" ${RELEASE} complete +$CMD_PREFIX send_fedora_message "${fedora_message_json_done}" "${RELEASE}" complete echo "" echo "========================================" echo "TELL INTERESTED PERSONS THAT THE RSYNC IS STARTING." echo "" -$CMD_PREFIX send_fedora_message "${fedora_message_json_start}" ${RELEASE} rsync.start +$CMD_PREFIX send_fedora_message "${fedora_message_json_start}" "${RELEASE}" rsync.start echo "" echo "========================================" echo "CREATE THE DIRECTORY TARGETED FOR THE COPY (IF IT DOESN'T EXIST)." echo "" if [ ! -d "${RSYNC_TARGET}" ]; then - ${CMD_PREFIX} ${RSYNC_PREFIX} mkdir -m 750 -p "${RSYNC_TARGET}" + ${CMD_PREFIX} "${RSYNC_PREFIX}" mkdir -m 750 -p "${RSYNC_TARGET}" fi echo "" @@ -198,7 +198,7 @@ fi echo "" # Copy the metadata to the non-garbage-collected metadata archive -YEAR=$(echo $COMPOSE_ID_2|sed -e 's|Fedora-.*-||g'|cut -c1-4) +YEAR=$(echo "$COMPOSE_ID_2"|sed -e 's|Fedora-.*-||g'|cut -c1-4) mkdir -p "${MD_ARCHIVE_DIR}/${YEAR}/${COMPOSE_ID_2}" cp "${DESTDIR}"/compose/metadata/*.json "${MD_ARCHIVE_DIR}/${YEAR}/${COMPOSE_ID_2}/" # Add the compose ID to the 'series' file which records the @@ -209,4 +209,4 @@ echo "${COMPOSE_ID_2} ${LABEL}" >> "${SERIES_DIR}/${SHORT}-${RELEASE}" echo "========================================" echo "LET INTERESTED PERSONS KNOW THAT THE RSYNC IS COMPLETE." echo "" -$CMD_PREFIX send_fedora_message "${fedora_message_json_done}" ${RELEASE} rsync.complete +$CMD_PREFIX send_fedora_message "${fedora_message_json_done}" "${RELEASE}" rsync.complete