development setup and libdir

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-hackers(at)postgresql(dot)org
Subject: development setup and libdir
Date: 2010-01-30 10:57:27
Message-ID: 20100130115727.23b4cc5b@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I finally put enough code together and it has some chance it could
work.
It's time to test it.
Now I'm going to test it quite frequently.

My code is written and compiled in my ~/.
Then it is moved through svn to a test box where it is compiled under
another version of postgres, but still it ends up "far away" from
anything pg related.

Now it would be nice to be able to test it without any modification
to the source (namely the sql.in file). But the kosher way to write
one and then be able to eventually package it into a deb or even
make it reach contrib would be to use $libdir.

I can't make install (provided it works as expected, I didn't try
yet) since I sincerely hope that my user doesn't have write right on
whatever is pointed by $libdir.

My *nix user is also postgres superuser.

One way would be to
- let postgres user (or anyone) read in the dev dir
- export USE_PGXS=1; export someunknownparam=`pwd`; make

So that the resulting module.sql will point to the dev dir.
Does that someunknownparam exist?

2nd choice would be to write a bash script that just
- make
- sed -e 's/\$libdir/'`pwd`'/g' module.sql > module.l.sql
- sed -e 's/\$libdir/'`pwd`'/g' uninstall_module.sql >
uninstall_module.l.sql
- psql < sometestcode.sql

Not that bad... but if that "someunknownparam" existed it would be
nicer and avoid hard coding the module name in 2 places (Makefile and
bash script)[1]

[1] OK I know I can parse the Makefile with sed... ;)

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-01-30 11:38:08 Re: Hot Standby: Relation-specific deferred conflict resolution
Previous Message Boszormenyi Zoltan 2010-01-30 10:09:34 Re: NaN/Inf fix for ECPG Re: out-of-scope cursor errors