summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-02-28 13:40:08 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-02-28 13:40:08 +0000
commitf3a30a2f3412b3528b2e7e05ecc57cdbc8c6e449 (patch)
tree151f5e350ea9d0b6440e7d2d0a191bd779351b4e /morph
parent10bbea27a2b86dea661ead782557a4921b0b92e5 (diff)
downloadmorph-f3a30a2f3412b3528b2e7e05ecc57cdbc8c6e449.tar.gz
Set sensible defaults for git-base-url, bundle-server, cachedir, max-jobs
Also, change builder.py to always obey the --max-jobs setting, unless a morphology has a max-jobs field. The defaults have been chosen so that they work for everyone equally well. It may be useful to have a local mirror and then set the options to point there, but it's not reasonable to try to guess such things, so the defaults can be adapated to that. Collect the defaults into one place so they're easier to overview. The cliapp interface for adding settings is verbose enough that the defaults were getting buried.
Diffstat (limited to 'morph')
-rwxr-xr-xmorph27
1 files changed, 21 insertions, 6 deletions
diff --git a/morph b/morph
index c053753e..1876c7cb 100755
--- a/morph
+++ b/morph
@@ -27,22 +27,37 @@ from morphlib.morphologyloader import MorphologyLoader
from morphlib.builddependencygraph import BuildDependencyGraph
+defaults = {
+ 'git-base-url': [
+ 'git://gitorious.org/baserock-morphs/',
+ 'git://gitorious.org/baserock/',
+ ],
+ 'bundle-server': 'http://roadtrain.codethink.co.uk/bundles/',
+ 'cachedir': os.path.expanduser('~/.cache/morph'),
+ 'max-jobs': morphlib.util.make_concurrency(),
+}
+
+
class Morph(cliapp.Application):
def add_settings(self):
self.settings.boolean(['verbose', 'v'], 'show what is happening')
self.settings.string_list(['git-base-url'],
'prepend URL to git repos that are not URLs',
- metavar='URL')
+ metavar='URL',
+ default=defaults['git-base-url'])
self.settings.string(['bundle-server'],
'base URL to download bundles',
- metavar='URL')
+ metavar='URL',
+ default=defaults['bundle-server'])
self.settings.string(['cachedir'],
- 'put build results in DIR (default: %default)',
- metavar='DIR', default='.')
+ 'put build results in DIR',
+ metavar='DIR',
+ default=defaults['cachedir'])
self.settings.string(['tempdir'],
'temporary directory to use for builds',
- metavar='DIR', default=os.environ.get('TMPDIR'))
+ metavar='DIR',
+ default=os.environ.get('TMPDIR'))
self.settings.boolean(['no-ccache'], 'do not use ccache')
self.settings.boolean(['no-distcc'], 'do not use distcc')
self.settings.integer(['max-jobs'],
@@ -50,7 +65,7 @@ class Morph(cliapp.Application):
'is to a value based on the number of CPUs '
'in the machine running morph',
metavar='N',
- default=0)
+ default=defaults['max-jobs'])
self.settings.boolean(['keep-path'],
'do not touch the PATH environment variable '
'(use with tests ONLY)')