Re: Detecting Postgres version during build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 06, 2012 at 01:13:24AM +0100, Gianluca Sforna wrote:
> I am trying to build a package that provides a Postegres cartridge
> compatible with 8.x and 9.x. Unfortunately the cartridge related files
> are not installed in the same path for both version so I am looking
> for a way to query the version against I'm building and pick the
> correct path.
> 
> Is there any standard mean for doing what I need?

If you BuildRequire the database itself (likely you don't) then
postgres --version + some scripting seems to do what you want:

$ postgres --version | awk '{print $3}'
9.1.2

I suspect this isn't going to do what your users need.  What happens
if they connect to a remote PostgreSQL database?  I'm guessing they
could use either cartridge depending on the remote version, so you
probably want to build and install both of them, if that is possible.

More context could help, including knowing which package you are
trying to build and what this "cartridge" actually does.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux