summaryrefslogtreecommitdiffstats
path: root/tools/cr
diff options
context:
space:
mode:
authoriancottrell@chromium.org <iancottrell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 13:47:44 +0000
committeriancottrell@chromium.org <iancottrell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 13:47:44 +0000
commitd70cfd4ff15243bd40d49d13e5e8697f91b4fd2a (patch)
tree5ea9036076d2c684bba2f5e5884c340c5240a05f /tools/cr
parent632056c1b1119131a71e7e8161101c1f6632683a (diff)
downloadchromium_src-d70cfd4ff15243bd40d49d13e5e8697f91b4fd2a.zip
chromium_src-d70cfd4ff15243bd40d49d13e5e8697f91b4fd2a.tar.gz
chromium_src-d70cfd4ff15243bd40d49d13e5e8697f91b4fd2a.tar.bz2
[cr tool] Adding the install command
BUG=316397 Review URL: https://codereview.chromium.org/99393002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/cr')
-rw-r--r--tools/cr/cr/commands/install.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/cr/cr/commands/install.py b/tools/cr/cr/commands/install.py
new file mode 100644
index 0000000..51a02b3
--- /dev/null
+++ b/tools/cr/cr/commands/install.py
@@ -0,0 +1,36 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""A module for the install command."""
+
+import cr
+
+
+class InstallCommand(cr.Command):
+ """The implementation of the install command.
+
+ This first uses Builder.Build to bring the target up to date, and then
+ installs it using Installer.Reinstall.
+ The builder installs its command line arguments, and you can use those to
+ select which builder is used. Selecting the skip builder
+ (using --builder=skip) bypasses the build stage.
+ """
+
+ def __init__(self):
+ super(InstallCommand, self).__init__()
+ self.help = 'Install a binary'
+
+ def AddArguments(self, subparsers):
+ parser = super(InstallCommand, self).AddArguments(subparsers)
+ cr.Builder.AddArguments(self, parser)
+ cr.Installer.AddArguments(self, parser)
+ cr.Target.AddArguments(self, parser, allow_multiple=True)
+ self.ConsumeArgs(parser, 'the installer')
+ return parser
+
+ def Run(self, context):
+ targets = cr.Target.GetTargets(context)
+ if not cr.Installer.Skipping(context):
+ cr.Builder.Build(context, targets, [])
+ cr.Installer.Reinstall(context, targets, context.remains)