[csw-maintainers] GAR: Preprocessing a postinstall file

Maciej (Matchek) Blizinski maciej at opencsw.org
Thu Sep 16 18:17:28 CEST 2010


No dia 16 de Setembro de 2010 11:35, Maciej (Matchek) Blizinski
<maciej at opencsw.org> escreveu:
> No dia 12 de Dezembro de 2009 07:05, Dagobert Michelsen
> <dam at opencsw.org> escreveu:
>> Hi Maciej,
>>
>> Am 12.12.2009 um 02:27 schrieb Maciej (Matchek) Blizinski:
>>>
>>> Suppose I have a file CSWfoo.postinstall, which has some variables
>>> which need to be substituted before the file can be shipped.
>>> Something along the lines of:
>>>
>>> mycommand=@bindir@/foo

Dago, you asked why do I need to preprocess the file.  Here's an example:

# Read in the user configuration file
[ -s /opt/csw/etc/postgresql.conf ] && . /opt/csw/etc/postgresql.conf
[ -s @sysconfdir@/postgresql.conf ] && . @sysconfdir@/postgresql.conf

# Defaults
[ -z "${PGDATA}" ] && PGDATA=@PGDATA@
[ -z "${PGCTL}" ] && PGCTL=@bindir@/sparcv8/pg_ctl
[ -z "${PGINIT}" ] && PGINIT=@bindir@/sparcv8/initdb

I would like the script source to be identical for PostgreSQL 8.3 and
8.4 (and potentially 9.0).  Of course, I could just hardcode the
values.  However, the bigger plan is to rework both 8.3 and 8.4
packages so that you can run both at the same time and migrate the
data with minimal downtime.


More information about the maintainers mailing list