Skip to content

Commit 70756f2

Browse files
committed
Remove Postgres 8 detection from Makefile
A bad regex was matching `18.0` when it should not have, but since we no longer support Postgres 8, just remove matching for that version except where it needs to refuse to build for versions prior to 9.1.
1 parent 5b0daf5 commit 70756f2

File tree

3 files changed

+17
-22
lines changed

3 files changed

+17
-22
lines changed

Changes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Revision history for pgTAP
1313
* Removed the `$libdir/` prefix from the `module_pathname` directive, so that
1414
the module can be installed and found in any directory listed in
1515
`dynamic_library_path`.
16-
* Tested on PostgreSQL 9.1–18.
16+
* Tested on PostgreSQL 9.1–18 and fixed a test failure on PostgreSQL 18.
1717
* Improved Markdown formatting in `README.md`.
1818

1919
1.3.3 2024-04-08T13:44:11Z

Makefile

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ endif
9898
EXTRA_CLEAN += $(_IN_PATCHED)
9999
all: $(_IN_PATCHED) sql/pgtap.sql sql/uninstall_pgtap.sql sql/pgtap-core.sql sql/pgtap-schema.sql
100100

101-
# Add extension build targets on 9.1 and up.
102-
ifeq ($(shell echo $(VERSION) | grep -qE "^(8[.]|9[.]0)" && echo no || echo yes),yes)
101+
# Add extension build targets.
103102
all: sql/$(MAINEXT)--$(EXTVERSION).sql sql/$(MAINEXT)-core--$(EXTVERSION).sql sql/$(MAINEXT)-schema--$(EXTVERSION).sql
104103

105104
sql/$(MAINEXT)--$(EXTVERSION).sql: sql/$(MAINEXT).sql
@@ -113,10 +112,6 @@ sql/$(MAINEXT)-schema--$(EXTVERSION).sql: sql/$(MAINEXT)-schema.sql
113112

