From 6fa832dc329b3e47797cb827f3125912cd30c167 Mon Sep 17 00:00:00 2001 From: Brian Salehi Date: Sun, 6 Oct 2024 09:42:04 +0200 Subject: [PATCH] #79 apply requested changes on old bash compatibility --- bin/pgenv | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/pgenv b/bin/pgenv index 406a469..6d04107 100755 --- a/bin/pgenv +++ b/bin/pgenv @@ -1360,14 +1360,15 @@ case $1 in $PGENV_CURL -fLO ${PGENV_DOWNLOAD_ROOT}/v$v/${PG_TARBALL} fi - if [[ ${v%.*} -ge 17 ]]; then + # Starting from 17.x docs target might fail + # due to a missing dependency (docbooks-xsl). + # Download the docs tarball separately and + # install it after build. + if [[ $v =~ ^(1[789]|[2-9][0-9])\. ]]; then PG_DOCS_TARBALL="postgresql-$v-docs.tar.gz" - DOCS_TAR_OPTS="zxf" pgenv_debug "Downloading docs tarball" - # starting from 17.x docs target might fail - # due to a missing dependency (docbooks-xsl). if [ ! -f $PG_DOCS_TARBALL ]; then $PGENV_CURL -fLO ${PGENV_DOWNLOAD_ROOT}/v$v/${PG_DOCS_TARBALL} fi @@ -1425,10 +1426,10 @@ EOF # dependency for docs since 17.x and above, extracted # docs will be placed into the source directory, # as if they were built. - if [[ ${v%.*} -ge 17 ]]; then + if [[ $v =~ ^(1[789]|[2-9][0-9])\. ]]; then pgenv_debug "Unpacking docs tarball" - $PGENV_TAR $DOCS_TAR_OPTS $PG_DOCS_TARBALL + $PGENV_TAR zxf $PG_DOCS_TARBALL fi fi