[kernel] r5288 - people/waldi/linux-2.6/debian/lib/python/debian_linux

Bastian Blank waldi at costa.debian.org
Thu Jan 5 18:08:36 UTC 2006


Author: waldi
Date: Thu Jan  5 18:08:35 2006
New Revision: 5288

Modified:
   people/waldi/linux-2.6/debian/lib/python/debian_linux/config.py
Log:
debian/lib/python/debian_linux/config.py:
Only bail out if a section is not found in any config file.


Modified: people/waldi/linux-2.6/debian/lib/python/debian_linux/config.py
==============================================================================
--- people/waldi/linux-2.6/debian/lib/python/debian_linux/config.py	(original)
+++ people/waldi/linux-2.6/debian/lib/python/debian_linux/config.py	Thu Jan  5 18:08:35 2006
@@ -6,7 +6,7 @@
 
 class config_reader(dict):
     """
-    Read configs in debian/arch and in the overlay directory.
+    Read configs in debian/arch and in the underlay directory.
     """
 
     class schema_item_boolean(object):
@@ -34,8 +34,8 @@
 
     config_name = "defines"
 
-    def __init__(self, overlay_dir = None):
-        self._overlay_dir = overlay_dir
+    def __init__(self, underlay = None):
+        self._underlay = underlay
         self._read_base()
 
     def __getitem__(self, key):
@@ -43,8 +43,8 @@
 
     def _get_files(self, name):
         ret = []
-        if self._overlay_dir is not None:
-            ret.append(os.path.join(self._overlay_dir, name))
+        if self._underlay is not None:
+            ret.append(os.path.join(self._underlay, name))
         ret.append(os.path.join('debian/arch', name))
         return ret
 
@@ -181,21 +181,20 @@
     def items(self, section, var = {}):
         ret = {}
         section = '_'.join(section)
-        exception = None
+        exceptions = []
         for config in self.configs:
             try:
                 items = config.items(section)
             except ConfigParser.NoSectionError, e:
-                exception = e
+                exceptions.append(e)
             else:
                 for key, value in items:
                     try:
                         value = self.schema[key](value)
                     except KeyError: pass
                     ret[key] = value
-                exception = None
-        if exception is not None:
-            raise exception
+        if len(exceptions) == len(self.configs):
+            raise exceptions[0]
         return ret
 
     def sections(self):



More information about the Kernel-svn-changes mailing list