Skip to content

Commit

Permalink
chore: improve error message on architecture discrepancy (#190)
Browse files Browse the repository at this point in the history
Signed-off-by: Niccolò Fei <[email protected]>
  • Loading branch information
NiccoloFei authored Oct 1, 2024
1 parent da8d784 commit a483eca
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions UBI/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ get_cloudsmith_postgis_pkg() {
compare_architecture_pkgs() {
for arg; do
if [[ "$1" != "$arg" ]]; then
echo "Version discrepancy between the architectures." >&2
echo "Versions: $@" >&2
false; return
fi
done
Expand Down Expand Up @@ -224,6 +222,11 @@ generate_redhat() {
pg_s390x=$(get_postgresql_version "${ubiRelease}" 's390x' "$version")
pg_arm64=$(get_postgresql_version "${ubiRelease}" 'aarch64' "$version")
if ! compare_architecture_pkgs "$pg_x86_64" "$pg_arm64" "$pg_ppc64le" "$pg_s390x"; then
echo "Version discrepancy between the architectures of PostgreSQL $version packages in UBI$ubiRelease." >&2
echo "x86_64: $pg_x86_64" >&2
echo "arm64: $pg_arm64" >&2
echo "ppc64le: $pg_ppc64le" >&2
echo "s390x: $pg_s390x" >&2
return
fi

Expand Down Expand Up @@ -381,6 +384,11 @@ generate_redhat_postgis() {
pg_s390x=$(get_postgresql_version "${ubiRelease}" 's390x' "$version")
pg_arm64=$(get_postgresql_version "${ubiRelease}" 'aarch64' "$version")
if ! compare_architecture_pkgs "$pg_x86_64" "$pg_arm64" "$pg_ppc64le" "$pg_s390x"; then
echo "Version discrepancy between the architectures of PostgreSQL $version packages in UBI$ubiRelease." >&2
echo "x86_64: $pg_x86_64" >&2
echo "arm64: $pg_arm64" >&2
echo "ppc64le: $pg_ppc64le" >&2
echo "s390x: $pg_s390x" >&2
return
fi

Expand All @@ -407,6 +415,11 @@ generate_redhat_postgis() {
postgis_s390x=$(get_postgis_version "${ubiRelease}" 's390x' "$version")
postgis_arm64=$(get_postgis_version "${ubiRelease}" 'aarch64' "$version")
if ! compare_architecture_pkgs "$postgis_x86_64" "$postgis_arm64" "$postgis_ppc64le" "$postgis_s390x"; then
echo "Version discrepancy between the architectures of PostGIS $version packages in UBI$ubiRelease." >&2
echo "x86_64: $postgis_x86_64" >&2
echo "arm64: $postgis_arm64" >&2
echo "ppc64le: $postgis_ppc64le" >&2
echo "s390x: $postgis_s390x" >&2
return
fi

Expand Down

0 comments on commit a483eca

Please sign in to comment.