r1047 - in zope-common/trunk (dzhandle)

Bernd Zeimetz bzed-guest at alioth.debian.org
Thu Nov 29 18:56:40 UTC 2007


    Date: Thursday, November 29, 2007 @ 18:56:40
  Author: bzed-guest
Revision: 1047

do not require a .dzproduct file

Modified:
  zope-common/trunk/dzhandle

Modified: zope-common/trunk/dzhandle
===================================================================
--- zope-common/trunk/dzhandle	2007-11-29 18:12:34 UTC (rev 1046)
+++ zope-common/trunk/dzhandle	2007-11-29 18:56:40 UTC (rev 1047)
@@ -208,7 +208,7 @@
             yield line
 
 class Addon:
-    def __init__(self, path, dzfile_required=True):
+    def __init__(self, path, dzfile_required=False):
         self.type = None
         if not os.path.isdir(path):
             raise DZError, "%s directory doesn't exist: `%s'" % (self.kind, path)
@@ -217,7 +217,7 @@
             if dzfile_required:
                 raise DZError, "`%s' file not found`%s'" \
                       % (self.dzname, os.path.join(self.path, self.dzname))
-            self.type = ADDON_MANUAL
+            self.type = None
             self.name = os.path.basename(path)
             self.directory = self.name.split(':', 1)[0]
             self.package = 'unknown'
@@ -232,11 +232,12 @@
             self.read_dzfile()
         if self.type == None:
             if path.startswith('/usr/share/zope') or \
-               path.startswith('/usr/lib/zope'):
+               path.startswith('/usr/lib/zope') or \
+               path.startswith('/usr/local/share/zope'):
                 self.type = ADDON_MASTER
             elif os.path.islink(path):
                 self.type = ADDON_LINKED
-            elif os.path.islink(os.path.join(path, self.dzname)):
+            elif os.path.islink(os.path.join(path, '__init__.py')):
                 self.type = ADDON_TREELINKED
             else:
                 self.type = ADDON_COPIED
@@ -297,9 +298,7 @@
         ipath = os.path.join(instance.home, self.subdir, self.name)
         if not os.path.isdir(ipath):
             return None
-        iaddon = self.__class__(ipath,
-                                dzfile_required=\
-                                os.path.isfile(os.path.join(ipath, self.dzname)))
+        iaddon = self.__class__(ipath)
         return iaddon
     
     def installed_by_in_instances(self, instances, exclude=[]):
@@ -321,7 +320,7 @@
         if self.type == ADDON_MANUAL:
             return None
         master = None
-        for prefix in ('/usr/share/zope', '/usr/lib/zope'):
+        for prefix in ('/usr/share/zope', '/usr/lib/zope', '/usr/local/share/zope'):
             path = os.path.join(prefix, self.subdir, self.directory)
             try:
                 master = self.addonClass(path)
@@ -469,7 +468,7 @@
                 # not installed in instance
                 continue
             try:
-                iaddon = self.addonClass(directory, dzfile_required=False)
+                iaddon = self.addonClass(directory)
             except DZError, msg:
                 # some error reading the dzfile ... 
                 # maybe the product hasn't been unpacked yet, let's skip it
@@ -583,7 +582,7 @@
                         self.toinstall.append(instance)
                     continue
                 try:
-                    iaddon = self.addonClass(addon_path, dzfile_required=False)
+                    iaddon = self.addonClass(addon_path)
                 except DZError, msg:
                     # some error reading the dzfile ...
                     self.error(msg, go_on=True)
@@ -1095,7 +1094,7 @@
             ipath = os.path.join(self.instance.home, self.subdir, addon_base)
             if os.path.exists(ipath + '.installed'):
                 path = open(ipath + '.installed', 'r').read()
-                addon = self.addonClass(path, dzfile_required=False)
+                addon = self.addonClass(path)
                 addons.append((addon, addon))
                 continue
             elif not os.path.isdir(ipath):
@@ -1105,7 +1104,7 @@
                                go_on=True)
                 continue
             try:
-                iaddon = self.addonClass(ipath, dzfile_required=False)
+                iaddon = self.addonClass(ipath)
             except DZError, msg:
                 self.error(msg, go_on=True)
             else:




More information about the pkg-zope-commits mailing list