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:
Daniele Varrazzo 2012-11-15 23:31:58 +00:00
parent ffe5a2b323
commit 0af231dff5
3 changed files with 7 additions and 9 deletions

1
lib/.gitignore vendored
View File

@ -1,3 +1,4 @@
/.deps/ /.deps/
/pg_repack.sql /pg_repack.sql
/pg_repack--[0-9.]*.sql /pg_repack--[0-9.]*.sql
/pg_repack.control

View File

@ -17,12 +17,6 @@ OBJS = repack.o pgut/pgut-be.o pgut/pgut-spi.o
REPACK_VERSION = $(shell grep '"version":' ../META.json | head -1 \ REPACK_VERSION = $(shell grep '"version":' ../META.json | head -1 \
| sed -e 's/\s*"version":\s*"\(.*\)",/\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) PG_CPPFLAGS = -DREPACK_VERSION=$(REPACK_VERSION)
# Support CREATE EXTENSION for PG >= 9.1 and a simple sql script for PG < 9.1 # 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) | grep -qE " 8\.| 9\.0" && echo no || echo yes)
ifeq ($(HAVE_EXTENSION),yes) ifeq ($(HAVE_EXTENSION),yes)
DATA_built = pg_repack--$(EXTVER).sql DATA_built = pg_repack--$(REPACK_VERSION).sql pg_repack.control
else else
DATA_built = pg_repack.sql DATA_built = pg_repack.sql
DATA = uninstall_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' $< >> $@; \ sed 's,MODULE_PATHNAME,$$libdir/$(MODULE_big),g' $< >> $@; \
echo "\nCOMMIT;" >> $@; echo "\nCOMMIT;" >> $@;
pg_repack--$(EXTVER).sql: pg_repack.sql.in pg_repack--$(REPACK_VERSION).sql: pg_repack.sql.in
cat $< > $@; cat $< > $@;
pg_repack.control: pg_repack.control.in
sed 's,REPACK_VERSION,$(REPACK_VERSION),g' $< > $@

View File

@ -1,5 +1,5 @@
# pg_repack extension # pg_repack extension
comment = 'Reorganize tables in PostgreSQL databases with minimal locks' comment = 'Reorganize tables in PostgreSQL databases with minimal locks'
default_version = '1.2dev0' default_version = 'REPACK_VERSION'
module_pathname = '$libdir/pg_repack' module_pathname = '$libdir/pg_repack'
relocatable = false relocatable = false