PostgreSQL 9.3 beta breaks some extensions "make install"

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема PostgreSQL 9.3 beta breaks some extensions "make install"
Дата
Msg-id CABRT9RASFgGqP-DJv0EAyXeFnquuap1-P=PVma=ZtnKHiNWPpA@mail.gmail.com
обсуждение исходный текст
Ответы Re: PostgreSQL 9.3 beta breaks some extensions "make install"  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: PostgreSQL 9.3 beta breaks some extensions "make install"  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Hi list,

While testing out PostgreSQL 9.3beta1, I stumbled upon a problem
installing some extensions (pgTAP and semver among others):

% make
[...]
% make DESTDIR=/tmp/foo install
[...]
/usr/bin/install -c -m 644 ./sql/semver--unpackaged--0.2.1.sql
./sql/semver--0.2.4--0.3.0.sql ./sql/semver--0.2.1--0.2.4.sql
./sql/semver--0.3.0.sql ./sql/semver--0.3.0.sql
'/tmp/foo/usr/share/postgresql/extension/'
/usr/bin/install: will not overwrite just-created
‘/tmp/foo/usr/share/postgresql/extension/semver--0.3.0.sql’ with
‘./sql/semver--0.3.0.sql’
make: *** [install] Error 1

I traced the problem down to commit
9db7ccae2000524b72a4052352cbb5407fb53b02 "Use system install program
when available and usable". It turns out that 'install' from coreutils
8.21 complains when it's told to install the same source file twice.

It's caused by this common pattern in extension makefiles:
DATA = $(wildcard sql/*--*.sql) sql/$(EXTENSION)--$(EXTVERSION).sql

The wildcard will match semver--0.3.0.sql too, in addition to the
direct reference, causing it to be duplicated (unless "make install"
is called from a clean directory).

The attached 1st patch fixes this case by putting $(sort ...) around
the DATA install command, which drops duplicate filenames. While there
are other install commands, the chances of them containing duplicate
names seem lower.

I'm not sure if this is worth worrying about, but there's still a
problem when DATA and DATA_built are separated, e.g:
DATA = $(wildcard sql/*--*.sql)
DATA_built = sql/$(EXTENSION)--$(EXTVERSION).sql

This can't be solved with a sort since DATA_built doesn't use
$(addprefix). But the install could be split into 2 separate commands
(2nd patch)

Regards,
Marti

Вложения

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: erroneous restore into pg_catalog schema
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Logging of PAM Authentication Failure