summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2012-10-26 15:35:50 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2012-10-26 15:38:37 +0100
commitfcd0f5eee8624a0c67046e03d4f24bac17f777cb (patch)
tree521173dec429ab002943952c7a9ed05c7c59d0f8
parent15243493b945d87bc56d625b722060dd10799d15 (diff)
downloaddefinitions-fcd0f5eee8624a0c67046e03d4f24bac17f777cb.tar.gz
Reorder settings by broad category
Also remove the '--ignore-submodules' option, which is redundant. Hopefully cliapp will one day support option grouping, so we can hide some sets by default and group eg. all the logging options together.
-rwxr-xr-xmorphlib/app.py117
1 files changed, 59 insertions, 58 deletions
diff --git a/morphlib/app.py b/morphlib/app.py
index f4dd3403..0b797b7d 100755
--- a/morphlib/app.py
+++ b/morphlib/app.py
@@ -52,10 +52,21 @@ defaults = {
class Morph(cliapp.Application):
def add_settings(self):
+ # Logging
self.settings.boolean(['verbose', 'v'],
'show what is happening in much detail')
self.settings.boolean(['quiet', 'q'],
'show no output unless there is an error')
+
+ # General Options
+ self.settings.string(['cachedir'],
+ 'put build results in DIR',
+ metavar='DIR',
+ default=defaults['cachedir'])
+ self.settings.string(['build-ref-prefix'],
+ 'Prefix to use for temporary build refs',
+ metavar='PREFIX',
+ default=defaults['build-ref-prefix'])
self.settings.string(['trove-host'],
'hostname of Trove instance',
metavar='TROVEHOST',
@@ -72,6 +83,12 @@ class Morph(cliapp.Application):
'the trove.',\
metavar='ALIAS=PREFIX#PULL#PUSH',
default=defaults['trove-prefix'])
+
+ # Advanced Options
+ self.settings.boolean(['no-git-update'],
+ 'do not update the cached git repositories '
+ 'during a build (user must have done that '
+ 'already using the update-gits subcommand)')
self.settings.string_list(['repo-alias'],
'define URL prefix aliases to allow '
'repository addresses to be shortened; '
@@ -81,46 +98,24 @@ class Morph(cliapp.Application):
'contain a %s where the shortname gets '
'replaced',
default=defaults['repo-alias'])
- self.settings.string(['tarball-server'],
- 'base URL to download tarballs. '
- 'If not provided, defaults to '
- 'http://TROVEHOST/tarballs/',
- metavar='URL',
- default=None)
self.settings.string(['cache-server'],
'HTTP URL of the morph cache server to use. '
'If not provided, defaults to '
'http://TROVEHOST:8080/',
metavar='URL',
default=None)
- self.settings.string(['cachedir'],
- 'put build results in DIR',
- metavar='DIR',
- default=defaults['cachedir'])
- self.settings.string(['prefix'],
- 'build chunks with prefix PREFIX',
- metavar='PREFIX', default=defaults['prefix'])
- self.settings.string(['toolchain-target'],
- 'set the TOOLCHAIN_TARGET variable which is used '
- 'in some chunks to determine which architecture '
- 'to build tools for',
- metavar='TOOLCHAIN_TARGET',
- default=defaults['toolchain-target'])
- self.settings.string(['target-cflags'],
- 'inject additional CFLAGS into the environment '
- 'that is used to build chunks',
- metavar='CFLAGS',
- default='')
- self.settings.string(['tempdir'],
- 'temporary directory to use for builds '
- '(this is separate from just setting $TMPDIR '
- 'or /tmp because those are used internally '
- 'by things that cannot be on NFS, but '
- 'this setting can point at a directory in '
- 'NFS)',
- metavar='DIR',
- default=os.environ.get('TMPDIR'))
- self.settings.boolean(['no-ccache'], 'do not use ccache')
+ self.settings.string(['tarball-server'],
+ 'base URL to download tarballs. '
+ 'If not provided, defaults to '
+ 'http://TROVEHOST/tarballs/',
+ metavar='URL',
+ default=None)
+
+ # Build Options
+ self.settings.boolean(['bootstrap'],
+ 'build stuff in bootstrap mode; this is '
+ 'DANGEROUS and will install stuff on your '
+ 'system')
self.settings.string(['ccache-remotedir'],
'allow ccache to download objects from REMOTEDIR '
'if they are not cached locally',
@@ -131,42 +126,48 @@ class Morph(cliapp.Application):
'NLEVELS levels of subdirectories',
metavar='NLEVELS',
default=defaults['ccache-remotenlevels'])
- self.settings.boolean(['no-distcc'], 'do not use distcc')
+ self.settings.boolean(['keep-path'],
+ 'do not touch the PATH environment variable')
self.settings.integer(['max-jobs'],
'run at most N parallel jobs with make (default '
'is to a value based on the number of CPUs '
'in the machine running morph',
metavar='N',
default=defaults['max-jobs'])
- self.settings.boolean(['keep-path'],
- 'do not touch the PATH environment variable')
- self.settings.boolean(['bootstrap'],
- 'build stuff in bootstrap mode; this is '
- 'DANGEROUS and will install stuff on your '
- 'system')
- self.settings.boolean(['ignore-submodules'],
- 'do not cache repositories of git submodules '
- 'or unpack them into the build directory')
-
- self.settings.boolean(['no-git-update'],
- 'do not update the cached git repositories '
- 'during a build (user must have done that '
- 'already using the update-gits subcommand)')
-
+ self.settings.boolean(['no-ccache'], 'do not use ccache')
+ self.settings.boolean(['no-distcc'], 'do not use distcc')
+ self.settings.string(['prefix'],
+ 'build chunks with prefix PREFIX',
+ metavar='PREFIX', default=defaults['prefix'])
+ self.settings.boolean(['staging-chroot'],
+ 'build things in a staging chroot '
+ '(require real root to use)')
self.settings.string_list(['staging-filler'],
'unpack BLOB into staging area for '
'non-bootstrap builds (this will '
'eventually be replaced with proper '
'build dependencies)',
metavar='BLOB')
- self.settings.boolean(['staging-chroot'],
- 'build things in a staging chroot '
- '(require real root to use)')
-
- self.settings.string(['build-ref-prefix'],
- 'Prefix to use for temporary build refs',
- metavar='PREFIX',
- default=defaults['build-ref-prefix'])
+ self.settings.string(['target-cflags'],
+ 'inject additional CFLAGS into the environment '
+ 'that is used to build chunks',
+ metavar='CFLAGS',
+ default='')
+ self.settings.string(['tempdir'],
+ 'temporary directory to use for builds '
+ '(this is separate from just setting $TMPDIR '
+ 'or /tmp because those are used internally '
+ 'by things that cannot be on NFS, but '
+ 'this setting can point at a directory in '
+ 'NFS)',
+ metavar='DIR',
+ default=os.environ.get('TMPDIR'))
+ self.settings.string(['toolchain-target'],
+ 'set the TOOLCHAIN_TARGET variable which is used '
+ 'in some chunks to determine which architecture '
+ 'to build tools for',
+ metavar='TOOLCHAIN_TARGET',
+ default=defaults['toolchain-target'])
def check_time(self):
# Check that the current time is not far in the past.