Skip to content

Commit

Permalink
Do version compare without bc
Browse files Browse the repository at this point in the history
  • Loading branch information
andyundso committed Dec 10, 2024
1 parent 5b968ce commit 3f32d27
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ RUN if [ "${PGTARGET}" -eq 14 ]; then rm -rf /usr/local-pg14 /usr/local-pg15 /us
RUN if [ "${PGTARGET}" -eq 15 ]; then rm -rf /usr/local-pg15 /usr/local-pg16; fi
RUN if [ "${PGTARGET}" -eq 16 ]; then rm -rf /usr/local-pg16; fi

# Install locale and bc command for comparisons
# Install locale
RUN apk update && \
apk add --update bc icu-data-full musl musl-utils musl-locales tzdata && \
apk add --update icu-data-full musl musl-utils musl-locales tzdata && \
apk cache clean

## FIXME: Only useful while developing this Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.bookworm
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ RUN if [ "${PGTARGET}" -eq 14 ]; then rm -rf /usr/local-pg14 /usr/local-pg15 /us
RUN if [ "${PGTARGET}" -eq 15 ]; then rm -rf /usr/local-pg15 /usr/local-pg16; fi
RUN if [ "${PGTARGET}" -eq 16 ]; then rm -rf /usr/local-pg16; fi

# Install locale and bc command for comparisons
# Install locale
RUN apt update && \
apt install -y bc icu-devtools locales tzdata && \
apt install -y icu-devtools locales tzdata && \
apt clean

# Pass the PG build target through to the running image
Expand Down
2 changes: 1 addition & 1 deletion pgautoupgrade-postupgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if [ "x${PGAUTO_REINDEX}" != "xno" ]; then
echo "Reindexing the databases"
echo "------------------------"

if [[ $(echo "15 <= $PGTARGET" | bc) -eq 0 ]]; then
if [[ "$PGTARGET" -le 15 ]]; then
reindexdb --all --username="${POSTGRES_USER}"
else
reindexdb --all --concurrently --username="${POSTGRES_USER}"
Expand Down

0 comments on commit 3f32d27

Please sign in to comment.