diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-12-14 11:26:10 +0000 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-12-17 12:09:24 +0000 |
commit | c853e4aa39c978054c037d1e7061e939427d495c (patch) | |
tree | 5cd306f27e2789e886269501638e9e80b6f0ed79 /morphlib | |
parent | f19efa182d0e53d97e163f980d6e221c55dd9c9b (diff) | |
download | morph-c853e4aa39c978054c037d1e7061e939427d495c.tar.gz |
Fix default setting for compiler cache dir; update tests
Reviewed-by: Lars Wirzenius <lars.wirzenius@codethink.co.uk>
Diffstat (limited to 'morphlib')
-rwxr-xr-x | morphlib/app.py | 11 | ||||
-rw-r--r-- | morphlib/buildenvironment_tests.py | 8 |
2 files changed, 7 insertions, 12 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index a13d26a1..9239bf31 100755 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -60,10 +60,10 @@ class Morph(cliapp.Application): metavar='DIR', default=defaults['cachedir']) self.settings.string(['compiler-cache-dir'], - 'cache compiled objects in CCDIR/REPO_NAME', - metavar='CCDIR', - default=os.path.join(self.settings['cachedir'], - 'ccache')) + 'cache compiled objects in DIR/REPO. If not ' + 'provided, defaults to CACHEDIR/ccache/', + metavar='DIR', + default=None) self.settings.string(['build-ref-prefix'], 'Prefix to use for temporary build refs', metavar='PREFIX', @@ -186,6 +186,9 @@ class Morph(cliapp.Application): if self.settings['tarball-server'] is None: self.settings['tarball-server'] = 'http://%s/tarballs/' % ( self.settings['trove-host']) + if self.settings['compiler-cache-dir'] is None: + self.settings['compiler-cache-dir'] = os.path.join( + self.settings['cachedir'], 'ccache') if 'MORPH_DUMP_PROCESSED_CONFIG' in os.environ: self.settings.dump_config(sys.stdout) sys.exit(0) diff --git a/morphlib/buildenvironment_tests.py b/morphlib/buildenvironment_tests.py index 7cb0f07b..61844c19 100644 --- a/morphlib/buildenvironment_tests.py +++ b/morphlib/buildenvironment_tests.py @@ -30,8 +30,6 @@ class BuildEnvironmentTests(unittest.TestCase): 'target-cflags': '', 'prefix': '/usr', 'no-ccache': True, - 'ccache-remotedir': '', - 'ccache-remotenlevels': 2, 'no-distcc': True, 'staging-chroot': False, } @@ -39,7 +37,6 @@ class BuildEnvironmentTests(unittest.TestCase): 'PATH': '/fake_bin', } self.default_path = 'no:such:path' - self.remote_ccache = 'http://example.com/ccache' def test_arch_defaults_to_host(self): buildenv = buildenvironment.BuildEnvironment(self.settings) @@ -128,12 +125,7 @@ class BuildEnvironmentTests(unittest.TestCase): def test_ccache_vars_set(self): self.settings['no-ccache'] = False - self.settings['ccache-remotedir'] = self.remote_ccache self.settings['no-distcc'] = False buildenv = buildenvironment.BuildEnvironment(self.settings) self.assertTrue(buildenv._ccache_path in buildenv.env['PATH']) - self.assertEqual(buildenv.env['CCACHE_REMOTEDIR'], - self.remote_ccache) - self.assertEqual(buildenv.env['CCACHE_REMOTENLEVELS'], - str(self.settings['ccache-remotenlevels'])) self.assertEqual(buildenv.env['CCACHE_PREFIX'], 'distcc') |