Re: Adding optionally commit number in PG_VERSION_STR

Поиск
Список
Период
Сортировка
От Erik Rijkers
Тема Re: Adding optionally commit number in PG_VERSION_STR
Дата
Msg-id c51433da5e804767724d60eea57f4178.squirrel@webmail.xs4all.nl
обсуждение исходный текст
Ответ на Re: Adding optionally commit number in PG_VERSION_STR  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, July 17, 2013 05:27, Tom Lane wrote:
> Michael Paquier <michael.paquier@gmail.com> writes:
>> It happens that I work occasionally on multiple builds based on


FWIW, I've been doing this for while:


where $project is mostly the patchname, $commit_hash is extracted like this:

commit_hash=$( cd /home/aardvark/pg_stuff/git/master; git log | head -n 1 | cut --delimiter=" " -f 2 );

version_string=${project}-${db_timestamp}-${commit_hash};

perl -i.original -ne "
s,(PACKAGE_.*[[:digit:]]+\.[[:digit:]]+(?:\.[[:digit:]]+)?(?:devel)?(?:(?:alpha|beta|rc)[[:digit:]]+)?),\\1-${version_string},;
   print;" configure
 


Which will then give:

PostgreSQL 9.4devel-HEAD-20130717_0828-ffcf654547ef38555203e6d716f47b7065a0a87d on x86_64-unknown-linux-gnu, compiled
by
gcc (GCC) 4.8.1, 64-bit


Btw, in an even more ugly hack I also stick some of that same config data in information_schema.sql_packages, with a
feature_id >= 100:

select * from information_schema.sql_packages where cast(substring(feature_id from E'^PKG([[:digit:]]+)') as integer)
>=100feature_id |    feature_name    | is_supported | is_verified_by |                               comments
 

------------+--------------------+--------------+----------------+----------------------------------------------------------------------PKG100
   | project name       | YES          | ej             | HEADPKG101     | patched            | NO           | ej
     | NOPKG103     | build time         | YES          | ej             | 2013-07-17 08:32:03.400521+02PKG104     |
server_version    | YES          | ej             |
 
9.4devel-HEAD-20130717_0828-ffcf654547ef38555203e6d716f47b7065a0a87dPKG105     | server_version_num | YES          | ej
           | 90400PKG106     | port               | YES          | ej             | 6544PKG110     | commit hash
|YES          | ej             | ffcf654547ef38555203e6d716f47b7065a0a87dPKG111     | catversion         | YES
|ej             | 201307161PKG112     | control version    | YES          | ej             | 937
 
(9 rows)



Needless to say, YMMV ...


Thanks,

Erik Rijkers






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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Cube extension point support // GSoC'13