Skip to content

Commit 95ce24c

Browse files
committed
More sed tweaks to Makefile for portability.
The -E flag to specify extended regular expressions apparently is not portable to all platforms, such as CentOS 4.5. Use an uglier but hopefully more portable basic regular expression in Makefiles.
1 parent dc31920 commit 95ce24c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $(error pg_config not found)
1515
endif
1616

1717
# version as a number, e.g. 9.1.4 -> 901
18-
INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed -E 's/([0-9]+)\.([0-9]+).*/\1*100+\2/'))))
18+
INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/'))))
1919

2020
# We support PostgreSQL 8.3 and later.
2121
ifeq ($(shell echo $$(($(INTVERSION) < 803))),1)

lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PG_CONFIG ?= pg_config
1010

1111
# version as a number, e.g. 9.1.4 -> 901
1212
VERSION := $(shell $(PG_CONFIG) --version | awk '{print $$2}')
13-
INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed -E 's/([0-9]+)\.([0-9]+).*/\1*100+\2/'))))
13+
INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/'))))
1414

1515
EXTENSION = pg_repack
1616
MODULE_big = $(EXTENSION)

regress/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PG_CONFIG ?= pg_config
1010

1111
# version as a number, e.g. 9.1.4 -> 901
1212
VERSION := $(shell $(PG_CONFIG) --version | awk '{print $$2}')
13-
INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed -E 's/([0-9]+)\.([0-9]+).*/\1*100+\2/'))))
13+
INTVERSION := $(shell echo $$(($$(echo $(VERSION) | sed 's/\([[:digit:]]\{1,\}\)\.\([[:digit:]]\{1,\}\).*/\1*100+\2/' ))))
1414

1515

1616
#

0 commit comments

Comments
 (0)