[library-web] Log an error when directory mentioned in overlay is not found



commit 335e7897ec5d5e48310f23ae7d1ff9c2c2aef336
Author: Frédéric Péters <fpeters 0d be>
Date:   Thu Jun 24 14:18:38 2010 +0200

    Log an error when directory mentioned in overlay is not found

 src/lgo.py |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/lgo.py b/src/lgo.py
index 5bd533d..2b6a389 100755
--- a/src/lgo.py
+++ b/src/lgo.py
@@ -402,9 +402,16 @@ class Lgo(App):
         doc_version = os.path.splitext(tar.name)[0].split('-')[-1]
         if doc_version.endswith('.tar'):
             doc_version = doc_version[:-4]
+
         more_tarball_docs = self.overlay.more_tarball_docs.get(
                 base_tarball_name, [])[:]
 
+        for more_doc in more_tarball_docs:
+            # don't look for docs that require a newer version of the module
+            if 'minimum-version' in more_doc.attrib:
+                if version_cmp(doc_version, more_doc.attrib.get('minimum-version')) < 0:
+                    more_tarball_docs.remove(more_doc)
+
         regex_gdu = re.compile(r'include.*gnome-doc-utils.make', re.DOTALL)
         for tarinfo in tar:
             doc = None
@@ -435,10 +442,6 @@ class Lgo(App):
                     continue
             else:
                 for more_doc in more_tarball_docs[:]:
-                    if 'minimum-version' in more_doc.attrib:
-                        if version_cmp(doc_version, more_doc.attrib.get('minimum-version')) < 0:
-                            more_tarball_docs.remove(more_doc)
-                            continue
                     if tarinfo.name.endswith(more_doc.attrib.get('dir')):
                         doc = HtmlFilesModule.create_from_tar(tar, tarinfo, more_doc)
                         more_tarball_docs.remove(more_doc)
@@ -452,6 +455,11 @@ class Lgo(App):
                 doc.path = self.get_module_web_path(doc)
                 doc_modules.append(doc)
 
+        if more_tarball_docs:
+            for more_doc in more_tarball_docs:
+                logging.error('[%s] overlay file mentioned %s but it was not found' % \
+                                (base_tarball_name, more_doc.attrib.get('dir')))
+
         tar.close()
 
         if stamp_file:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]