diff --git a/Makefile b/Makefile index 445575a..0962722 100644 --- a/Makefile +++ b/Makefile @@ -12,13 +12,13 @@ EXTENSION = pg_repack .PHONY: dist/$(EXTENSION)-$(EXTVERSION).zip # Pull out PostgreSQL version number from pg_config -VERSION := $(shell $(PG_CONFIG) --version | awk '{print $$2}') +VERSION := $(shell $(PG_CONFIG) --version | sed 's/.* \([[:digit:].]\{1,\}\).*/\1/') ifeq ("$(VERSION)","") $(error pg_config not found) endif # PostgreSQL version as a number, e.g. 9.1.4 -> 901 -INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/')))) +INTVERSION := $(shell echo $$(($$(echo $(VERSION).0 | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/')))) # The version number of the library EXTVERSION = $(shell grep '"version":' META.json | head -1 \ diff --git a/lib/Makefile b/lib/Makefile index db2aeda..bcea169 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -9,8 +9,8 @@ PG_CONFIG ?= pg_config # version as a number, e.g. 9.1.4 -> 901 -VERSION := $(shell $(PG_CONFIG) --version | awk '{print $$2}') -INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/')))) +VERSION := $(shell $(PG_CONFIG) --version | sed 's/.* \([[:digit:].]\{1,\}\).*/\1/') +INTVERSION := $(shell echo $$(($$(echo $(VERSION).0 | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/')))) EXTENSION = pg_repack MODULE_big = $(EXTENSION) diff --git a/regress/Makefile b/regress/Makefile index 943f440..006c332 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -9,8 +9,8 @@ PG_CONFIG ?= pg_config # version as a number, e.g. 9.1.4 -> 901 -VERSION := $(shell $(PG_CONFIG) --version | awk '{print $$2}') -INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/' )))) +VERSION := $(shell $(PG_CONFIG) --version | sed 's/.* \([[:digit:].]\{1,\}\).*/\1/') +INTVERSION := $(shell echo $$(($$(echo $(VERSION).0 | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/')))) #