[library-web] Add processing of <autotools> nodes of modulesets



commit 4ebdefacb990009085943c512f5f80239cf26ddb
Author: Frédéric Péters <fpeters 0d be>
Date:   Tue Aug 3 18:17:05 2010 +0200

    Add processing of <autotools> nodes of modulesets

 src/lgo.py |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/src/lgo.py b/src/lgo.py
index 2aa1180..b139083 100755
--- a/src/lgo.py
+++ b/src/lgo.py
@@ -313,15 +313,39 @@ class Lgo(App):
         doc_modules = []
 
         tree = ET.parse(moduleset)
+
+        repositories = {}
+        for repository in tree.findall('repository'):
+            if repository.attrib['type'] != 'tarball':
+                continue
+            repositories[repository.attrib['name']] = repository.attrib['href']
+
+        hrefs = []
+
         for tarball in tree.findall('tarball'):
             if self.config.modules is not None and not tarball.attrib['id'] in self.config.modules:
                 continue
             href = tarball.find('source').attrib['href']
+            hrefs.append((tarball, href))
+
+        for module in tree.findall('autotools'):
+            if self.config.modules is not None and not module.attrib['id'] in self.config.modules:
+                continue
+            branch = module.find('branch')
+            if branch is None:
+                continue
+            repository = repositories.get(branch.attrib.get('repo'))
+            if repository is None:
+                continue
+            href = repository + branch.attrib.get('module')
+            hrefs.append((module, href))
+
+        for module, href in hrefs:
             filename = self.download(href)
             if not filename:
                 continue
             logging.info('extracting module %s (from %s moduleset)' % (
-                    tarball.attrib['id'], version_number))
+                    module.attrib['id'], version_number))
             doc_modules.extend(self.extract_modules(filename))
 
         gduxrefs = ET.Element('gduxrefs')



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