Index: tools/cr/cr/commands/install.py |
diff --git a/tools/cr/cr/commands/install.py b/tools/cr/cr/commands/install.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..772975f23a3df4ff9097c0b9bf7fef0de8ec42d0 |
--- /dev/null |
+++ b/tools/cr/cr/commands/install.py |
@@ -0,0 +1,34 @@ |
+# 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. |
+ You can set the builder to a skip version to bypass that stage. |
bulach
2013/12/02 18:33:09
this comment is a bit cryptic.. :) is it a command
|
+ """ |
+ |
+ 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) |