[library-web] [overlay] add support for marking releases as unstable (GNOME bug 619022)



commit 0ed37c4c96bc5af8f9f9325611904f9fdebdd713
Author: Frédéric Péters <fpeters 0d be>
Date:   Sat Jun 12 17:07:17 2010 +0200

    [overlay] add support for marking releases as unstable (GNOME bug 619022)
    
    This is done on a per module basis, like this (it is allowed to have more than
    one extra-devel-releases tag):
    
      <document doc_module="gtk" channel="devel>
        <extra-devel-releases>2.90</extra-devel-releases>
      </document>

 src/modtypes/base.py |   12 ++++++++++--
 src/overlay.py       |   10 ++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/src/modtypes/base.py b/src/modtypes/base.py
index 0deb26c..347475b 100644
--- a/src/modtypes/base.py
+++ b/src/modtypes/base.py
@@ -37,6 +37,7 @@ class DocModule(object):
 
     channel = None
     nightly = False
+    extra_devel_releases = None
 
     def create_from_tar(cls, tar, tarinfo, makefile_am, nightly = False):
         self = cls()
@@ -147,6 +148,14 @@ class DocModule(object):
 
         return doc
 
+    def is_development_release(self):
+        development_release = (int(self.one_dot_version.split('.')[1]) % 2 == 1) or (
+                int(self.one_dot_version.split('.')[0]) == 0)
+        if not development_release:
+            development_release = app.overlay.is_development_release(
+                            self.modulename, self.one_dot_version)
+        return development_release
+
     def install_version_symlinks(self, doc):
         '''Create stable and devel symlinks'''
 
@@ -162,8 +171,7 @@ class DocModule(object):
             return
 
         web_output_dir = app.get_module_web_output_dir(self, versioned=False)
-        development_release = (int(self.one_dot_version.split('.')[1]) % 2 == 1) or (
-                int(self.one_dot_version.split('.')[0]) == 0)
+        development_release = self.is_development_release()
 
         if development_release:
             keyword = 'unstable'
diff --git a/src/overlay.py b/src/overlay.py
index b3ad6c5..9082a4e 100644
--- a/src/overlay.py
+++ b/src/overlay.py
@@ -74,6 +74,7 @@ class Overlay:
         self.new_docs = []
         self.more_tarball_docs = {}
         self.quirks = {}
+        self.extra_devel_releases = {}
 
         for doc in self.tree.findall('/documents/document'):
             if 'doc_module' in doc.attrib:
@@ -93,6 +94,11 @@ class Overlay:
                 tarball_docs = self.more_tarball_docs[tarball]
                 tarball_docs.append(doc)
 
+            if 'doc_module' in doc.attrib:
+                doc_module = doc.attrib.get('doc_module')
+                for extra in [x.text for x in doc.findall('extra-devel-releases')]:
+                    self.extra_devel_releases[(doc_module, extra)] = True
+
         self.toc_mapping = {}
         for mapping in self.tree.findall('/subsections/map'):
             channel = mapping.attrib.get('channel')
@@ -183,4 +189,8 @@ class Overlay:
             q.append(quirk.text)
         return q
 
+    def is_development_release(self, modulename, version):
+        if self.extra_devel_releases.get((modulename, version)):
+            return True
+        return False
 



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