Re: Extensions, this time with a patch

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Extensions, this time with a patch
Дата
Msg-id m239s07vh9.fsf@2ndQuadrant.fr
обсуждение исходный текст
Ответ на Re: Extensions, this time with a patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Extensions, this time with a patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> I don't think that "no changes to the makefiles" is a requirement,
> or even a wish-list item, for this.  I think it's perfectly reasonable
> for the makefile to have to specify the module name; far better that
> than that we get the name by some "magic" or other.

It seemed easy to get a reasonable approach requiring very few edits in
contribs so I favoured that. Now, it's still entirely possible to hand
adjust. Determining the extension name automatically from DATA_built or
DATA is only done where EXTENSION has not been provided, and guessing
the CONTROL file name from the EXTENSION name only occurs when CONTROL
has not been provided.

Of course if those changes (inlined there after) are seen as a bad idea,
then I will change all contrib Makefiles to add EXTENSION, EXTVERSION
(which always is MAJORVERSION here) and CONTROL (which almost always is
EXTENSION.control).

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support

# create extension support
ifndef CONTROL
ifndef EXTENSION
ifdef DATA_built
EXTENSION = $(basename $(notdir $(firstword $(DATA_built))))
else ifdef DATA
EXTENSION = $(basename $(notdir $(firstword $(DATA))))
endif # DATA_built
endif # EXTENSION
ifndef EXTVERSION
EXTVERSION = $(MAJORVERSION)
endif
ifdef EXTENSION
CONTROL = $(EXTENSION).control
endif # EXTENSION
endif # CONTROL

control:# create .control to keep track that we created the control file(s)@for file in $(CONTROL); do \  test -f
`basename$$file .control`.sql -a ! -f $$file && touch .control || true ; \  if [ -f .control ]; then \    if [ -n
"$(EXTENSION)"]; then \    (echo "name = '$(EXTENSION)'"; echo "version = '$(EXTVERSION)'") > $$file ; \    else \
(echo"name = '`basename $$file .control`'"; echo "version = '$(EXTVERSION)'") > $$file ; \    fi ; \    if [ -n
"$(EXTCOMMENT)"]; then echo "comment = '$(EXTCOMMENT)'" >> $$file ; fi ; \  fi ; \done
 

install: all installdirs control
ifneq (,$(DATA)$(DATA_built)$(CONTROL))@for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built) $(CONTROL); do \
echo"$(INSTALL_DATA) $$file '$(DESTDIR)$(datadir)/$(datamoduledir)'"; \  $(INSTALL_DATA) $$file
'$(DESTDIR)$(datadir)/$(datamoduledir)';\done
 
endif # DATA


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Serializable snapshot isolation patch
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: How to reliably detect if it's a promoting standby