summaryrefslogtreecommitdiffstats
path: root/tools/cr
diff options
context:
space:
mode:
authoriancottrell@chromium.org <iancottrell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-09 19:16:46 +0000
committeriancottrell@chromium.org <iancottrell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-09 19:16:46 +0000
commit8c99ee2560d31ee1e8d39175d2bb784af4d5ebe7 (patch)
tree34ee25bf3ebddebe9feefe45e8bf8a0e7e8b00bf /tools/cr
parent3eeef33c0987837b11d6896d71c73a726fa5e804 (diff)
downloadchromium_src-8c99ee2560d31ee1e8d39175d2bb784af4d5ebe7.zip
chromium_src-8c99ee2560d31ee1e8d39175d2bb784af4d5ebe7.tar.gz
chromium_src-8c99ee2560d31ee1e8d39175d2bb784af4d5ebe7.tar.bz2
[cr tool] Fixing init with no arguments failing
BUG=313727 Review URL: https://codereview.chromium.org/110453002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/cr')
-rw-r--r--tools/cr/cr/commands/init.py16
-rw-r--r--tools/cr/cr/config.py4
2 files changed, 10 insertions, 10 deletions
diff --git a/tools/cr/cr/commands/init.py b/tools/cr/cr/commands/init.py
index 2cb5ec4..8e24c33b 100644
--- a/tools/cr/cr/commands/init.py
+++ b/tools/cr/cr/commands/init.py
@@ -59,6 +59,7 @@ class InitCommand(cr.Command):
out = cr.base.client.GetOutArgument(context)
if out:
# Output directory is fully specified
+ # We need to deduce other settings from it's name
base, buildtype = os.path.split(out)
if not (base and buildtype):
print 'Specified output directory must be two levels'
@@ -89,16 +90,11 @@ class InitCommand(cr.Command):
CR_PLATFORM=platform,
CR_BUILDTYPE=buildtype,
)
- elif context.args.CR_BUILDTYPE or context.args.CR_PLATFORM:
- # output directory name needs to be rebuilt from the parts
- context.derived.Set(
- CR_OUT_BASE='out_{CR_PLATFORM}',
- CR_OUT_FULL=os.path.join('{CR_OUT_BASE}', '{CR_BUILDTYPE}'),
- )
- else:
- # Nothing specified, we are either re-building the selected client
- # or building from scratch the default client
- pass
+ if not 'CR_OUT_BASE' in context:
+ context.derived['CR_OUT_BASE'] = 'out_{CR_PLATFORM}'
+ if not 'CR_OUT_FULL' in context:
+ context.derived['CR_OUT_FULL'] = os.path.join(
+ '{CR_OUT_BASE}', '{CR_BUILDTYPE}')
def Run(self, context):
"""Overridden from cr.Command."""
diff --git a/tools/cr/cr/config.py b/tools/cr/cr/config.py
index cbb4891a..a19b837 100644
--- a/tools/cr/cr/config.py
+++ b/tools/cr/cr/config.py
@@ -234,3 +234,7 @@ class Config(cr.visitor.Node):
def __setitem__(self, key, value):
self._Set(key, value)
+
+ def __contains__(self, key):
+ return self.Find(key) is not None
+