[jhbuild/external-deps] Make use of system packages configurable



commit c4948f122c13eeab3663a518ee962f6aa1d0fcd6
Author: John Carr <john carr unrouted co uk>
Date:   Sun Jun 7 22:13:16 2009 +0100

    Make use of system packages configurable
---
 jhbuild/commands/base.py      |    6 +++---
 jhbuild/commands/builddeps.py |    5 +++++
 jhbuild/config.py             |    2 +-
 jhbuild/defaults.jhbuildrc    |    3 +++
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/jhbuild/commands/base.py b/jhbuild/commands/base.py
index 65463a1..1751929 100644
--- a/jhbuild/commands/base.py
+++ b/jhbuild/commands/base.py
@@ -63,7 +63,7 @@ class cmd_update(Command):
         module_list = module_set.get_module_list(args or config.modules,
                 config.skip, tags=config.tags,
                 ignore_suggests=config.ignore_suggests,
-                reuse_system_packages=True)
+                reuse_system_packages=config.reuse_system_packages)
         # remove modules up to startat
         if options.startat:
             while module_list and module_list[0].name != options.startat:
@@ -274,7 +274,7 @@ class cmd_build(Command):
                 config.skip, tags = config.tags,
                 include_optional_modules=options.build_optional_modules,
                 ignore_suggests=config.ignore_suggests,
-                reuse_system_packages=True)
+                reuse_system_packages=config.reuse_system_packages)
         # remove modules up to startat
         if options.startat:
             while module_list and module_list[0].name != options.startat:
@@ -463,7 +463,7 @@ class cmd_list(Command):
                                 config.skip, tags = config.tags,
                                 include_optional_modules = options.list_optional_modules,
                                 ignore_suggests=config.ignore_suggests,
-                                reuse_system_packages=True)
+                                reuse_system_packages=config.reuse_system_packages)
 
         # remove modules up to startat
         if options.startat:
diff --git a/jhbuild/commands/builddeps.py b/jhbuild/commands/builddeps.py
index c87ed4b..6501546 100644
--- a/jhbuild/commands/builddeps.py
+++ b/jhbuild/commands/builddeps.py
@@ -21,6 +21,7 @@
 #    John Carr <john carr unrouted co uk>
 
 from optparse import make_option
+import logging
 
 import jhbuild.moduleset
 import jhbuild.frontends
@@ -43,6 +44,10 @@ class cmd_builddeps(Command):
             ])
 
     def run(self, config, options, args):
+        if not config.reuse_system_packages:
+            logging.error(_("Command not available when reuse_system_packages is False. Check your jhbuildrc."))
+            return
+
         pkgs = systempackages.get_system_packages()
         module_set = jhbuild.moduleset.load(config)
 
diff --git a/jhbuild/config.py b/jhbuild/config.py
index 23e87fd..f1ee622 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -55,7 +55,7 @@ _known_keys = [ 'moduleset', 'modules', 'skip', 'tags', 'prefix',
                 'jhbuildbot_dir', 'jhbuildbot_mastercfg',
                 'use_local_modulesets', 'ignore_suggests', 'modulesets_dir',
                 'mirror_policy', 'module_mirror_policy', 'dvcs_mirror_dir',
-                'build_targets', 'aliases_dir',
+                'build_targets', 'aliases_dir', 'reuse_system_packages', 
                 ]
 
 env_prepends = {}
diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc
index e5a8189..8cfb9cc 100644
--- a/jhbuild/defaults.jhbuildrc
+++ b/jhbuild/defaults.jhbuildrc
@@ -168,3 +168,6 @@ ignore_suggests = False
 
 # local directory for DVCS mirror (git only atm)
 dvcs_mirror_dir = None
+
+# try and use system packages wherever possible
+reuse_system_packages = True



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