114113
# sort is necessary to remove dupes so install won't complain
115114
DATA = $(sort $(wildcard sql/*--*.sql) $(BASE_FILES) $(VERSION_FILES) $(_IN_PATCHED))
116-
else
117-
# No extension support, just install the base files.
118-
DATA = $(BASE_FILES)
119-
endif
120115

121116
# Load PGXS now that we've set all the variables it might need.
122117
ifdef NO_PGXS
@@ -131,17 +126,17 @@ endif
131126
#
132127

133128
# Row security policy tests not supported by 9.4 and earlier.
134-
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][01234]|8[.]" && echo yes || echo no),yes)
129+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][01234]" && echo yes || echo no),yes)
135130
EXCLUDE_TEST_FILES += test/sql/policy.sql
136131
endif
137132

138133
# Partition tests tests not supported by 9.x and earlier.
139-
ifeq ($(shell echo $(VERSION) | grep -qE "^[89][.]" && echo yes || echo no),yes)
134+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.]" && echo yes || echo no),yes)
140135
EXCLUDE_TEST_FILES += test/sql/partitions.sql
141136
endif
142137

143-
# Stored procecures not supported prior to Postgres 11.
144-
ifeq ($(shell echo $(VERSION) | grep -qE "^([89]|10)[.]" && echo yes || echo no),yes)
138+
# Stored procedures not supported prior to Postgres 11.
139+
ifeq ($(shell echo $(VERSION) | grep -qE "^(9|10)[.]" && echo yes || echo no),yes)
145140
EXCLUDE_TEST_FILES += test/sql/proctap.sql
146141
endif
147142

@@ -207,16 +202,16 @@ uninstall-all:
207202
# VERSION = 9.1.0 # Uncomment to test all patches.
208203
sql/pgtap.sql: sql/pgtap.sql.in
209204
cp $< $@
210-
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][0123456]|8[.][1234])" && echo yes || echo no),yes)
205+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][0123456]" && echo yes || echo no),yes)
211206
patch -p0 < compat/install-9.6.patch
212207
endif
213-
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][01234]|8[.][1234])" && echo yes || echo no),yes)
208+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][01234]" && echo yes || echo no),yes)
214209
patch -p0 < compat/install-9.4.patch
215210
endif
216-
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][012]|8[.][1234])" && echo yes || echo no),yes)
211+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][012]" && echo yes || echo no),yes)
217212
patch -p0 < compat/install-9.2.patch
218213
endif
219-
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][01]|8[.][1234])" && echo yes || echo no),yes)
214+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][01]" && echo yes || echo no),yes)
220215
patch -p0 < compat/install-9.1.patch
221216
endif
222217
sed -e 's,MODULE_PATHNAME,pgtap,g' -e 's,__OS__,$(OSNAME),g' -e 's,__VERSION__,$(NUMVERSION),g' sql/pgtap.sql > sql/pgtap.tmp
@@ -226,35 +221,35 @@ endif
226221
EXTRA_CLEAN += sql/pgtap--0.99.0--1.0.0.sql
227222
sql/pgtap--0.99.0--1.0.0.sql: sql/pgtap--0.99.0--1.0.0.sql.in
228223
cp $< $@
229-
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][01234]|8[.][1234])" && echo yes || echo no),yes)
224+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][01234]|" && echo yes || echo no),yes)
230225
patch -p0 < compat/9.4/pgtap--0.99.0--1.0.0.patch
231226
endif
232227

233228
EXTRA_CLEAN += sql/pgtap--0.98.0--0.99.0.sql
234229
sql/pgtap--0.98.0--0.99.0.sql: sql/pgtap--0.98.0--0.99.0.sql.in
235230
cp $< $@
236-
ifeq ($(shell echo $(VERSION) | grep -qE "^([89]|10)[.]" && echo yes || echo no),yes)
231+
ifeq ($(shell echo $(VERSION) | grep -qE "^(9|10)[.]" && echo yes || echo no),yes)
237232
patch -p0 < compat/10/pgtap--0.98.0--0.99.0.patch
238233
endif
239234

240235
EXTRA_CLEAN += sql/pgtap--0.97.0--0.98.0.sql
241236
sql/pgtap--0.97.0--0.98.0.sql: sql/pgtap--0.97.0--0.98.0.sql.in
242237
cp $< $@
243-
ifeq ($(shell echo $(VERSION) | grep -qE "^[89][.]" && echo yes || echo no),yes)
238+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.]" && echo yes || echo no),yes)
244239
patch -p0 < compat/9.6/pgtap--0.97.0--0.98.0.patch
245240
endif
246241

247242
EXTRA_CLEAN += sql/pgtap--0.96.0--0.97.0.sql
248243
sql/pgtap--0.96.0--0.97.0.sql: sql/pgtap--0.96.0--0.97.0.sql.in
249244
cp $< $@
250-
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][01234]|8[.][1234])" && echo yes || echo no),yes)
245+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][01234]" && echo yes || echo no),yes)
251246
patch -p0 < compat/9.4/pgtap--0.96.0--0.97.0.patch
252247
endif
253248

254249
EXTRA_CLEAN += sql/pgtap--0.95.0--0.96.0.sql
255250
sql/pgtap--0.95.0--0.96.0.sql: sql/pgtap--0.95.0--0.96.0.sql.in
256251
cp $< $@
257-
ifeq ($(shell echo $(VERSION) | grep -qE "^(9[.][012]|8[.][1234])" && echo yes || echo no),yes)
252+
ifeq ($(shell echo $(VERSION) | grep -qE "^9[.][012]" && echo yes || echo no),yes)
258253
patch -p0 < compat/9.2/pgtap--0.95.0--0.96.0.patch
259254
endif
260255

@@ -471,7 +466,7 @@ updatecheck_deps: pgtap-version-$(UPDATE_FROM) test/sql/update.sql
471466
# TODO: find something that can generically compare majors (ie: GE91 from
472467
# https://github.com/decibel/pgxntool/blob/0.1.10/base.mk).
473468
updatecheck_setup: updatecheck_deps
474-
@if echo $(VERSION) | grep -qE "8[.]|9[.][012]"; then echo "updatecheck is not supported prior to 9.3"; exit 1; fi
469+
@if echo $(VERSION) | grep -qE "^9[.][012]"; then echo "updatecheck is not supported prior to 9.3"; exit 1; fi
475470
$(eval SETUP_SCH = test/schedule/update.sch)
476471
$(eval REGRESS_OPTS += --launcher "tools/psql_args.sh -v 'old_ver=$(UPDATE_FROM)' -v 'new_ver=$(EXTVERSION)'")
477472
@echo

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pgTAP 1.3.4
1+
/Users/david/Library/Mobile\ Documents/com\~apple\~CloudDocs/SymlinkpgTAP 1.3.4
22
============
33

44
[pgTAP](https://pgtap.org) is a unit testing framework for PostgreSQL written

0 commit comments

Comments
 (0)