[Zope-CVS] SVN: zpkgtools/branches/fdrake-zconfig-branch/ - change how we locate the default support packages

Fred L. Drake, Jr. fdrake at gmail.com
Tue Aug 30 16:42:46 EDT 2005


Log message for revision 38166:
  - change how we locate the default support packages
  - add a TODO about using a separate resource map for support packages
  

Changed:
  U   zpkgtools/branches/fdrake-zconfig-branch/doc/TODO.txt
  U   zpkgtools/branches/fdrake-zconfig-branch/doc/zpkg.txt
  U   zpkgtools/branches/fdrake-zconfig-branch/zpkgtools/app.py

-=-
Modified: zpkgtools/branches/fdrake-zconfig-branch/doc/TODO.txt
===================================================================
--- zpkgtools/branches/fdrake-zconfig-branch/doc/TODO.txt	2005-08-30 20:42:14 UTC (rev 38165)
+++ zpkgtools/branches/fdrake-zconfig-branch/doc/TODO.txt	2005-08-30 20:42:46 UTC (rev 38166)
@@ -20,6 +20,10 @@
         Second svn://svn.example.org/repos/main/Second/tags/*/
       </resources>
 
+  - It should be possible to specify a separate resource map for
+    support code.  This would allow the packaging and the distributed
+    code to remain completely independent.
+
   - We should have a way to express dependence on particular versions
     of Python, and a way to say which is preferred.  (This can be used
     when building an "application" distribution since that has some

Modified: zpkgtools/branches/fdrake-zconfig-branch/doc/zpkg.txt
===================================================================
--- zpkgtools/branches/fdrake-zconfig-branch/doc/zpkg.txt	2005-08-30 20:42:14 UTC (rev 38165)
+++ zpkgtools/branches/fdrake-zconfig-branch/doc/zpkg.txt	2005-08-30 20:42:46 UTC (rev 38166)
@@ -136,10 +136,10 @@
 bundles the support code along with the resulting distribution.  The
 value is a boolean, where the strings ``true`` and ``false`` can be
 used in the configuration file.  If true (the default), copies of the
-``zpkgsetup`` package and any additionally configured support packages
-will be included in the distribution (less the test code).  If false,
-these packages will be assumed to be available for import on target
-systems.
+``zpkgsetup`` and ``ZConfig`` packages and any additionally configured
+support packages will be included in the distribution (less the test
+code).  If false, the right versions of these packages will be assumed
+to be available for import on target systems.
 
 The value for ``resource-map`` is a path or URL (including
 ``cvs:`` URLs) for a file that defines the map.  Relative paths are
@@ -251,15 +251,14 @@
 ----------------
 
 **zpkg** creates distributions which require some additional support
-packages to operate properly.  These packages are located in much the
-same way that other packages are located: the resource map is
-consulted to determine their location.  One difference is that if the
-resource map does not define the appropriate resources, a built-in
-fallback location will be used.
+packages to operate properly.  These packages are located in a similar
+way to packages that go into the distribution.  An internal map is
+used first, followed by the resource map based on the configuration
+files.
 
-The fallback location for the ``zpkgsetup`` package is the copy
-provided as part of the running **zpkg**; a location only needs to be
-specified if a different version should be used.  (This seems highly
-unlikely.)
+The sources for the ``zpkgsetup`` and ``ZConfig`` packages are the
+copies provided as part of the running **zpkg**; a location only needs
+to be specified for additional packages that should appear in the
+support directory.
 
 .. include:: links.rst

Modified: zpkgtools/branches/fdrake-zconfig-branch/zpkgtools/app.py
===================================================================
--- zpkgtools/branches/fdrake-zconfig-branch/zpkgtools/app.py	2005-08-30 20:42:14 UTC (rev 38165)
+++ zpkgtools/branches/fdrake-zconfig-branch/zpkgtools/app.py	2005-08-30 20:42:46 UTC (rev 38166)
@@ -292,16 +292,11 @@
             # have the package as a side effect of something else
             return
         source = None
-        if name in self.locations:
-            url = self.locations[name]
-        else:
-            url = fallback
-            if not url:
-                self.logger.warning("resource %s not configured;"
-                                    " no fallback URL" % name)
-                return
-            self.logger.info("resource %s not configured;"
-                             " using fallback URL" % name)
+        url = fallback or self.locations.get(name)
+        if not url:
+            self.logger.warning("resource %s not configured;"
+                                " no location known" % name)
+            return
         if source is None:
             self.logger.debug("loading resource '%s' from %s",
                               name, url)



More information about the Zope-CVS mailing list