[jhbuild] jhbuild make: Automatically create modules for non-existent ones



commit b55c98c689ce6e9be0e4484573637a127cd19d1e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Jun 1 00:45:25 2012 -0400

    jhbuild make: Automatically create modules for non-existent ones
    
    Similar to what jhbuild buildone does.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677271

 jhbuild/commands/make.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/jhbuild/commands/make.py b/jhbuild/commands/make.py
index 09f0132..222c7ed 100644
--- a/jhbuild/commands/make.py
+++ b/jhbuild/commands/make.py
@@ -78,13 +78,20 @@ class cmd_make(Command):
 
         cwd = cwd[len(config.checkoutroot):]
         cwd = cwd.lstrip(os.sep)
-        name, _slash, _rest = cwd.partition(os.sep)
+        modname, _slash, _rest = cwd.partition(os.sep)
 
         try:
-            module = module_set.get_module(name, ignore_case=True)
+            module = module_set.get_module(modname, ignore_case=True)
         except KeyError, e:
-            logging.error(_('No module matching current directory %r in the moduleset') % (name, ))
-            return False
+            default_repo = jhbuild.moduleset.get_default_repo()
+            if not default_repo:
+                logging.error(_('No module matching current directory %r in the moduleset') % (modname, ))
+                return False
+            from jhbuild.modtypes.autotools import AutogenModule
+            module = AutogenModule(modname, default_repo.branch(modname))
+            module.config = config
+            logging.info(_('module "%s" does not exist, created automatically using repository "%s"') % \
+                             (modname, default_repo.name))
 
         build = jhbuild.frontends.get_buildscript(config, [module], module_set=module_set)
         return build.build()



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