CPS 3.4.2 New packaging

Frédéric LESUEUR <[email protected]>
Newsgroups gmane.comp.web.zope.cps.devel
Message-ID <[email protected]>
It's about the new packaging CPS 3.4.2-1 that was make today.

If you copy content of cps plateforme 3.4.2-1 and cps
groupware 3.4.2-1 in different directory (with "products"
directive inside zope.conf) zope does not start.

I've found two errors (maybe it's errors) :

1. method registerUpgradeCategory inside CPSCore.upgrade has a
static directory name "Products" (see patch
cpscore_ugrade.patch for one possible solution,
works for me)

2. file CPSSharedCalendar/configure.zcml reference at line 8
"../CalZope/permissions.zcml" which is inside plateforme,
plateforme is inside another directory and can't be find with
'../' style. Maybe it's not ok on Windows plateform. I can't
do anything, the solution maybe move CalZope inside directory
of groupware....



Cet été, pensez aux cartes postales de laposte.net !

_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
cpscore_ugrade.patch (application/octet-stream, 1.7 KB)
--- upgrade.py.orig     2006-08-08 14:33:34.000000000 +0200
+++ upgrade.py  2006-08-08 15:17:30.000000000 +0200
@@ -19,6 +19,8 @@

 import os
 from logging import getLogger
+from os.path import abspath
+import Products

 logger = getLogger('CPSCore.upgrade')

@@ -127,18 +129,23 @@
     if ref_product:
         info['ref_product'] = ref_product
         # very Zope2 centric
-        product_dir = os.path.join(INSTANCE_HOME, 'Products', ref_product)
-        try:
-            version_file = open(os.path.join(product_dir, VERSION_FILE), 'r')
-        except OSError:
-            raise # catch later
-        else:
-            lines = [l.strip() for l in version_file.readlines()]
-            version_file.close()
-            pref = 'PKG_VERSION='
-            for l in lines:
-                if l.startswith(pref):
-                    info['code_version'] = l[len(pref):]
+        ProductsPath = [ abspath(ppath)  for ppath in Products.__path__ ]
+        flag = False
+        for ppath in ProductsPath:
+            version_path = os.path.join(ppath,ref_product, VERSION_FILE)
+            print version_path
+            abs_path = version_path
+            if os.path.exists(abs_path):
+                version_file = open(version_path, 'r')
+                lines = [l.strip() for l in version_file.readlines()]
+                version_file.close()
+                pref = 'PKG_VERSION='
+                for l in lines:
+                    if l.startswith(pref):
+                        info['code_version'] = l[len(pref):]
+                flag = True
+                break
+        if not flag: raise OSError('File %s not found for % s Product' %(VERSION_FILE, info['title']) )


     _categories_registry[cid] = info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.