问题描述
如果需要,我正在尝试使用build out config安装psycopg2 egg和postgres :
parts =
...
postgre
psycopg2
...
[postgre]
食谱= hexagonit.recipe。 cmmi
url = ftp://ftp3.ua.postgresql.org/pub/mirrors/postgresql/source/v9.0.0/postgresql-9.0.0.tar.gz
configure-options =
--without-readline
[psycopg2]
recipe = zc.recipe.egg:custom
egg = psycopg2
include-dirs =
$ {postgre:location} / include
library-dirs =
$ {postgre:location} / lib
rpath =
$ {postgre:location} / lib
问题是它始终从源代码生成postgresql,即使用户已经安装了postgresql。
我如何告诉buildout来检查用户是否已经有必要建立psycopg2?
p>你可以这样做,但是你会必须做自己的食谱做这个检查。没有现有的食谱可以做你想要的。
另一种方法是使用两个buildout配置。主要的 buildout.cfg
假定postgresql是可用的,不会尝试构建它。
第二个 withpostgres.cfg
可能如下所示:
[buildout]
零件+ =
postgre
psycopg2
[postgres]
...您现有的...
[psycopg2]
...您现有的...
需要从源代码构建的用户可以使用通过调用 bin / buildout -c withpostres.cfg
的第二个配置。
这会解决你的问题吗? p>
I'm trying to make buildout config that installs psycopg2 egg and postgres from source if needed:
parts =
...
postgre
psycopg2
...
[postgre]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp3.ua.postgresql.org/pub/mirrors/postgresql/source/v9.0.0/postgresql-9.0.0.tar.gz
configure-options =
--without-readline
[psycopg2]
recipe = zc.recipe.egg:custom
egg = psycopg2
include-dirs =
${postgre:location}/include
library-dirs =
${postgre:location}/lib
rpath =
${postgre:location}/lib
The problem is that it always builds postgresql from source, even if the user already has postgresql installed.
How can I tell buildout to check if user already have all necessary to build psycopg2?
You can do it, but you'll have to make your own recipe to do that check. There's no existing recipe that does what you want.
An alternative is to have two buildout configs. The main buildout.cfg
assumes postgresql is available and doesn't attempt to build it.
A second withpostgres.cfg
could look like this:
[buildout]
parts +=
postgre
psycopg2
[postgres]
... your existing one ...
[psycopg2]
... your existing one ...
Users that need to build it from source can use the second configuration by calling bin/buildout -c withpostres.cfg
.
Would that solve your issue?
这篇关于Buildout,psycopg2,postgresql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!