[library-web] make it possible for use_git_for_stable_version to be a list



commit 73b92486c644404b84362700de8265036f4db3ae
Author: Frédéric Péters <fpeters 0d be>
Date:   Tue Jan 28 14:39:53 2014 +0000

    make it possible for use_git_for_stable_version to be a list

 src/defaults.lgorc |    3 ++-
 src/lgo.py         |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/defaults.lgorc b/src/defaults.lgorc
index 19af6fe..2bc07a2 100644
--- a/src/defaults.lgorc
+++ b/src/defaults.lgorc
@@ -46,7 +46,8 @@ if os.path.exists(extra_tarballs_file):
 # explicitely written in jhbuild moduleset)
 use_latest_version = True
 
-# replace latest stable version by a git clone
+# replace latest stable version by a git clone, this can be a boolean to
+# activate for all modules, or a list, to activate selectively, by module.
 use_git_for_stable_version = False
 
 # path to dbm file to hold all API symbols (useful for Apache RewriteMap)
diff --git a/src/lgo.py b/src/lgo.py
index 129a3dc..8da3d7a 100755
--- a/src/lgo.py
+++ b/src/lgo.py
@@ -519,6 +519,8 @@ class Lgo(App):
 
         git_branch = 'gnome-%s-%s' % tuple(release.split('.')[:2])
 
+        module_defs = []
+
         tree = ET.parse(moduleset)
         for tarball in tree.findall('tarball'):
             if self.config.modules is not None and not tarball.attrib['id'] in self.config.modules:
@@ -531,10 +533,7 @@ class Lgo(App):
             min_version = tarball.attrib.get('version')
             if not min_version:
                 continue
-            logging.info('registering module %s for git stable update' % tarball.attrib['id'])
-            extra_tarball = 'gnome+git://%s?branch=%s&version=%s' % (
-                    module.attrib['id'], git_branch, min_version)
-            self.config.extra_tarballs.append(extra_tarball)
+            module_defs.append((tarball.attrib['id'], min_version))
 
         # XXX: this needs to be refactored, and moduleset processing code to be
         # shared with process_moduleset (bis repetita)
@@ -556,11 +555,18 @@ class Lgo(App):
             min_version = branch.attrib.get('version')
             if not min_version:
                 continue
-            logging.info('registering module %s for git stable update' % module.attrib['id'])
+            module_defs.append((module.attrib['id'], min_version))
+
+        for module_id, version in module_defs:
+            if type(self.config.use_git_for_stable_version) is list and \
+                    module_id not in self.config.use_git_for_stable_version:
+                continue
+            logging.info('registering module %s for git stable update' % module_id)
             extra_tarball = 'gnome+git://%s?branch=%s&version=%s' % (
-                    module.attrib['id'], git_branch, min_version)
+                    module_id, git_branch, version)
             self.config.extra_tarballs.append(extra_tarball)
 
+
     def extract_modules(self, filename, nightly = False):
         logging.debug('looking for doc modules in %s' % filename)
         doc_modules = []


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