From 0136feb36d0127b90e6cd48e70493b76e97970ca Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Thu, 5 May 2011 15:35:35 +0200
Subject: [PATCH] get products and bt5 directly from git repository

---
 slapos/software.cfg | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/slapos/software.cfg b/slapos/software.cfg
index ff703b473c..89efbb82ef 100644
--- a/slapos/software.cfg
+++ b/slapos/software.cfg
@@ -30,7 +30,6 @@ extends =
   profile/memcached.cfg
   profile/mysql-python.cfg
   profile/pdftk.cfg
-  profile/products-erp5.cfg
   profile/pysvn-python.cfg
   profile/python-2.6.cfg
   profile/python-2.7.cfg
@@ -94,12 +93,13 @@ parts =
 
 # Zope products
   products-deps
-  products-erp5
-  products-erp5-development
 
 # Cloudooo specific part
   cloudooo
 
+# get git repositories
+  erp5_repository
+
 # Create instance template
   template
 
@@ -178,6 +178,18 @@ update-command =
     ${git:location}/bin/git pull --quiet
   fi
 
+[erp5_repository_list]
+repository_id_list = erp5
+
+[erp5_repository]
+recipe = zerokspot.recipe.git
+repository = https://git.erp5.org/repos/erp5.git
+
+[products]
+# XXX: ERP5 related products are not defined as python distributions, so it is
+#      required to configure them in declarative manner
+list = ${products-deps:location} ${products-tidstorage:location} ${buildout:parts-directory}/parts/erp5/product
+
 [testrunner]
 # XXX: Workaround for fact ERP5Type is not an distribution and does not
 #      expose entry point for test runner
@@ -197,6 +209,11 @@ initialization =
   import Zope2
   os.environ['SOFTWARE_HOME'] = os.path.abspath(os.path.dirname(os.path.dirname(Zope2.__file__)))
   os.environ['ZOPE_SCRIPTS'] = ''
+  temp_bt5_path_list = ['/'.join(['''${buildout:parts-directory}''', x, 'bt5']) for x in '''${erp5_repository_list:repository_id_list}'''.split(' ')]
+  bt5_path_list = []
+  [bt5_path_list.extend([bt5_path, '%s/*' % bt5_path]) for bt5_path in temp_bt5_path_list]
+  os.environ['erp5_tests_bt5_path'] = ','.join(bt5_path_list)
+  sys.path[0:0] = ['/'.join(['''${buildout:parts-directory}''', x, 'tests']) for x in '''${erp5_repository_list:repository_id_list}'''.split(' ')]
 
 [test_suite_runner]
 # XXX: Workaround for fact ERP5Type is not an distribution and does not
@@ -217,6 +234,7 @@ initialization =
   import Zope2
   os.environ['SOFTWARE_HOME'] = os.path.abspath(os.path.dirname(os.path.dirname(Zope2.__file__)))
   os.environ['ZOPE_SCRIPTS'] = ''
+  sys.path[0:0] = ['/'.join(['''${buildout:parts-directory}''', x]) for x in '''${erp5_repository_list:repository_id_list}'''.split(' ')]
 
 [pycrypto-python]
 # This is a workaround for pkg_resources.ExtractionError: Can't extract file(s) to egg cache
-- 
2.30.9