File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 8
8
9
9
PG_CONFIG ?= pg_config
10
10
11
- SUBDIRS = bin lib
12
-
13
11
# Pull out the version number from pg_config
14
12
VERSION := $(shell $(PG_CONFIG ) --version | awk '{print $$2}')
13
+ ifeq ("$(VERSION ) ","")
14
+ $(error pg_config not found)
15
+ endif
15
16
16
- # version as a number, e.g. 9.1.4 -> 90104
17
- INTVERSION := $(shell echo $( VERSION ) | sed -E 's/([0-9]+) \.([0-9]+)\.?([0-9]+)?(.*)/( \1*100+\2)*100+0\3/' | bc )
17
+ # 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
19
19
20
# We support PostgreSQL 8.3 and later.
20
- ifeq ($(shell echo $$(($(INTVERSION ) < 80300 ) ) ),1)
21
+ ifeq ($(shell echo $$(($(INTVERSION ) < 803 ) ) ),1)
21
22
$(error pg_repack requires PostgreSQL 8.3 or later. This is $(VERSION))
22
23
endif
23
24
24
25
26
+ SUBDIRS = bin lib
27
+
25
28
all install installdirs uninstall distprep clean distclean maintainer-clean debug :
26
29
@for dir in $(SUBDIRS ) ; do \
27
30
$(MAKE ) -C $$ dir $@ || exit ; \
Original file line number Diff line number Diff line change 8
8
9
9
PG_CONFIG ?= pg_config
10
10
11
- # version as a number, e.g. 9.1.4 -> 90104
11
+ # version as a number, e.g. 9.1.4 -> 901
12
12
VERSION := $(shell $(PG_CONFIG ) --version | awk '{print $$2}')
13
- INTVERSION := $(shell echo $( VERSION ) | sed -E 's/([0-9]+) \.([0-9]+)\.?([0-9]+)?.*/( \1*100+\2)*100+0\3/' | bc )
13
+ INTVERSION := $(shell echo $$( ( $$( echo $( VERSION ) | sed -E 's/([0-9]+ ) \.([0-9]+ ) . * / \1* 100+\2/') )) )
14
14
15
15
SRCS = pg_repack.c pgut/pgut.c pgut/pgut-fe.c
16
16
OBJS = $(SRCS:.c=.o )
@@ -21,16 +21,16 @@ PROGRAM = pg_repack
21
21
# Test suite
22
22
#
23
23
24
- ifeq ($(shell echo $$(($(INTVERSION ) >= 90100 ) ) ),1)
24
+ ifeq ($(shell echo $$(($(INTVERSION ) >= 901 ) ) ),1)
25
25
REGRESS = init-extension
26
26
else
27
27
REGRESS = init-legacy
28
28
endif
29
29
30
30
REGRESS += repack tablespace
31
31
32
- # This test depends on collate, not supported before 9.0
33
- ifeq ($(shell echo $$(($(INTVERSION ) >= 90000 ) ) ),1)
32
+ # This test depends on collate, not supported before 9.1
33
+ ifeq ($(shell echo $$(($(INTVERSION ) >= 901 ) ) ),1)
34
34
REGRESS += issue3
35
35
endif
36
36
Original file line number Diff line number Diff line change 8
8
9
9
PG_CONFIG ?= pg_config
10
10
11
- # version as a number, e.g. 9.1.4 -> 90104
11
+ # version as a number, e.g. 9.1.4 -> 901
12
12
VERSION := $(shell $(PG_CONFIG ) --version | awk '{print $$2}')
13
- INTVERSION := $(shell echo $( VERSION ) | sed -E 's/([0-9]+) \.([0-9]+)\.?([0-9]+)?.*/( \1*100+\2)*100+0\3/' | bc )
13
+ INTVERSION := $(shell echo $$( ( $$( echo $( VERSION ) | sed -E 's/([0-9]+ ) \.([0-9]+ ) . * / \1* 100+\2/') )) )
14
14
15
15
EXTENSION = pg_repack
16
16
MODULE_big = $(EXTENSION )
@@ -24,7 +24,7 @@ REPACK_VERSION = $(shell grep '"version":' ../META.json | head -1 \
24
24
PG_CPPFLAGS = -DREPACK_VERSION=$(REPACK_VERSION )
25
25
26
26
# Support CREATE EXTENSION for PG >= 9.1 and a simple sql script for PG < 9.1
27
- ifeq ($(shell echo $$(($(INTVERSION ) >= 90100 ) ) ),1)
27
+ ifeq ($(shell echo $$(($(INTVERSION ) >= 901 ) ) ),1)
28
28
DATA_built = pg_repack--$(REPACK_VERSION ) .sql pg_repack.control
29
29
else
30
30
DATA_built = pg_repack.sql
You can’t perform that action at this time.
0 commit comments