Use a single version number for program, library and SQL
Having the SQL on a different numbering scheme is useful to provide an ungrade path. But pg_repack has no need of such a path as it can be uninstalled with no problem, so we are not going to provide update script. Hence it's much easier to have a single version number for everything.
This commit is contained in:
parent
ffe5a2b323
commit
0af231dff5
1
lib/.gitignore
vendored
1
lib/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/.deps/
|
||||
/pg_repack.sql
|
||||
/pg_repack--[0-9.]*.sql
|
||||
/pg_repack.control
|
||||
|
13
lib/Makefile
13
lib/Makefile
@ -17,12 +17,6 @@ OBJS = repack.o pgut/pgut-be.o pgut/pgut-spi.o
|
||||
REPACK_VERSION = $(shell grep '"version":' ../META.json | head -1 \
|
||||
| sed -e 's/\s*"version":\s*"\(.*\)",/\1/')
|
||||
|
||||
# The version of the extension, read from the .control file.
|
||||
# Note that it doesn't need to be the same of the library version: it should
|
||||
# be increased only when the sql changes.
|
||||
EXTVER = $(shell grep -e '^default_version' $(EXTENSION).control \
|
||||
| sed -e "s/[^']*'\([^']*\)'.*/\1/")
|
||||
|
||||
PG_CPPFLAGS = -DREPACK_VERSION=$(REPACK_VERSION)
|
||||
|
||||
# Support CREATE EXTENSION for PG >= 9.1 and a simple sql script for PG < 9.1
|
||||
@ -30,7 +24,7 @@ HAVE_EXTENSION = $(shell $(PG_CONFIG) --version \
|
||||
| grep -qE " 8\.| 9\.0" && echo no || echo yes)
|
||||
|
||||
ifeq ($(HAVE_EXTENSION),yes)
|
||||
DATA_built = pg_repack--$(EXTVER).sql
|
||||
DATA_built = pg_repack--$(REPACK_VERSION).sql pg_repack.control
|
||||
else
|
||||
DATA_built = pg_repack.sql
|
||||
DATA = uninstall_pg_repack.sql
|
||||
@ -49,5 +43,8 @@ pg_repack.sql: pg_repack.sql.in
|
||||
sed 's,MODULE_PATHNAME,$$libdir/$(MODULE_big),g' $< >> $@; \
|
||||
echo "\nCOMMIT;" >> $@;
|
||||
|
||||
pg_repack--$(EXTVER).sql: pg_repack.sql.in
|
||||
pg_repack--$(REPACK_VERSION).sql: pg_repack.sql.in
|
||||
cat $< > $@;
|
||||
|
||||
pg_repack.control: pg_repack.control.in
|
||||
sed 's,REPACK_VERSION,$(REPACK_VERSION),g' $< > $@
|
||||
|
@ -1,5 +1,5 @@
|
||||
# pg_repack extension
|
||||
comment = 'Reorganize tables in PostgreSQL databases with minimal locks'
|
||||
default_version = '1.2dev0'
|
||||
default_version = 'REPACK_VERSION'
|
||||
module_pathname = '$libdir/pg_repack'
|
||||
relocatable = false
|
Loading…
x
Reference in New Issue
Block a user