diff --git a/support/build/_util/remove.sh b/support/build/_util/remove.sh index 42cdf3a48..348eaa646 100755 --- a/support/build/_util/remove.sh +++ b/support/build/_util/remove.sh @@ -50,13 +50,10 @@ pushd "$manifests_tmp" > /dev/null echo "Fetching manifests, excluding given removals... " >&2 s5cmd "${S5CMD_OPTIONS[@]}" cp ${S3_REGION:+--source-region "$S3_REGION"} "${excludes[@]}" "s3://${S3_BUCKET}/${S3_PREFIX}*.composer.json" "$manifests_tmp" || { echo -e "\nFailed to fetch manifests! See message above for errors." >&2; exit 1; } -echo "...done, now performing a sync of the differences. -" >&2 -# we now simply treat this as a sync of packages between two folders, passing sync.sh the local and the remote +echo -e "\nNow performing a sync of the differences:\n" >&2 + +# we now simply treat this as a sync of packages between two folders, passing sync.sh the local dir as source and the remote as destination # the "source" repository will have our matched manifests removed "${here}/sync.sh" -s "$manifests_tmp" "$S3_BUCKET" "$S3_PREFIX" "$S3_REGION" "$S3_BUCKET" "$S3_PREFIX" "$S3_REGION" - -echo "Removal complete. -" >&2 diff --git a/support/build/_util/sync.sh b/support/build/_util/sync.sh index c60d17ef8..a77e809cd 100755 --- a/support/build/_util/sync.sh +++ b/support/build/_util/sync.sh @@ -269,7 +269,7 @@ EOF read -p "${prompt} [yN] " proceed -[[ ! $proceed =~ [yY](es)* ]] && exit +[[ ! $proceed =~ [yY](es)* ]] && { echo -e "Sync aborted.\n" >&2; exit; } echo "" >&2 @@ -297,13 +297,11 @@ fi if $wipe; then echo "Removing packages.json..." >&2 AWS_REGION=$dst_region s5cmd "${S5CMD_OPTIONS[@]}" rm "s3://${dst_bucket}/${dst_prefix}packages.json" || { echo -e "\nFailed to remove repository! See message above for errors." >&2; exit 1; } - echo "" >&2 else - echo -n "Generating and uploading packages.json... " >&2 - out=$(cd "$dst_tmp"; S3_BUCKET=$dst_bucket S3_PREFIX=$dst_prefix S3_REGION=$dst_region "$here/mkrepo.sh" --upload *.composer.json 2>&1) || { echo -e "failed! Error:\n$out\n\nIn case of transient errors, the repository must be re-generated manually." >&2; exit 1; } - echo "done! - " >&2 + echo "Generating and uploading packages.json..." >&2 + out=$(cd "$dst_tmp"; S3_BUCKET=$dst_bucket S3_PREFIX=$dst_prefix S3_REGION=$dst_region "$here/mkrepo.sh" --upload *.composer.json 2>&1) || { echo -e "\nFailed to generate/upload repository! Error:\n$out\n\nIn case of transient errors, the repository must be re-generated manually." >&2; exit 1; } fi +echo "" >&2 if (( ${#run_dists_rm[@]} )); then echo "Removing ${#run_dists_rm[@]} dists from destination..." >&2 @@ -311,5 +309,4 @@ if (( ${#run_dists_rm[@]} )); then echo "" >&2 fi -echo "Sync complete. -" >&2 +echo -e "Sync complete.\n" >&2