Skip to content

Commit cacb384

Browse files
committed
Improve PG_VERSION extraction
18beta1 wasn't handled correctly, the new regexp will capture the first group of number which should be the major version.
1 parent 19dcec6 commit cacb384

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PG_CONFIG = pg_config
88
PG_CONFIG_EXISTS := $(shell command -v $(PG_CONFIG) 2> /dev/null)
99
ifdef PG_CONFIG_EXISTS
1010
# Default to pg_config's advertised version
11-
PG_VERSION ?= $(shell $(PG_CONFIG) --version | cut -d' ' -f2 | cut -d'.' -f1 | tr -d 'devel')
11+
PG_VERSION ?= $(shell $(PG_CONFIG) --version | sed 's/PostgreSQL \([0-9]*\).*/\1/g')
1212
else
1313
# pg_config is not present, let's assume we are packaging and use the latest PG version
1414
PG_VERSION ?= $(lastword $(PG_VERSIONS))

0 commit comments

Comments
 (0)